import { type ForwardedRef, type ReactElement, type ReactNode } from "react"; export interface AutocompleteOption { label: string; value: T; } export type AutocompleteInputChangeReason = 'input' | 'reset' | 'clear'; interface AutocompleteBaseProps { /** Available options to select from */ options: AutocompleteOption[]; /** Placeholder text */ placeholder?: string; /** Whether the component is disabled */ disabled?: boolean; /** Element displayed at the start of the input */ startAdornment?: ReactNode; /** Whether to show clear button */ showClearAll?: boolean; /** Custom className for the container */ className?: string; /** Custom className for the dropdown */ dropdownClassName?: string; /** When true, allows creating new options by typing */ freeSolo?: boolean; /** Label for the input */ label?: string; /** Label scale forwarded to FieldWrapper ("large" = text-h4 for designs with body-scale field titles) */ labelVariant?: "default" | "large"; /** Error message displayed below the field */ error?: string; /** Custom filter function */ filterOptions?: (options: AutocompleteOption[], inputValue: string) => AutocompleteOption[]; /** Render custom option content */ renderOption?: (option: AutocompleteOption, isSelected: boolean) => ReactNode; /** When true, shows validation error styling */ invalid?: boolean; /** No options text */ noOptionsText?: string; /** Controlled input value. When provided, the component won't manage input state internally. */ inputValue?: string; /** Callback when input value changes (typing, selection, clearing). Fires in both controlled and uncontrolled modes. */ onInputChange?: (value: string, reason: AutocompleteInputChangeReason) => void; /** Loading state */ loading?: boolean; /** Loading text */ loadingText?: string; /** When true, shows a clickable "+ Create" option when no results match the input */ creatable?: boolean; /** Callback fired after a new option is created via creatable. Use it to persist the new option server-side, etc. */ onCreateOption?: (inputValue: string) => void; /** Max length for a created option. When exceeded, creation is blocked and a hint is shown. Omit for no limit. */ maxCreateLength?: number; /** When set, each unselected option shows a hover trash button that calls this. Omit to hide delete. */ onDeleteOption?: (value: T) => void; isDeletingOption?: boolean; /** When true, disables built-in client-side filtering (useful when options are filtered server-side via onInputChange) */ disableClientFilter?: boolean; /** Whether to show the chevron icon. Default true */ showChevron?: boolean; /** Whether to clear the input when the dropdown opens (single mode only). Default true */ clearOnOpen?: boolean; } export interface AutocompleteSingleProps extends AutocompleteBaseProps { /** Single-select mode (default) */ multiple?: false; /** Currently selected value */ value: T | null; /** Callback when selection changes */ onChange: (value: T | null) => void; } export interface AutocompleteMultipleProps extends AutocompleteBaseProps { /** Enable multi-select mode */ multiple: true; /** Currently selected values */ value: T[]; /** Callback when selection changes */ onChange: (value: T[]) => void; /** Maximum number of items that can be selected */ maxItems?: number; /** Render custom tag content */ renderTag?: (option: AutocompleteOption) => ReactNode; /** Maximum number of visible tags. Set to "auto" for automatic calculation based on available width. Default "auto" */ limitTags?: number | "auto"; /** Custom render function for the "+N" overflow chip */ getLimitTagsText?: (more: number) => ReactNode; } export type AutocompleteProps = AutocompleteSingleProps | AutocompleteMultipleProps; type AutocompleteComponent = { (props: AutocompleteMultipleProps & { ref?: ForwardedRef; }): ReactElement; (props: AutocompleteSingleProps & { ref?: ForwardedRef; }): ReactElement; }; export declare const Autocomplete: AutocompleteComponent; export {}; //# sourceMappingURL=autocomplete.d.ts.map