API reference · generated from source
Interface: IRetreeUndoHistory#
Defined in: undoHistory.ts:42
Undo/redo controller returned by createUndoHistory.
Properties#
Methods#
clear()#
clear(): void;Defined in: undoHistory.ts:70
Drop all recorded undo and redo steps without touching state.
Returns#
void
dispose()#
dispose(): void;Defined in: undoHistory.ts:75
Stop recording and drop all steps. The history is unusable afterwards;
undo/redo return false.
Returns#
void
redo()#
redo(): boolean;Defined in: undoHistory.ts:64
Replay the most recently undone step.
Returns#
boolean
true when a step was redone; false when there was nothing
to redo.
undo()#
undo(): boolean;Defined in: undoHistory.ts:57
Apply the inverse of the most recent recorded step.
Returns#
boolean
true when a step was undone; false when the history was
empty.
Remarks#
The step moves to the redo stack. Applying emits normally — listeners
and React re-render — but is not recorded as a new step. That holds
inside a Retree.runTransaction too: the transaction flush carrying
the applied records is skipped by recording, so avoid mixing undo/
redo with unrelated writes in one transaction — those writes flush
together with the applied records and are skipped with them.