The mixed application class augmented with Handlebars template rendering behavior.

Hierarchy (view full)

Properties

PARTS: Record<string, HandlebarsTemplatePart> = {}

Configure a registry of template parts which are supported for this application for partial rendering.

Accessors

  • get parts(): Record<string, HTMLElement>
  • A record of all rendered template parts.

    Returns Record<string, HTMLElement>

Methods

  • Parameters

    • options: any

    Returns void

    Inherit Doc

  • Parameters

    • context: any
    • options: any

    Returns Promise<void>

    Inherit Doc

  • Protected

    Render each configured application part using Handlebars templates.

    Parameters

    • context: ApplicationRenderContext

      Context data for the render operation

    • options: HandlebarsRenderOptions

      Options which configure application rendering behavior

    Returns Promise<Record<string, HTMLElement>>

    A single rendered HTMLElement for each requested part

  • Protected

    Prepare context that is specific to only a single rendered part.

    It is recommended to augment or mutate the shared context so that downstream methods like _onRender have visibility into the data that was used for rendering. It is acceptable to return a different context object rather than mutating the shared context at the expense of this transparency.

    Parameters

    • partId: string

      The part being rendered

    • context: ApplicationRenderContext

      Shared context provided by _prepareContext

    • options: HandlebarsRenderOptions

      Options which configure application rendering behavior

    Returns Promise<ApplicationRenderContext>

    Context data for a specific part

  • Protected

    Replace the HTML of the application with the result provided by Handlebars rendering.

    Parameters

    • result: Record<string, HTMLElement>

      The result from Handlebars template rendering

    • content: HTMLElement

      The content element into which the rendered result must be inserted

    • options: HandlebarsRenderOptions

      Options which configure application rendering behavior

    Returns void

  • Protected

    Prepare data used to synchronize the state of a template part.

    Parameters

    • partId: string

      The id of the part being rendered

    • newElement: HTMLElement

      The new rendered HTML element for the part

    • priorElement: HTMLElement

      The prior rendered HTML element for the part

    • state: object

      A state object which is used to synchronize after replacement

    Returns void

  • Protected

    Synchronize the state of a template part after it has been rendered and replaced in the DOM.

    Parameters

    • partId: string

      The id of the part being rendered

    • newElement: HTMLElement

      The new rendered HTML element for the part

    • priorElement: HTMLElement

      The prior rendered HTML element for the part

    • state: object

      A state object which is used to synchronize after replacement

    Returns void

  • Protected

    Attach event listeners to rendered template parts.

    Parameters

    • partId: string

      The id of the part being rendered

    • htmlElement: HTMLElement

      The rendered HTML element for the part

    • options: ApplicationRenderOptions

      Rendering options passed to the render method

    Returns void

  • Parse the returned HTML string from template rendering into a uniquely identified HTMLElement for insertion.

    Parameters

    • partId: string

      The id of the part being rendered

    • part: HandlebarsTemplatePart

      Configuration of the part being parsed

    • htmlString: string

      The string rendered for the part

    Returns HTMLElement

    The parsed HTMLElement for the part