mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Merge pull request #1598 from derekcicerone/patch-34
Add missing error-handling methods
This commit is contained in:
commit
30001c0201
14
when/when.d.ts
vendored
14
when/when.d.ts
vendored
@ -56,11 +56,25 @@ declare module When {
|
||||
}
|
||||
|
||||
interface Promise<T> {
|
||||
catch<U>(onRejected?: (reason: any) => Promise<U>): Promise<U>;
|
||||
catch<U>(onRejected?: (reason: any) => U): Promise<U>;
|
||||
|
||||
ensure(onFulfilledOrRejected: Function): Promise<T>;
|
||||
|
||||
inspect(): Snapshot<T>;
|
||||
|
||||
otherwise<U>(onRejected?: (reason: any) => Promise<U>): Promise<U>;
|
||||
otherwise<U>(onRejected?: (reason: any) => U): Promise<U>;
|
||||
|
||||
then<U>(onFulfilled: (value: T) => Promise<U>, onRejected?: (reason: any) => Promise<U>, onProgress?: (update: any) => void): Promise<U>;
|
||||
then<U>(onFulfilled: (value: T) => Promise<U>, onRejected?: (reason: any) => U, onProgress?: (update: any) => void): Promise<U>;
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => Promise<U>, onProgress?: (update: any) => void): Promise<U>;
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U, onProgress?: (update: any) => void): Promise<U>;
|
||||
}
|
||||
|
||||
interface Snapshot<T> {
|
||||
state: string;
|
||||
value?: T;
|
||||
reason?: any;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user