History
The undo and redo stack over one workbook, the order every change took, and the stream of records it reports to listeners. It has no edit methods: operators record into it, and undo and redo hand the inverse back to the operator that made the change. An undo or redo the workbook refuses stays on the stack, since the operator leaves the workbook as it was.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TContext |
undefined |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new History<TContext = undefined>(): History<TContext>;Returns
Section titled “Returns”History<TContext>
Methods
Section titled “Methods”canRedo()
Section titled “canRedo()”canRedo(): boolean;Returns
Section titled “Returns”boolean
canUndo()
Section titled “canUndo()”canUndo(): boolean;Returns
Section titled “Returns”boolean
clear()
Section titled “clear()”clear(): void;Returns
Section titled “Returns”void
getOperationHistory()
Section titled “getOperationHistory()”getOperationHistory(): OperationRecord[];Returns
Section titled “Returns”offOperationChange()
Section titled “offOperationChange()”offOperationChange(callback: OperationChangeCallback): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
callback |
OperationChangeCallback |
Returns
Section titled “Returns”void
onOperationChange()
Section titled “onOperationChange()”onOperationChange(callback: OperationChangeCallback): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
callback |
OperationChangeCallback |
Returns
Section titled “Returns”void
record()
Section titled “record()”record( pending: PendingRecord, operator: Operator<TContext>, context?: TContext): AppliedRecord;Numbers a change an operator made and keeps it on the stack, as a record nothing can change.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
pending |
PendingRecord |
operator |
Operator<TContext> |
context? |
TContext |
Returns
Section titled “Returns”redo()
Section titled “redo()”redo(): | RecordEntry<EditorOperation, TContext> | undefined;Returns
Section titled “Returns”| RecordEntry<EditorOperation, TContext>
| undefined
undo()
Section titled “undo()”undo(): | RecordEntry<EditorOperation, TContext> | undefined;Returns
Section titled “Returns”| RecordEntry<EditorOperation, TContext>
| undefined