From d04ad93621b4057ae99036918e1a277f5cad4525 Mon Sep 17 00:00:00 2001 From: Mika Turunen Date: Mon, 26 Jan 2015 10:30:02 +0200 Subject: [PATCH] Q.try update and reasoning --- q/Q.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index 59e891c52..b47981c7f 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -201,7 +201,11 @@ declare module Q { export function when(value: IPromise, onFulfilled: (val: T) => U, onRejected?: (reason: any) => IPromise, onProgress?: (progress: any) => any): Promise; export function when(value: IPromise, onFulfilled: (val: T) => U, onRejected?: (reason: any) => U, onProgress?: (progress: any) => any): Promise; - //export function try(method: Function, ...args: any[]): Promise; // <- This is broken currently - not sure how to fix. + /** + * Currently "impossible" (and I use the term loosely) to implement due to TypeScript limitations as it is now. + * See: https://github.com/Microsoft/TypeScript/issues/1784 for discussion on it. + */ + // export function try(method: Function, ...args: any[]): Promise; export function fbind(method: (...args: any[]) => IPromise, ...args: any[]): (...args: any[]) => Promise; export function fbind(method: (...args: any[]) => T, ...args: any[]): (...args: any[]) => Promise;