Merge pull request #1598 from derekcicerone/patch-34

Add missing error-handling methods
This commit is contained in:
Masahiro Wakame 2014-01-27 17:44:03 -08:00
commit 30001c0201

14
when/when.d.ts vendored
View File

@ -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;
}
}