type Focusable = { focus?: () => void; } | null; /** * The options of `useRovingFocus`: the number of items, the active one, what activating * an item does, which arrows move, the layout direction, whether the ends wrap, and which * items are disabled. */ export interface RovingFocusOptions { /** Number of items in the group. */ count: number; /** Index of the active/selected item (the single tab stop). */ active: number; /** Move activation (and focus) to `index` when an arrow/Home/End lands on it. */ onActivate: (index: number) => void; /** Which arrows move: horizontal (Left/Right), vertical (Up/Down), or both. Default horizontal. */ orientation?: "horizontal" | "vertical" | "both"; /** Flip the horizontal arrows for right-to-left locales (ArrowLeft advances). */ rtl?: boolean; /** Wrap past the ends (default true). */ loop?: boolean; /** * Whether the item at `index` is disabled: never the tab stop, and the arrows, Home and * End skip it. Omit when no item can be disabled. */ isDisabled?: (index: number) => boolean; } /** The props one item of a roving group spreads onto its pressable: its tab stop, its ref and its key handler. */ export interface RovingItemProps { /** Only the tab stop is focusable on web; native rows retain click support. */ focusable: boolean; /** Web tab order: 0 for the tab stop (the active item, or the first enabled one when * the active item is disabled), -1 for the rest. Native uses 0 for every row so * tabIndex does not disable Pressable's native click handler. */ tabIndex: number; /** Ref that captures the item's host node so arrows can move focus to it. */ ref: (node: Focusable) => void; /** Web-only key handler; never fires on native. */ onKeyDown: (event: { key: string; preventDefault: () => void; }) => void; } /** * Roving keyboard focus for a composite widget (the WAI-ARIA pattern Tabs, RadioGroup and * Listbox share): the group is one tab stop, the arrows, Home and End move focus and * activate the item it lands on, a disabled item is skipped and never the tab stop, and * native rows keep their own focus and click support. */ export declare function useRovingFocus(options: RovingFocusOptions): { getItemProps: (index: number) => RovingItemProps; /** Move DOM focus to an item by index (e.g. focus the first item when a menu opens). */ focusItem: (index: number) => void; }; export {}; //# sourceMappingURL=use-roving-focus.d.ts.map