new UndoManager(typeScope, options)
Parameters:
| Name | Type | Description |
|---|---|---|
typeScope |
AbstractType.<any> | Array.<AbstractType.<any>> | Accepts either a single type, or an array of types |
options |
UndoManagerOptions |
Extends
- Observable.<('stack-item-added'|'stack-item-popped')>
Classes
Members
-
redoStack :Array.<StackItem>
-
-
undoing :boolean
-
Whether the client is currently undoing (calling UndoManager.undo)
-
undoStack :Array.<StackItem>
-
Methods
-
redo() → nullable {StackItem}
-
Redo last undo operation.
-
stopCapturing()
-
UndoManager merges Undo-StackItem if they are created within time-gap smaller than
options.captureTimeout. Callum.stopCapturing()so that the next StackItem won't be merged.Example
// without stopCapturing ytext.insert(0, 'a') ytext.insert(1, 'b') um.undo() ytext.toString() // => '' (note that 'ab' was removed) // with stopCapturing ytext.insert(0, 'a') um.stopCapturing() ytext.insert(0, 'b') um.undo() ytext.toString() // => 'a' (note that only 'b' was removed) -
undo() → nullable {StackItem}
-
Undo last changes on type.