export type ObservedSize = { width: number | undefined; height: number | undefined; }; type UseResizeObserverOptions = { /** * Observe an externally-managed ref instead of the returned `ref` callback. * - `undefined`: attach the returned `ref` callback to the element to observe. * - a ref object: observe its current element. * - `null`: disable observation entirely. * * Limitation: the observer is (re)subscribed only when the ref object's * identity changes (or on mount), not when `ref.current` is mutated to point * at a different node behind the same ref object. If the element is swapped * without a re-render that changes the ref identity, the hook keeps observing * the stale node. This is fine for a stable element (or when you toggle the * ref object itself), but if the observed node can change in place, prefer the * returned `ref` callback instead — it re-subscribes on every node change. */ ref?: React.RefObject | null; /** * Called on every resize with the new size. When provided, the hook does not * store the size in state, so it never triggers a re-render of its own. */ onResize?: (size: ObservedSize) => void; }; type UseResizeObserverResult = { ref: (element: T | null) => void; width: number | undefined; height: number | undefined; }; /** * Observe an element's content-box size with a `ResizeObserver`. */ export declare function useResizeObserver(options?: UseResizeObserverOptions): UseResizeObserverResult; export {}; //# sourceMappingURL=useResizeObserver.d.ts.map