import { type RefObject } from 'react'; export interface RovingMenuOption { readonly disabled?: boolean | undefined; readonly selected?: boolean | undefined; } export interface RovingMenuOptions { readonly active: boolean; readonly options: readonly RovingMenuOption[]; } export interface RovingMenuKeyEvent { nativeEvent: { key: string; target?: unknown; }; preventDefault: () => void; } export interface RovingMenuItemProps { readonly onKeyDown: (event: RovingMenuKeyEvent) => void; readonly ref: (node: object | null) => void; readonly tabIndex: 0 | -1; } export interface RovingMenuResult { /** The item holding the tab stop, or null when no item is enabled. */ readonly activeIndex: number | null; /** A stable ref to the active item's host; its `current` is null when no item is enabled. */ readonly initialFocusRef: RefObject; readonly itemProps: (index: number) => RovingMenuItemProps; } /** * Maps an arrow, Home, or End key to the enabled item it moves to, or null to * ignore the key. Movement is relative to `currentIndex` even when that item is * disabled or gone, and wraps at both ends. */ export declare function nextEnabledMenuIndex(key: string, currentIndex: number, options: readonly RovingMenuOption[]): number | null; /** * Keyboard and focus state for an action menu: one tab stop on an enabled item, * arrow keys that skip disabled items, and Home and End. It renders nothing, * invokes no action, and leaves Escape, focus containment, and restoration to * `useOverlayA11y`. Call it before `useOverlayA11y` and pass `initialFocusRef` on. */ export declare function useRovingMenu({ active, options }: RovingMenuOptions): RovingMenuResult; //# sourceMappingURL=use-roving-menu.d.ts.map