Skip to content

Allow ability to do an in-place override (_not_ extend) of interface properties #26011

@ffxsam

Description

@ffxsam

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?)

  • 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) (???)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions