UNPKG

reablocks

Version:
17 lines (15 loc) 550 B
import { ReactNode, RefObject } from 'react'; export declare const DATA_ATTRIBUTE_INDEX = "keyboard_index"; export interface FocusableElement { ref: RefObject<HTMLElement>; onClick: (() => void) | undefined; } export interface HotkeyIem { hotkey: string; index: number; } export declare const useFlattenedTree: (children: ReactNode, selectedIndex: number, onSelectedIndexChange: (index: number) => void) => { flattenedTree: ReactNode[]; hotkeys: HotkeyIem[]; itemsRef: import('react').MutableRefObject<HTMLElement[]>; };