Fix .fail<> generic precedence bug and missing generic on .reject()

This commit is contained in:
d-ph
2014-11-01 10:57:08 +00:00
parent 1fa34a5449
commit 9cbb16d81e
2 changed files with 49 additions and 3 deletions
Vendored
+2 -2
View File
@@ -74,8 +74,8 @@ declare module Q {
*/
spread<U>(onFulfilled: Function, onRejected?: Function): Promise<U>;
fail<U>(onRejected: (reason: any) => U): Promise<U>;
fail<U>(onRejected: (reason: any) => IPromise<U>): Promise<U>;
fail<U>(onRejected: (reason: any) => U): Promise<U>;
/**
* A sugar method, equivalent to promise.then(undefined, onRejected).
*/
@@ -329,7 +329,7 @@ declare module Q {
/**
* Returns a promise that is rejected with reason.
*/
export function reject(reason?: any): Promise<any>;
export function reject<T>(reason?: any): Promise<T>;
export function Promise<T>(resolver: (resolve: (val: IPromise<T>) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise<T>;
export function Promise<T>(resolver: (resolve: (val: T) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise<T>;