Tree Interface
Provides various functions for interacting with TreeNodes.
For more information about our API support guarantees, see here.
This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.
Signature
/** @sealed */
export interface Tree extends TreeNodeApi
Extends: TreeNodeApi
Remarks
This type should only be used via the Tree export. 
Properties
| Property | Modifiers | Type | Description | 
|---|---|---|---|
| runTransaction | readonly | 
    RunTransaction | Run a transaction. | 
Methods
| Method | Return Type | Description | 
|---|---|---|
| contains(node, other) | boolean | Check if the subtree defined by node contains other. | 
  
Property Details
runTransaction
Run a transaction.
For more information about our API support guarantees, see here.
Signature
readonly runTransaction: RunTransaction;
Type: RunTransaction
Method Details
contains
Check if the subtree defined by node contains other.
For more information about our API support guarantees, see here.
Signature
contains(node: TreeNode, other: TreeNode): boolean;
Remarks
This includes direct and indirect children: as long as node is an ancestor of other (occurs in its parentage chain), this returns true, regardless of the number of levels of the tree between.
node is considered to contain itself, so the case where node === other returns true.
This is handy when checking if moving node into other would create a cycle and would thus be invalid.
This check walks the parents of other looking for node, and thus runs in time proportional to the depth of child in the tree.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| node | TreeNode | |
| other | TreeNode | 
Returns
true if other is an inclusive descendant of node, and false otherwise.
Return type: boolean