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

    Interface DepSchema

    interface DepSchema {
        activeTool: ActiveToolContextValue;
        applyOps?: (ops: Op[], label: string) => void;
        areaSelect: AreaSelectDep;
        booleansAdapter?: BooleansAdapter;
        clipboard?: ClipboardDep;
        color: ColorContextValue;
        dispatcher?: { cancelAll(reason: "commit" | "cancel"): void };
        editAnchors: EditAnchorsDep;
        geometryProjection?: GeometryProjection;
        history: History;
        ingestion?: IngestionDep;
        insert: InsertDep;
        lassoSelect: LassoSelectDep;
        layout?: LayoutDep;
        nodeAtPoint?: NodeAtPointDep;
        pointer: PointerContextValue;
        poseComposition?: PoseComposition<unknown>;
        resizePolicy?: ResizePolicy<unknown>;
        scene: Scene<unknown, string, unknown>;
        selection: SelectionApi;
        slice?: SliceDep;
        snap?: SnapDep;
        textEdit: TextEditDep;
        view: ViewApi;
    }
    Index

    Properties

    Currently active tool id + hotkey-hold stack.

    applyOps?: (ops: Op[], label: string) => void

    Optional consumer commit hook. When present, moveAction (and other default actions) submit their committed ops through it instead of scene.applyBatch, so apps with their own history integration (checkpoint + push entry) capture the gesture as one undo entry. When absent, commits fall back to scene.applyBatch.

    areaSelect: AreaSelectDep

    Area-select dep — AABB hit-test + selection read/write.

    Sourced from <SceneCanvas> via AABB overlap over all scene nodes. Override per-consumer for custom hit-testing (e.g. contain-mode, lock-aware filtering).

    booleansAdapter?: BooleansAdapter

    Booleans adapter — read selection ids, fetch world-space Paths, compare z-order, and mint result nodes for Pathfinder ops.

    Consumers wire via useBooleansAdapter(adapter) (a thin wrapper around useDepSource('booleansAdapter', ...)). The descriptor's enabled predicate reads deps.selection for the count check; the invoker reads deps.booleansAdapter to execute the op.

    clipboard?: ClipboardDep

    Clipboard dep — the imperative surface useClipboardOps returns.

    Published by the consumer (useDepSource('clipboard', …) from under <SceneCanvas>), because useClipboardOps needs an adapter and a selection reader only the consumer has. Feeds clipboard.copy / clipboard.cut; both no-op when the dep is absent.

    color: ColorContextValue
    dispatcher?: { cancelAll(reason: "commit" | "cancel"): void }

    Gesture dispatcher control surface — exposes cancelAll(reason) so actions that need to abort an in-flight handle (Escape cancels a drag, etc.) can do so. Sourced by <SceneCanvas> from the dispatcher instance it already owns.

    editAnchors: EditAnchorsDep

    Edit-anchors dep — narrow read/write of one polygon's path pose.

    Sourced from consumer. Wraps getPose/setPose/applyOps for the currently-being-edited polygon node.

    The editAnchorsAction requires this dep to be registered when anchor editing is active. If absent, start returns an empty handle (no-op).

    geometryProjection?: GeometryProjection

    Optional consumer seam for the eager-sync layer: lets pose-transform actions (resize/move/nudge/flip — NOT rotate) ALSO rewrite a node's data-held geometry. Given a node and the affine m applied to its pose, transform(node, m) returns updated data (geometry mapped by m) or null for nodes with no data-held geometry.

    Strictly opt-in: when absent (or when transform returns null), the kit emits only the pose op and leaves data untouched. apps/draw wires this to mirror data.path through transformPath. Rotate intentionally never consults this seam (rotation lives on the pose, baked at render).

    history: History

    Undo/redo history bound to the current scene.

    ingestion?: IngestionDep

    Ingestion dep — canvas viewport rect + consumer file→src resolver.

    Sourced from <SceneCanvas> / <StandardActionsRegistrar> via useIngestionDepSource. Feeds ingestAction with the world-space viewport rect for paste-placement and image fit-clamping, and forwards the consumer's optional resolveSrc seam.

    Optional: when absent, the ingest action no-ops (there is no placement geometry to work with).

    insert: InsertDep

    Insert dep — node factory for drag-to-insert.

    Sourced from <SceneCanvas>. The kind param comes from the active binding's opts.params.kind. Override per-consumer to provide a typed node factory (e.g. with custom data payloads).

    lassoSelect: LassoSelectDep

    Lasso-select dep — polygon hit-test + selection read/write.

    Sourced from <SceneCanvas> / <StandardActionsRegistrar>. Falls back to AABB hit-test when hitTestLasso is absent.

    layout?: LayoutDep

    Layout-strategy lookup. Sourced by <SceneCanvas> from layouts. Optional: absent (or all-null) → moveAction skips reflow.

    nodeAtPoint?: NodeAtPointDep

    Topmost node at a world-space point. Sourced by <SceneCanvas> from the same picker that feeds the tool dispatcher's getNodeAtPoint. Optional: actions that read this (e.g. moveAction reparent-on-drop) fall back to a no-op when the dep isn't registered.

    Canvas pointer position in world space.

    Exposes pointerRef (mutable live ref) and getDropPoint() thunk. Marked @experimental in the source.

    poseComposition?: PoseComposition<unknown>

    Optional pose-composition strategy for hierarchical (local-pose) scenes. When absent, defaults to IDENTITY (absolute-pose: nodes store world coords). Local-pose consumers supply { compose: composeRectPose, decompose: decomposeRectPose } (or their pose shape's equivalent).

    resizePolicy?: ResizePolicy<unknown>

    Resize-policy dep — bounds constraints, point-snap behaviors, group expansion, and pose↔bounds projection for resizeAction.

    Optional: when omitted, resizeAction falls back to identity defaults (no constraints, no snap, identity expandIds, RECT_POSE_DESCRIPTOR). Consumers wire via useDepSource('resizePolicy', ...) or the useResizePolicy helper.

    scene: Scene<unknown, string, unknown>

    Scene tree — structural reads + undoable mutations.

    The entry uses the fully-erased form Scene<unknown, string, unknown> because DepSchema must be concrete. Actions that need a typed scene should cast: deps.scene as Scene<MyData, MyLayer, MyPose>.

    selection: SelectionApi

    Kit selection state — ids of currently selected nodes.

    slice?: SliceDep

    Slice dep — consumer-supplied commit for the Slice action.

    Receives the finite slice segment in world coordinates; the consumer scans the scene, splits crossed paths via splitPathByLine, and applies the result as one undoable batch.

    Optional: when absent, sliceAction is a no-op.

    snap?: SnapDep

    Snap dep — world-space point snapping (grid / guides).

    Sourced by <SceneCanvas> from toolOptions.snapPoint. Optional: absent means no snapping (identity).

    textEdit: TextEditDep

    Text-edit dep — activates the in-place text editing overlay.

    Sourced from consumer via useTextEdit / useSceneTextEdit. The enterTextEditAction requires this dep to be registered by the text tool when text editing is available.

    The optional isTextNode predicate guards against entering edit mode on non-text nodes. A binding can pre-filter instead with a target: 'kind:text:selected' spec; the guard remains for consumers who bind the broader 'selected-body' target or opted out of routing.

    view: ViewApi

    Current viewport — camera position + scale.