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

    Interface GestureContext<TPose, TNode>

    Per-gesture context passed to behaviors. current is the running pose map; behaviors mutate proposed poses by returning new TPose values from onMove. scratch is per-gesture key/value storage that resets at the next gesture start.

    interface GestureContext<TPose, TNode extends { id: string } = { id: string }> {
        adapter: MoveAdapter<TNode, TPose>;
        current: Map<string, TPose>;
        draggedIds: string[];
        modifiers: ModifierState;
        origin: Map<string, TPose>;
        pointer: PointerState;
        scratch: Record<string, unknown>;
        snap: SnapTarget<TPose> | null;
    }

    Type Parameters

    • TPose
    • TNode extends { id: string } = { id: string }
    Index

    Properties

    current: Map<string, TPose>
    draggedIds: string[]
    modifiers: ModifierState
    origin: Map<string, TPose>
    pointer: PointerState
    scratch: Record<string, unknown>

    Per-gesture mutable store. Keys should be namespaced by behavior name to avoid collisions: 'behaviorName' for a single value, 'behaviorName.field' for sub-keys. Two behaviors sharing a key will silently clobber each other.

    snap: SnapTarget<TPose> | null