title: Having trouble creating .d.ts files for requirejs module
body: <p>I have a module written using requirejs that I need to get working in Angular 4 .  To understand the process I created a simplified requirejs module and am trying to create a .d.ts file for it However I am having trouble getting the code to compile.</p>
  
  <p>My directory structure looks like</p>
  
  <pre><code>.
  +--index.html
  +--lib
  |  +-require
  |    +--require.js
  |
  +--js
  |  +-bootstrap.ts
     +-test.js
     +-test
       +-index.d.ts
  </code></pre>
  
  <p>My index.html file looks like this</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      ...
      &lt;script type="text/javascript" src="lib/require/require.js" data-main="js/bootstrap"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My bootstrap.js</p>
  
  <pre><code>import test from 'test';
  add(5,6);
  </code></pre>
  
  <p>My test.js</p>
  
  <pre><code>define(function(){
      return {
         add: function(x, y){
             console.log(x + y);
         return x+y;
         }
      };
  });
  </code></pre>
  
  <p>My test/index.d.ts</p>
  
  <pre><code>export function add(a:number, b:number):number;
  </code></pre>
  
  <p>When I try to compile my bootstrap.ts I get this error</p>
  
  <pre><code>bootstrap.ts(2,18): error TS2307: Cannot find module 'test'.
  bootstrap.ts(3,1): error TS2304: Cannot find name 'add'.
  </code></pre>