s4san
s4san

Reputation: 319

How to override constructor definitions of browser APIs in typescript?

I want to override the constructor of a new browser API which is still experimental. The default lib.dom.ts for this API has the constructor definition which I want to override. How should I go about this?

I have extracted out what I'm trying to do in the REPL here

Upvotes: 0

Views: 231

Answers (1)

Przemyslaw Jan Beigert
Przemyslaw Jan Beigert

Reputation: 2486

You can declare this type in Window interface and run it from window. global object.

Playground

Upvotes: 1

Related Questions