Add exception type filter using any

This commit is contained in:
Wim Looman
2014-12-04 08:40:44 +13:00
parent cc7b89066e
commit b4de422678

5
when/when.d.ts vendored
View File

@@ -56,6 +56,11 @@ 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>;