mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add tests
This commit is contained in:
parent
322c5e6cad
commit
ddb90ccfe1
@ -311,8 +311,10 @@ namespace TestQ {
|
||||
}
|
||||
const abcObject: AbcObject = null;
|
||||
const abcObjectPromise: angular.IPromise<AbcObject> = null;
|
||||
const abcObjectPromiseLike: PromiseLike<AbcObject> = null;
|
||||
const efObject: EfObject = null;
|
||||
const efObjectPromise: angular.IPromise<EfObject> = null;
|
||||
const efObjectPromiseLike: PromiseLike<EfObject> = null;
|
||||
const ghObject: GhObject = null;
|
||||
const ghObjectPromise: angular.IPromise<GhObject> = null;
|
||||
|
||||
@ -404,6 +406,7 @@ namespace TestQ {
|
||||
|
||||
result = $q.when<AbcObject>(abcObject);
|
||||
result = $q.when<AbcObject>(abcObjectPromise);
|
||||
result = $q.when<AbcObject>(abcObjectPromiseLike);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObject);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObject, (any) => any);
|
||||
@ -416,10 +419,21 @@ namespace TestQ {
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject, (any) => any);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromise);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromise, (any) => any);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromiseLike);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any, (any) => any);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObjectPromise, (result: EfObject) => abcObjectPromise);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any);
|
||||
|
||||
6
types/angular/index.d.ts
vendored
6
types/angular/index.d.ts
vendored
@ -1154,9 +1154,9 @@ declare namespace angular {
|
||||
*/
|
||||
when<T>(value: PromiseLike<T>|T): IPromise<T>;
|
||||
when<T1, T2>(value: PromiseLike<T1>|T2): IPromise<T1|T2>;
|
||||
when<TResult, T>(value: PromiseLike<T>|T, successCallback: (promiseValue: T) => IPromise<TResult>|TResult): IPromise<TResult>;
|
||||
when<TResult, T>(value: T, successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
when<TResult, TResult2, T>(value: PromiseLike<T>, successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback: (reason: any) => TResult2 | IPromise<TResult2>, notifyCallback?: (state: any) => any): IPromise<TResult | TResult2>;
|
||||
when<TResult, T>(value: PromiseLike<T>|T, successCallback: (promiseValue: T) => PromiseLike<TResult>|TResult): IPromise<TResult>;
|
||||
when<TResult, T>(value: T, successCallback: (promiseValue: T) => PromiseLike<TResult>|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
when<TResult, TResult2, T>(value: PromiseLike<T>, successCallback: (promiseValue: T) => PromiseLike<TResult>|TResult, errorCallback: (reason: any) => TResult2 | PromiseLike<TResult2>, notifyCallback?: (state: any) => any): IPromise<TResult | TResult2>;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user