@@ -17,77 +17,13 @@ interface PromiseConstructor {
17
17
* @param values An array of Promises.
18
18
* @returns A new Promise.
19
19
*/
20
- allSettled < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > , T5 | PromiseLike < T5 > , T6 | PromiseLike < T6 > , T7 | PromiseLike < T7 > , T8 | PromiseLike < T8 > , T9 | PromiseLike < T9 > , T10 | PromiseLike < T10 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > , PromiseSettledResult < T3 > , PromiseSettledResult < T4 > , PromiseSettledResult < T5 > , PromiseSettledResult < T6 > , PromiseSettledResult < T7 > , PromiseSettledResult < T8 > , PromiseSettledResult < T9 > , PromiseSettledResult < T10 > ] > ;
20
+ allSettled < T extends readonly any [ ] | readonly [ any ] > ( values : T ) : Promise < { - readonly [ P in keyof T ] : PromiseSettledResult < T [ P ] extends PromiseLike < infer U > ? U : T [ P ] > } > ;
21
21
22
22
/**
23
23
* Creates a Promise that is resolved with an array of results when all
24
24
* of the provided Promises resolve or reject.
25
25
* @param values An array of Promises.
26
26
* @returns A new Promise.
27
27
*/
28
- allSettled < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > , T5 | PromiseLike < T5 > , T6 | PromiseLike < T6 > , T7 | PromiseLike < T7 > , T8 | PromiseLike < T8 > , T9 | PromiseLike < T9 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > , PromiseSettledResult < T3 > , PromiseSettledResult < T4 > , PromiseSettledResult < T5 > , PromiseSettledResult < T6 > , PromiseSettledResult < T7 > , PromiseSettledResult < T8 > , PromiseSettledResult < T9 > ] > ;
29
-
30
- /**
31
- * Creates a Promise that is resolved with an array of results when all
32
- * of the provided Promises resolve or reject.
33
- * @param values An array of Promises.
34
- * @returns A new Promise.
35
- */
36
- allSettled < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > , T5 | PromiseLike < T5 > , T6 | PromiseLike < T6 > , T7 | PromiseLike < T7 > , T8 | PromiseLike < T8 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > , PromiseSettledResult < T3 > , PromiseSettledResult < T4 > , PromiseSettledResult < T5 > , PromiseSettledResult < T6 > , PromiseSettledResult < T7 > , PromiseSettledResult < T8 > ] > ;
37
-
38
- /**
39
- * Creates a Promise that is resolved with an array of results when all
40
- * of the provided Promises resolve or reject.
41
- * @param values An array of Promises.
42
- * @returns A new Promise.
43
- */
44
- allSettled < T1 , T2 , T3 , T4 , T5 , T6 , T7 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > , T5 | PromiseLike < T5 > , T6 | PromiseLike < T6 > , T7 | PromiseLike < T7 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > , PromiseSettledResult < T3 > , PromiseSettledResult < T4 > , PromiseSettledResult < T5 > , PromiseSettledResult < T6 > , PromiseSettledResult < T7 > ] > ;
45
-
46
- /**
47
- * Creates a Promise that is resolved with an array of results when all
48
- * of the provided Promises resolve or reject.
49
- * @param values An array of Promises.
50
- * @returns A new Promise.
51
- */
52
- allSettled < T1 , T2 , T3 , T4 , T5 , T6 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > , T5 | PromiseLike < T5 > , T6 | PromiseLike < T6 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > , PromiseSettledResult < T3 > , PromiseSettledResult < T4 > , PromiseSettledResult < T5 > , PromiseSettledResult < T6 > ] > ;
53
-
54
- /**
55
- * Creates a Promise that is resolved with an array of results when all
56
- * of the provided Promises resolve or reject.
57
- * @param values An array of Promises.
58
- * @returns A new Promise.
59
- */
60
- allSettled < T1 , T2 , T3 , T4 , T5 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > , T5 | PromiseLike < T5 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > , PromiseSettledResult < T3 > , PromiseSettledResult < T4 > , PromiseSettledResult < T5 > ] > ;
61
-
62
- /**
63
- * Creates a Promise that is resolved with an array of results when all
64
- * of the provided Promises resolve or reject.
65
- * @param values An array of Promises.
66
- * @returns A new Promise.
67
- */
68
- allSettled < T1 , T2 , T3 , T4 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > , PromiseSettledResult < T3 > , PromiseSettledResult < T4 > ] > ;
69
-
70
- /**
71
- * Creates a Promise that is resolved with an array of results when all
72
- * of the provided Promises resolve or reject.
73
- * @param values An array of Promises.
74
- * @returns A new Promise.
75
- */
76
- allSettled < T1 , T2 , T3 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > , PromiseSettledResult < T3 > ] > ;
77
-
78
- /**
79
- * Creates a Promise that is resolved with an array of results when all
80
- * of the provided Promises resolve or reject.
81
- * @param values An array of Promises.
82
- * @returns A new Promise.
83
- */
84
- allSettled < T1 , T2 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > ] ) : Promise < [ PromiseSettledResult < T1 > , PromiseSettledResult < T2 > ] > ;
85
-
86
- /**
87
- * Creates a Promise that is resolved with an array of results when all
88
- * of the provided Promises resolve or reject.
89
- * @param values An array of Promises.
90
- * @returns A new Promise.
91
- */
92
- allSettled < T > ( values : Iterable < T | PromiseLike < T > > ) : Promise < PromiseSettledResult < T > [ ] > ;
28
+ allSettled < T > ( values : Iterable < T > ) : Promise < PromiseSettledResult < T extends PromiseLike < infer U > ? U : T > [ ] > ;
93
29
}
0 commit comments