title: How to add Typescript interface for Js promises?
body: <p>I'm new to TypeScript and trying to set types of Promises to the following code</p>
  
  <p>Giving type of <code>Promise&lt;any&gt;</code> to <strong>promise</strong> variable is still giving squiggly red for <strong>.resolve</strong> , <strong>.reject</strong> and <strong>.promise</strong></p>
  
  <pre><code>const wrappedPromise = function() {
    var wrappedPromise = {},
      promise = new Promise(function(resolve, reject) {
        wrappedPromise.resolve = resolve;
        wrappedPromise.reject = reject;
      });
    wrappedPromise.then = promise.then.bind(promise);
    wrappedPromise.catch = promise.catch.bind(promise);
    wrappedPromise.promise = promise;
    return wrappedPromise;
  };
  </code></pre>
  
  <p>Also, does use of <em>generics</em> make sense here? If yes, then how?</p>