Open danvk opened 2 years ago
Comment by Serhii on 2021-07-07 09:13:
Here I have overloaded BuiltIn CallableFunction
Declaration merging deserves all the hate it gets. I can’t declare a class named Plugin in one of my files because it conflicts with the DOM Plugin class? That’s user-antagonistic behavior. Local names in JS shadow global names, so it’s really annoying that TS behaves completely differently.
It’s just leftover cruft from TypeScript's pre-ESM days that needs to be eradicated.
Monkeypatching type definitions can be useful but there should be a way to explicitly declare overrides, instead of having to exploit an ill-conceived feature to do so.
In defense of interface: Using declaration merging to disable bad parts
https://effectivetypescript.com/2021/06/03/interface/