UndoManager Class
Stores the sequence of operations performed on a Markup. Facilitates undo/redo of the operations.
Methods
| Name | Description | |
|---|---|---|
| constructor(): UndoManager | ||
| doRedo(): void | reinstate the most recently reversed operation, if any | |
| doUndo(): void | reverse the most recent operation, if any | |
| onAdded(elem: @svgdotjs/svg.js.Element): void | call this from within a performOperation function after an element has been added to a markup | |
| onDelete(elem: @svgdotjs/svg.js.Element): void | call this from within a performOperation function before an element is about to be deleted from a markup | |
| onModified(newElem: @svgdotjs/svg.js.Element, oldElem: @svgdotjs/svg.js.Element): void | call this from within a performOperation function after an element has been modified in a markup | |
| onRepositioned(elem: @svgdotjs/svg.js.Element, oldIndex: number, oldParent: @svgdotjs/svg.js.Element): void | call this from within a performOperation function after an element has been moved in display order in a markup | |
| performOperation(cmdName: string, fn: VoidFunction): void | Perform a series of changes to markup elements that should all be reversed as a single operation. | 
Properties
Defined in
- markup/src/Undo.ts Line 106
Last Updated: 30 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.