diff --git a/when/when.d.ts b/when/when.d.ts index 475fb23a6..a9e9d483d 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -3,6 +3,10 @@ // Definitions by: Derek Cicerone // Definitions: https://github.com/borisyankov/DefinitelyTyped +declare function When(value: When.Promise): When.Promise; +declare function When(value: When.Thenable): When.Promise; +declare function When(value: T): When.Promise; + declare module When { /** @@ -80,6 +84,10 @@ declare module When { then(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U, onProgress?: (update: any) => void): Promise; } + interface Thenable { + then(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Thenable; + } + interface Snapshot { state: string; value?: T;