[F] paramMessage
function paramMessage<T>(strings, ...keys): CallableMessage<T>;Build a typed diagnostic-message formatter using a tagged template whose substitutions name parameters.
The returned callable substitutes values from a dictionary and exposes the parameter names in keys.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends string[] |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
strings | readonly string[] |
…keys | T |
Returns
Section titled “Returns”Example
Section titled “Example”const message = paramMessage`Unknown type ${"name"}.`;message({ name: "Widget" }); // "Unknown type Widget."