mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #11667 from eric-wieser/q-fixes
Add argumentless Q()
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import q = require('q');
|
||||
|
||||
Q(8).then(x => console.log(x.toExponential()));
|
||||
Q().then(() => console.log("nothing"));
|
||||
|
||||
var delay = function (delay: number) {
|
||||
var d = Q.defer<void>();
|
||||
|
||||
@@ -12,6 +12,10 @@ declare function Q<T>(promise: Q.IPromise<T>): Q.Promise<T>;
|
||||
* If value is not a promise, returns a promise that is fulfilled with value.
|
||||
*/
|
||||
declare function Q<T>(value: T): Q.Promise<T>;
|
||||
/**
|
||||
* Calling with nothing at all creates a void promise
|
||||
*/
|
||||
declare function Q(): Q.Promise<void>;
|
||||
|
||||
declare namespace Q {
|
||||
interface IPromise<T> {
|
||||
|
||||
Reference in New Issue
Block a user