site
site copied to clipboard
Article: how to override third party types?
A question brought up on my Twitch stream today: overriding types of third party libraries if the types aren't made to be extended?
Example: some-library exports an interface MyData, and in your code you need to have an extra property myProperty added to all instances of MyData?
A more specific example: https://github.com/versatica/mediasoup/blob/41e2f52786a61942209512ca5ce20798baad8b96/node/lib/Worker.d.ts#L39
Thanks voltaryx on Twitch for bringing up! 🙌
See also: https://twitter.com/phunkren/status/1561794275855241216