How do I use RequestPromise in TypeScript?
<p>I have installed <a href="https://github.com/request/request-promise" rel="noreferrer">request-promise</a> library and trying to use it in my TypeScript app but without much luck.</p>

<p>If I use it like this:</p>

<pre><code>import {RequestPromise} from'request-promise';

RequestPromise('http://www.google.com')
        .then(function (htmlString) {
            // Process html...
        })
        .catch(function (err) {
            // Crawling failed...
        });
</code></pre>

<p>I see this on TS compile output:</p>

<pre><code>error TS2304: Cannot find name 'RequestPromise'.
</code></pre>

<p>If I use it this way:</p>

<pre><code>import * as rp from'request-promise';

rp('http://www.google.com')
    .then(function (htmlString) {
        // Process html...
    })
    .catch(function (err) {
        // Crawling failed...
    });
</code></pre>

<p>I see an error that says that there is no '.then()' method on object rp.</p>

<p>How do I properly use it with TypeScript?</p>