Merge pull request #1339 from johnnyreilly/master

Q:jQueryPromise converted implicitly to Q promise
This commit is contained in:
Basarat Ali Syed
2013-11-26 22:22:21 -08:00
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -79,6 +79,9 @@ declare var jPromise: JQueryPromise<string>;
Q<string>(jPromise).then(str => str.split(','));
jPromise.then<number>(returnsNumPromise);
// watch the typing flow through from jQueryPromise to Q.Promise
Q(jPromise).then(str => str.split(','));
declare var promiseArray: Q.IPromise<number>[];
var qPromiseArray = promiseArray.map(p => Q<number>(p));
var myNums: any[] = [2, 3, Q(4), 5, Q(6), Q(7)];
Vendored
+4 -1
View File
@@ -3,8 +3,11 @@
// Definitions by: Barrie Nemetchek, Andrew Gaspar
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function Q<T>(value: T): Q.Promise<T>;
/// <reference path="../jquery/jquery.d.ts"/>
declare function Q<T>(promise: Q.IPromise<T>): Q.Promise<T>;
declare function Q<T>(promise: JQueryPromise<T>): Q.Promise<T>;
declare function Q<T>(value: T): Q.Promise<T>;
declare module Q {
interface IPromise<T> {