Skip to content

NodeSchema

Defined in: src/schema/index.ts:496

A node definition schema.

Generic parameters capture the literal types needed for compile-time grammar computation:

  • TName: The unique node name (e.g., “add”, “ternary”)
  • TPattern: The pattern elements as a tuple type
  • TPrecedence: The precedence level (non-negative integer)
  • TResultType: binding name, arktype string def, object def, or undefined (allowed only for passthrough patterns)

TName extends string = string

TPattern extends readonly PatternSchema[] = readonly PatternSchema[]

TPrecedence extends Precedence = Precedence

TResultType extends ResultSpec | undefined = ResultSpec | undefined

readonly name: TName

Defined in: src/schema/index.ts:502


readonly pattern: TPattern

Defined in: src/schema/index.ts:503


readonly precedence: TPrecedence

Defined in: src/schema/index.ts:504


readonly optional resultType?: TResultType

Defined in: src/schema/index.ts:505


readonly optional eval?: EvalFn

Defined in: src/schema/index.ts:514

Optional: Evaluate the node to produce a runtime value.

values

The named bindings as memoized thunks (evaluation is uniformly lazy — call a binding to evaluate it; untaken branches are never evaluated)