mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-25 11:11:46 +08:00
Merge pull request #1339 from johnnyreilly/master
Q:jQueryPromise converted implicitly to Q promise
This commit is contained in:
@@ -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)];
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user