downshift
Version:
🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.
12 lines (11 loc) • 624 B
TypeScript
/**
* Returns the next non-disabled highlightedIndex value.
*
* @param start The current highlightedIndex.
* @param offset The offset from the current highlightedIndex to start searching.
* @param items The items array.
* @param isItemDisabled Function that tells if an item is disabled or not.
* @param circular If the search reaches the end, if it can search again starting from the other end.
* @returns The next highlightedIndex.
*/
export declare function getHighlightedIndex<Item>(start: number, offset: number, items: Item[], isItemDisabled: (item: Item, index: number) => boolean, circular?: boolean): any;