type-alias / @typed/template

Node

Represents any root or child node in the renderer-neutral template AST.

Package version
1.0.0-beta.7
Category
Template structure
Since
1.0.0

Import

import type { Node } from "@typed/template";

Signatures

export type Node = ElementNode | SelfClosingElementNode | TextOnlyElement | TextNode | NodePart | Comment | DocType;

Why

DOM and HTML compilers exhaustively dispatch on the public _tag union.

Ownership and lifetime

This union describes parsed data and owns no renderer resource.

Examples

import { TextNode, type Node } from "@typed/template/Template"

const node: Node = new TextNode("hello")

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source