import { AutocompleteChangeReason, AutocompleteFreeSoloValueMapping, AutocompleteInputChangeReason, AutocompleteProps as MUIAutocompleteProps, Theme } from '@mui/material';
import { Sizes } from '@m4l/styles';
import { ChangeEvent, ReactElement, ReactNode } from 'react';
import { TextFieldProps } from '../TextField/types';
import { AUTOCOMPLETE_KEY_COMPONENT } from './constants';
import { AutocompleteSlots } from './slots';
import { M4LOverridesStyleRules } from '../../../../@types/augmentations';
export type GetOptionString<T> = (option: T | null) => string;
export type AutocompleteVariants = 'outlined' | 'text';
export interface BaseAutocompleteProps {
    /**
     * The size of the autocomplete input field.
     */
    size?: Extract<Sizes, 'small' | 'medium'>;
    /**
     * The variant of the autocomplete (e.g., outlined, contained, text).
     */
    variant?: AutocompleteVariants;
    /**
     * Custom data-testid for testing purposes.
     */
    dataTestid?: string;
}
export type AdornmentType = ReactElement | string;
/**
 * Props for the unified Autocomplete component.
 * Supports both single and multiple selection, and two types: `text` and `image`.
 */
export interface AutocompleteProps<T, Multiple extends boolean | undefined> extends Pick<MUIAutocompleteProps<T, Multiple, undefined, false>, 'options' | 'onOpen' | 'onClose' | 'loading' | 'disabled'>, Pick<TextFieldProps, 'error'>, BaseAutocompleteProps {
    /**
     * Indica si el campo de texto está en modo de solo lectura.
     * readOnly={true}
     */
    readOnly?: boolean;
    /**
     * The placeholder of the autocomplete.
     * placeholder={}
     */
    placeholder?: string;
    /**
     * Whether multiple selections are allowed.
     * multiple={true}
     */
    multiple?: boolean;
    /**
     * The value of the autocomplete, supports single or multiple selection.
     * Extended to include `null` for controlled components.
     */
    value: T | T[] | null | undefined;
    /**
     *
     * Function to get the label for a given option.
     */
    getOptionLabel: (option: T | AutocompleteFreeSoloValueMapping<false>) => string;
    /**
     * Function to get the start adornment for a given option.
     */
    getOptionStartAdornment?: (option: T) => ResourceType;
    /**
     * Function to get the description for a given option.
     */
    getOptionDescription?: (option: T) => string;
    /**
     * Function to get the end adornment for a given option.
     */
    getOptionEndAdornment?: (option: T) => ResourceType;
    /**
     * Function to compare if an option matches the selected value.
     */
    isOptionEqualToValue: (option: T, value: T) => boolean;
    /**
     * Function to refresh the options.
     */
    refresh?: () => void;
    /**
     * Callback for filtering options based on user input.
     */
    onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
    /**
     * Function to get the image URL for a given option (only for `type: 'image'`).
     * @deprecated Use getOptionStartAdornment or getOptionEndAdornment instead.
     */
    getOptionUrlImage?: (option: T) => string;
    /**
     * se cambia el nativo de Autocomplete por este, debido a que el value esta disponible para procesar
     * Handler for when the selected value changes.
     */
    onChange: (event: ChangeEvent<{}> | undefined, value: T | T[] | null, reason: AutocompleteChangeReason) => void;
    /**
     * "htmlFor" attribute for the autocomplete field.
     */
    htmlFor?: string;
    /**
     * Icono o adorno que se muestra al inicio del autocomplete.
     */
    startAdornment?: ReactElement;
    /**
     * Element rendered in the end-adornment slot (before the chevron, same position as the refresh icon).
     * Use to inject static action buttons on the right side of the input (e.g. a map toggle button).
     */
    endAdornment?: ReactElement;
    /**
     * Clase de css para el autocomplete.
     */
    className?: string;
}
export type ResourceType = {
    resource: ReactNode;
    type?: 'icon' | 'image';
};
/**
 * Represents the owner state of the Autocomplete component for styling purposes.
 */
export type AutocompleteOwnerState = {
    error?: boolean;
    disabled?: boolean;
    multiple?: boolean;
    readOnly?: boolean;
    startAdornment?: boolean;
    hasChips?: boolean;
    size: BaseAutocompleteProps['size'];
    variant: BaseAutocompleteProps['variant'];
};
/**
 * Defines the types of Slots available for the Autocomplete.
 */
export type AutocompleteSlotsType = keyof typeof AutocompleteSlots;
/**
 * Styles applicable to the Autocomplete using themes and custom slots.
 */
export type AutocompleteStyles = M4LOverridesStyleRules<AutocompleteSlotsType, typeof AUTOCOMPLETE_KEY_COMPONENT, Theme>;
//# sourceMappingURL=types.d.ts.map