AshTypescript.Codegen.FilterTypes (ash_typescript v0.18.0)

Copy Markdown View Source

Generates TypeScript filter types for Ash resources.

Generates:

  • {ResourceName}FilterInput — full typed filter objects with per-field operators
  • {resourceName}FilterFields — runtime as const array of filterable field names
  • {ResourceName}FilterField — union type derived from the array

Per-field operator lists are driven by Ash.Info.Manifest: field.filter_operators is a list of %Ash.Info.Manifest.ApplicableOperator{} records carrying both the canonical operator name (e.g. :==, :<) and a pre-resolved rhs (:same | :any | {:concrete, type} | {:array, rhs}). The TS renderer maps the canonical name to a client-facing key via @operator_atom_to_key and computes the RHS TS type from op.rhs.

Fields/relationships whose filterable? is false are skipped entirely.

Summary

Functions

generate_filter_field_array(resource, resource_lookup)

generate_filter_field_arrays(resources)

generate_filter_field_arrays(resources, resource_lookup)

Generates as const arrays and derived union types for filterable field names.

Includes fields whose manifest filterable? is true (attributes, calculations, aggregates) and relationships whose manifest filterable? is true.

generate_filter_type(resource)

generate_filter_type(resource, allowed_resources)

generate_filter_type(resource, allowed_resources, resource_lookup)

generate_filter_types(resources)

generate_filter_types(resources, allowed_resources)

generate_filter_types(resources, allowed_resources, resource_lookup)