mattpocock / ts-reset

A 'CSS reset' for TypeScript, improving types for common JavaScript API's
https://www.totaltypescript.com/ts-reset
MIT License
7.84k stars 123 forks source link

Promise Union - This expression is not callable. #209

Open stanislav215 opened 1 week ago

stanislav215 commented 1 week ago

Hello,

From version 0.6.0 I am getting errors on function that returns union of promises.

This expression is not callable. Each member of the union type '{ (onfulfilled?: ((value: number) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined): Promise<...>; (onfulfilled?: ((value: number) => TResult1 | PromiseLike...' has signatures, but none of those signatures are compatible with each other.typescript(2349)

probably related to: ts-reset/dist/promise-catch.d.ts

here is url, where issue is recreated: https://codesandbox.io/p/sandbox/4lnj2q

wojtekmaj commented 6 days ago

I'm having the same issue.

Same repro in TS playground:

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAIgAIwjAhgGwLQwJ5gCmAzgMZTBgwD0Mx2UJhMCA3AFDukQB2x8AVx7BeABSgQQwYoTgBeOD0IB3OOMnTCACi2NiASnkA+OAG8AvofTF2cOAB81EqTIA8PASABGhKEdsOThpuAG4QwAAmRhzcfPBgzpoA6sAwABYAqiI8AEokApjwCkqq6i7auiSGciYWVsRB5a4BHt6+gWGR7NGcQtllmgB06YQ8OnrVtZYcCcGEKelZvHnEBTDDaaPjVcZm0+xAA