mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
[@types/request-promise-native] Add transform2xxOnly option. (#23328)
This commit is contained in:
committed by
Sheetal Nandi
parent
3c357a1ccf
commit
a436740d5d
1
types/request-promise-native/index.d.ts
vendored
1
types/request-promise-native/index.d.ts
vendored
@@ -18,6 +18,7 @@ declare namespace requestPromise {
|
||||
interface RequestPromiseOptions extends request.CoreOptions {
|
||||
simple?: boolean;
|
||||
transform?(body: any, response: request.Response, resolveWithFullResponse?: boolean): any;
|
||||
transform2xxOnly?: boolean;
|
||||
resolveWithFullResponse?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,11 @@ rpn('http://google.com').promise().then(console.dir);
|
||||
rpn({ uri: 'http://google.com', resolveWithFullResponse: true }).then((response) => { });
|
||||
rpn({ uri: 'http://google.com', simple: false }).catch((reason) => { });
|
||||
|
||||
const rp: rpn.RequestPromise = rpn('http://google.com', {transform2xxOnly: true, json: true});
|
||||
|
||||
const promiseLike: PromiseLike<any> = rpn('http://google.com');
|
||||
const promise: Promise<any> = rpn('http://google.com').promise();
|
||||
|
||||
// Defaults tests
|
||||
(() => {
|
||||
const githubUrl = 'https://github.com';
|
||||
|
||||
Reference in New Issue
Block a user