mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Basing the duck typed Promise interface on es6
This commit is contained in:
Vendored
+8
-1
@@ -17,8 +17,15 @@ declare module "hapi" {
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
interface IPromise<T> {
|
||||
interface IThenable<R> {
|
||||
then<U>(onFulfilled?: (value: R) => U | IThenable<U>, onRejected?: (error: any) => U | IThenable<U>): IThenable<U>;
|
||||
then<U>(onFulfilled?: (value: R) => U | IThenable<U>, onRejected?: (error: any) => void): IThenable<U>;
|
||||
}
|
||||
|
||||
interface IPromise<R> extends IThenable<R> {
|
||||
then<U>(onFulfilled?: (value: R) => U | IThenable<U>, onRejected?: (error: any) => U | IThenable<U>): IPromise<U>;
|
||||
then<U>(onFulfilled?: (value: R) => U | IThenable<U>, onRejected?: (error: any) => void): IPromise<U>;
|
||||
catch<U>(onRejected?: (error: any) => U | IThenable<U>): IPromise<U>;
|
||||
}
|
||||
|
||||
/** Boom Module for errors. https://github.com/hapijs/boom
|
||||
|
||||
Reference in New Issue
Block a user