From 86c0c56e6e3b28debedf3baf5cb5bf377b8e217a Mon Sep 17 00:00:00 2001 From: cristian-harja Date: Thu, 7 Aug 2014 18:24:18 +0300 Subject: [PATCH] missing Promise.nodeify() added --- q/Q.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index 617bf0140..f567c5871 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -101,6 +101,11 @@ declare module Q { */ done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void; + /** + * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. If callback is not a function, simply returns promise. + */ + nodeify(callback: (reason: any, value: any) => void): void; + /** * Returns a promise to get the named property of an object. Essentially equivalent to * @@ -161,7 +166,7 @@ declare module Q { * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. */ isPending(): boolean; - + valueOf(): any; /**