From a02593d2778bd40de47d9b72bb1934907ee6b85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thierry=20R=C3=A9gagnon?= Date: Thu, 2 Jun 2016 17:45:53 +0200 Subject: [PATCH] Fix declaration for 'denodeify' method in npm module 'promise' (#9521) --- promise/promise-tests.ts | 6 ++++++ promise/promise.d.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/promise/promise-tests.ts b/promise/promise-tests.ts index 140d170b1a..361fa06006 100644 --- a/promise/promise-tests.ts +++ b/promise/promise-tests.ts @@ -19,3 +19,9 @@ var prom3 = Promise.all([prom, prom2]); prom3.then((resolve: Array) => { }); + +function withCallback(arg: any, cb: (e: Error, result: any) => void): void { + cb(null, arg); +} +var prom4 = Promise.denodeify(withCallback); +prom4('test').then(result => result); diff --git a/promise/promise.d.ts b/promise/promise.d.ts index b771f67893..39ff90f3fc 100644 --- a/promise/promise.d.ts +++ b/promise/promise.d.ts @@ -18,7 +18,7 @@ declare namespace Promise { resolve: (value: T) => IThenable; reject: (value: T) => IThenable; all: (array: Array>) => IThenable>; - denodeify: (fn: Function) => IThenable; + denodeify: (fn: Function) => (...args: any[]) => IThenable; nodeify: (fn: Function) => Function; }