@@ -10,123 +10,115 @@ interface PromiseConstructor {
10
10
* a resolve callback used to resolve the promise with a value or the result of another promise,
11
11
* and a reject callback used to reject the promise with a provided reason or error.
12
12
*/
13
- new < T > ( executor : ( resolve : ( value ?: T | PromiseLike < T > | awaited T ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
13
+ new < T > ( executor : ( resolve : ( value ?: T | PromiseLike < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
14
14
15
15
/**
16
16
* Creates a Promise that is resolved with an array of results when all of the provided Promises
17
17
* resolve, or rejected when any Promise is rejected.
18
18
* @param values An array of Promises.
19
19
* @returns A new Promise.
20
20
*/
21
- all < 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 < [ awaited T1 , awaited T2 , awaited T3 , awaited T4 , awaited T5 , awaited T6 , awaited T7 , awaited T8 , awaited T9 , awaited T10 ] > ;
21
+ all < 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 < [ T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ] > ;
22
22
23
23
/**
24
24
* Creates a Promise that is resolved with an array of results when all of the provided Promises
25
25
* resolve, or rejected when any Promise is rejected.
26
26
* @param values An array of Promises.
27
27
* @returns A new Promise.
28
28
*/
29
- all < 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 < [ awaited T1 , awaited T2 , awaited T3 , awaited T4 , awaited T5 , awaited T6 , awaited T7 , awaited T8 , awaited T9 ] > ;
30
-
31
- /**
32
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
33
- * resolve, or rejected when any Promise is rejected.
34
- * @param values An array of Promises.
35
- * @returns A new Promise.
36
- */
37
- all < 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 < [ awaited T1 , awaited T2 , awaited T3 , awaited T4 , awaited T5 , awaited T6 , awaited T7 , awaited T8 ] > ;
38
-
29
+ all < 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 < [ T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ] > ;
30
+
39
31
/**
40
32
* Creates a Promise that is resolved with an array of results when all of the provided Promises
41
33
* resolve, or rejected when any Promise is rejected.
42
34
* @param values An array of Promises.
43
35
* @returns A new Promise.
44
36
*/
45
- all < 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 < [ awaited T1 , awaited T2 , awaited T3 , awaited T4 , awaited T5 , awaited T6 , awaited T7 ] > ;
46
-
37
+ all < 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 < [ T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ] > ;
38
+
47
39
/**
48
40
* Creates a Promise that is resolved with an array of results when all of the provided Promises
49
41
* resolve, or rejected when any Promise is rejected.
50
42
* @param values An array of Promises.
51
43
* @returns A new Promise.
52
44
*/
53
- all < 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 < [ awaited T1 , awaited T2 , awaited T3 , awaited T4 , awaited T5 , awaited T6 ] > ;
54
-
45
+ all < 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 < [ T1 , T2 , T3 , T4 , T5 , T6 , T7 ] > ;
46
+
55
47
/**
56
48
* Creates a Promise that is resolved with an array of results when all of the provided Promises
57
49
* resolve, or rejected when any Promise is rejected.
58
50
* @param values An array of Promises.
59
51
* @returns A new Promise.
60
52
*/
61
- all < T1 , T2 , T3 , T4 , T5 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > , T5 | PromiseLike < T5 > ] ) : Promise < [ awaited T1 , awaited T2 , awaited T3 , awaited T4 , awaited T5 ] > ;
62
-
53
+ all < 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 < [ T1 , T2 , T3 , T4 , T5 , T6 ] > ;
54
+
63
55
/**
64
56
* Creates a Promise that is resolved with an array of results when all of the provided Promises
65
57
* resolve, or rejected when any Promise is rejected.
66
58
* @param values An array of Promises.
67
59
* @returns A new Promise.
68
60
*/
69
- all < T1 , T2 , T3 , T4 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > ] ) : Promise < [ awaited T1 , awaited T2 , awaited T3 , awaited T4 ] > ;
70
-
61
+ all < T1 , T2 , T3 , T4 , T5 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > , T5 | PromiseLike < T5 > ] ) : Promise < [ T1 , T2 , T3 , T4 , T5 ] > ;
62
+
71
63
/**
72
64
* Creates a Promise that is resolved with an array of results when all of the provided Promises
73
65
* resolve, or rejected when any Promise is rejected.
74
66
* @param values An array of Promises.
75
67
* @returns A new Promise.
76
68
*/
77
- all < T1 , T2 , T3 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > ] ) : Promise < [ awaited T1 , awaited T2 , awaited T3 ] > ;
78
-
69
+ all < T1 , T2 , T3 , T4 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > , T4 | PromiseLike < T4 > ] ) : Promise < [ T1 , T2 , T3 , T4 ] > ;
70
+
79
71
/**
80
72
* Creates a Promise that is resolved with an array of results when all of the provided Promises
81
73
* resolve, or rejected when any Promise is rejected.
82
74
* @param values An array of Promises.
83
75
* @returns A new Promise.
84
76
*/
85
- all < T1 , T2 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > ] ) : Promise < [ awaited T1 , awaited T2 ] > ;
77
+ all < T1 , T2 , T3 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > , T3 | PromiseLike < T3 > ] ) : Promise < [ T1 , T2 , T3 ] > ;
86
78
87
79
/**
88
80
* Creates a Promise that is resolved with an array of results when all of the provided Promises
89
81
* resolve, or rejected when any Promise is rejected.
90
82
* @param values An array of Promises.
91
83
* @returns A new Promise.
92
84
*/
93
- all < T extends readonly unknown [ ] | [ ] > ( values : T ) : Promise < { - readonly [ P in keyof T ] : awaited T [ P ] } > ;
85
+ all < T1 , T2 > ( values : readonly [ T1 | PromiseLike < T1 > , T2 | PromiseLike < T2 > ] ) : Promise < [ T1 , T2 ] > ;
94
86
95
87
/**
96
88
* Creates a Promise that is resolved with an array of results when all of the provided Promises
97
89
* resolve, or rejected when any Promise is rejected.
98
90
* @param values An array of Promises.
99
91
* @returns A new Promise.
100
92
*/
101
- all < T > ( values : readonly ( T | PromiseLike < T > ) [ ] ) : Promise < ( awaited T ) [ ] > ;
93
+ all < T > ( values : readonly ( T | PromiseLike < T > ) [ ] ) : Promise < T [ ] > ;
102
94
103
95
// see: lib.es2015.iterable.d.ts
104
- // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<(awaited T) []>;
96
+ // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T []>;
105
97
106
98
/**
107
99
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
108
100
* or rejected.
109
101
* @param values An array of Promises.
110
102
* @returns A new Promise.
111
103
*/
112
- race < T > ( values : readonly ( T | PromiseLike < T > ) [ ] ) : Promise < awaited T > ;
104
+ race < T > ( values : readonly T [ ] ) : Promise < T extends PromiseLike < infer U > ? U : T > ;
113
105
114
106
// see: lib.es2015.iterable.d.ts
115
- // race<T>(values: Iterable<T | PromiseLike<T>> ): Promise<awaited T>;
107
+ // race<T>(values: Iterable<T> ): Promise<T extends PromiseLike<infer U> ? U : T>;
116
108
117
109
/**
118
110
* Creates a new rejected promise for the provided reason.
119
111
* @param reason The reason the promise was rejected.
120
112
* @returns A new rejected Promise.
121
113
*/
122
- reject < T = never > ( reason ?: any ) : Promise < awaited T > ;
114
+ reject < T = never > ( reason ?: any ) : Promise < T > ;
123
115
124
116
/**
125
117
* Creates a new resolved promise for the provided value.
126
118
* @param value A promise.
127
119
* @returns A promise whose internal state matches the provided promise.
128
120
*/
129
- resolve < T > ( value : T | PromiseLike < T > ) : Promise < awaited T > ;
121
+ resolve < T > ( value : T | PromiseLike < T > ) : Promise < T > ;
130
122
131
123
/**
132
124
* Creates a new resolved promise .
0 commit comments