Module / v1.0.0-beta.7

@typed/template/Html

5 unique exports available through this public import path, including their members and aliases.

import * as Html from "@typed/template/Html";

Buffered HTML

  • renderToHtmlString

    function

    Renders a stream of RenderEvents into a single HTML string.

    This is a convenience function that collects all events from renderToHtml and joins them into a single string. It is an Effect that resolves when the stream completes.

HTML rendering policy

  • StaticRendering

    variable

    A boolean service that indicates whether the current rendering context is static.

    If true, the HTML renderer will optimize for static output, potentially skipping dynamic placeholder generation or other interactive features not needed for static HTML.

Hydratable HTML rendering

  • HtmlRenderTemplate

    variable

    A Layer that provides the RenderTemplate service implemented for HTML string generation.

    Using this layer enables templates to be rendered as HTML strings (e.g., for SSR) rather than DOM nodes. It sets the RefSubject.CurrentComputedBehavior to "one", indicating a single-pass render approach typical for HTML generation.

Static HTML rendering

  • StaticHtmlRenderTemplate

    variable

    A variant of HtmlRenderTemplate that enables static rendering optimizations.

    This layer provides the RenderTemplate service for HTML generation but also sets StaticRendering to true, enabling optimizations for static content.

Streaming HTML

  • renderToHtml

    function

    Renders a stream of RenderEvents into a stream of HTML strings.

    This function transforms the output of a template rendering process (which produces RenderEvents) into a stream of strings suitable for HTML output (e.g., for Server-Side Rendering).