Skip to main content
Version: v1

UndoRedoStackManager Class

Manages the Undo and Redo stacks, and operations within those stacks. Allows adding items to the current operation on the stack, closing the current operation, and issuing an undo or a redo.

Signature

export declare class UndoRedoStackManager

Constructors

ConstructorDescription
(constructor)()Constructs a new instance of the UndoRedoStackManager class

Methods

MethodReturn TypeDescription
closeCurrentOperation()void
on(event, listener)void
pushToCurrentOperation(revertible)void
redoOperation()boolean
removeListener(event, listener)void
undoOperation()boolean

Constructor Details

(constructor)

Constructs a new instance of the UndoRedoStackManager class

Signature

constructor();

Method Details

closeCurrentOperation

Signature

closeCurrentOperation(): void;

on

Signature

on(event: "changePushed", listener: () => void): void;

Parameters

ParameterTypeDescription
event"changePushed"
listener() => void

pushToCurrentOperation

Signature

pushToCurrentOperation(revertible: IRevertible): void;

Parameters

ParameterTypeDescription
revertibleIRevertible

redoOperation

Signature

redoOperation(): boolean;

Returns

Return type: boolean

removeListener

Signature

removeListener(event: "changePushed", listener: () => void): void;

Parameters

ParameterTypeDescription
event"changePushed"
listener() => void

undoOperation

Signature

undoOperation(): boolean;

Returns

Return type: boolean