@lexical/history
Type Aliases
HistoryState
HistoryState =
object
Defined in: packages/lexical-history/src/index.ts:44
Properties
current
current:
null
|HistoryStateEntry
Defined in: packages/lexical-history/src/index.ts:45
redoStack
redoStack:
HistoryStateEntry
[]
Defined in: packages/lexical-history/src/index.ts:46
undoStack
undoStack:
HistoryStateEntry
[]
Defined in: packages/lexical-history/src/index.ts:47
HistoryStateEntry
HistoryStateEntry =
object
Defined in: packages/lexical-history/src/index.ts:40
Properties
editor
editor:
LexicalEditor
Defined in: packages/lexical-history/src/index.ts:41
editorState
editorState:
EditorState
Defined in: packages/lexical-history/src/index.ts:42
Functions
createEmptyHistoryState()
createEmptyHistoryState():
HistoryState
Defined in: packages/lexical-history/src/index.ts:498
Creates an empty history state.
Returns
- The empty history state, as an object.
registerHistory()
registerHistory(
editor
,historyState
,delay
): () =>void
Defined in: packages/lexical-history/src/index.ts:392
Registers necessary listeners to manage undo/redo history stack and related editor commands.
It returns unregister
callback that cleans up all listeners and should be called on editor unmount.
Parameters
editor
The lexical editor.
historyState
The history state, containing the current state and the undo/redo stack.
delay
number
The time (in milliseconds) the editor should delay generating a new history stack, instead of merging the current changes with the current stack.
Returns
The listeners cleanup callback function.
():
void
Returns
void