Skip to content
Shapemetry

Model - Types

API reference for src/schema/vocabulary/types 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.

bareTypeName

function

Strip one (possibly annotated) arg type to its base name: removes the [] array suffix and any (…) annotation — "curveEntity[]""curveEntity", "length(mm)""length". THE one parser for this; callers that need union handling split on | first and map over the branches.

The entityAliases option encodes an INTENTIONAL divergence between the two call sites: with it set, the bare value-type names curve/face map to their scene-entity types — ArgumentNode's runtime coercion dispatch wants that (a NurbsCurve value fills a curveEntity slot via asShapes). The Registry's arg-type validation passes NO aliases: it checks declared names against this type registry, where curve/face/point are their own registered value types — aliasing there would mis-validate a legitimately declared curve arg.

bareTypeName(raw: string, opts?: { entityAliases?: boolean; }): string

THEME_COLOR_FAMILIES

const

const THEME_COLOR_FAMILIES: readonly ["primary", "secondary", "info", "success", "warning", "attention", "error", "danger", "highlight", "neutral"]

ThemeColorFamily

type

type ThemeColorFamily
// = (typeof THEME_COLOR_FAMILIES)[number]

TYPE_REGISTRY

const

const TYPE_REGISTRY: ({ name: string

TypeCategory

type

Three roles for a type-table entry:

  • sceneEntity — stream entities (curve/face/point/group/annotation/…) and the stream union (entity).
  • record — lane-resolved records and chain step values (material, layer, style, table, view, texture, …). Formerly misnamed namespace (those entries are not expression namespaces).
  • value — scalars / geometry values / expression-language types that parameters and args carry.
type TypeCategory
// = "sceneEntity" | "record" | "value"

TypeDef

type

type TypeDef
// = {
    name: string;
    category: TypeCategory;
    color: ThemeColorFamily;
    note?: string;
    shape?: string;
    /** Optional coercion hook the arg coercer runs for values of this type
     *  (e.g. font: registered name → FontData from the Store). Stripped from
     *  the serializable catalog. */
    coerce?: (value: unknown, context: {
        store?: unknown;
    }) => unknown;
    /** Opaque frontend metadata (control hint etc.) — engine never reads it. */
    attributes?: Record<string, unknown>;
}
Last updated: 📖 1 min readEdit on GitHub