title: Typescript cannot find name of own class when importing Node.js
body: <p>I'm attempting to use a node.js class (net in this instance) in a class I have defined.</p>
  
  <p>Connection.ts:</p>
  
  <pre><code>import net = require('net');
  class Connection  {
  
  }
  </code></pre>
  
  <p>Then I reference my class in another file,</p>
  
  <p>ConnectionContext.ts:</p>
  
  <pre><code>interface IConnectionContext {
      connection: Connection;
  }
  </code></pre>
  
  <p>When I have this code, I see an underlined "Connection" in ConnectionContext that says <code>"IConnectionContext.ts(3,17): error TS2304: Cannot find name 'Connection'"</code></p>
  
  <p>if I remove the import * as net from part, the compile error goes away.</p>
  
  <p>I'm a bit confused, when I look at the resulting JavaScript, all my classes look identical in their creation. I'm not certain why typescript is saying the class doesn't exist.</p>
  
  <p>Here's my tsconfig:</p>
  
  <pre><code>{
      "compileOnSave": true,
      "compilerOptions": {
          "module": "commonjs",
          "outDir": "bin/",
          "noImplicitAny": true,
          "removeComments": true,
          "preserveConstEnums": true,
          "sourceMap": true,
          "moduleResolution": "node",
          "target": "es5"
      },
      "exclude": [
          "node_modules"
      ]
  }
  </code></pre>
  
  <p>Based on this, what do I need to do to get my interface to see my class that uses node.js modules? </p>