import { type ForwardedRef, type ReactElement, type ReactNode } from "react";
export interface AutocompleteOption<T = string> {
    label: string;
    value: T;
}
export type AutocompleteInputChangeReason = 'input' | 'reset' | 'clear';
interface AutocompleteBaseProps<T = string> {
    /** Available options to select from */
    options: AutocompleteOption<T>[];
    /** 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;
    /** Error message displayed below the field */
    error?: string;
    /** Custom filter function */
    filterOptions?: (options: AutocompleteOption<T>[], inputValue: string) => AutocompleteOption<T>[];
    /** Render custom option content */
    renderOption?: (option: AutocompleteOption<T>, 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;
    /** 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<T = string> extends AutocompleteBaseProps<T> {
    /** Single-select mode (default) */
    multiple?: false;
    /** Currently selected value */
    value: T | null;
    /** Callback when selection changes */
    onChange: (value: T | null) => void;
}
export interface AutocompleteMultipleProps<T = string> extends AutocompleteBaseProps<T> {
    /** 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<T>) => 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<T = string> = AutocompleteSingleProps<T> | AutocompleteMultipleProps<T>;
type AutocompleteComponent = {
    <T = string>(props: AutocompleteMultipleProps<T> & {
        ref?: ForwardedRef<HTMLDivElement>;
    }): ReactElement;
    <T = string>(props: AutocompleteSingleProps<T> & {
        ref?: ForwardedRef<HTMLDivElement>;
    }): ReactElement;
};
export declare const Autocomplete: AutocompleteComponent;
export {};
//# sourceMappingURL=autocomplete.d.ts.map