paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 387 forks source link

Typing for Promise#catch #423

Closed rtm closed 7 years ago

rtm commented 7 years ago

Is there any reason for this overload in the typings file? The preceding line would seem to encompass this one.

catch(onrejected?: (reason: any) => T | PromiseLike<T> | void): Promise<T>;
ljharb commented 7 years ago

What typings file are you referring to?

rtm commented 7 years ago

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/es6-shim/es6-shim.d.ts

See also http://stackoverflow.com/questions/39198286/typescript-signature-of-promisecatch-onrejected-handler

ljharb commented 7 years ago

That's not this repo, so I'm not sure what you want me to do about it.

It looks like the SO answer explains the problem with trying to statically type non-statically-typable interfaces.