forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
request-promise.d.ts
33 lines (27 loc) · 1.59 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
31
32
33
// 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/DefinitelyTyped/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<TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
then<TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
catch(onrejected?: (reason: any) => any | PromiseLike<any>): Promise<any>;
catch(onrejected?: (reason: any) => void): Promise<any>;
finally<TResult>(handler: () => PromiseLike<TResult>): Promise<any>;
finally<TResult>(handler: () => TResult): Promise<any>;
promise(): Promise<any>;
}
interface RequestPromiseOptions extends request.CoreOptions {
simple?: boolean;
transform?: (body: any, response: http.IncomingMessage) => any;
resolveWithFullResponse?: boolean;
}
var requestPromise: request.RequestAPI<RequestPromise, RequestPromiseOptions, request.RequiredUriUrl>;
export = requestPromise;
}