Skip to content
GRID Editor

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 Parameter Default type
TContext undefined
new History<TContext = undefined>(): History<TContext>;

History<TContext>

canRedo(): boolean;

boolean


canUndo(): boolean;

boolean


clear(): void;

void


getOperationHistory(): OperationRecord[];

OperationRecord[]


offOperationChange(callback: OperationChangeCallback): void;
Parameter Type
callback OperationChangeCallback

void


onOperationChange(callback: OperationChangeCallback): void;
Parameter Type
callback OperationChangeCallback

void


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.

Parameter Type
pending PendingRecord
operator Operator<TContext>
context? TContext

AppliedRecord


redo():
| RecordEntry<EditorOperation, TContext>
| undefined;

| RecordEntry<EditorOperation, TContext> | undefined


undo():
| RecordEntry<EditorOperation, TContext>
| undefined;

| RecordEntry<EditorOperation, TContext> | undefined