Type alias Tagger<Output, Expressions>

Tagger<Output, Expressions>: Function<readonly [templateStrings: TemplateStringsArray, expressions: Expressions], Output>

Tag function for tagged templates.

Remarks

Type to represent a tag function for tagged templates, which takes a TemplateStringArray and any number of expressions, and returns a value of type Output (string by default).

Example

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

See

Type Parameters