This class extends the nunjucks loader to allow adding templates directly to the loader

Hierarchy

  • Loader
    • TemplateEntityLoader

Constructors

Properties

async: true
templates: {
    [templateId: string]: TemplateEntityExtended;
} = {}

Type declaration

Methods

  • Parameters

    • name: string
    • Rest ...args: any[]

    Returns void

  • This method is required to be implemented by a subclass of Loader. It is used to get the source of a template by name.

    Parameters

    • name: string

      this is actually the templateId but nunjucks calls it name and makes it a string, we handle it as a number internally

    • callBack: any

    Returns void

  • Parameters

    • filename: string

    Returns boolean

  • Parameters

    • name: string
    • func: ((...args) => any)
        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

  • Parameters

    • from: string
    • to: string

    Returns string

  • Type Parameters

    • LoaderClass extends typeof Loader

    Parameters

    Returns LoaderClass