Skip to content

TransactionManager

Defined in: transaction.ts:99

new TransactionManager(options?): TransactionManager

Defined in: transaction.ts:105

TransactionManagerOptions

TransactionManager

begin(label): Transaction

Defined in: transaction.ts:114

Opens a transaction and returns it. Caller adds ops, then calls commit(tx). Only one transaction is active at a time — nested begins throw, keeping the LIFO invariant clean.

string

Transaction


canRedo(): boolean

Defined in: transaction.ts:186

boolean


canUndo(): boolean

Defined in: transaction.ts:182

boolean


clear(): void

Defined in: transaction.ts:199

Clears both undo and redo stacks. Use on scene load / project switch.

void


commit(tx): void

Defined in: transaction.ts:129

Commits the active transaction onto the undo stack. Empty transactions are dropped silently (keeps the stack uncluttered when a gesture ends up being a no-op).

Transaction

void


peekRedo(): Transaction | null

Defined in: transaction.ts:194

Transaction | null


peekUndo(): Transaction | null

Defined in: transaction.ts:190

Transaction | null


redo(): Transaction | null

Defined in: transaction.ts:170

Transaction | null


rollback(tx): void

Defined in: transaction.ts:150

Aborts the active transaction without committing. Ops that have already been add-ed are reversed so the world returns to the pre-begin state.

Transaction

void


undo(): Transaction | null

Defined in: transaction.ts:158

Transaction | null