wb.history
WorkbookHistory
9 methods
canUndo
→ booleancanUndo(): boolean;Check if undo is available. Synchronous (uses cached state).
canRedo
→ booleancanRedo(): boolean;Check if redo is available. Synchronous (uses cached state).
list
→ UndoHistoryEntry[]list(): UndoHistoryEntry[];Get the undo history entries. Synchronous.
goToIndex
→ Promise<void>goToIndex(index: number): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| index | number | required |
Undo to a specific index in the history. Performs multiple undo operations to reach the target state. @param index - Index in the history (0 = most recent operation)
getState
→ Promise<UndoState>getState(): Promise<UndoState>;Get the full undo/redo state from the compute engine. Returns depth counts used by CheckpointManager to track checkpoint state.
subscribe
→ CallableDisposablesubscribe(listener: (event: UndoStateChangeEvent) => void): CallableDisposable;| Parameter | Type | Required |
|---|---|---|
| listener | (event: UndoStateChangeEvent) => void | required |
Subscribe to undo/redo state changes. Called whenever the undo stack changes (push, undo, redo, clear). @returns Unsubscribe function
setNextDescription
→ voidsetNextDescription(description: string): void;| Parameter | Type | Required |
|---|---|---|
| description | string | required |
Set the description for the next undo step. Call immediately before a mutation to label the undo entry.