interface PromiseFulfilledResult { status: 'fulfilled'; value: T; } interface PromiseRejectedResult { status: 'rejected'; reason: any; } type PromiseSettledResult = PromiseFulfilledResult | PromiseRejectedResult; interface PromiseConstructor { /** * Creates a Promise that is resolved with an array of results when all * of the provided Promises resolve or reject. * @param values An array of Promises. * @returns A new Promise. */ allSettled(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult ? U : T[P]> }>; /** * Creates a Promise that is resolved with an array of results when all * of the provided Promises resolve or reject. * @param values An array of Promises. * @returns A new Promise. */ allSettled(values: Iterable): Promise ? U : T>[]>; }