Ir al contenido

UndoManager

Defined in: undo/UndoManager.ts:23

Manages undo/redo history for a diagram.

new UndoManager(maxHistorySize?): UndoManager

Defined in: undo/UndoManager.ts:32

number = 100

UndoManager

get clearsHistory(): boolean

Defined in: undo/UndoManager.ts:57

GoJS-compatible: Whether undo/redo history is cleared by non-undoable actions.

boolean

set clearsHistory(value): void

Defined in: undo/UndoManager.ts:61

boolean

void


get isEnabled(): boolean

Defined in: undo/UndoManager.ts:37

GoJS-compatible: Whether undo/redo is enabled.

boolean

set isEnabled(value): void

Defined in: undo/UndoManager.ts:41

boolean

void


get isUndoingRedoing(): boolean

Defined in: undo/UndoManager.ts:84

GoJS-compatible: Whether the UndoManager is currently undoing or redoing.

boolean


get maxHistoryLength(): number

Defined in: undo/UndoManager.ts:46

GoJS-compatible: The maximum number of undo/redo steps kept in history.

number

set maxHistoryLength(value): void

Defined in: undo/UndoManager.ts:50

number

void


get skipUndoManager(): boolean

Defined in: undo/UndoManager.ts:75

boolean

set skipUndoManager(value): void

Defined in: undo/UndoManager.ts:79

boolean

void

addListener(listener): void

Defined in: undo/UndoManager.ts:258

Add a change listener.

UndoManagerEventHandler

void


beginTransaction(name?): void

Defined in: undo/UndoManager.ts:120

Begin a transaction. Commands executed afterward are grouped into one undo unit.

string = 'Transaction'

void


canRedo(): boolean

Defined in: undo/UndoManager.ts:224

Check if redo is available.

boolean


canUndo(): boolean

Defined in: undo/UndoManager.ts:219

Check if undo is available.

boolean


clear(): void

Defined in: undo/UndoManager.ts:251

Clear all history.

void


commitTransaction(): Transaction | null

Defined in: undo/UndoManager.ts:128

Commit the current transaction as a single undoable command. Returns the committed transaction, or null if no transaction is open.

Transaction | null


execute(command): void

Defined in: undo/UndoManager.ts:89

Execute a command and add it to the undo stack.

Command

void


getRedoDescription(): string | null

Defined in: undo/UndoManager.ts:245

Get the description of the next redo command.

string | null


getRedoStack(): readonly Command[]

Defined in: undo/UndoManager.ts:234

Get the redo stack.

readonly Command[]


getTransactionDepth(): number

Defined in: undo/UndoManager.ts:178

Get the depth of open transactions.

number


getUndoDescription(): string | null

Defined in: undo/UndoManager.ts:239

Get the description of the next undo command.

string | null


getUndoStack(): readonly Command[]

Defined in: undo/UndoManager.ts:229

Get the undo stack.

readonly Command[]


isTransactionOpen(): boolean

Defined in: undo/UndoManager.ts:173

Check whether a transaction is currently open.

boolean


redo(): boolean

Defined in: undo/UndoManager.ts:201

Redo the last undone command.

boolean


removeListener(listener): void

Defined in: undo/UndoManager.ts:263

Remove a change listener.

UndoManagerEventHandler

void


rollbackTransaction(): boolean

Defined in: undo/UndoManager.ts:161

Roll back (cancel) the current transaction, undoing its commands. Returns true if a transaction was rolled back.

boolean


setTransactionIsSeparateFromHistory(): void

Defined in: undo/UndoManager.ts:70

GoJS-compatible: Mark the current transaction as separate from history. No-op: GraphoJS doesn’t yet distinguish “separate from history” transactions from regular ones.

void


undo(): boolean

Defined in: undo/UndoManager.ts:183

Undo the last command.

boolean