Closed
Description
Because of TypeScript 2.8 Conditional Types, we can now do the following:
type Param0<Func> = Func extends (a: infer T, ...args: any[]) => any
? T
: never;
type T0 = Param0<() => void>; // {}
type T1 = Param0<(a: number) => void>; // number
type T2 = Param0<(a: string[]) => void>; // string[]
Issue for discussion!
Questions:
- Naming scheme?
- Multiple Parameter Unpacks at the same time?
See also ReturnType<Func>
Metadata
Metadata
Assignees
Labels
No labels