forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
request-promise.d.ts
30 lines (24 loc) · 1.17 KB
/
request-promise.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Type definitions for request-promise v0.4.2
// Project: https://www.npmjs.com/package/request-promise
// Definitions by: Christopher Glantschnig <https://github.com/cglantschnig/>, Joe Skeen <http://github.com/joeskeen>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Change [0]: 2015/08/20 - Aya Morisawa <https://github.com/AyaMorisawa>
/// <reference path="../request/request.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
declare module 'request-promise' {
import request = require('request');
import http = require('http');
interface RequestPromise extends request.Request {
then(onFulfilled: Function, onRejected?: Function): Promise<any>;
catch(onRejected: Function): Promise<any>;
finally(onFinished: Function): Promise<any>;
promise(): Promise<any>;
}
interface RequestPromiseOptions extends request.OptionalOptions {
simple?: boolean;
transform?: (body: any, response: http.IncomingMessage) => any;
resolveWithFullResponse?: boolean;
}
var requestPromise: request.RequestAPI<RequestPromise, RequestPromiseOptions>;
export = requestPromise;
}