mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-25 12:00:38 +08:00
Basing the duck typed Promise interface on es6
This commit is contained in:
1 parent
88d8553e62
commit
af9d89e725
1 file changed
+8
-1
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