@awsui/components-react
Version:
AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A
34 lines (33 loc) • 1.2 kB
TypeScript
interface IsInteractive<T> {
(option?: T): boolean;
}
interface WithinRange<T> {
(items: ReadonlyArray<T>, index: number): boolean;
}
interface MoveHighlight {
(direction: -1 | 1, startIndex?: number): void;
}
interface CreateMoveHighlight {
<T>(items: ReadonlyArray<T>, callback: (index: number) => void, isInteractive: IsInteractive<T>, withinRange: WithinRange<T>): MoveHighlight;
}
interface UseHighlightedOption {
<T>(inputProps: {
options: ReadonlyArray<T>;
isInteractive: IsInteractive<T>;
scrollToIndex?: (index: number) => void;
withinRange?: WithinRange<T>;
}): {
highlightedOption?: T;
moveHighlight: (direction: -1 | 1, startIndex?: number) => void;
resetHighlight: () => void;
setHighlightedIndex: (index: number) => void;
highlightedIndex: number;
goHome: () => void;
goEnd: () => void;
highlightOption: (option: T) => void;
};
}
export declare const createMoveHighlight: CreateMoveHighlight;
export declare const __withinRange: (items: ReadonlyArray<any>, index: number) => boolean;
export declare const useHighlightedOption: UseHighlightedOption;
export {};