weasel API - v0.8.0
    Preparing search index...

    Interface NodeRouting

    NodeRouting — the routing trait's registry. Each trait of a node (shape, routing, label, icon, affordances, …) is its own registry; this one answers "what routing-kind string does this node's data map to?" The result flows into declarative tool-routing tables ({ target: 'rect', actionId: 'move' }).

    Other traits (shape painters, future label/icon/propertyRows registries) are their own registries — they are NOT optional fields on NodeRoutingEntry. See: docs/superpowers/specs/2026-05-24-node-traits-reframe-design.md.

    Instances are constructed by <SceneCanvas> from its routing prop and used to classify each hit node's data into a kind string when building getNodeAtPoint. Direct use from consumer code is supported but not required for the common SceneCanvas flow.

    interface NodeRouting {
        classify(data: unknown): string;
        get(name: string): NodeRoutingEntry | undefined;
        list(): readonly NodeRoutingEntry[];
        register(kind: NodeRoutingEntry): void;
    }
    Index

    Methods

    • Walk registered kinds in registration order; return the first kind whose matches(data) returns true, or 'unknown' if none match.

      Parameters

      • data: unknown

      Returns string