Class: InMemoryHistory
Defined in: diagram/history.ts:257
Implements command history which stores all commands in memory.
Implements
Constructors
Constructor
new InMemoryHistory():
InMemoryHistory
Returns
InMemoryHistory
Properties
Property | Modifier | Type | Description |
---|---|---|---|
| Events for the command history. |
Accessors
redoStack
Get Signature
get redoStack(): readonly
Command
[]
Defined in: diagram/history.ts:269
Current stack of operation which could be redone (performed again after being undone).
Latest undone commands are put at the end of the stack.
Returns
readonly Command
[]
Current stack of operation which could be redone (performed again after being undone).
Latest undone commands are put at the end of the stack.
Implementation of
undoStack
Get Signature
get undoStack(): readonly
Command
[]
Defined in: diagram/history.ts:265
Current stack of operation which could be undone (reverted).
Latest executed (or redone) commands are put at the end of the stack.
Returns
readonly Command
[]
Current stack of operation which could be undone (reverted).
Latest executed (or redone) commands are put at the end of the stack.
Implementation of
Methods
execute()
execute(
command
):void
Defined in: diagram/history.ts:301
Executes the specified command and puts its inverse into undo stack.
Parameters
Parameter | Type |
---|---|
|
Returns
void
Implementation of
redo()
redo():
void
Defined in: diagram/history.ts:292
Redoes (performs again) the latest undone command.
If redo stack is empty, does nothing.
Returns
void
Implementation of
registerToUndo()
registerToUndo(
command
):void
Defined in: diagram/history.ts:306
Puts the inverse command directly into undo stack.
Parameters
Parameter | Type |
---|---|
|
Returns
void
Implementation of
reset()
reset():
void
Defined in: diagram/history.ts:277
Clears undo and redo stacks of commands.
Returns
void
Implementation of
startBatch()
startBatch(
title?
):CommandBatch
Defined in: diagram/history.ts:321
Starts a new command batch which will be active either stored or discarded.
When a batch is active, all executed or registered to undo commands will be put into the batch instead of the undo stack, so it could be undo as whole later.
Starting a new batch when there is an active command batch already causes the new batch to become nested, which allows to use operations creating command batches as part of a larger operation having its own top-level batch.
Parameters
Parameter | Type |
---|---|
|
|
Returns
Implementation of
undo()
undo():
void
Defined in: diagram/history.ts:283
Undoes (reverts) the latest executed command and puts it into redo stack.
If undo stack is empty, does nothing.
Returns
void