class / @typed/template/Template

TextNode

Represents a static text node.

Package version
1.0.0-beta.7
Category
Text content
Since
1.0.0

Import

import { TextNode } from "@typed/template/Template";

Signatures

export declare class TextNode {
    readonly _tag: "text";
    readonly value: string;
    constructor(value: string);
}

Why

Static author text can be compiled once into native text or SSR output.

Ownership and lifetime

The model owns one string and no DOM node.

Constructor

Creates static text syntax.

Property: _tag

Static-text discriminant.

Property: _tag: Why

Selects one-time native text creation and escaped SSR output.

Property: _tag: Ownership and lifetime

Immutable AST metadata.

Property: value

Authored text value.

Property: value: Why

Preserves exact literal content for compilation.

Property: value: Ownership and lifetime

Retained string metadata.

Examples

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

const node = new TextNode("hello")

Other public imports

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

Source