import type { RefObject, DependencyList } from 'react'; export type Direction = 'up-down' | 'left-right' | 'both'; export interface UseArrowsOptions { /** * If true, the down or up arrow key will navigate to the first or last element if the element currently focused is the last or first index of the selected elements. * @default true */ cycle?: boolean; /** A query selector that will determine which elements to cycle through with the arrow keys. The selector will be used in conjunction with [querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll#selectors). */ selector?: string; /** * Which keys are used to navigate through the list. Use 'both' to bind up/left to previous and down/right to next. * @default 'up-down' * */ dir?: Direction; /** * Keeps one element focusable. * @default true * */ allowTabFocus?: boolean; /** * Tab index will be updated to -1 for all elements except the one that is currently focused. * @default true * */ updateTabIndex?: boolean; /** When focus enters the ref, which element should receive focus first if available */ initialFocusElement?: Element | null; } /** * @example useArrows(ref, { cycle, selector }); * @param ref - A reference to the element that will be navigated through. [React RefObject](https://reactjs.org/docs/refs-and-the-dom.html) */ declare const useArrows: (ref: RefObject, { cycle, selector, dir, allowTabFocus, updateTabIndex, initialFocusElement }?: UseArrowsOptions, /** Pass this prop in the internal dependencies when list is dynamic */ dependencies?: DependencyList) => void; export default useArrows; //# sourceMappingURL=useArrows.d.ts.map