title: Import TypeScript module using only ambient definition for use in amd
body: <p>I have a module that depends on <code>Backbone</code>. I have a <code>backbone.d.ts</code> definition but TypeScript doesn't seem to want to compile my module unless my </p>
  
  <pre><code>import Backbone = module("backbone")
  </code></pre>
  
  <p>actually points to a valid backbone module as opposed to a definition file. I am using AMD loaded modules and have a requirejs shim defined for backbone.</p>
  
  <p>Is there a workaround besides creating a phoney backbone.ts module definition?</p>
  
  <p><strong>Update:</strong> A side effect of the solution is that code such as this no longer works because the module no longer exists. It needs to exist because of the requirejs shim. The only workaround I know of is to have two .d.ts files. One for the file using backbone as an import that does not include the <code>declare module</code> bit. The other for using a <code>/// &lt;reference</code> that does include the <code>declare module</code> line.</p>
  
  <pre><code>/// &lt;reference path="../dep/backbone/backbone.d.ts" /&gt;
  
  interface IApi {
      version: number;
      Events: Backbone.Events;
  }
  </code></pre>