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

    Interface MoveAdapter<TNode, TPose>

    Narrow adapter for useMove. Includes optional snap-target lookup; apps without container-snapping leave it out.

    interface MoveAdapter<TNode extends { id: string }, TPose> {
        applyOps?(ops: Op[], label: string): void;
        findSnapTarget?(
            draggedId: string,
            worldX: number,
            worldY: number,
        ): SnapTarget<TPose> | null;
        getChildren?(id: string): string[];
        getLayout?(containerId: string): LayoutStrategy<TPose> | null;
        getNode(id: string): TNode | undefined;
        getNodes(): TNode[];
        getParent?(id: string): string | null;
        getPose(id: string): TPose;
        setParent?(id: string, parentId: string | null): void;
        setPose(id: string, pose: TPose): void;
    }

    Type Parameters

    • TNode extends { id: string }
    • TPose

    Hierarchy (View Summary)

    Index

    Methods

    • Optional: direct children of id. When present (alongside the cascadeWorldPose option on useMove), dragging a node auto-cascades its descendants in the live overlay so structurally- grouped children visually follow the parent during the drag. No additional ops are generated — children's local poses don't change when the parent's local pose moves.

      Parameters

      • id: string

      Returns string[]

    • Optional: layout strategy attached to a container, or null if the container uses absolute positioning (default behavior). When present, useMove uses the strategy to compute drop targets, sibling reflow, and the commit op batch when a drag ends over the container.

      Parameters

      • containerId: string

      Returns LayoutStrategy<TPose> | null

    • Optional. Required only by hierarchy-aware paths: layout-pass drop targeting (getLayout present), nested-hit collapse (pickTopMostHit), and group-pose composition. Flat scenes may omit.

      Parameters

      • id: string

      Returns string | null

    • Optional. Used only by reparent ops (e.g. drag-into-container drops via layout strategies). Flat scenes that never reparent may omit.

      Parameters

      • id: string
      • parentId: string | null

      Returns void