Merge pull request #3240 from Nemo157/when-catch-filter

Add in lambda filtered catches for when's promises
This commit is contained in:
Masahiro Wakame
2014-12-05 03:36:44 +09:00

8
when/when.d.ts vendored
View File

@@ -56,6 +56,14 @@ declare module When {
}
interface Promise<T> {
// Make sure you test any usage of these overloads, exceptionType must
// be a constructor with prototype set to an instance of Error.
catch<U>(exceptionType: any, onRejected?: (reason: any) => Promise<U>): Promise<U>;
catch<U>(exceptionType: any, onRejected?: (reason: any) => U): Promise<U>;
catch<U>(filter: (reason: any) => boolean, onRejected?: (reason: any) => Promise<U>): Promise<U>;
catch<U>(filter: (reason: any) => boolean, onRejected?: (reason: any) => U): Promise<U>;
catch<U>(onRejected?: (reason: any) => Promise<U>): Promise<U>;
catch<U>(onRejected?: (reason: any) => U): Promise<U>;