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

Constructor Description
(constructor)() Constructs a new instance of the UndoRedoStackManager class

Methods

Method Return Type Description
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

Parameter Type Description
event "changePushed"
listener () => void

pushToCurrentOperation

Signature
pushToCurrentOperation(revertible: IRevertible): void;

Parameters

Parameter Type Description
revertible IRevertible

redoOperation

Signature
redoOperation(): boolean;

Returns

Return type: boolean

removeListener

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

Parameters

Parameter Type Description
event "changePushed"
listener () => void

undoOperation

Signature
undoOperation(): boolean;

Returns

Return type: boolean