/** * Shared MutationObserver for detecting element unmount. * * One observer watches `document.body` with `subtree: true`. Each watched * element registers a callback; when ANY DOM removal happens, the observer * walks the removed subtree and fires the callback for any tracked element * it finds (including descendants of the actually-removed node). * * One shared observer beats per-element observers for two reasons: * - parent re-mounts that detach the watched node also fire * - lower memory / browser overhead than dozens of observers */ type UnmountCallback = () => void; /** Register `cb` to fire when `element` is removed from the DOM. */ export declare function watchUnmount(element: HTMLElement, cb: UnmountCallback): () => void; export {}; //# sourceMappingURL=unmount-observer.d.ts.map