class / @typed/template

SparseCommentNode

Represents a sparse comment.

Package version
1.0.0-beta.7
Category
Sparse comments
Since
1.0.0

Import

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

Signatures

export declare class SparseCommentNode {
    readonly _tag: "sparse-comment";
    readonly nodes: Array<TextNode | CommentPartNode>;
    constructor(nodes: Array<TextNode | CommentPartNode>);
}

Why

Literal and dynamic comment segments remain one local native comment value.

Ownership and lifetime

The model owns segments; the mounted Scope owns the comment updater.

Constructor

Creates sparse comment syntax.

Property: _tag

Sparse-comment discriminant.

Property: _tag: Why

Selects ordered segment joining into one native Comment.

Property: _tag: Ownership and lifetime

Immutable AST metadata.

Property: nodes

Ordered literal and dynamic comment segments.

Property: nodes: Why

Reconstructs one comment value in author order.

Property: nodes: Ownership and lifetime

Retained AST array; the mounted part owns live inputs.

Examples

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

const node = new SparseCommentNode([])

Other public imports

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

Source