@mocanvas/editor · class
declare class HistoryManager<R extends UnknownRecord>Undo/redo over store diffs. Every user-sourced document change is recorded; marks delimit undo steps. Undo applies the reverse of every diff back to the previous mark.
Methods · 13
bail(): thisUndo to the previous mark and drop the undone entries (no redo).
bailToMark(id: string): thisUndo back to a specific mark and drop the entries.
clear(): voidconstructor(store: Store<R>, onBatchComplete?: (() => void) | undefined)destroy(): voidgetNumRedos(): numbergetNumUndos(): numbergetVersion(): numberReactive counter for UI.
ignore<T>(fn: () => T): TRun fn without recording its changes.
mark(id?: string): stringPlace a stopping point. Returns the mark id.
redo(): thissquashToMark(id: string): thisMerge every diff since id into one step (the mark stays).
undo(): thismocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.