From d72601e3208bc02a86dd29050c6bdb6ec1fc064c Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Sun, 30 Nov 2014 16:17:18 +1300 Subject: [PATCH] Add when(x) overloads --- when/when.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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;