title: How to correctly import the same namespace in two different files in Typescript
body: <p>I'm having an issue in understanding how to make two files with the same namespace and import one into the other in Typescript.</p>
  
  <p>This is the situation:</p>
  
  <p>file1.ts</p>
  
  <pre><code>export namespace nspace {
      export class ClassA {
  
      }
  }
  </code></pre>
  
  <p>file2.ts</p>
  
  <pre><code>import {nspace} from './file1';
  
  export namespace nspace {
      export class ClassB extends nspace.ClassA {
          private z: nspace.ClassA;
      }
  }
  </code></pre>
  
  <p>inside file2 i have these errors:</p>
  
  <p>1) Individual declarations in merged declaration 'nspace' must be all exported or all local</p>
  
  <p>2) Property 'ClassA' does not exist on type 'typeof nspace'</p>
  
  <p>On top of that, ClassA is correctly found when used to declare the type of the <code>z</code> field (it even brings me to the correct file if i use "go to declaration" in my IDE)<br>
  I have tried searching the first error on the internet because i don't really understand what it means but none of the pages i found helped. I read the documentation about Declaration Merging in Typescript but i couldn't find a situation similar to mine<br>
  I don't know if this is of any help but i'm using SystemJS in my application</p>