Merge pull request #3070 from d-ph/fail-precedence-bug

Fix .fail<> generic precedence bug and missing generic on .reject()
This commit is contained in:
Masahiro Wakame
2014-11-29 13:44:09 +09:00
2 changed files with 49 additions and 3 deletions
Vendored
+2 -2
View File
@@ -67,8 +67,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).
*/
@@ -325,7 +325,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>;