The forward operation definition type.
The inverse operation definition type.
Optional ReadonlycontextOptional opaque context (e.g. view path and selection) returned on undo and redo so the UI can return to where the change happened.
ReadonlyderiveDerives the input for the inverse operation from the forward operation's input and output.
ReadonlyinverseThe inverse operation to invoke for undo.
Optional ReadonlymergeOptional fold of two merged invocations into one forward, from which the inverse is derived again; without it the entry keeps the earliest inverse and the latest forward, which suits absolute writes but not relative ones (a delta, or a patch between versions).
Optional ReadonlymergeOptional merge key; consecutive entries in one scope with equal keys inside the tracker's merge window fold into one undo step (e.g. typing into one field).
Optional ReadonlymessageOptional message to show in the undo toast. Can be a static Label or a function that derives the message from input/output.
ReadonlyoperationThe forward operation.
Optional ReadonlyscopeOptional scope (document or subject id) so scoped undo/redo can act on this entry alone. Return undefined to leave the entry reachable only by unscoped undo/redo.
Optional ReadonlytoastWhether recording an entry offers the undo toast; true when absent. An editor with undo keys of its own (a canvas) turns it off, since every gesture would raise one.
Undo mapping that links a forward operation to its inverse. Type parameters ensure deriveContext has correctly typed arguments.