mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-26 00:21:41 +08:00
make RequestPromise generic
The default Promise interface is a generic which is useful for specifying your expected return value from the promise resolving.
This commit is contained in:
8
types/request-promise-native/index.d.ts
vendored
8
types/request-promise-native/index.d.ts
vendored
@@ -9,10 +9,10 @@ import request = require('request');
|
||||
import http = require('http');
|
||||
|
||||
declare namespace requestPromise {
|
||||
interface RequestPromise extends request.Request {
|
||||
then: Promise<any>["then"];
|
||||
catch: Promise<any>["catch"];
|
||||
promise(): Promise<any>;
|
||||
interface RequestPromise<T = any> extends request.Request {
|
||||
then: Promise<T>["then"];
|
||||
catch: Promise<T>["catch"];
|
||||
promise(): Promise<T>;
|
||||
}
|
||||
|
||||
interface RequestPromiseOptions extends request.CoreOptions {
|
||||
|
||||
Reference in New Issue
Block a user