Skip to content
Shapemetry

Model - Contract

API reference for src/registry/contract 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.

isEntityDefinition

function

Entity-stream producer or transform.

isEntityDefinition(def: OperationDefinition): def is EntityDefinition

isEntityStreamReturn

function

True when a definition's return is an entity stream (list of scene entities). Used by ExpressionNode unwrap and container return.

isEntityStreamReturn(returnType: string | null | undefined): boolean

isStepDefinition

function

Linear-lane schema-only step.

isStepDefinition(def: OperationDefinition): def is StepDefinition

isValueDefinition

function

Parameters-header binding (foldRole "binding").

isValueDefinition(def: OperationDefinition): def is ValueDefinition

LINEAR_LANE_TYPE

const

Đ2: what a linear fold lane CARRIES.

Two shapes, not one. A STEP lane is narrow — every step's return is exactly the lane type (material, view…). An ENTITY lane (scene/component/flat) carries the UNION entity[]: a producer's return names what it CREATES (textEntitytextEntity[]), the stream it lands in stays mixed. So the law there is "returns a stream", not "equals the lane type" — see tests/typeTable.test.ts's Đ2 case for the exact predicate.

const LINEAR_LANE_TYPE: Record<string, string>

RETURN_LANE_OF

const

Lane type a fold-role-step method belongs to, derived from its return. Used by validate to place methods without reading attributes.lane.

DERIVED, not listed: a lane's step type is the lane name minus the plural s. That held for most entries and was quietly broken by the rest (image→textures), which is what made the type table unreadable — you could not tell a step type from its name (2026-07-25: that one renamed to texture). Adding a lane now means adding it here only, and the name it implies is the name it must have.

const RETURN_LANE_OF: Record<string, string>
Last updated: 📖 1 min readEdit on GitHub