title: Typings: Array<Promise<T>> to Promise<Array<T>>
body: <p>I've written a helper method and added it to Array.prototype to wrap an array of promises in <code>Promise.all</code>.</p>
  
  <pre><code>Array.prototype.awaitPromises = function() {
    return Promise.all(this);
  }
  </code></pre>
  
  <p>Now I'm trying to get TypeScript typings to work, but I don't see a way to "unpack" the Array type into a Promise-wrapped value:</p>
  
  <pre><code>declare global {
    interface Array&lt;T&gt; {
      awaitPromises&lt;U&gt;(): Promise&lt;Array&lt;U&gt;&gt;
    }
  }
  </code></pre>
  
  <p>Ideally I'd like <code>Array&lt;Promise&lt;T&gt;&gt;</code> -> <code>Promise&lt;Array&lt;T&gt;&gt;</code> and to get rid of needing to specify <code>&lt;U&gt;</code>. Is this possible, or am I stuck with what I've got?</p>