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

    Interface InvocationCtx

    Per-invocation runtime context the dispatcher hands to an Invoker. Gesture-kind-specific fields (drag, wheel, multiTouch, key) are populated only for matching gesture kinds.

    interface InvocationCtx {
        deps: ActionDeps;
        drag?: {
            affordance?: AffordanceHit;
            current: Point2;
            delta: Point2;
            points?: DragSample[];
            screenDelta?: Point2;
            start: Point2;
        };
        key?: { key: string; repeat: boolean };
        modifiers: ModifierState;
        multiTouch?: {
            centroid: Point2;
            pinch?: { centroid: Point2; currentSpread: number; startSpread: number };
            rotation: number;
            spread: number;
        };
        params?: Record<string, unknown>;
        screen: Point2;
        wheel?: { deltaX: number; deltaY: number; deltaZ: number };
        world: Point2;
    }
    Index

    Properties

    drag?: {
        affordance?: AffordanceHit;
        current: Point2;
        delta: Point2;
        points?: DragSample[];
        screenDelta?: Point2;
        start: Point2;
    }

    Type Declaration

    • Optionalaffordance?: AffordanceHit
    • current: Point2
    • delta: Point2
    • Optionalpoints?: DragSample[]

      Full pointermove history for the current drag, in world space, with per-sample stylus state when the browser reported it. Accumulated by the dispatcher on every pointermove pump event. Available only during onMove and onEnd calls (not on start). Used by lassoSelectAction to build its polygon vertex list and by insertAction's pencil kind to carry the freehand stroke.

    • OptionalscreenDelta?: Point2

      Drag delta in client/screen coordinates (CSS pixels from the drag origin). Use this — never delta — for any action whose effect mutates the viewport itself (pan, view-zoom), because world-space deltas become self-referential as the view shifts mid-drag.

      Populated when the dispatcher received clientX/clientY on the underlying pointer events. Absent for legacy callers that don't provide them.

    • start: Point2
    key?: { key: string; repeat: boolean }
    modifiers: ModifierState
    multiTouch?: {
        centroid: Point2;
        pinch?: { centroid: Point2; currentSpread: number; startSpread: number };
        rotation: number;
        spread: number;
    }

    Type Declaration

    • centroid: Point2
    • Optionalpinch?: { centroid: Point2; currentSpread: number; startSpread: number }

      Pinch-zoom geometry. Populated by the dispatcher when a multitouch handle is in flight and a pointermove-pump fires. startSpread is the spread at the moment the gesture began. currentSpread is the spread at the current frame.

    • rotation: number
    • spread: number
    params?: Record<string, unknown>

    Per-invocation parameters. Populated by ActionsRegistry.begin() for UI-driven ongoing actions (color picker, opacity slider) so handles can read the current value on start and updated values on onMove. The gesture dispatcher does not populate this field; gesture-driven actions receive params via BindingOpts.params on start (the opts arg).

    screen: Point2
    wheel?: { deltaX: number; deltaY: number; deltaZ: number }
    world: Point2