Ir al contenido

Transaction

Defined in: undo/Transaction.ts:7

A transaction groups multiple commands into a single undoable unit. All sub-commands are executed together and undone together.

new Transaction(name?): Transaction

Defined in: undo/Transaction.ts:11

string = 'Transaction'

Transaction

get isEmpty(): boolean

Defined in: undo/Transaction.ts:26

Whether this transaction has no commands.

boolean


get name(): string

Defined in: undo/Transaction.ts:16

The name of this transaction.

string


get size(): number

Defined in: undo/Transaction.ts:21

Get the number of sub-commands in this transaction.

number

add(command): this

Defined in: undo/Transaction.ts:31

Add a command to this transaction.

Command

this


clear(): void

Defined in: undo/Transaction.ts:42

Clear all commands in this transaction.

void


describe(): string

Defined in: undo/Transaction.ts:61

Get a description of this transaction.

string

Command.describe


execute(): void

Defined in: undo/Transaction.ts:47

Execute all commands in order.

void

Command.execute


removeLast(): Command | null

Defined in: undo/Transaction.ts:37

Remove the last added command.

Command | null


undo(): void

Defined in: undo/Transaction.ts:54

Undo all commands in reverse order.

void

Command.undo