title: Why isn't my MongoDB ObjectID recognised as a type in TypeScript?
body: <p>I'm using Node.js with MongoDB and TypeScript.</p>
  
  <p>The following two lines of code:</p>
  
  <pre><code>const ObjectID = require("mongodb").ObjectID;
  const id = new ObjectID("5b681f5b61020f2d8ad4768d");
  </code></pre>
  
  <p>compile without error.</p>
  
  <p>But when I change the second line to:</p>
  
  <pre><code>const id: ObjectID = new ObjectID("5b681f5b61020f2d8ad4768d");
  </code></pre>
  
  <p>I get an error:</p>
  
  <blockquote>
    <p>Cannot find name 'ObjectID'</p>
  </blockquote>
  
  <p>Why isn't <code>ObjectID</code> recognised as a type in TypeScript?</p>