import * as React from 'react'; import type { LayerKind } from '../../../contracts/preferences.js'; import type { OverlayOpenChangeDetails } from './overlayTypes.js'; export interface OverlayLayerOptions { kind: LayerKind; modal: boolean; open: boolean; onOpenChange?: ((open: boolean, details: OverlayOpenChangeDetails) => void) | undefined; /** Popup element once mounted (fed back by the root for LayerEntry.element). */ element?: HTMLElement | null | undefined; /** Close path supplied by the root (useRoutedRootActions) when the registration lives in the popup or Base UI has no imperative close. */ actions?: React.RefObject | undefined; } /** The subset of Base UI's Root `actionsRef` the stack needs. */ export interface OverlayRootActions { close: () => void; } export interface OverlayLayerHandle { id: string; depth: number; isTop: boolean; emit: (open: boolean, details: { event?: Event; reason?: unknown; }) => void; /** Pass to `Base.Root actionsRef` so the stack can close the overlay. */ actionsRef: React.RefObject; } export declare function useOverlayLayer({ kind, modal, open, onOpenChange, element, actions: externalActions }: OverlayLayerOptions): OverlayLayerHandle; export interface RoutedRootActions { /** Pass to the popup's useOverlayLayer({ actions }). */ actions: React.RefObject; /** True (once) when the close now being reported came from the stack's Escape. */ takeEscape: () => boolean; } /** Root-side close path for overlays whose LayerStack entry is registered by the popup, or whose Base UI root exposes no imperative close. `close` performs the actual close (Base UI actionsRef.close(), or the root's controlled open state); the close it triggers is then reported by the root's onOpenChange as reason 'escape-key' via takeEscape(). */ export declare function useRoutedRootActions(close: () => void): RoutedRootActions; //# sourceMappingURL=useOverlayLayer.d.ts.map