title: TypeScript declare reference throws error
body: <p>I want to understand the concept behind the <code>declare</code> keyword in practice, and I have tried to run <a href="https://www.typescriptlang.org/docs/handbook/declaration-files/by-example.html#reusable-types-interfaces" rel="nofollow noreferrer">Reusable Types (Interfaces)</a> example:</p>
  <pre class="lang-js prettyprint-override"><code>interface GreetingSettings {
    greeting: string;
    duration?: number;
    color?: string;
  }
  
  declare function greet(setting: GreetingSettings): void;
  
  greet({
    greeting: &quot;hello world&quot;,
    duration: 4000
  });
  
  </code></pre>
  <p>But I get an error: <code>greet is not defined</code></p>
  <p><a href="https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgOJQhMoDmBlLbEHAZ2QG8AoZZHDLXALmRLClwG5rkATAVyhxsAexAB+ZiD4BbAEbQuNBMIA2wqBJZtOlAL6UeEBCrgZkMPiAQiQtemAAUJQkzT3cBMEVIBKZgDdhYB4uSjpMRyoacIZiZgAiAAsIFTVkAHd1FR54gBpufkEbZgAWAAYKvR9QoA" rel="nofollow noreferrer">TypeScript Playground Link</a></p>
  <p>Is this the expected behavior of the <code>declare</code> keyword? If yes, what should I do that I would not get this error?</p>