Skip to content

Node

Defined in: node.ts:9

A doubly-linked node within a hierarchical tree. Supports both lateral traversal (siblings) and vertical traversal (parent-child).

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.

new Node<Self, Child, Parent>(): Node<Self, Child, Parent>

Defined in: node.ts:23

Node<Self, Child, Parent>

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: 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.

get siblings(): Node<Self, Child, any>[]

Defined in: node.ts:45

Retrieves all subsequent nodes in the current sibling chain.

Node<Self, Child, any>[]

set siblings(arr): void

Defined in: node.ts:29

Connects an array of nodes as a doubly-linked sibling chain starting after this node.

Parameter Type
arr Node<Self, Child, any>[]

void