title: TS2318: Cannot find global type 'AsyncIterableIterator' - async generator
body: <p>I have an async generator: </p>
  
  <pre><code>async function* foo() {
    yield "wait...";
    await new Promise(r=&gt;setTimeout(r, 900));
    yield new Promise(r=&gt;setTimeout(()=&gt;r("okay!"), 100));
  }
  
  async function main() {
    for await (let item of foo()) {
      let result = await item;
      console.log(result);
    }
  }
  
  main();
  </code></pre>
  
  <p>but with typescript 2.3 this give me errors: </p>
  
  <blockquote>
    <p>error TS2318: Cannot find global type 'AsyncIterableIterator'.
    example.ts(10,26): </p>
    
    <p>error TS2504: Type must have a 'Symbol.asyncIterator' method that returns an async iterator.</p>
  </blockquote>
  
  <p>How can this error be fixed and how can you run the async generator? </p>