HistoryStack
Documentation / @elitechart/core / HistoryStack
Defined in: history/history-stack.ts:90
Command-pattern undo/redo stack used internally by the chart and exported for advanced embedders that want to extend undo into their own UI actions.
Example
Constructors
Constructor
Defined in: history/history-stack.ts:96
Parameters
opts?
HistoryStackOptions = {}
Returns
HistoryStack
Accessors
canRedo
Get Signature
Defined in: history/history-stack.ts:147
Returns
boolean
canUndo
Get Signature
Defined in: history/history-stack.ts:143
Returns
boolean
redoLabel
Get Signature
Defined in: history/history-stack.ts:167
Returns
string | null
size
Get Signature
Defined in: history/history-stack.ts:151
Returns
number
undoLabel
Get Signature
Defined in: history/history-stack.ts:162
Label of the top-of-stack command, for UI hints ("Undo: move drawing").
Returns
string | null
Methods
clear()
Defined in: history/history-stack.ts:155
Returns
void
push()
Defined in: history/history-stack.ts:106
Record a command. By default the command's redo() is invoked
immediately — pass { execute: false } when the action has already
been performed and you only want to record the reversal.
Parameters
cmd
opts?
execute?
boolean
Returns
void
redo()
Defined in: history/history-stack.ts:134
Returns
HistoryCommand | null
undo()
Defined in: history/history-stack.ts:125
Returns
HistoryCommand | null