title: setTimeout() and clearTimeout() with Promise in TypeScript (strict mode + all annotations)
body: <p>I saw many examples of timer with Promise for JavaScript. Most of them are too complicated, but I suppose, it could be implemented more simply. However, I need the solution for TypeScript in <code>"strict": true</code> mode with all annotations. </p>
  
  <p>I tried to do it until below code:</p>
  
  <pre class="lang-js prettyprint-override"><code>import Timeout = NodeJS.Timeout;
  
  let testTimeout : Timeout;
  const DELAY: number = 3000;
  
  testTimeout = (): Promise&lt;void&gt; =&gt; (
    new Promise&lt;void&gt;( (resolve): void =&gt; {
      setTimeout(resolve, DELAY);
    })
  );
  
  testTimeout = testTimeout().then( () =&gt; {
    console.log('done');
  });
  clearTimeout(testTimeout);
  </code></pre>
  
  <p>It has errors:</p>
  
  <pre><code>TS2739: Type '() =&gt; Promise&lt;void&gt;' is missing the following properties from type 'Timeout': ref, refresh, unref
  
  TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Timeout' has no compatible call signatures.
  </code></pre>
  
  <p>I suppose, I do something wrong.</p>