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

    Interface UseMoveOptions<TPose>

    interface UseMoveOptions<TPose> {
        behaviors?: MoveBehavior<TPose>[];
        cascadeWorldPose?: (id: string) => TPose | null;
        dragThresholdPx?: number;
        expandIds?: (ids: string[]) => string[];
        moveLabel?: string;
        transient?: boolean;
        translatePose?: (pose: TPose, dx: number, dy: number) => TPose;
        onGestureEnd?(committed: boolean): void;
        onGestureStart?(ids: string[]): void;
    }

    Type Parameters

    • TPose
    Index

    Properties

    behaviors?: MoveBehavior<TPose>[]
    cascadeWorldPose?: (id: string) => TPose | null

    Optional: lookup a world-space pose by id. When supplied alongside adapter.getChildren, the hook walks each dragged id's descendants and includes them in the live overlay (translated by the same drag delta and added to overlay.hideIds) so structurally-grouped children visually follow the parent during the gesture. No transform ops are generated for cascaded ids — under local-pose semantics, a child's local pose is unchanged when its parent's local pose moves, so the post-commit scene is already correct.

    Pair with worldPoseLookup(adapter, composeRectPose) from @weasel-js/core/transforms for the standard rect case. Returning null for an id (e.g., one removed mid-render) skips it.

    dragThresholdPx?: number
    expandIds?: (ids: string[]) => string[]

    Optional: expand the incoming id list before pose lookups. Used for group expansion (groups have no pose; their leaves do). Called once at start(). The returned list flows through ctx, overlay (overlay.draggedIds is the expanded leaves), and op generation. Returning [] aborts the gesture cleanly. Default: identity.

    moveLabel?: string
    transient?: boolean

    Reserved for transient gestures (no history entry). Move is never transient in practice; accepted for API consistency but ignored.

    translatePose?: (pose: TPose, dx: number, dy: number) => TPose

    How to apply a (dx, dy) translation to a pose. Defaults to translateRectPose, which assumes the pose carries top-level x/y (the common rect-shaped case). Override for non-rect poses (e.g. PathtranslatePath).

    Methods