Class Template<T>

A template that can be used to render HTML content.

Type Parameters

Hierarchy (view full)

Constructors

Properties

content: TemplateContent | ((params) => TemplateContent)

The content of the template, or a function that returns the content.

Type declaration

Methods

  • Renders the template with the given params (if content is a function).

    Parameters

    • params: T

      The params to pass to the template.

    Returns RawContent

    The rendered template as a RawContent instance.

  • Renders the template with the given params (if content is a function).

    Parameters

    • params: T

      The params to pass to the template.

    Returns string

    The rendered template.

  • Returns the HTML string representation of a child of the template.

    Parameters

    • Optional child: TagChild<any>

      The child to stringify.

    Returns string

    The HTML string representation of the child.

Generated using TypeDoc