It would be nice to be able to override (not extend) third party libraries' interfaces to change the types/signatures of the interface properties.
Use Cases
Sometimes they make mistakes or define interfaces in ways that force me to constantly use as to typecast. I'd rather short-circuit it in one place so it works across my project.
My suggestion meets these guidelines:
(Honestly I'm in no position to make these judgment calls, as I don't know the inner workings of this library - why ask these quesitons?)
[X] This wouldn't be a breaking change in existing TypeScript / JavaScript code
[X] This wouldn't change the runtime behavior of existing JavaScript code
[ ] This could be implemented without emitting different JS based on the types of the expressions (not sure what this means)
[ ] This isn't a runtime feature (e.g. new expression-level syntax) (???)
I think a core problem here is: in the case of multiple overrides of the same property, how would the type-checker decide which override takes precedence?
Search Terms
override interface override interface replace
Suggestion
It would be nice to be able to override (not extend) third party libraries' interfaces to change the types/signatures of the interface properties.
Use Cases
Sometimes they make mistakes or define interfaces in ways that force me to constantly use
as
to typecast. I'd rather short-circuit it in one place so it works across my project.Examples
Reference: https://stackoverflow.com/questions/51562792/how-to-override-a-typescript-interface-without-extending
Checklist
My suggestion meets these guidelines: (Honestly I'm in no position to make these judgment calls, as I don't know the inner workings of this library - why ask these quesitons?)