title: How to use the .d.ts typings locally for vscode intellisense in a node.js project?
body: <p>I am setting up a node.js project that uses a native add-on. The native add-on includes a large number of exported functions. I've setup a typings file (<code>.d.ts</code>) that includes all the function definitions and data etc. that are exported from the native add-on. When I pack all of this up with npm, and install it into the client project, the vscode intellisense picks up all the types and all is well.</p>
  
  <p>When I try to use the typings for a <code>test.js</code> in the same project as the native add-on, the typings are not being picked up, specifically the exported variables; I suspect it has something to do with the way they are exported in the <code>.d.ts</code>, or the naming of the module in the <code>.d.ts</code>.</p>
  
  <p>In the <code>.d.ts</code>, I have the exports listed as;</p>
  
  <pre><code>interface MyI {
      Initiate() : void;
  }
  
  module 'modulename' {
      export var i : MyI;
  }
  </code></pre>
  
  <p>I <code>require</code> the module in the client as (<code>.js</code> file);</p>
  
  <pre><code>var i = require("modulename");
  </code></pre>
  
  <p>In the test code, I require it as (since I stub it through a <code>index.js</code> file);</p>
  
  <pre><code>var i = require("./index.js");
  </code></pre>
  
  <p>The <code>index.js</code> in turn looks like;</p>
  
  <pre><code>var i = require("./lib/nativeaddon");
  
  module.exports.i = i;
  </code></pre>
  
  <p>How to I get vscode to use the typings, locally, for the intellisense when I use the add-on (via the <code>index.js</code>) for the <code>test.js</code>?</p>