How to get argument types from function in Typescript [duplicate]

Typescript now comes with a predefined Parameters<F> type alias in the standard library which is almost the same as ArgumentTypes<> below, so you can just use that instead of creating your own type alias. type TestParams = Parameters<(a: string, b: number) => void> // [string, number] Then to get for example the second parameter’s type … Read more