whits
    Preparing search index...

    Class Template<T>

    A template that can be used to render HTML content.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates a new template.

      Type Parameters

      Parameters

      • content: TemplateContent | ((params: T) => TemplateContent | Promise<TemplateContent>)

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

      Returns Template<T>

    Properties

    content:
        | TemplateContent
        | ((params: T) => TemplateContent | Promise<TemplateContent>)

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

    Methods

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

      Parameters

      • params: T

        The params to pass to the template.

      Returns Promise<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 Promise<string>

      The rendered template.