import { ReactNode, ReactPortal } from 'react'; /** * Returns the portal host element `#id`, creating it when missing. * * @remarks * If the element is missing, a `div` with the given `id` is appended to `document.body`. * The portal mounts **into** that host — `document.body` itself is never used as the * direct portal container. * * @param rootId - `id` of the root node (e.g. `'dialog-root'`). * * @returns The host element, or `null` when `document` is unavailable (e.g. SSR). * * @category Utils */ export declare function ensurePortalRoot(rootId: string): HTMLElement | null; /** * Renders children into a dedicated portal root, creating that node when absent. * * @remarks * Uses {@link ensurePortalRoot}; returns `null` when the document is not available. * * @param rootId - `id` of the portal host (e.g. `'dialog-root'`). * @param children - Tree to render into the host. * * @returns A {@link https://react.dev/reference/react-dom/createPortal | React portal}, or `null`. * * @category Utils */ export declare function renderPortal(rootId: string, children: ReactNode): ReactPortal | null;