microsoft / microsoft/TypeScript
Allow ability to do an in-place override (_not_ extend) of interface properties
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
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
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?)
- This wouldn't be a breaking change in existing TypeScript / JavaScript code
- 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) (???)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files, tests, or compiler entry points are identified. Start by reading the requested override behavior and the linked Stack Overflow discussion, then trace how TypeScript currently handles third-party interface declarations and type assertions. Done means a precisely defined override mechanism with agreed type-checking behavior and coverage for the reported use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100