Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ResizeObserver type
declare global {
interface DOMRectReadOnly {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
readonly top: number;
readonly right: number;
readonly bottom: number;
readonly left: number;
interface ResizeObserverSize {
readonly inlineSize: number;
readonly blockSize: number;
interface ResizeObserverEntry {
readonly target: Element;
readonly contentRect: DOMRectReadOnly;
readonly borderBoxSize: ResizeObserverSize[];
readonly contentBoxSize: ResizeObserverSize[];
readonly devicePixelContentBoxSize: ResizeObserverSize[];
interface ResizeObserver {
observe(target: Element): void;
unobserve(target: Element): void;
disconnect(): void;
interface ResizeObserverCallback {
(entries: ResizeObserverEntry[], observer: ResizeObserver): void;
interface ResizeObserverConstructor {
new (callback: (entries: ResizeObserverEntry[]) => void): ResizeObserver;
interface Window {
ResizeObserver: ResizeObserverConstructor;
const ResizeObserver: ResizeObserverConstructor;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment