mockdeep / typewiz

Automatically discover and add missing types in your TypeScript code
https://medium.com/@urish/manual-typing-is-no-fun-introducing-typewiz-58e3e8813f4c
1.1k stars 46 forks source link

Support for applying types one at time #34

Open urish opened 6 years ago

urish commented 6 years ago

Currently, calling applyTypes() adds all the given types to the code at once. If we added support to applying types one at a time, this would pave the way to implement editor plugins (see #15).

One important thing we need to pay attention to - since applyTypes() modifies the original source code, the offsets of the types we collected may change. So ideally, we need change applyTypes() so that it also updates the file offsets in the collected type info whenever it modifies a source file.