I have a TypeScript generic for an object with an unspecified number of string parameters like this:
type Params<T extends string[]> = Record<T[number], string>;
However, every time I want to use it, I need to define it with an array like so:
const params: Params<['param1', 'param2', ...]> = { param1: etc...
Is there a way to declare this generic without specifying an array, so I can use it like this instead:
const params: Params<'param1', 'param2', ...> = { param1: etc...