@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
39 lines (38 loc) • 1.5 kB
TypeScript
import React from 'react';
import { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';
import { MutableRefObject } from 'react';
import { FireLoadItems } from './use-load-items';
import { OptionsListProps } from '../../internal/components/options-list';
import { ItemProps } from '../parts/item';
export declare type MenuProps = Omit<OptionsListProps, 'children'> & {
ref: React.RefObject<HTMLUListElement>;
};
export declare type GetOptionProps = (option: DropdownOption, index: number) => ItemProps;
interface UseSelect {
(inputProps: {
selectedOptions: ReadonlyArray<OptionDefinition>;
updateSelectedOption: (option: OptionDefinition) => void;
options: ReadonlyArray<DropdownOption>;
filteringType: string;
keepOpen?: boolean;
rootRef: MutableRefObject<HTMLElement | undefined>;
externalRef: React.Ref<any>;
multiSelection?: boolean;
fireLoadItems: FireLoadItems;
setFilteringValue: (value: string) => void;
scrollToIndex?: (index: number) => void;
}): {
isOpen: boolean;
highlightedOption?: DropdownOption;
getTriggerProps: any;
getMenuProps: () => MenuProps;
getDropdownProps: any;
getFilterProps: any;
getOptionProps: GetOptionProps;
isKeyboard: boolean;
resetHighlight: () => void;
announceSelected: boolean;
};
}
export declare const useSelect: UseSelect;
export {};