Node
Defined in: node.ts:9
A doubly-linked node within a hierarchical tree. Supports both lateral traversal (siblings) and vertical traversal (parent-child).
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type | Description |
|---|---|---|
Self |
- | Type of the node’s value. |
Child |
null |
Type of the nodes stored in the children array. |
Parent |
null |
Type of the parent node. |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Node<
Self,Child,Parent>():Node<Self,Child,Parent>
Defined in: node.ts:23
Returns
Section titled “Returns”Node<Self, Child, Parent>
Properties
Section titled “Properties”children
Section titled “children”children:
Node<Child,any,any>[] |null=null
Defined in: node.ts:21
Collection of child nodes.
next:
Node<Self,null,null> |null=null
Defined in: node.ts:11
Next sibling in the sequence.
parent
Section titled “parent”parent:
Node<Parent,any,any> |null=null
Defined in: node.ts:18
Reference to the parent container.
prev:
Node<Self,null,null> |null=null
Defined in: node.ts:13
Previous sibling in the sequence.
value:
Self|null=null
Defined in: node.ts:15
Node data.
Accessors
Section titled “Accessors”siblings
Section titled “siblings”Get Signature
Section titled “Get Signature”get siblings():
Node<Self,Child,any>[]
Defined in: node.ts:45
Retrieves all subsequent nodes in the current sibling chain.
Returns
Section titled “Returns”Node<Self, Child, any>[]
Set Signature
Section titled “Set Signature”set siblings(
arr):void
Defined in: node.ts:29
Connects an array of nodes as a doubly-linked sibling chain starting after this node.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
arr |
Node<Self, Child, any>[] |
Returns
Section titled “Returns”void