mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
Merge pull request #3240 from Nemo157/when-catch-filter
Add in lambda filtered catches for when's promises
This commit is contained in:
8
when/when.d.ts
vendored
8
when/when.d.ts
vendored
@@ -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>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user