diff --git a/types/promise.allsettled/implementation.d.ts b/types/promise.allsettled/implementation.d.ts index 7d00ef2b16..9a7f56d640 100644 --- a/types/promise.allsettled/implementation.d.ts +++ b/types/promise.allsettled/implementation.d.ts @@ -1,10 +1,10 @@ import { PromiseRejection, PromiseResolution, PromiseResult } from './types'; type PromiseTuple = {[P in keyof T]: Promise}; -type PromiseResultTuple = {[P in keyof T]: PromiseResult}; +type PromiseResultTuple = {[P in keyof T]: PromiseResult}; declare function allSettled(): Promise<[]>; declare function allSettled(iterable: PromiseTuple): Promise>; -declare function allSettled(iterable: Iterable): Promise; +declare function allSettled(iterable: Iterable): Promise>>; export = allSettled; diff --git a/types/promise.allsettled/index.d.ts b/types/promise.allsettled/index.d.ts index a9338e59da..ec6895b926 100644 --- a/types/promise.allsettled/index.d.ts +++ b/types/promise.allsettled/index.d.ts @@ -28,6 +28,6 @@ export = exportedImplementation; declare namespace exportedImplementation { type PromiseRejection = PromiseRejectionType; type PromiseResolution = PromiseResolutionType; - type PromiseResult = PromiseResultType; + type PromiseResult = PromiseResultType; type PromiseResultTuple = PromiseResultTupleType; } diff --git a/types/promise.allsettled/promise.allsettled-tests.ts b/types/promise.allsettled/promise.allsettled-tests.ts index b154040d38..9b59007db3 100644 --- a/types/promise.allsettled/promise.allsettled-tests.ts +++ b/types/promise.allsettled/promise.allsettled-tests.ts @@ -1,6 +1,7 @@ import allSettled = require("promise.allsettled"); type Result = Promise>; +type ArrayResult = Promise>>; allSettled(); // $ExpectType Promise<[]> // the $ExpectType comment does not work with the following constraints unfortunately @@ -8,4 +9,4 @@ const r0: Result<[number]> = allSettled([Promise.resolve(0)]); const r1: Result<[number, string]> = allSettled([Promise.resolve(1), Promise.resolve('a')]); const r2: Result<[never, boolean]> = allSettled([Promise.reject(null), Promise.resolve(true)]); // tslint:disable-line use-default-type-parameter const input = [0, 1, 2, 3, 4]; -const r3: Promise = allSettled(input); +const r3: ArrayResult = allSettled(input); diff --git a/types/promise.allsettled/types.d.ts b/types/promise.allsettled/types.d.ts index 715ee292f6..b5f804cb92 100644 --- a/types/promise.allsettled/types.d.ts +++ b/types/promise.allsettled/types.d.ts @@ -8,7 +8,7 @@ export interface PromiseRejection { reason: E; } -export type PromiseResult = PromiseResolution | PromiseRejection; +export type PromiseResult = PromiseResolution | PromiseRejection; export type PromiseTuple = {[P in keyof T]: Promise}; -export type PromiseResultTuple = {[P in keyof T]: PromiseResult}; +export type PromiseResultTuple = {[P in keyof T]: PromiseResult};