@lexical/history
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -20,3 +20,16 @@ /** @module @lexical/history */ | ||
}; | ||
/** | ||
* 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. | ||
* @param editor - The lexical editor. | ||
* @param historyState - The history state, containing the current state and the undo/redo stack. | ||
* @param delay - 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. | ||
*/ | ||
export declare function registerHistory(editor: LexicalEditor, historyState: HistoryState, delay: number): () => void; | ||
/** | ||
* Creates an empty history state. | ||
* @returns - The empty history state, as an object. | ||
*/ | ||
export declare function createEmptyHistoryState(): HistoryState; |
@@ -269,3 +269,13 @@ /** | ||
} | ||
/** | ||
* 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. | ||
* @param editor - The lexical editor. | ||
* @param historyState - The history state, containing the current state and the undo/redo stack. | ||
* @param delay - 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. | ||
*/ | ||
function registerHistory(editor, historyState, delay) { | ||
@@ -336,2 +346,7 @@ const getMergeAction = createMergeActionGetter(editor, delay); | ||
} | ||
/** | ||
* Creates an empty history state. | ||
* @returns - The empty history state, as an object. | ||
*/ | ||
function createEmptyHistoryState() { | ||
@@ -338,0 +353,0 @@ return { |
@@ -11,9 +11,9 @@ { | ||
"license": "MIT", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"main": "LexicalHistory.js", | ||
"peerDependencies": { | ||
"lexical": "0.9.1" | ||
"lexical": "0.9.2" | ||
}, | ||
"dependencies": { | ||
"@lexical/utils": "0.9.1" | ||
"@lexical/utils": "0.9.2" | ||
}, | ||
@@ -20,0 +20,0 @@ "repository": { |
20470
348
+ Added@lexical/list@0.9.2(transitive)
+ Added@lexical/selection@0.9.2(transitive)
+ Added@lexical/table@0.9.2(transitive)
+ Added@lexical/utils@0.9.2(transitive)
+ Addedlexical@0.9.2(transitive)
- Removed@lexical/list@0.9.1(transitive)
- Removed@lexical/selection@0.9.1(transitive)
- Removed@lexical/table@0.9.1(transitive)
- Removed@lexical/utils@0.9.1(transitive)
- Removedlexical@0.9.1(transitive)
Updated@lexical/utils@0.9.2