title: error TS2307: Cannot find module (but it can when running the js)
body: <p>Here is the scenario:</p>
  
  <p>Using Swagger, I have created an api spec for my REST service. I then generate the angular typescript boilerplate files for calling into my service from the Swagger Editor tool. </p>
  
  <p>When I generate the boilerplate files there are multiple files that all use typescript internal namespace while the rest of my project is AMD so I am trying to treat this compilation as if it is a third party non-AMD library. When I compile the typescript files I am emitting to a single javascript file.</p>
  
  <p>My project uses RequireJS and I have registered my single javascript file with RequireJS like so:</p>
  
  <pre><code>requirejs.config({
      paths: 'myApi': 'my/path/to/myApi', // There is no ts file with this name but there is a js once compiled
      shim: {
          'myApi': {
              init: () =&gt; {
                  return this.API;  // The top level object from the boilerplate is API
              },
              exports: 'myApi'
          }
      }
  }
  </code></pre>
  
  <p>})</p>
  
  <p>In another file I have the code:</p>
  
  <pre><code>import myApi = require('myApi');
  console.log(myApi);
  </code></pre>
  
  <p>In this same file I have above it:</p>
  
  <pre><code>import angular = require('angular');
  </code></pre>
  
  <p>which is registered with RequireJS in a similar way as myApi. Typescript doesn;t have a problem finding angular.</p>
  
  <p>When I compile my project I get typescript </p>
  
  <blockquote>
    <p>error TS2307: Cannot find module 'myApi' from the file trying to
    import it.</p>
  </blockquote>
  
  <p>When I run the actual project the correct myApi object gets logged to the console. </p>
  
  <p>How can I make Typescript see this module (or otherwise suppress this error message)?</p>