What is the correct way to use Q promises with TypeScript 1.6 if they are not valid? That is, they do not represent value. For example:
return Q.Promise<void>((resolve,reject) => {
resolve();
}
or
let deferred = Q.defer<void>();
deferred.resolve();
return deferred.promise;
The call resolve()causes an error:
Supplied parameters do not match any signature of call target
(parameter) resolve: (val: void | Q.IPromise<void>) => void
Please note that the following works:
let deferred = Q.defer<string>();
deferred.resolve("Hello World");
return deferred.promise;
Perhaps this is a bug in DefinitelyTyped (updated August 17, 2015 at the time of this writing), or am I pointing this out incorrectly?
source
share