Skip to main content
Version: v1

TransactionInternal Namespace

A mutable transaction for applying sequences of changes to a TreeView. Allows viewing the intermediate states.

Contains necessary state to apply changes within an edit to a TreeView.

May have any number of changes applied to make up the edit. Use close to complete the transaction, returning the array of changes and an EditingResult showing the results of applying the changes as an Edit to the initial TreeView (passed to the constructor).

No data outside the Transaction is modified by Transaction: the results from close must be used to actually submit an Edit.

Signature

export declare namespace TransactionInternal

Interfaces

Interface Description
BadPlaceFailure Error thrown when an insert change uses an invalid Place
BadRangeFailure Error thrown when a detach operation is given an invalid or malformed Range
ConstraintViolationFailure Error thrown when a constraint fails to apply
DetachedSequenceIdAlreadyInUseFailure Error thrown when a transaction encounters a build operation using an already in use DetachedSequenceID.
DetachedSequenceNotFoundFailure Error thrown when a transaction tries to operate on an unknown DetachedSequenceID
DuplicateIdInBuildFailure Error thrown when a build uses a duplicated NodeId
IdAlreadyInUseFailure Error thrown when a build node ID is already used in the current state
UnknownIdFailure Error thrown when a change is attempted on an unknown NodeId
UnusedDetachedSequenceFailure Error returned when a transaction is closed while there is an unused detached sequence.

Classes

Class Description
Policy The policy followed by a TransactionInternal.

Enumerations

Enum Description
ConstraintViolationKind Enum of possible kinds of constraint violations that can be encountered
FailureKind The kinds of failures that a transaction might encounter.

Types

TypeAlias Description
ConstraintViolationResult The details of what kind of constraint was violated and caused a ConstraintViolationFailure error to occur
Failure A failure encountered by a transaction.
ValidState

Functions

Function Return Type Description
factory(view) GenericTransaction Makes a new GenericTransaction that follows the Policy policy.

Function Details

factory

Makes a new GenericTransaction that follows the Policy policy.

Signature

export function factory(view: RevisionView): GenericTransaction;

Parameters

Parameter Type Description
view RevisionView

Returns

Return type: GenericTransaction