class / @typed/template

NodePart

Represents a dynamic insertion point within the node structure (e.g. <div>${content}</div>).

Package version
1.0.0-beta.13
Category
Dynamic child positions
Since
1.0.0

Import

import { NodePart } from "@typed/template";

Signatures

export declare class NodePart {
    readonly _tag = "node";
    readonly index: number;
    constructor(index: number);
}

Why

A node part is a bounded structural range, allowing local reconciliation and arbitrary DOM output without a wrapper element.

Ownership and lifetime

The AST stores only the value index; the part’s child Scope owns live output.

Constructor

Creates a structural part for one interpolation index.

Constructor: Why

Parser tooling records exact producer paths.

Constructor: Ownership and lifetime

Stores only the index.

Property: _tag

Node-part discriminant.

Property: _tag: Why

Selects bounded structural rendering.

Property: _tag: Ownership and lifetime

Immutable AST metadata.

Property: index

The index of the value in the interpolation array.

Property: index: Why

Selects the producer for this exact dynamic range.

Property: index: Ownership and lifetime

Immutable index; the mounted range owns its producer Scope.

Examples

import { NodePart } from "@typed/template/Template"

const part = new NodePart(0)

Other public imports

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

Source