typescript 4.8.0-dev.20220807 → 4.8.1-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,7 +49,7 @@ function createCancellationToken(args) {
49
49
  },
50
50
  resetRequest: function (requestId) {
51
51
  if (currentRequestId_1 !== requestId) {
52
- throw new Error("Mismatched request id, expected " + currentRequestId_1 + ", actual " + requestId);
52
+ throw new Error("Mismatched request id, expected ".concat(currentRequestId_1, ", actual ").concat(requestId));
53
53
  }
54
54
  perRequestPipeName_1 = undefined;
55
55
  }
@@ -41,7 +41,7 @@ interface PromiseConstructor {
41
41
  all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]> }>;
42
42
 
43
43
  // see: lib.es2015.iterable.d.ts
44
- // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
44
+ // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
45
45
 
46
46
  /**
47
47
  * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
@@ -52,7 +52,7 @@ interface PromiseConstructor {
52
52
  race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
53
53
 
54
54
  // see: lib.es2015.iterable.d.ts
55
- // race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
55
+ // race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
56
56
 
57
57
  /**
58
58
  * Creates a new rejected promise for the provided reason.
@@ -66,18 +66,13 @@ interface PromiseConstructor {
66
66
  * @returns A resolved promise.
67
67
  */
68
68
  resolve(): Promise<void>;
69
+
69
70
  /**
70
71
  * Creates a new resolved promise for the provided value.
71
72
  * @param value A promise.
72
73
  * @returns A promise whose internal state matches the provided promise.
73
74
  */
74
- resolve<T>(value: T): Promise<Awaited<T>>;
75
- /**
76
- * Creates a new resolved promise for the provided value.
77
- * @param value A promise.
78
- * @returns A promise whose internal state matches the provided promise.
79
- */
80
- resolve<T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
75
+ resolve<T>(value: T | PromiseLike<T>): Promise<T>;
81
76
  }
82
77
 
83
78
  declare var Promise: PromiseConstructor;
package/lib/lib.es5.d.ts CHANGED
@@ -1532,8 +1532,8 @@ interface Promise<T> {
1532
1532
  */
1533
1533
  type Awaited<T> =
1534
1534
  T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
1535
- T extends object & { then(onfulfilled: infer F, ...args: infer _): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
1536
- F extends ((value: infer V, ...args: infer _) => any) ? // if the argument to `then` is callable, extracts the first argument
1535
+ T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
1536
+ F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument
1537
1537
  Awaited<V> : // recursively unwrap the value
1538
1538
  never : // the argument to `then` was not callable
1539
1539
  T; // non-object or non-thenable