Using Parameters I can get the argument types, even as named tuple, but how can I access the name of the argument (or the tuple for that matter), is it possible in the latest TypeScript Version (5.1.6)?
type MyFunction = (argumentName: number) => void
type FirstArgumentType<F extends ((p:any)=>any)> = Parameters<F>[0]
type FirstArgumentName<F extends ((p:any)=>any)> = ...
type T0 = Parameters<MyFunction> // [argumentName: number]
type T1 = FirstArgumentType<MyFunction> // number
type T2 = FirstArgumentName<MyFunction> // argumentName
Essentially I want a type helper that returns argumentName given (argumentName: number) => void, is that possible TypeScript?
I suppose this GitHub Issue is somewhat related, but it gives me no clue what else I could look up https://github.com/microsoft/TypeScript/issues/49122