We are updating our web app using TypeScript and now we are running into this problem. This is our static class, MyModule.js:
MyModule = {};
MyModule.Constants = function(){};
MyModule.Constants.WIDTH = 100;
MyModule.Constants.HEIGHT = 100;
.......
Now we change it to this, MyModule.ts:
module MyModule {
export class Constants {
public static WIDTH:number = 100;
public static HEIGHT:number = 100;
....
}
}
export = MyModule;
This works fine for us, using import/require statement, but there are a few classes (in javascript) from a third party that we can't change, and they can't get to MyModule.Constants static properties because MyModule is undefined to them.
So is there anyway to code so to make MyModule and MyModule.Constants are globar var?