Skip to main content

Interface: UndoMiddlewareOptions<S>

Undo middleware options.

Type Parameters​

Type Parameter
S

Properties​

attachedState?​

optional attachedState?: object;

Attached states are states that are saved/restored when undoing/redoing. Usually used to restore state that is not part of the document model such as focus, selection, scroll position, etc.

restore()​

restore(s): void;

Restores a certain state previously saved.

Parameters​
ParameterTypeDescription
sSState to restore.
Returns​

void

save()​

save(): S;

Saves a certain state and associates it with the undo step. This state can be restored when undoing/redoing.

Returns​

S


maxRedoLevels?​

optional maxRedoLevels?: number;

Max number of redo levels to keep, or undefined for infinite.


maxUndoLevels?​

optional maxUndoLevels?: number;

Max number of undo levels to keep, or undefined for infinite.