diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 48a3224bc..9dc49d979 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -94,6 +94,7 @@ Q.fbind((dateString?: string) => new Date(dateString), "11/11/1991")().then(d => Q.when(8, num => num + "!"); Q.when(Q(8), num => num + "!").then(str => str.split(',')); +var voidPromise: Q.Promise = Q.when(); declare function saveToDisk(): Q.Promise; declare function saveToCloud(): Q.Promise; diff --git a/q/Q.d.ts b/q/Q.d.ts index 59e891c52..8dbf93450 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -188,6 +188,9 @@ declare module Q { reason?: any; } + // If no value provided, returned promise will be of void type + export function when(): Promise; + // if no fulfill, reject, or progress provided, returned promise will be of same type export function when(value: IPromise): Promise; export function when(value: T): Promise;