Skip to content

Commit

Permalink
Fix the TypeScript type for pProgress.all (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
irrelevelephant authored Apr 9, 2021
1 parent 7f1b233 commit 2c98ab0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,12 +717,12 @@ declare class PProgress<ValueType> extends Promise<ValueType> {
static all<AllValuesType>(
promises: Iterable<PProgress.PromiseFactory<AllValuesType>>,
options: PProgress.Options
): PProgress<AllValuesType>;
): PProgress<Iterable<AllValuesType>>;
static all<AllValuesType>(
promises: Iterable<
PromiseLike<AllValuesType> | PProgress.PromiseFactory<AllValuesType>
>
): PProgress<AllValuesType>;
): PProgress<Iterable<AllValuesType>>;

/**
Same as the [`Promise` constructor](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise).
Expand Down
12 changes: 6 additions & 6 deletions index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ expectType<
)
);

expectType<PProgress<string | number | boolean | symbol | string[]>>(
expectType<PProgress<Iterable<string | number | boolean | symbol | string[]>>>(
PProgress.all<string | number | boolean | symbol | string[]>([
Promise.resolve('sindresorhus.com'),
Promise.resolve(1),
Expand All @@ -650,7 +650,7 @@ expectType<PProgress<string | number | boolean | symbol | string[]>>(
Promise.resolve(['foo'])
])
);
expectType<PProgress<string | number | boolean | symbol | string[]>>(
expectType<PProgress<Iterable<string | number | boolean | symbol | string[]>>>(
PProgress.all<string | number | boolean | symbol | string[]>([
() => Promise.resolve('sindresorhus.com'),
() => Promise.resolve(1),
Expand All @@ -665,7 +665,7 @@ expectType<PProgress<string | number | boolean | symbol | string[]>>(
() => Promise.resolve(['foo'])
])
);
expectType<PProgress<string | number | boolean | symbol | string[]>>(
expectType<PProgress<Iterable<string | number | boolean | symbol | string[]>>>(
PProgress.all<string | number | boolean | symbol | string[]>(
[
() => Promise.resolve('sindresorhus.com'),
Expand All @@ -684,7 +684,7 @@ expectType<PProgress<string | number | boolean | symbol | string[]>>(
)
);

expectType<PProgress<string | number | boolean | symbol | string[]>>(
expectType<PProgress<Iterable<string | number | boolean | symbol | string[]>>>(
PProgress.all<string | number | boolean | symbol | string[]>(
new Set([
Promise.resolve('sindresorhus.com'),
Expand All @@ -701,7 +701,7 @@ expectType<PProgress<string | number | boolean | symbol | string[]>>(
])
)
);
expectType<PProgress<string | number | boolean | symbol | string[]>>(
expectType<PProgress<Iterable<string | number | boolean | symbol | string[]>>>(
PProgress.all<string | number | boolean | symbol | string[]>(
new Set([
() => Promise.resolve('sindresorhus.com'),
Expand All @@ -718,7 +718,7 @@ expectType<PProgress<string | number | boolean | symbol | string[]>>(
])
)
);
expectType<PProgress<string | number | boolean | symbol | string[]>>(
expectType<PProgress<Iterable<string | number | boolean | symbol | string[]>>>(
PProgress.all<string | number | boolean | symbol | string[]>(
new Set([
() => Promise.resolve('sindresorhus.com'),
Expand Down

0 comments on commit 2c98ab0

Please sign in to comment.