TreeNodeApi Interface
Provides various functions for analyzing TreeNodes. *
Signature
/** @sealed */
export interface TreeNodeApi
Remarks
This type should only be used via the public Tree
export.
Methods
Method | Return Type | Description |
---|---|---|
is(value, schema) | value is TreeNodeFromImplicitAllowedTypes<TSchema> | Narrow the type of the given value if it satisfies the given schema. |
key(node) | string | number | The key of the given node under its parent. |
on(node, eventName, listener) | () => void | Register an event listener on the given node. |
parent(node) | TreeNode | undefined | Return the node under which this node resides in the tree (or undefined if this is a root node of the tree). |
schema(node) | TreeNodeSchema | The schema information for this node. |
shortId(node) | number | string | undefined | Returns the identifier of the given node in the most compressed form possible. |
status(node) | TreeStatus | Returns the TreeStatus of the given node. |
Method Details
is
Narrow the type of the given value if it satisfies the given schema.
Signature
is<TSchema extends ImplicitAllowedTypes>(value: unknown, schema: TSchema): value is TreeNodeFromImplicitAllowedTypes<TSchema>;