diff --git a/lib/lib.es2015.promise.d.ts b/lib/lib.es2015.promise.d.ts index 685f7164f5d61..57eea0f6bbc31 100644 --- a/lib/lib.es2015.promise.d.ts +++ b/lib/lib.es2015.promise.d.ts @@ -41,7 +41,7 @@ interface PromiseConstructor { all(values: T): Promise<{ -readonly [P in keyof T]: Awaited }>; // see: lib.es2015.iterable.d.ts - // all(values: Iterable>): Promise[]>; + // all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -52,7 +52,7 @@ interface PromiseConstructor { race(values: T): Promise>; // see: lib.es2015.iterable.d.ts - // race(values: Iterable>): Promise>; + // race(values: Iterable): Promise ? U : T>; /** * Creates a new rejected promise for the provided reason. @@ -66,18 +66,13 @@ interface PromiseConstructor { * @returns A resolved promise. */ resolve(): Promise; + /** * Creates a new resolved promise for the provided value. * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ - resolve(value: T): Promise>; - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise>; + resolve(value: T | PromiseLike): Promise; } declare var Promise: PromiseConstructor; diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index cd91033d5f0b5..28ca95abe3e6f 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -1532,8 +1532,8 @@ interface Promise { */ type Awaited = T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode - 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 - F extends ((value: infer V, ...args: infer _) => any) ? // if the argument to `then` is callable, extracts the first argument + T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped + F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument Awaited : // recursively unwrap the value never : // the argument to `then` was not callable T; // non-object or non-thenable