Coral 0.2.17 candidate API
    Preparing search index...

    Interface UseLayoutHistoryResult

    Return type of the useLayoutHistory hook

    interface UseLayoutHistoryResult {
        canRedo: boolean;
        canUndo: boolean;
        clearHistory: () => void;
        discardRedo?: () => void;
        redo: () => UndoRedoResult | null;
        redoCount: number;
        redoSequence?: number;
        saveSnapshot: (
            nodes: Node[],
            source?: string,
            waypoints?: Map<string, EdgeWaypoint[]>,
        ) => void;
        saveSnapshotWithSequence?: (
            nodes: Node[],
            source?: string,
            waypoints?: Map<string, EdgeWaypoint[]>,
            sequence?: number,
        ) => void;
        undo: () => UndoRedoResult | null;
        undoCount: number;
        undoSequence?: number;
    }
    Index
    canRedo: boolean

    Whether redo is available

    canUndo: boolean

    Whether undo is available

    clearHistory: () => void

    Clear all history

    discardRedo?: () => void
    redo: () => UndoRedoResult | null

    Redo to next position state, returns positions + waypoints or null if can't redo

    redoCount: number

    Number of available redo steps

    redoSequence?: number
    saveSnapshot: (
        nodes: Node[],
        source?: string,
        waypoints?: Map<string, EdgeWaypoint[]>,
    ) => void

    Save current node positions (and optional waypoints) to history

    saveSnapshotWithSequence?: (
        nodes: Node[],
        source?: string,
        waypoints?: Map<string, EdgeWaypoint[]>,
        sequence?: number,
    ) => void

    Save a snapshot with the optional cross-owner transaction sequence.

    undo: () => UndoRedoResult | null

    Undo to previous position state, returns positions + waypoints or null if can't undo

    undoCount: number

    Number of available undo steps

    undoSequence?: number