vendored binaries of common web development dependencies
0

Configure Feed

Select the types of activity you want to include in your feed.

vendor / typescript / lib.es2020.promise.d.ts
1.8 kB 45 lines
1/*! ***************************************************************************** 2Copyright (c) Microsoft Corporation. All rights reserved. 3Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4this file except in compliance with the License. You may obtain a copy of the 5License at http://www.apache.org/licenses/LICENSE-2.0 6 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10MERCHANTABILITY OR NON-INFRINGEMENT. 11 12See the Apache Version 2.0 License for specific language governing permissions 13and limitations under the License. 14***************************************************************************** */ 15 16 17interface PromiseFulfilledResult<T> { 18 status: "fulfilled"; 19 value: T; 20} 21 22interface PromiseRejectedResult { 23 status: "rejected"; 24 reason: any; 25} 26 27type PromiseSettledResult<T> = PromiseFulfilledResult<T> | PromiseRejectedResult; 28 29interface PromiseConstructor { 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<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>; }>; 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<T>(values: Iterable<T | PromiseLike<T>>): Promise<PromiseSettledResult<Awaited<T>>[]>; 45}