Skip to content

Macro

Macro<Names> = { readonly [K in Names]: MacroArg }

The parameter of a macro function. Take the arguments you use out of it by name:

function Greet({ name, count }: Macro) {
$.say(macro`hi ${name}, you have ${count} points`);
}

To list the names in the type too, give them: Macro<"name" | "count">.

Names extends string = string