class / @typed/template

CommentNode

Represents a static comment.

Package version
1.0.0-beta.13
Category
Comment content
Since
1.0.0

Import

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

Signatures

export declare class CommentNode {
    readonly _tag: "comment";
    readonly value: string;
    constructor(value: string);
}

Why

Author comments remain explicit AST nodes across DOM and HTML output.

Ownership and lifetime

The model owns a string and no native node.

Constructor

Creates static comment syntax.

Property: _tag

Static-comment discriminant.

Property: _tag: Why

Selects one-time native comment creation and SSR serialization.

Property: _tag: Ownership and lifetime

Immutable AST metadata.

Property: value

Authored comment value.

Property: value: Why

Preserves exact literal comment content.

Property: value: Ownership and lifetime

Retained string metadata.

Examples

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

const node = new CommentNode("note")

Other public imports

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

Source