import { type ReactNode } from "react"; import { type StyleProp, type ViewStyle } from "react-native"; export interface OverlayHost { /** Register or update a portaled node. Called on every render of . */ mount(id: string, node: ReactNode): void; /** Remove a portaled node. Called only when a unmounts. */ unmount(id: string): void; /** Measure the outlet's window rect, for relative anchoring. */ measureOutlet(cb: (x: number, y: number, width: number, height: number) => void): void; /** Observe host layout changes, including native keyboard resizing. */ subscribeLayout?(listener: () => void): () => void; /** * Hold this window's page hidden from VoiceOver and TalkBack while a modal card * (an anchored card that can close) is open in this host's outlet; call the returned * function when it closes. Cards held later are above earlier ones. */ holdModal?(id: string): () => void; /** Observe the modal cards held in this host. */ subscribeModal?(listener: () => void): () => void; /** The id of the topmost modal card held in this host, or null. */ topModal?(): string | null; /** * Measure the visible band inherited from this native window's viewport: the * window's safe area less the app's declared chrome and the keyboard, on all four * edges, in window coordinates. */ measureVisibleBounds?(cb: (bounds: OverlayBounds) => void): void; /** * Measure the window this host's layer covers, where a modal sheet stands: `window` is * the layer's own box cut at the keyboard's top (the app's declared chrome is not cut: * a sheet covers its tab bar), and `safe` is the window's safe area within it, which the * sheet's content keeps clear of; both in window coordinates. */ measureWindowBounds?(cb: (window: OverlayBounds, safe: OverlayBounds) => void): void; } export interface OverlayBounds { x: number; y: number; width: number; height: number; } export interface OverlayViewportInsets { top?: number; bottom?: number; } /** Reserve app-declared vertical occlusions within a measured viewport. */ export declare function insetOverlayBounds(bounds: OverlayBounds, insets: OverlayViewportInsets): OverlayBounds; export declare function intersectOverlayBounds(a: OverlayBounds, b: OverlayBounds): OverlayBounds; /** The nearest overlay host, or null when no is mounted. */ export declare function useOverlayHost(): OverlayHost | null; export interface OverlayProviderProps { children: ReactNode; /** Start a new measurement boundary inside a separate native Modal window. */ separateWindow?: boolean; /** Constrain nested cards to this provider's measured viewport. Nested * content-sized hosts otherwise inherit their window's visible bounds. */ viewport?: boolean; /** Measured header/footer occlusions, relative to this provider's own box. * Applies to root hosts and nested hosts with `viewport`; content hosts * inherit their parent band instead. Vertical geometry only. */ viewportInsets?: OverlayViewportInsets; /** * Style for the positioning wrapper. Defaults to `flex: 1` so an app-root host * fills the screen; pass a style to override for a content-sized host (e.g. a * docs example stage). */ style?: StyleProp; } /** * The overlay host: mount one at the app root, inside ThemeProvider, so menus, popovers, * tooltips and other floating content render above the page in its outlet. Without one, * overlays render inline where they are declared. */ export declare function OverlayProvider({ children, style, separateWindow, viewport, viewportInsets }: OverlayProviderProps): import("react").JSX.Element; export interface PortalProps { children: ReactNode; } /** * Teleport `children` into the nearest outlet. With no provider * mounted, render them inline in place (the kit's pre-portal behavior). */ export declare function Portal({ children }: PortalProps): import("react").JSX.Element | null; //# sourceMappingURL=portal.d.ts.map