Skip to content

DOMNode

Defined in: src/dom/dom.ts:6

Base tree node: parent/children links and identity. Widget extends it with layout, styling, and rendering. Bindings build a tree of these and the engine walks it each frame.

new DOMNode(tagName?): DOMNode

Defined in: src/dom/dom.ts:18

string = ""

DOMNode

children: DOMNode[] = []

Defined in: src/dom/dom.ts:16

Child nodes in document order.


classes: Set<string>

Defined in: src/dom/dom.ts:10

Advisory class names (no CSS cascade today).


id: string = ""

Defined in: src/dom/dom.ts:8

Optional stable identifier (from the id prop).


parent: DOMNode | null = null

Defined in: src/dom/dom.ts:14

Parent node, or null when detached / at the root.


tagName: string = ""

Defined in: src/dom/dom.ts:12

Host element tag, lowercased (e.g. “ztui-button”).

appendChild(child): void

Defined in: src/dom/dom.ts:23

Append child, detaching it from any previous parent.

DOMNode

void


describe(): string

Defined in: src/dom/dom.ts:59

Human/LLM-readable identity for logs and diagnostics, e.g. button#submit.primary @ (2,1 10x1). Includes the laid-out region when one is present (widgets), and the text preview for text nodes.

string


insertBefore(child, before): void

Defined in: src/dom/dom.ts:41

Insert child before the before sibling (appends if before isn’t found).

DOMNode

DOMNode

void


matchesSelector(selector): boolean

Defined in: src/dom/dom.ts:87

Match a compound selector against this node — tags, IDs, and classes (e.g. tag#id.a.b).

string

boolean


removeChild(child): void

Defined in: src/dom/dom.ts:32

Remove child if it’s a child of this node.

DOMNode

void


walk(callback): void

Defined in: src/dom/dom.ts:74

Depth-first visit of this node and its descendants, in z-index order.

(node) => void

void