microsoft / TypeScript-DOM-lib-generator

Tool for generating dom related TypeScript and JavaScript library files
Apache License 2.0
616 stars 417 forks source link

ResizeObserver not present on the Window interface #1683

Open guillaumebrunerie opened 8 months ago

guillaumebrunerie commented 8 months ago

The ResizeObserver class is only available as a global declaration and not on the Window interface. I think it should also be available on the Window interface for at least two reasons:

turansky commented 7 months ago

says [Exposed=(Window)]

Window in this case is environment name, like DedicatedWorker or SecureContext (no such interfaces)

Also:

  1. Global ResizeObserver is fine
  2. There is no support for nested interfaces/types in TS
  3. It could't be implemented without duplication