title: How do you put multiple external modules into the same namespace in TypeScript?
body: <p>Say I want to have one class per .ts file. I have two .ts files, that look like so:</p>
  
  <pre><code>export module MyClasses { export class A {} }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>export module MyClasses { export class B {} }
  </code></pre>
  
  <p>I can't do this:</p>
  
  <pre><code>import MyClasses = module('A');
  import MyClasses = module('B');
  </code></pre>
  
  <p>How do I define classes in separate files and put them into the same "namespace"? Furthermore, we end up having to do something like:</p>
  
  <pre><code>MyClasses.MyClasses.A
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>MyClasses.A
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>import AModule = module('A');
  module MyClasses{ var A = AModule.A; }
  import BModule = module('B');
  module MyClasses { var B = BModule.B; }
  </code></pre>
  
  <p>Though it works perfectly, it's not exactly succinct. Is there not a better way to do this?</p>