fn

createHistory

tested

Signature

ts
export function createHistory(options: HistoryOptions ={ ... }

Parameters

ParameterTypeDescription
options?HistoryOptions

Returns

History
PropertyTypeDescription
record(entry: HistoryEntry) => voidRecord a new edit, clearing the redo stack.
undo() => HistoryEntry | undefinedPop the latest undo entry (and push it onto the redo stack).
redo() => HistoryEntry | undefinedPop the latest redo entry (and push it back onto the undo stack).
canUndo() => boolean
canRedo() => boolean
clear() => void