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

    Interface AffordanceHit

    Information about which UI affordance was hit at pointerdown.

    Populated by the dispatcher when the affordanceAt thunk is provided to useGestureDispatcher. Tools / action invokers that only fire on a specific affordance (e.g. a resize handle) use this field as a guard — if the affordance is absent or is the wrong kind, they return {} and let other bindings handle the drag.

    kind is a discriminator string:

    • 'handle:top-left' / 'handle:top-right' / 'handle:bottom-left' / 'handle:bottom-right' — corner resize handles.
    • 'rotate-handle' — the rotation affordance.
    • 'anchor:N' — a path anchor at index N.

    fixedPoint is the world-space point that should remain stationary during the gesture. For resize handles this is the opposite (diagonally fixed) corner; for rotate it is the pivot.

    targetIds are the node ids this affordance belongs to.

    interface AffordanceHit {
        anchor?: ResizeAnchor;
        cursor?: string;
        fixedPoint?: { x: number; y: number };
        kind: string;
        payload?: unknown;
        targetIds?: string[];
    }
    Index

    Properties

    anchor?: ResizeAnchor

    Set when kind matches 'handle:*'. Identifies which corner stays fixed during a resize so consumers (resizeAction) don't re-parse kind. Other affordance kinds (rotate-handle, anchor:N, controlIn:N, controlOut:N) leave this undefined.

    cursor?: string

    CSS cursor to show while the pointer hovers this affordance (no gesture in flight). Consumed by the hover-cursor pump in useGestureDispatcher; unset = the pump falls through to action-cursor prediction, then to the active tool's cursor.

    fixedPoint?: { x: number; y: number }

    World-space fixed/pivot point. For resize: opposite corner. For rotate: pivot.

    kind: string

    Discriminator string, e.g. 'handle:bottom-right'.

    payload?: unknown

    Free-form payload from whatever produced the hit, carried through to the matching action untouched.

    Kit affordances describe themselves fully in the fields above and leave this unset. It exists for affordances the kit doesn't know the shape of — a registered layer's own chrome, where the hit-test already resolved which of its pieces was hit and the action would otherwise have to redo that work. @weasel-js/hud passes the hit widget here.

    targetIds?: string[]

    Which nodes this affordance belongs to.