TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
ResizeObserver not present on the Window interface
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:
- The specification (https://drafts.csswg.org/resize-observer/#idl-index) says
[Exposed=(Window)], which I’m guessing means that it is supposed to be on theWindowinterface (I’m actually surprised, isn’t the specification supposed to be automatically translated to Typescript declarations?) - For applications with several windows, it behaves differently depending on the window from which it is taken (see https://codepen.io/Latcarf/pen/RwdyLXr?editors=0010). So it would make a lot of sense to be able to do the following, which currently doesn’t typecheck as
popupis of typeWindow.
const popup = window.open(...)!;
new popup.ResizeObserver(...);