Say I want to have one class per .ts file. I have two .ts files, that look like so:
export module MyClasses { export class A {} }
and
export module MyClasses { export class B {} }
I can't do this:
import MyClasses = module('A');
import MyClasses = module('B');
How do I define classes in separate files and put them into the same "namespace"? Furthermore, we end up having to do something like:
MyClasses.MyClasses.A
instead of
MyClasses.A
What's the point of this additional level of hierarchy? So that you can have more than one exported module in a module file? The best solution I've figure out so far is to remove "export module" (since "export class" seems to be sufficient when compiling AMD), which moves the class up one hierarchical level. Then:
import AModule = module('A');
module MyClasses{ var A = AModule.A; }
import BModule = module('B');
module MyClasses { var B = BModule.B; }
Though it works perfectly, it's not exactly succinct. Is there not a better way to do this?