diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index fe9e17b5b..b31c24b16 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -17,8 +17,15 @@ declare module "hapi" { [key: string]: T; } - interface IPromise { + interface IThenable { + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IThenable; + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IThenable; + } + interface IPromise extends IThenable { + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IPromise; + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IPromise; + catch(onRejected?: (error: any) => U | IThenable): IPromise; } /** Boom Module for errors. https://github.com/hapijs/boom