diff --git a/README.md b/README.md index bb67601..10e27b6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ A strongly typed drop-in replacement for Promises in TypeScript. ## Installation Promise is available from the NPM registry and as a GitHub Package. Whichever -source you prefer to use, the installation instructions should remain the same. +source you prefer to use, the installation should remain the same. ```sh # Using NPM diff --git a/lib/promise.d.ts b/lib/promise.d.ts index 04c08c1..88523d4 100644 --- a/lib/promise.d.ts +++ b/lib/promise.d.ts @@ -89,7 +89,7 @@ declare type AssertRejects, U extends RejectType, V * Upgrade a vanilla Promise to a strongly typed Promise while respecting * function overloads. * - * Support is provided for functions with four or fewer arguments. + * Support is provided for functions with six or fewer overloads. * * @remarks * @@ -99,6 +99,12 @@ declare type AssertRejects, U extends RejectType, V * {@link https://stackoverflow.com/a/64330561/4000053} */ type UpgradePromise = + T extends + { (...args: infer A1): PromiseLike; (...args: infer A2): PromiseLike; (...args: infer A3): PromiseLike; (...args: infer A4): PromiseLike; (...args: infer A5): PromiseLike; (...args: infer A6): PromiseLike; } ? + { (...args: A1): Promise; (...args: A2): Promise; (...args: A3): Promise; (...args: A4): Promise; (...args: A5): Promise; (...args: A6): Promise; } : + T extends + { (...args: infer A1): PromiseLike; (...args: infer A2): PromiseLike; (...args: infer A3): PromiseLike; (...args: infer A4): PromiseLike; (...args: infer A5): PromiseLike; } ? + { (...args: A1): Promise; (...args: A2): Promise; (...args: A3): Promise; (...args: A4): Promise; (...args: A5): Promise; } : T extends { (...args: infer A1): PromiseLike; (...args: infer A2): PromiseLike; (...args: infer A3): PromiseLike; (...args: infer A4): PromiseLike; } ? { (...args: A1): Promise; (...args: A2): Promise; (...args: A3): Promise; (...args: A4): Promise; } :