TransactionManager
此内容尚不支持你的语言。
Defined in: transaction.ts:99
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TransactionManager(
options?):TransactionManager
Defined in: transaction.ts:105
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”TransactionManager
Methods
Section titled “Methods”begin()
Section titled “begin()”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”canRedo()
Section titled “canRedo()”canRedo():
boolean
Defined in: transaction.ts:186
Returns
Section titled “Returns”boolean
canUndo()
Section titled “canUndo()”canUndo():
boolean
Defined in: transaction.ts:182
Returns
Section titled “Returns”boolean
clear()
Section titled “clear()”clear():
void
Defined in: transaction.ts:199
Clears both undo and redo stacks. Use on scene load / project switch.
Returns
Section titled “Returns”void
commit()
Section titled “commit()”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).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
peekRedo()
Section titled “peekRedo()”peekRedo():
Transaction|null
Defined in: transaction.ts:194
Returns
Section titled “Returns”Transaction | null
peekUndo()
Section titled “peekUndo()”peekUndo():
Transaction|null
Defined in: transaction.ts:190
Returns
Section titled “Returns”Transaction | null
redo()
Section titled “redo()”redo():
Transaction|null
Defined in: transaction.ts:170
Returns
Section titled “Returns”Transaction | null
rollback()
Section titled “rollback()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
undo()
Section titled “undo()”undo():
Transaction|null
Defined in: transaction.ts:158
Returns
Section titled “Returns”Transaction | null