angularjs: allow $q.when to be called w/o args

The current definition does not cover the case that the input type is
void.
This commit is contained in:
Tobias Bengfort
2014-07-21 11:09:13 +02:00
parent 5326ecda45
commit fe47b495c8
2 changed files with 12 additions and 0 deletions

View File

@@ -565,6 +565,12 @@ declare module ng {
* @param value Value or a promise
*/
when<T>(value: T): IPromise<T>;
/**
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
*
* @param value Value or a promise
*/
when(): IPromise<void>;
}
interface IPromise<T> {