Module / v1.0.0-beta.7

@typed/template/Parser

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

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

Template parsing

  • parse

    function

    Parses a template string array (from a tagged template literal) into a reusable Template object.

    This parser handles:

    • Standard HTML structure (elements, attributes, text, comments).
    • Custom part syntax for interpolation (e.g., ${value}).
    • Special attributes like .property, @event, ?boolean.
    • Self-closing tags and text-only elements (script, style).

    Each call returns a new Template instance containing the static AST and dynamic part locations. Render targets cache their compiled DOM fragments or HTML chunks independently by template-literal identity.