My TypeScript produces a .d.ts file. Which is perfect for TS projects:
declare function myGlobal(html: string): string;
declare module myHmi {
class bla {
static myStatic(bla: string): string;
}
}
But other teams are on JS and wants to use our nice typings. They have the .d.ts file inside of the project. VS2017 detects it in the new JS Language Service (Salsa).
var myHmi;
(function (myHmi) {
// Here VS2017 knows myGlobal()
// Here VS2017 detected myHmi as any. So it has no knowledge of myHmi.bla.myStatic()
main code...
})(myHmi || (myHmi = {}));
// Here VS2017 knows myGlobal()
// Here VS2017 knows myHmi.bla.myStatic()
Can we use a hint (@jsdoc magic?) to tell VS that the inner myHmi is an extension of the outer myHmi?
Edit: reported after a few days as https://github.com/Microsoft/TypeScript/issues/21877