14. implement ThisParameterType<T>
Share
- accepted / - tried
For a function type T, ThisParameterType<T> extracts the this type. If this is not set, unknown is used.
Please implement MyThisParameterType<T> by yourself.
function Foo(this: {a: string}) {}function Bar() {}type A = MyThisParameterType<typeof Foo> // {a: string}type B = MyThisParameterType<typeof Bar> // unknown