UndoStack
Source: undoStack.js:26
UndoStack class.
Constructor
new UndoStack(): UndoStackInstance Methods
getStackSize(): number
Get the stack size.
Returns
number— The size of the stack.
getCurrentStackIndex(): number
Get the current stack index. Warning: 1 based.
Returns
number— The stack index.
getCurrentCommand(): Command
Get the current command.
Returns
Command— The command.
add(cmd: Command)
Add a command to the stack.
Parameters
cmd(Command) — The command to add.
Fires
UndoStack#event:undoadd
remove(name: string): boolean
Remove a command from the stack.
Parameters
name(string) — The name of the command to remove.
Returns
boolean— True if the command was found and removed.
Fires
UndoStack#event:undoremove
undo()
Undo the last command.
Fires
UndoStack#event:undo
redo()
Redo the last command.
Fires
UndoStack#event:redo
Events
undoadd: Event
event
undoStack.js:89Add command to undo stack event.
undoremove: CustomEvent
event
undoStack.js:115Remove command from undo stack event. Get the removed command name from the event.detail.
undo: Event
event
undoStack.js:139Command undo event.
redo: Event
event
undoStack.js:164Command redo event.