Summary
The types added to global by importing 'resize-observer-polyfill' clash with Typescript's own typings for ResizeObserver in lib.dom.d.ts. This issue makes it very inconvenient to use this package.
import ResizeObserver from 'resize-observer-polyfill';
const resizeObserver = new ResizeObserver(entries => {
// ^^^^^^^ Error: Parameter 'entries' implicitly has an 'any' type.
console.log(entries);
});
typescript@4.2.3
resize-observer-polyfill@1.5.1

Suggestions
-
Since this package is trying to be used as a ponyfill, I don't think it should affect global with it's types as soon as it's imported. It's probably better that types are exported directly from the package if they are needed. Since there already are types provided by TS, this should likely not be needed unless for some reason lib.dom.d.ts is not used.
import ResizeObserver, { ResizeObserverEntry } from 'resize-observer-polyfill';
// or
import ResizeObserver from 'resize-observer-polyfill';
import type { ResizeObserverEntry } from 'resize-observer-polyfill';
-
Avoid using custom types, and rely on typescripts own types.
// src/index.d.ts
export default ResizeObserver;
Summary
The types added to
globalby importing'resize-observer-polyfill'clash with Typescript's own typings forResizeObserverinlib.dom.d.ts. This issue makes it very inconvenient to use this package.typescript@4.2.3resize-observer-polyfill@1.5.1Suggestions
Since this package is trying to be used as a ponyfill, I don't think it should affect
globalwith it's types as soon as it's imported. It's probably better that types are exported directly from the package if they are needed. Since there already are types provided by TS, this should likely not be needed unless for some reasonlib.dom.d.tsis not used.Avoid using custom types, and rely on typescripts own types.