import { MutableRefObject, RefObject } from 'react'; import type { VirtuosoHandle } from 'react-virtuoso'; import type { FormControlOptions, SystemStyleObject } from '@chakra-ui/react'; import type { UseComboboxPropGetters, UseComboboxState } from 'downshift'; import { ComboboxItem } from './types'; export interface SharedSelectContextReturnProps { /** Set to true to enable search, defaults to `true` */ isSearchable?: boolean; /** Set to true to allow clearing of input, defaults to `true` */ isClearable?: boolean; /** Nothing found label. Defaults to "No matching results" */ nothingFoundLabel?: string; /** aria-label for clear button. Defaults to "Clear selection" */ clearButtonLabel?: string; /** * Placeholder to show in the input field. * Defaults to "Select an option". * Set to `null` to hide the placeholder. */ placeholder?: string | null; /** ID of input itself, for a11y purposes */ name: string; /** Item data used to render items in dropdown */ items: Item[]; size?: 'xs' | 'sm' | 'md'; } interface SelectContextReturn extends UseComboboxPropGetters, UseComboboxState, Required>, FormControlOptions { isItemSelected: (item: ComboboxItem) => boolean; closeMenu: () => void; toggleMenu: () => void; selectItem: (item: Item) => void; styles: Record; isFocused: boolean; setIsFocused: (isFocused: boolean) => void; inputRef?: MutableRefObject; /** aria-describedby to be attached to the combobox input, if any. */ inputAria?: { id: string; label: string; }; resetInputValue: () => void; /** Ref for list virtualization */ virtualListRef: RefObject; /** Height to assign to virtual list */ virtualListHeight: number; } export declare const SelectContext: import("react").Context | undefined>; export declare const useSelectContext: () => SelectContextReturn; export {};