diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 3407259ca..21fc95138 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -79,6 +79,9 @@ declare var jPromise: JQueryPromise; Q(jPromise).then(str => str.split(',')); jPromise.then(returnsNumPromise); +// watch the typing flow through from jQueryPromise to Q.Promise +Q(jPromise).then(str => str.split(',')); + declare var promiseArray: Q.IPromise[]; var qPromiseArray = promiseArray.map(p => Q(p)); var myNums: any[] = [2, 3, Q(4), 5, Q(6), Q(7)]; diff --git a/q/Q.d.ts b/q/Q.d.ts index e56d5cc17..31537423f 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -3,8 +3,11 @@ // Definitions by: Barrie Nemetchek, Andrew Gaspar // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare function Q(value: T): Q.Promise; +/// + declare function Q(promise: Q.IPromise): Q.Promise; +declare function Q(promise: JQueryPromise): Q.Promise; +declare function Q(value: T): Q.Promise; declare module Q { interface IPromise {