function f([a,b,c]) {
// this works but a,b and c are any
}
it\'s possible write something like that?
function f([a: number,b: nu
Yes, it is. In TypeScript, you do it with types of array in a simple way, creating tuples.
type StringKeyValuePair = [string, string];
You can do what you want by naming the array:
function f(xs: [number, number, number]) {}
But you wouldn't name the interal parameter. Another possibility is use destructuring by pairs:
function f([a,b,c]: [number, number, number]) {}