An abstract class that helps with the application of templates in strings that require values computed asynchronously. Wrap the template in curly braces inside the string you want to apply the template to.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

keys: string[]

The keys handled by this async templater. They don't include the curly braces.

Memberof

AsyncTemplater

Methods

  • Apply the template.

    Parameters

    • str: string

      The string to process.

    Returns Promise<string>

    A promise that resolves to the string with the templates replaced.

  • Get the actual value that will replace the key inside the template.

    Parameters

    • key: string

      The key to replace.

    Returns Promise<string>

    A promise that resolves to the corresponding string for the given key.

    Throws

    Rejects if given key does not correspond to this async templater.

Generated using TypeDoc