Module / v1.0.0-beta.7

@typed/template/Render

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

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

DOM adoption

  • attemptHydration

    function

    Locates a compatible SSR template range for an advanced render context.

DOM document selection

  • CurrentRenderDocument

    variable

    A service that provides the Document interface for rendering.

    Defaults to the global document object. This can be overridden for testing or environments where the global document is not available or desired.

DOM mounting

  • render

    variable

    Mounts any Renderable to a specific DOM element.

    This function lifts primitives, arrays, Effects, Streams, and Fx values into a render stream and keeps the target DOM element updated. It handles:

    • Mounting the initial content.
    • Updating the content as new events are emitted.
    • Hydrating the content if hydration context is provided.

DOM output inference

  • ToRendered

    type-alias

    Computes the DOM value represented by a nullable RenderEvent.

DOM template interpretation

  • DomRenderTemplate

    variable

    A Layer that provides the RenderTemplate service implemented for DOM rendering.

    This layer enables templates to be rendered as actual DOM nodes. It handles:

    • Parsing templates into DOM fragments.
    • Caching parsed templates.
    • Hydrating from existing DOM (if applicable).
    • Setting up event listeners.
    • Managing fine-grained updates to DOM nodes via Fx streams.

Render scheduling

  • CurrentRenderPriority

    variable

    A service that provides the default priority for rendering tasks.

    The default value is RenderPriority.Raf(10), which typically schedules updates to occur before the next repaint.

  • CurrentRenderQueue

    variable

    A service that manages the queue of DOM updates.

    It ensures that DOM updates are batched and executed efficiently, often coordinating with browser painting cycles (e.g., via requestAnimationFrame).

Renderable normalization

  • liftRenderableToFx

    function

    Converts any Renderable into an Fx while preserving its nested errors and service requirements.

Template run context

  • TemplateContext

    type-alias

    Advanced per-template DOM rendering state used by renderer extensions.