forked from rlwhatley3/awaits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
34 lines (34 loc) · 1.45 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Resolves a promise or an array of promises and returns a tuple: [err, data]
* @param a promise or an array of promises to be resolved
* @return a Promise which resolves to a tuple of type [null | Error, any]
*/
// export declare function until(promises: Promise<any> | Array<Promise<any>>): Promise<[null | Error, any]>;
/**
* Resolves a promise or an array of promises and returns a tuple: [err, data]
* @param a promise or an array of promises to be resolved
* @return a Promise which resolves to a tuple of type [null | Error, any]
*/
// export declare function s(promises: Array<Promise<any>> | Promise<any>): Promise<[null | Error, any]>;
/**
* Resolves a key value store of Promises
* @param a promise or an array of promises to be resolved
* @return a key value store of the same shape as the input. Each value is a resolved tuple of [null, data]
* @note use _valid to check if the object was unzippable
*/
// export declare function unzip(promiseObj: {
// [key: string]: Promise<any> | Array<Promise<any>>;
// }): Promise<{
// [key: string]: any;
// _valid?: boolean;
// }>;
/**
* Resolves a key value store of Promises
* @param a promise or an array of promises to be resolved
* @return a Promise which resolves to a tuple of type [null | Error, ResolvedInputObj]
*/
// export declare function zip(promiseObj: {
// [key: string]: Promise<any> | Array<Promise<any>>;
// }): Promise<[null | Error, {
// [key: string]: any;
// }]>;