14. ThisParameterType<T>を実装する
シェアしよう
- accepted / - tried
function type T に対して、 ThisParameterType<T>
はthis
typeを返す。
指定していない場合はunknown
になる。
MyThisParameterType<T>
を実装してみてください。
function Foo(this: {a: string}) {}function Bar() {}type A = MyThisParameterType<typeof Foo> // {a: string}type B = MyThisParameterType<typeof Bar> // unknown