Is it possible to remap type of array (or maybe tuple?)
Let's say that I have an array of functions and I want to make of it array of functions captured parameters. Something like.
type Remap<F extends ((... args: any) => any)[]> =
F extends [infer T1] ? [Parameters<T1>] :
F extends [infer T1, infer T2] ? [Parameters<T1>, Parameters<T2>] :
F extends [infer T1, infer T2, infer T3] ? [Parameters<T1>, Parameters<T2>, Parameters<T3>] :
never;
const a = [(a: string) => void, (b: number) => void]
type T = Remap<typeof a> // [[string], [number]] - simply captured arguments of functions.
What i need to is pass array of functions like "a" and create maybe new function which will contain parameters from all functions like ([first arguments], [second arguments]).