borisyankov/DefinitelyTyped — pull request #1339 by johnnyreilly (2013-11-26 17:57:47+00:00)
Title: Q:jQueryPromise converted implicitly to Q promise

jQuery ajax promises can be converted to Q promises following the guidance / examples here:

https://github.com/kriskowal/q/wiki/Coming-from-jQuery#converting-jquery-promises-to-q

and here:

https://gist.github.com/domenic/1604916

These are already supported in Q.d.ts using this syntax:

```ts
var jQueryPromise: JQueryPromise = $.ajax({
url: "myUrl",
type: "GET"
});
var qPromise = Q(jQueryPromise); // qPromise will be of type Q.Promise
```

My change allows the promise typing to flow through implicitly:

```ts
var jQueryPromise: JQueryPromise = $.ajax({
url: "myUrl",
type: "GET"
});
var qPromise = Q(jQueryPromise); // qPromise will be of type Q.Promise
```

I've updated the tests to reflect this. The order of the Q overloads is key for getting this to work. I haven't tested this with the 0.9.5 beta of TS and I don't know if the changes to the overload resolution rules that come with 0.9.5 might have some bearing on this. Just something we might want to bear in mind for the future.