mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-24 11:50:59 +08:00
Add missing error-handling methods
* also added the inspect method (https://github.com/cujojs/when/blob/master/docs/api.md#inspect)
This commit is contained in:
1 parent
950d0d85a7
commit
6aa70b2cc5
1 file changed
+14
Vendored
+14
@@ -55,11 +55,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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user