10. Parameters<T> を実装する
シェアしよう
- accepted / - tried
function type Tに対して、Parameters<T>
は引数のタイプを抽出したtuple typeを返す。
MyParameters<T>
を実装してみてください。
type Foo = (a: string, b: number, c: boolean) => stringtype A = MyParameters<Foo> // [a:string, b: number, c:boolean]type B = A[0] // stringtype C = MyParameters<{a: string}> // Error