import { type RefObject } from 'react'; import { type View, type ViewProps } from 'react-native'; import type { HostRef } from './dom-boundary.js'; import { type FocusTrapOptions, type FocusTrapProps } from './use-focus-trap.js'; /** * Runs `task` once the overlay has laid out and returns a canceller. Products * that already have a presentation event should pass their own. */ export type DeferFocus = (task: () => void) => { cancel: () => void; }; export interface OverlayA11yOptions extends Pick { active: boolean; containerRef: RefObject; /** Overrides how the native focus request waits for layout. */ deferFocus?: DeferFocus | undefined; /** Container whose outside siblings go inert. Defaults to `containerRef`. */ inertContainerRef?: RefObject | undefined; initialFocusRef?: HostRef | undefined; onEscape?: (() => void) | undefined; /** Native tag of the opener, when the caller already resolved it. */ triggerHandle?: number | null | undefined; triggerRef?: RefObject | undefined; } export type OverlayBackgroundProps = Pick; export interface OverlayA11yResult { backgroundProps: OverlayBackgroundProps; containerProps: FocusTrapProps; } /** * One contract for overlay focus on both platforms. Web traps Tab, closes on * Escape, and makes the background inert. Native moves accessibility focus into * the overlay after layout and returns it to the trigger on close. */ export declare function useOverlayA11y({ active, containerRef, deferFocus, inertContainerRef, initialFocusRef, onEscape, restoreFocus, returnFocus, triggerHandle, triggerRef, }: OverlayA11yOptions): OverlayA11yResult; //# sourceMappingURL=use-overlay-a11y.d.ts.map