title: TS import separate type files into a single index.d.ts file
body: <p>I want to separate component types into individual <code>index.d.ts</code> and then import those types into a final <code>index.d.ts</code> under my src folder. How can I import these types into a single <code>index.d.ts</code> without getting the error <code>[ts] Import or export declaration in an ambient module declaration cannot reference module through relative module name.</code>?</p>
  
  <p><strong>files:</strong>  </p>
  
  <pre><code>src
   |__components  
   |  |__Text  
   |     |__index.js
   |     |__index.d.ts
   |  |__Button
   |     |__index.js
   |     |__index.d.ts
   |__index.js
   |__index.d.js
  </code></pre>
  
  <p><strong>src/index.d.ts</strong></p>
  
  <pre><code>declare module "my-module-name" { 
    export { default as Text } from "./components/Text/index.d.ts";
  }
  </code></pre>
  
  <p><strong>src/index.js</strong></p>
  
  <pre><code>export { default as Text } from "./components/Text";
  export { default as Button } from "./components/Button";
  </code></pre>