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

    Type Alias InsertNodeFactory

    InsertNodeFactory: (
        bounds: { height: number; width: number; x: number; y: number },
        extras: InsertExtras,
    ) => { data: unknown; pose?: unknown } | null

    Consumer-supplied node factory for one insert kind. Given the drag AABB and the tool's extras, returns the node's data (in the consumer's own data shape) plus an optional pose override — the dep supplies id, layer, and the undoable insert op. Return null to reject the insert.

    A factory registered for a kit kind (rect, line, …) fully replaces the kit's default { path, fill } factory for that kind; a factory for a novel kind adds support the kit doesn't ship (e.g. text). See SceneCanvas's insertNodeFactories prop.

    Type Declaration

      • (
            bounds: { height: number; width: number; x: number; y: number },
            extras: InsertExtras,
        ): { data: unknown; pose?: unknown } | null
      • Parameters

        • bounds: { height: number; width: number; x: number; y: number }
        • extras: InsertExtras

        Returns { data: unknown; pose?: unknown } | null