In TypeScript, there's the Parameters<T>
helper type, which allows the extraction of a labelled tuple type representing the parameters that a function expects. For instance:
function func(a: number, b: string) {}
type Args = Parameters<typeof func> // [a: number, b: string]
Is there a way to convert from this type to an object type? I.e., obtain this:
type ArgsAsObject = ??? // should be { a: number, b: string }