Taos API Reference
    Preparing search index...

    Interface NodeKindSpec

    Declarative spec for a node kind. Drives both the editor (palette label, port rendering, property inspector) and the compiler (input/output wiring, Expr/Action codegen).

    Most kinds have static inputs/outputs arrays. Compound kinds (e.g. setAttribute with multiple entries) declare dynamicInputs(params) instead — the port list is recomputed from the node's params whenever the user edits them. When both are present, dynamicInputs wins.

    interface NodeKindSpec {
        label: string;
        category: NodeCategory;
        inputs: readonly PortSpec[];
        outputs: readonly PortSpec[];
        dynamicInputs?: (params: Record<string, unknown>) => readonly PortSpec[];
        dynamicOutputs?: (params: Record<string, unknown>) => readonly PortSpec[];
        params?: readonly ParamSpec[];
        toExpr?: (
            inputs: Record<PortName, Expr>,
            params: Record<string, unknown>,
        ) => Expr | Record<string, Expr>;
        toAction?: (
            inputs: Record<PortName, Expr>,
            params: Record<string, unknown>,
        ) => Action | Action[];
    }
    Index

    Properties

    label: string

    Display label in the palette / on the node header.

    category: NodeCategory

    Category for palette grouping. 'effect' also implies execution-graph participation: the overlay/editor draws exec in/out ports on these.

    inputs: readonly PortSpec[]
    outputs: readonly PortSpec[]
    dynamicInputs?: (params: Record<string, unknown>) => readonly PortSpec[]

    Optional: derive the input port list from params for compound nodes (e.g. setAttribute with N attribute entries → N data input ports). Use getNodeInputPorts to read the effective list.

    dynamicOutputs?: (params: Record<string, unknown>) => readonly PortSpec[]

    Optional: derive the output port list from params for compound source nodes (e.g. attribute with N entries → N typed output ports, one per attribute). Use getNodeOutputPorts to read the effective list.

    params?: readonly ParamSpec[]

    Editor-facing parameter spec; runtime only reads params raw.

    toExpr?: (
        inputs: Record<PortName, Expr>,
        params: Record<string, unknown>,
    ) => Expr | Record<string, Expr>

    Pure-value codegen. Returns an Expr (single-output) or a per-port map for nodes with multiple outputs.

    toAction?: (
        inputs: Record<PortName, Expr>,
        params: Record<string, unknown>,
    ) => Action | Action[]

    Side-effect codegen. Returns one or more Actions for statement nodes.