import type { Bridge } from "./types.js"; /** Options for {@link startAutoResize}. */ export interface AutoResizeOptions { /** * Minimum change (in px) on either axis before a new size is reported. Guards * against sub-pixel churn and `ResizeObserver` feedback loops. Default `1`. */ threshold?: number; } /** * Observe the document's content box and emit {@link RESIZE_MESSAGE} to the host * whenever it changes, so the host can size a `fit`/auto container to the content. * * The content's *intrinsic* size is measured from the document body's * `scrollWidth/scrollHeight` — NOT `documentElement`, whose scroll size is floored * at the iframe viewport height. Measuring the root would create an * observe→resize→observe feedback loop: once the host sizes the iframe to a * placeholder taller than the content, `documentElement.scrollHeight` returns the * viewport height, the SDK reports that back, and the frame stays pinned at the * placeholder instead of shrinking to the content. The body's scroll box reflects * the intrinsic content and is independent of the iframe size. Reports are * coalesced to an animation frame and only sent when the value moves past * `threshold`. * * Safe to call in any environment: if there is no DOM or `ResizeObserver`, it is a * no-op and returns a no-op teardown. * * @returns a teardown that disconnects the observer and removes listeners. */ export declare function startAutoResize(bridge: Pick, win: Window & typeof globalThis, options?: AutoResizeOptions): () => void; //# sourceMappingURL=auto-resize.d.ts.map