fn
createHistory
testedSignature
ts
export function createHistory(options: HistoryOptions ={ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
options? | HistoryOptions | — |
Returns
History| Property | Type | Description |
|---|---|---|
record | (entry: HistoryEntry) => void | Record a new edit, clearing the redo stack. |
undo | () => HistoryEntry | undefined | Pop the latest undo entry (and push it onto the redo stack). |
redo | () => HistoryEntry | undefined | Pop the latest redo entry (and push it back onto the undo stack). |
canUndo | () => boolean | — |
canRedo | () => boolean | — |
clear | () => void | — |