Using Tuple types in TypeScript enables us to create typesafe rest arguments:
type Params = [string,number,string]
const fn = (...args: Params) => null
// Type is (args_0: string, args_1: number, args_2: string) => null
Is there a method to assign specific names to these parameters within the Type realm?
Instead of default names like args_0
, args_1
, args_2
, I am seeking a way to explicitly name them (e.g. myString
, myNumber
, mySecondString
).