UNPKG

@awsui/components-react

Version:

On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en

25 lines 1.07 kB
export declare class HighlightType { type: 'keyboard' | 'mouse'; moveFocus: boolean; constructor(type: 'keyboard' | 'mouse', moveFocus?: boolean); } interface HighlightedOptionProps<OptionType> { options: readonly OptionType[]; isHighlightable: (option: OptionType) => boolean; } export interface HighlightedOptionState<OptionType> { highlightType: HighlightType; highlightedIndex: number; highlightedOption?: OptionType; } export interface HighlightedOptionHandlers<OptionType> { setHighlightedIndexWithMouse(index: number, moveFocus?: boolean): void; moveHighlightWithKeyboard(direction: -1 | 1): void; highlightOptionWithKeyboard(option: OptionType): void; resetHighlightWithKeyboard(): void; goHomeWithKeyboard(): void; goEndWithKeyboard(): void; } export declare function useHighlightedOption<OptionType>({ options, isHighlightable, }: HighlightedOptionProps<OptionType>): [HighlightedOptionState<OptionType>, HighlightedOptionHandlers<OptionType>]; export {}; //# sourceMappingURL=use-highlight-option.d.ts.map