Skip to content

Commit 31f56fd

Browse files
committed
Merge pull request #5973 from Microsoft/improve-type-of-Promise.all
Explicitly list tuple overloads for `Promise.all`.
2 parents a405afd + 3bf39d6 commit 31f56fd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/lib/es6.d.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ declare namespace Reflect {
12241224
function isExtensible(target: any): boolean;
12251225
function ownKeys(target: any): Array<PropertyKey>;
12261226
function preventExtensions(target: any): boolean;
1227-
function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean;
1227+
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
12281228
function setPrototypeOf(target: any, proto: any): boolean;
12291229
}
12301230

@@ -1272,7 +1272,16 @@ interface PromiseConstructor {
12721272
* @param values An array of Promises.
12731273
* @returns A new Promise.
12741274
*/
1275-
all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
1275+
all<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
1276+
all<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
1277+
all<T1, T2, T3, T4>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>]): Promise<[T1, T2, T3, T4]>;
1278+
all<T1, T2, T3, T4, T5>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;
1279+
all<T1, T2, T3, T4, T5, T6>(values: [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]>;
1280+
all<T1, T2, T3, T4, T5, T6, T7>(values: [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]>;
1281+
all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [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]>;
1282+
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [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]>;
1283+
all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [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]>;
1284+
all<TAll>(values: Iterable<TAll | PromiseLike<TAll>>): Promise<TAll[]>;
12761285

12771286
/**
12781287
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved

0 commit comments

Comments
 (0)