title: The TypeScript compiler can't find my previosly declared variable
body: <p>I'm trying to create a Node.js application which will connect to a MongoDb database. I'm using TypeScript. But the following lines of code are troublesome. </p>
  
  <pre><code>/// &lt;reference path="mongodb.d.ts" /&gt;
  var mongo = require('mongodb');
  class DefaultModel&lt;T&gt; {
      private db : mongo.Db;
  }
  </code></pre>
  
  <p>TSC reports that: <code>TS2095: Could not find symbol 'mongo'.</code>. I don't understand why it cannot find it as it was declared just outside the class. Can you help me figure out why?</p>
  
  <p>The module is declared in mongodb.d.ts as <code>declare module "mongodb" { /* Omitted */ }</code></p>