diff --git a/when/when.d.ts b/when/when.d.ts index bb227cf080..475fb23a6e 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -56,6 +56,14 @@ declare module When { } interface Promise { + // Make sure you test any usage of these overloads, exceptionType must + // be a constructor with prototype set to an instance of Error. + catch(exceptionType: any, onRejected?: (reason: any) => Promise): Promise; + catch(exceptionType: any, onRejected?: (reason: any) => U): Promise; + + catch(filter: (reason: any) => boolean, onRejected?: (reason: any) => Promise): Promise; + catch(filter: (reason: any) => boolean, onRejected?: (reason: any) => U): Promise; + catch(onRejected?: (reason: any) => Promise): Promise; catch(onRejected?: (reason: any) => U): Promise;