Skip to content
Shapemetry

@huukhanhnguyen/model / schema/nodesRegistry

schema/nodesRegistry

Fn

Fn = (...args) => unknown

Parameters

args

...unknown[]

Returns

unknown


NodeArgEntry

NodeArgEntry = { default?: string; description?: string; formula?: true; key: string; label?: string; max?: string; min?: string; options?: string[]; step?: string; tooltip?: string; type: string; }

THE authored arg definition — one arg of a vocabulary/catalog method entry, with its display metadata as TYPED fields. This is the single shape the lane vocabularies (vocabulary/laneMethods.ts, vocabulary/cameras.ts) and the hand-written catalog entries (nodesRegistry/catalog.ts barrel) declare args with. Deliberately NOT the runtime contract: the registry's ArgDef (schema/registry.ts) carries display metadata in an opaque attributes bag instead — wiring.toArgDef packs label/tooltip/options/description into it, so the two layers can never drift.

default?

optional default?: string

description?

optional description?: string

formula?

optional formula?: true

Texture lane only: the text compiles PER PIXEL as (u, v, t, k).

key

key: string

label?

optional label?: string

max?

optional max?: string

min?

optional min?: string

options?

optional options?: string[]

step?

optional step?: string

tooltip?

optional tooltip?: string

type

type: string

A TYPE_REGISTRY name (list suffix allowed, e.g. "string[]"). A union form (color | vector) reads "either shape is accepted".


NodeRegistryEntry

NodeRegistryEntry = { args?: NodeArgEntry[]; defaultKey?: string; icon?: string; label?: string; method?: string; namespace?: string; nodeType: "parameter" | "generator" | "modifier" | "objectProducer" | "document" | "camera" | "layer" | "material" | "pattern" | "style" | "textStyle" | "annotationStyle" | "view" | "animation" | "table" | "texture" | "instanceProperty"; return: string; role?: "transform" | "prop"; shape?: "map" | "multiply" | "reduce" | "structural"; tooltip?: string; }

args?

optional args?: NodeArgEntry[]

defaultKey?

optional defaultKey?: string

Friendly short identifier base for auto-generated node keys ("arc" for every arc generator, "array" for every array*) — the key a new node gets is defaultKey + a model-wide-unique increment. The full human name stays in label.

icon?

optional icon?: string

Icon lookup key (packages/ui's NodeIcons.ts svg tables) when it differs from method — e.g. a renamed method reusing an old icon. Absent = UI falls back to method itself as the key.

label?

optional label?: string

method?

optional method?: string

namespace?

optional namespace?: string

nodeType

nodeType: "parameter" | "generator" | "modifier" | "objectProducer" | "document" | "camera" | "layer" | "material" | "pattern" | "style" | "textStyle" | "annotationStyle" | "view" | "animation" | "table" | "texture" | "instanceProperty"

return

return: string

Declared return type of this entry. Required: every catalog row states what it yields. A PRODUCER's return is the type of what it CREATES (its own tail), not the stream after it — see registry/contract.ts. Wiring does not invent objectData[] for a missing declaration.

role?

optional role?: "transform" | "prop"

shape?

optional shape?: "map" | "multiply" | "reduce" | "structural"

tooltip?

optional tooltip?: string

Last updated: 📖 3 min readEdit on GitHub