Type alias Tagger<Output, Expressions>

Tagger<Output, Expressions>: ((templateStringsArray: Readonly<TemplateStringsArray>, ...expressions: Expressions) => Output)

Type Parameters

Type declaration

    • (templateStringsArray: Readonly<TemplateStringsArray>, ...expressions: Expressions): Output
    • Tag function for tagged templates.

      Example

      const intParser: Tagger<number> = strings => parseInt(strings.join(""), 10);
      intParser`100`; // 100

      Parameters

      • templateStringsArray: Readonly<TemplateStringsArray>
      • Rest ...expressions: Expressions

      Returns Output