mockdeep/typewiz

Add this typing to functions

zoehneto opened this issue · 0 comments

In situations where typescript can't infer the type of this in a function (exposed by --noImplicitThis), typewiz should record the this type at runtime and add the relevant type annotation this: someType as the first parameter of the function. To implement this one would have to use the TypeChecker (similarly to #29) with the tryGetThisTypeAt(node) function (this function is not exposed by the interface, see checker.ts for the implementation).