diff --git a/when/when.d.ts b/when/when.d.ts index 56d8833562..859618852a 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -56,11 +56,25 @@ declare module When { } interface Promise { + catch(onRejected?: (reason: any) => Promise): Promise; + catch(onRejected?: (reason: any) => U): Promise; + ensure(onFulfilledOrRejected: Function): Promise; + inspect(): Snapshot; + + otherwise(onRejected?: (reason: any) => Promise): Promise; + otherwise(onRejected?: (reason: any) => U): Promise; + then(onFulfilled: (value: T) => Promise, onRejected?: (reason: any) => Promise, onProgress?: (update: any) => void): Promise; then(onFulfilled: (value: T) => Promise, onRejected?: (reason: any) => U, onProgress?: (update: any) => void): Promise; then(onFulfilled: (value: T) => U, onRejected?: (reason: any) => Promise, onProgress?: (update: any) => void): Promise; then(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U, onProgress?: (update: any) => void): Promise; } + + interface Snapshot { + state: string; + value?: T; + reason?: any; + } }