Skip to main content
Version: v2

TreeStatus Enum

Status of the tree that a particular node belongs to.

Signature​

export declare enum TreeStatus

Flags​

FlagDescription
DeletedIs removed and cannot be added back to the original document tree.
InDocumentIs parented under the root field.
NewIs created but has not yet been inserted into the tree.
RemovedIs not parented under the root field, but can be added back to the original document tree.

Deleted​

Is removed and cannot be added back to the original document tree.

Signature​

Deleted = 2

Remarks​

Nodes can enter this state for multiple reasons: - The node was removed and nothing (e.g. undo/redo history) kept it from being cleaned up. - The TreeView was disposed or had a schema change which made the tree incompatible.

Deleted nodes' contents should not be observed or edited. This includes functionality exposed via Tree, with the exception of status(node).

InDocument​

Is parented under the root field.

Signature​

InDocument = 0

New​

Is created but has not yet been inserted into the tree.

Signature​

New = 3

Remarks​

See also Unhydrated.

Nodes in the new state have some limitations:

  • Events are not currently triggered for changes. Fixes for this are planned.
  • Reading identifiers from nodes which were left unspecified (defaulted) when creating the tree will error. This is because allocating unique identifiers in a compressible manner requires knowing which tree the nodes will be inserted into.
  • Transactions do not work: transactions apply to a single TreeView, and New nodes are not part of one.
  • Automatically generated identifiers will be less compressible if read.

Removed​

Is not parented under the root field, but can be added back to the original document tree.

Signature​

Removed = 1