import { SimpleInputProps } from "./Input"; import { SearchProps } from "./Search"; import { Extras } from "./OptionGroup"; import { Omit } from "utility-types"; import { Placement, Modifiers } from "popper.js"; export interface CommonSelectProps { className?: string; placeholder: string; required?: boolean; errorMessage?: string; value?: string; onClear?: () => void; searchBox?: boolean; searchBoxProps?: Omit; dropdownClassName?: string; arrowClassName?: string; inputProps?: Omit; fullWidthDropdown?: boolean; onDropdownToggle?: (isOpen: boolean) => void; disabled?: boolean; children: React.ReactNode; isSelected?: (value: OptionType) => boolean; placement?: Placement; modifiers?: Modifiers; } export interface SingleSelectProps extends CommonSelectProps { multiSelect?: false; onChange: (value: OptionType, extras: Extras) => void; /** * @deprecated use isSelected */ selected?: OptionType; } export interface MultiSelectProps extends CommonSelectProps { multiSelect: true; onChange: (value: OptionType[], extras: Extras) => void; onApply?: (value: OptionType[], props: SelectProps) => void; /** * @deprecated use isSelected */ selected?: OptionType[]; } export type SelectProps = | SingleSelectProps | MultiSelectProps;