@witchcraft/layout
    Preparing search index...

    Type Alias DragChangeHandler

    DragChangeHandler: <T extends "start" | "move" | "end">(
        type: T,
        e: T extends "end" ? PointerEvent | undefined : PointerEvent,
        state: DragState,
        forceRecalculateEdges: () => void,
        cancel: (
            e: PointerEvent | KeyboardEvent | undefined,
            state: DragState,
        ) => void,
    ) => ActionDragChangeResult

    Called when the drag coordinates change (during any event).

    Should return { allowed: true/false, shapes: LayoutShape[] } to control whether the action is allowed and edges update and what deco shapes to render.

    Note that the allowed return type only affect the move event but is also typed as boolean for other events for ease of use.

    Type Declaration

      • <T extends "start" | "move" | "end">(
            type: T,
            e: T extends "end" ? PointerEvent | undefined : PointerEvent,
            state: DragState,
            forceRecalculateEdges: () => void,
            cancel: (
                e: PointerEvent | KeyboardEvent | undefined,
                state: DragState,
            ) => void,
        ): ActionDragChangeResult
      • Type Parameters

        • T extends "start" | "move" | "end"

        Parameters

        • type: T
        • e: T extends "end" ? PointerEvent | undefined : PointerEvent
        • state: DragState
        • forceRecalculateEdges: () => void
        • cancel: (e: PointerEvent | KeyboardEvent | undefined, state: DragState) => void

        Returns ActionDragChangeResult