import { type ReactNode } from 'react'; /** * Portal props. */ export interface PortalProps { /** * Container element. By default new `div` will be created. * Can be function that returns element or null. */ container?: HTMLElement | (() => HTMLElement | null); /** * How container will be connected to document. * By default `document.appendChild(container)` will be called if container is not connected yet. * When false passed, nothing will be done. */ connect?: boolean | ((container: HTMLElement) => void); /** * Component unmount handler. * When `true` passed, container will be removed from DOM by `container.remove()`. * When `false` passed, nothing will be done. * By default acts like for `true` if `container` prop is not passed, and like `false` otherwise. */ cleanup?: boolean | ((container: HTMLElement) => void); /** * Portal key. */ portalKey?: string; /** * Content that will be rendered into `container` element. */ children?: ReactNode; } /** * Declarative portal component. * @param props Props. * @returns JSX.Element or null. */ export declare function Portal(props: PortalProps): ReactNode;