import React from 'react'; declare type FocusList = HTMLElement[]; export declare function getFocusable(root?: Element | Document): FocusList; export declare type FocusHint = HTMLElement | string | number | null; export interface SearchState { focusHint: string | number; focusIndex: number; shift: boolean; } export interface FocusOpts { shift?: boolean; /** Allow overriding on a per-call basis. */ control?: FocusControl; } /** * This is used when focus needs to enter the root, in one of two ways: * 1. It can return a list of elements, and the `focus()` method will be * called on the one at `focusIndex` (accounting for negative indexes). * 2. It can return a single element. * 3. It can also return `undefined` to do nothing. * * The default returns a list of all focusable elements in the popup. */ export declare type FocusControl = (root: HTMLElement, state: SearchState) => FocusList | HTMLElement | undefined; export declare type FocusSetter = (f: FocusHint, opts?: FocusOpts) => void; export declare function useFocusControl(fc: FocusControl | undefined, rootId: string): FocusSetter; export declare function useFocusControl(fc?: FocusControl): [FocusSetter, React.RefObject]; export declare function getCurrentFocusIndex(focusList: FocusList, fallback: number): number; export declare function getFocusIndex(focusList: FocusList, { focusHint, focusIndex, shift }: SearchState): number | undefined; export declare function wrapIndex(focusIndex: number, focusCount: number): number; export declare function findIndexByTextContent(focusList: FocusList, focusHint: string, currentIndex: number): number | undefined; export {};