import type { RefObject } from "react"; export interface ElementSize { width: number; height: number; } /** * Tracks the width and height of an HTML element in real-time. * Uses `ResizeObserver` under the hood. * * @param ref - The React ref attached to the element you want to measure. * @returns Object containing the exact `width` and `height` in pixels. * * @example * ```tsx * const ref = useRef(null); * const { width, height } = useElementSize(ref); * return