Skip to content
Mog is in active development. The GitHub repo, SDK packages, and community channels are not yet available. Follow for launch updates

wb.history

WorkbookHistory

9 methods

undo

Promise<UndoReceipt>
undo(): Promise<UndoReceipt>;

Undo the last operation.

redo

Promise<RedoReceipt>
redo(): Promise<RedoReceipt>;

Redo the last undone operation.

canUndo

boolean
canUndo(): boolean;

Check if undo is available. Synchronous (uses cached state).

canRedo

boolean
canRedo(): 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>;
ParameterTypeRequired
indexnumberrequired

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

CallableDisposable
subscribe(listener: (event: UndoStateChangeEvent) => void): CallableDisposable;
ParameterTypeRequired
listener(event: UndoStateChangeEvent) => voidrequired

Subscribe to undo/redo state changes. Called whenever the undo stack changes (push, undo, redo, clear). @returns Unsubscribe function

setNextDescription

void
setNextDescription(description: string): void;
ParameterTypeRequired
descriptionstringrequired

Set the description for the next undo step. Call immediately before a mutation to label the undo entry.