langium-zod / PropertyLike
Interface: PropertyLike
Defined in: types.ts:203
Duck-typed representation of a single property within a Langium InterfaceType.
Captures the grammar-level attributes the extractor uses to determine the Zod type expression, optionality, and array cardinality for a property:
operator/assignment— grammar assignment operators (=,+=,?=).cardinality— cardinality suffix on the property's type node.ruleCall.cardinality— cardinality on the rule call inside the type node (Langium 4.x shape).isCrossRef/referenceType— signals that the property holds a Langium cross-reference rather than an inline value.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
assignment? | "=" | "+=" | "?=" | Alternative assignment field used in some Langium 3.x AST shapes; the extractor consults both operator and assignment. | types.ts:219 |
astNodes? | ReadonlySet<AstNode> | Originating Langium grammar nodes for this property, from collectAst's Property.astNodes (a `Set<Assignment | Action |
cardinality? | "*" | "+" | "?" | Cardinality suffix on the property's type node (*, +, ?). | types.ts:221 |
comment? | string | JSDoc/grammar comment for this property, propagated to form metadata. | types.ts:235 |
isCrossRef? | boolean | true when the property holds a Langium cross-reference (ref: prefix). | types.ts:228 |
name | string | Property name as declared in the grammar (e.g. "left", "elements"). | types.ts:205 |
operator? | "=" | "+=" | "?=" | Grammar assignment operator: = (single value), += (array append), ?= (boolean flag). | types.ts:214 |
optional? | boolean | true when the grammar marks the property optional. | types.ts:209 |
referenceType? | string | Target type name for cross-reference properties (e.g. "Symbol" in ref:Symbol). Used by the extractor to emit ReferenceSchema with the correct target type name. | types.ts:233 |
ruleCall? | { cardinality?: "*" | "+" | "?"; } | Cardinality on the rule call inside the type node (Langium 4.x shape); the extractor checks this when cardinality is absent. | types.ts:226 |
ruleCall.cardinality? | "*" | "+" | "?" | - | types.ts:226 |
type? | unknown | Raw Langium type node for this property, inspected by the type mapper. | types.ts:207 |