import { type RefObject } from 'react'; import { type TPopoverCloseReason } from '../popover/types'; type TUseSimpleLightDismissOptions = { /** * Ref to the popover element. Clicks inside this element will not trigger dismiss. */ popoverRef: RefObject; /** * Whether the popover is currently open. * Listeners are only bound when `isOpen` is `true`. */ isOpen: boolean; /** * Called when a light-dismiss event occurs. * * - `reason: 'escape'` - the user pressed the Escape key. * - `reason: 'light-dismiss'` - the user clicked outside the popover. * * **Note:** This hook provides simple, standalone light dismiss that does not * participate in the browser's `popover="auto"` dismiss stack. Every active * instance will fire independently - if multiple popovers use this hook, * they will all receive dismiss events. */ onClose: (args: { reason: TPopoverCloseReason; }) => void; }; /** * Simple light-dismiss hook for `popover="manual"` elements. * * Provides Escape-to-close and click-outside-to-close behavior without * relying on the browser's `popover="auto"` light-dismiss stack. * * **No stacking awareness:** This hook does not track a popover stack. * If multiple manual popovers are open and all use this hook, a single * Escape press or outside click will dismiss **all of them simultaneously**. * This is by design - the hook is intentionally simple for cases where * only one manual popover is open at a time. * * For stacked/nested popovers that should dismiss one-at-a-time, use * `popover="auto"` mode instead, which provides native stack-aware * light dismiss via the browser's top-layer stack. */ export declare function useSimpleLightDismiss({ popoverRef, isOpen, onClose, }: TUseSimpleLightDismissOptions): void; export type { TUseSimpleLightDismissOptions };