declare global namespace variable from TypeScript
meteor, typescript
Solution
Use the `declare` keyword. These are known as ambient declarations.
declare var MyExtentention:any;
Problem
How to explicitly declare a variable in the global namespace from typescript? I need the compiler to generate the following javascript code: ``` MyExtension = someFunction() ``` unfortunately, I can only have it generate ``` var MyExtension = someFunction() ``` This comes to an issue with the latest version (still in rc) of meteor packages. Meteor introduced a way to scope namespaces in packages - the issue is, the variable needs to be defined in the global namespace (which meteor reroutes to its own Package object). There is a video about it at https://www.eventedmind.com/posts/meteor-linker-package-namespacing. Is there some kind of `global` keyword available or in the plans?