import type { RefObject } from 'react'; export type UseMutationObserverOptions = { /** Whether to observe; `false` disconnects and runs `onDisconnect`. Defaults to `true`. */ enabled?: boolean; /** `MutationObserver` init, read on connect. Defaults to `{ childList: true, subtree: true }`. */ init?: MutationObserverInit; /** * Runs whenever observation stops, including on unmount, to clean up side effects of * `onMutation`. */ onDisconnect?: () => void; /** Also calls `onMutation` once right after connecting. Defaults to `true`. */ runOnConnect?: boolean; }; /** * Runs `onMutation` when the observed subtree of `ref` changes, and once on connect unless * `runOnConnect` is `false`. The latest `onMutation` and `onDisconnect` are used without * reconnecting the observer. * * It reconnects on an `enabled` change or a remount, not when `ref.current` is swapped silently; * use a `key` or toggle `enabled` when the target changes. */ export declare const useMutationObserver: (ref: RefObject, onMutation: () => void, { enabled, init, onDisconnect, runOnConnect, }?: UseMutationObserverOptions) => void; //# sourceMappingURL=useMutationObserver.d.ts.map