Skip to content
Shapemetry

Model - Lane fields

API reference for src/core/laneFields on @huukhanhnguyen/model, reachable from ..

See the Guide for the ModelJSON / evaluate pipeline.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

evalBoolean

function

Boolean field — expression evaluates to boolean/number/string, coerced. Shared with materials.ts (doubleSided).

ABSENT (no arg, or a blank one) is the only reading that means "use the field's default". An expression the author WROTE and this cannot read is a different statement, and it used to return the same undefined: both callers test !== undefined, so labels: "nope" and doubleSided: "nope" rendered exactly as if the field had never been authored. A value that evaluates to a non-coercible type (an object, null) is the same failure — the author asked for something this cannot answer.

evalBoolean(value: string | undefined, context: EvalContext, namespaces?: Record<string, unknown>, field?: string): boolean | undefined

evalNumber

function

Numeric field: literal number, or an expression string → number. Shared with materials.ts/layers.ts — same expression-field law.

evalNumber(value: number | string | undefined, context: EvalContext, namespaces?: Record<string, unknown>): number | undefined

evalPoint

function

Point field: literal [x,y,z], or an expression string → [x,y,z]. Shared with materials.ts/layers.ts.

evalPoint(value: [number, number, number] | string | undefined, context: EvalContext, namespaces?: Record<string, unknown>): Point$1 | undefined

evalText

function

Text field (color/layer/glyph) — the VALUE LAW: expression-first, literal fallback ("'#334155'" evaluates, a bare "#334155" IS the literal; a param reference evaluates live). Shared with materials.ts.

evalText(value: string | undefined, context: EvalContext, namespaces?: Record<string, unknown>): string | undefined

laneParameterContext

function

The record-lane FIELD EVALUATION law, in one place: the live parameter context every lane resolves against, plus the typed field readers (number / point / text / boolean) cameras, materials, layers and styles all share. Cross-lane by nature — it belongs to no single lane.

laneParameterContext(scope: { nodes?: unknown; }): EvalContext
Last updated: 📖 1 min readEdit on GitHub