title: TypeScript type definition for promise.reject
body: <p>The following code is correct in terms of the type that is returned, because <code>then</code> always return the promise array.</p>
  
  <pre><code>Promise.resolve(['one', 'two'])
  .then( arr =&gt;
  {
    if( arr.indexOf('three') === -1 )
      return Promise.reject( new Error('Where is three?') );
  
    return Promise.resolve(arr);
  })
  .catch( err =&gt;
  {
    console.log(err); // Error: where is three?
  })
  </code></pre>
  
  <p>TypeScript throw error:</p>
  
  <blockquote>
    <p>The type argument for type parameter 'TResult' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
      Type argument candidate 'void' is not a valid type argument because it is not a supertype of candidate 'string[]'.</p>
  </blockquote>
  
  <p>But in reality, <code>then</code> never will return <code>void</code>.</p>
  
  <p>I can explicitly specify type <code>.then&lt;Promise&lt;any&gt;&gt;</code>, but it's more like a workaround, not the right solution.</p>
  
  <p>How to write this right?</p>