@lexical/history
Interfaces
HistoryConfig
Defined in: packages/lexical-history/src/index.ts:540
Properties
createInitialHistoryState()
createInitialHistoryState: (
editor) =>HistoryState
Defined in: packages/lexical-history/src/index.ts:549
The initial history state, the default is createEmptyHistoryState.
Parameters
editor
Returns
delay
delay:
number
Defined in: packages/lexical-history/src/index.ts:545
The time (in milliseconds) the editor should delay generating a new history stack, instead of merging the current changes with the current stack. The default is 300ms.
disabled
disabled:
boolean
Defined in: packages/lexical-history/src/index.ts:553
Whether history is disabled or not
Type Aliases
HistoryState
HistoryState =
object
Defined in: packages/lexical-history/src/index.ts:56
Properties
current
current:
null|HistoryStateEntry
Defined in: packages/lexical-history/src/index.ts:57
redoStack
redoStack:
HistoryStateEntry[]
Defined in: packages/lexical-history/src/index.ts:58
undoStack
undoStack:
HistoryStateEntry[]
Defined in: packages/lexical-history/src/index.ts:59
HistoryStateEntry
HistoryStateEntry =
object
Defined in: packages/lexical-history/src/index.ts:52
Properties
editor
editor:
LexicalEditor
Defined in: packages/lexical-history/src/index.ts:53
editorState
editorState:
EditorState
Defined in: packages/lexical-history/src/index.ts:54
Variables
HistoryExtension
constHistoryExtension:LexicalExtension<HistoryConfig,"@lexical/history/History",NamedSignalsOutput<{delay:number;disabled:boolean;historyState:HistoryState; }>,unknown>
Defined in: packages/lexical-history/src/index.ts:561
Registers necessary listeners to manage undo/redo history stack and related editor commands, via the @lexical/history module.
SharedHistoryExtension
constSharedHistoryExtension:LexicalExtension<ExtensionConfigBase,"@lexical/history/SharedHistory",unknown,unknown>
Defined in: packages/lexical-history/src/index.ts:598
Registers necessary listeners to manage undo/redo history stack and related editor commands, via the @lexical/history module, only if the parent editor has a history plugin implementation.
Functions
createEmptyHistoryState()
createEmptyHistoryState():
HistoryState
Defined in: packages/lexical-history/src/index.ts:532
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:426
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
The time (in milliseconds) the editor should delay generating a new history stack, instead of merging the current changes with the current stack.
number | ReadonlySignal<number>
Returns
The listeners cleanup callback function.
():
void
Returns
void