import { AutocompleteChangeReason, AutocompleteProps, AutocompleteRenderGroupParams, AutocompleteRenderOptionState, PopperProps, SxProps, TextFieldProps } from '@mui/material'; import { HTMLAttributes, JSXElementConstructor, KeyboardEvent, ReactNode, Ref, SyntheticEvent } from 'react'; interface ActionOption { label?: ReactNode; onClick?: () => void; value?: unknown; isActionOption?: boolean; isActionStartOption?: boolean; } export interface ApiAutocompleteProps { /** * Action row appended at the end of the options list */ actionEndOption?: ActionOption; /** * Action row pinned at the top of the options list (e.g. a "create new…" entry) */ actionStartOption?: ActionOption; /** Replaces the default dropdown caret (e.g. a switcher's up/down chevrons). */ popupIcon?: ReactNode; limitTags?: number; defaultValue?: Value; value?: Multiple extends true ? Value[] | null : Value | null; label?: string; placeholder?: string; name?: string; keyOptionLabel: string | string[]; noOptionsText?: ReactNode; getOptionLabel?: (option: Value) => string; renderOption?: (props: HTMLAttributes, option: Value & ActionOption, state: AutocompleteRenderOptionState) => ReactNode; searchKey?: string; required?: boolean; queryParams?: Record; queryParamsOnFocus?: Record; queryOptions?: Record; helperMessage?: string | false; disabled?: boolean; disableClearable?: DisableClearable; width?: number | string; sx?: SxProps; error?: boolean; openOnFocus?: boolean; autoHighlight?: boolean; getOptionKey?: (option: Value) => string; size?: AutocompleteProps["size"]; renderInput?: AutocompleteProps["renderInput"]; InputProps?: TextFieldProps["InputProps"]; setSelectedValue?: (value: Multiple extends true ? Value[] | null : Value | null) => void; shrink?: boolean; onFocus?: () => void; onBlur?: () => void; variant?: "standard" | "outlined" | "filled"; endAdornment?: ReactNode; /** Hide the circular loader shown in the input while fetching; the listbox loading state is unaffected. */ disableInputLoader?: boolean; fetchOnFocus?: boolean; filterOptions?: (options: Value[], state: { inputValue: string; }) => Value[]; groupBy?: (option: Value) => string; slotProps?: AutocompleteProps["slotProps"]; inputSlotProps?: TextFieldProps["slotProps"]; disableCloseOnSelect?: boolean; PopperComponent?: JSXElementConstructor; ListboxProps?: AutocompleteProps["ListboxProps"]; renderGroup?: (params: AutocompleteRenderGroupParams) => ReactNode; filterSelectedOptions?: boolean; inputRef?: Ref; multiple?: Multiple; open?: boolean; onOpen?: () => void; onClose?: () => void; blurOnSelect?: "touch" | "mouse" | true | false; autoFocus?: boolean; onKeyDown?: (event: KeyboardEvent) => void; onNoResults?: (search: string) => void; /** Resolves the option `image` field to a displayable URL (e.g. a CDN path adapter). Identity by default. */ getOptionImageSrc?: (imagePath: string) => string | undefined; onChange?(event: SyntheticEvent, value: Value | Value[] | null, reason: AutocompleteChangeReason): void; /** * Injected query hook. Structurally typed so any data layer fits (react-query hooks match as-is) * without making the library depend on one. */ useQuery(params?: Record, options?: { query: { enabled: boolean; }; }): { data?: Value[]; isFetching: boolean; refetch: (refetchOptions?: Record) => Promise; }; } declare const ApiAutocomplete: >({ actionEndOption, actionStartOption, popupIcon, blurOnSelect, label, placeholder, name, slotProps, disableClearable, setSelectedValue, useQuery, noOptionsText, renderOption, getOptionLabel: getOptionLabelProp, keyOptionLabel, queryParams, openOnFocus, autoHighlight, queryParamsOnFocus, queryOptions, required, helperMessage, error, disabled, defaultValue, onFocus, onBlur, onChange, sx, renderInput, variant, InputProps, size, shrink, getOptionKey, width, limitTags, groupBy, disableCloseOnSelect, renderGroup, value, PopperComponent, ListboxProps, multiple, filterSelectedOptions, autoFocus, onKeyDown, onNoResults, endAdornment, inputSlotProps, inputRef, open, onOpen, onClose, searchKey, disableInputLoader, fetchOnFocus, filterOptions, getOptionImageSrc, }: ApiAutocompleteProps) => import("@emotion/react/jsx-runtime").JSX.Element; export default ApiAutocomplete;