import React, { type ReactNode, type AriaRole } from "react"; import { type BaseListSizes } from "../BaseList.types"; export interface BaseListItemContextProps { /** * The index of this item in the list. */ index: number; /** * The derived ID for this item. */ id: string; /** * Whether this item is currently highlighted (has keyboard focus). */ highlighted: boolean; /** * The tabIndex for this item (0 if highlighted, -1 otherwise). */ tabIndex: number; /** * The HTML element to render as. */ component: string; /** * The size of the item. */ size: BaseListSizes; /** * The ARIA role for this item. */ role: AriaRole | undefined; /** * Callback ref to register the item's DOM element. */ refCallback: (element: HTMLElement | null) => void; } export interface BaseListContextProps { /** * The index of the currently focused/active item. */ activeItemIndex: number; /** * Callback to update the focused item by id and index. */ updateFocusedItem: (id: string, index: number) => void; /** * Register an item ref for keyboard navigation. */ registerItem: (ref: HTMLElement | null, index: number) => void; /** * The size of items in the list. */ size?: BaseListSizes; } export interface BaseListProviderProps { value: BaseListContextProps; children: ReactNode; } export interface BaseListItemProviderProps { value: BaseListItemContextProps; children: ReactNode; } export declare const BaseListProvider: ({ value, children }: BaseListProviderProps) => React.JSX.Element; export declare const BaseListItemProvider: ({ value, children }: BaseListItemProviderProps) => React.JSX.Element; export declare const useBaseList: () => BaseListContextProps; export declare const useBaseListItem: () => BaseListItemContextProps | undefined;