interface / @typed/template

HtmlTextChunk

A static text chunk.

Package version
1.0.0-beta.13
Category
Static HTML chunks
Since
1.0.0

Import

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

Signatures

export interface HtmlTextChunk {
    readonly _tag: "text";
    readonly text: string;
}

Why

Contiguous static markup can be written without waiting for an interpolation.

Ownership and lifetime

The record retains one renderer-authored string and owns no resource.

Property: _tag

Identifies an immediately writable static-text chunk.

Property: _tag: Why

Exhaustive dispatch avoids inspecting arbitrary object shapes.

Property: _tag: Ownership and lifetime

The literal is immutable metadata.

Property: text

Renderer-authored HTML text ready for the output sink.

Property: text: Why

Static markup can stream without awaiting dynamic inputs.

Property: text: Ownership and lifetime

The chunk owns the string; the response sink owns emitted bytes.

Examples

import type { HtmlTextChunk } from "@typed/template/HtmlChunk"

const chunk: HtmlTextChunk = { _tag: "text", text: "<p>ready</p>" }

Other public imports

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

Source