I have the following situation
type fnArgs = [string, number];
function test(a: string, b: number): void {}
const x: fnArgs = ['a', 2];
test(...x);
What I have is that the values passed to function test come from an array x (demo). The nice thing is that Typescript can figure out that the structure of the array matches the function signature in combination with the spread operator.
My quetion now is, can I use type fnArgs for the function signature as well? Because I have to define string, number twice.