title: Typescript Promise rejection type
body: <p>How do I set the type of the rejection of my promise? Let's say I do:</p>
  
  <pre><code>const start = (): Promise&lt;string&gt; =&gt; {
     return new Promise((resolve, reject) =&gt; {
        if (someCondition) {
           resolve('correct!');
        } else {
           reject(-1);
        }
     });
  }
  </code></pre>
  
  <p>Let's say I want to reject with a number. But I cannot set the type; I can pass whatever I want to the <code>reject</code> here. </p>
  
  <p>Moreover, when using this promise, I want to have compiling error if I use the rejection response type incorrectly.</p>