import type { AriaAttributes, HTMLAttributes } from 'react';
import React from 'react';
import type { Nullable } from '../../typings/utility-types';
import type { InputIconType, Input, ShowClearIcon } from '../../components/Input';
import type { Menu } from '../Menu';
import type { InputLikeText } from '../InputLikeText';
import type { MenuItemState } from '../../components/MenuItem';
import type { CommonProps } from '../CommonWrapper';
import type { TGetRootNode } from '../../lib/rootNode';
import type { ComboBoxExtendedItem, ComboBoxViewMode } from '../../components/ComboBox';
import type { SizeProp } from '../../lib/types/props';
import type { MaskedInputOnBeforePasteValue, MaskedInputProps } from '../../components/MaskedInput';
import type { InternalTextareaWithLayout } from '../InternalTextareaWithLayout/InternalTextareaWithLayout';
import { ComboBoxRequestStatus } from './CustomComboBoxTypes';
export * from './tids';
export interface CustomComboBoxProps<T> extends Pick<AriaAttributes, 'aria-describedby' | 'aria-label'>, Pick<HTMLAttributes<HTMLElement>, 'id'>, CommonProps, Partial<Pick<MaskedInputProps, 'mask' | 'maskChar' | 'formatChars'>> {
    align?: 'left' | 'center' | 'right';
    autoFocus?: boolean;
    borderless?: boolean;
    disablePortal?: boolean;
    disabled?: boolean;
    /**
     * Cостояние валидации при ошибке.
     */
    error?: boolean;
    maxLength?: number;
    /**
     * Позволяет вручную задать текущую позицию выпадающего окна
     */
    menuPos?: 'top' | 'bottom';
    menuAlign?: 'left' | 'right';
    drawArrow?: boolean;
    leftIcon?: InputIconType;
    rightIcon?: InputIconType;
    searchOnFocus?: boolean;
    onValueChange?: (value: T) => void;
    onInputValueChange?: (value: string) => Nullable<string> | void;
    onUnexpectedInput?: (value: string) => void | null | T;
    onFocus?: () => void;
    onBlur?: () => void;
    onMouseEnter?: (e: React.MouseEvent) => void;
    onMouseOver?: (e: React.MouseEvent) => void;
    onMouseLeave?: (e: React.MouseEvent) => void;
    onInputKeyDown?: (e: React.KeyboardEvent<HTMLElement>) => void;
    placeholder?: string;
    size?: SizeProp;
    totalCount?: number;
    value?: Nullable<T>;
    showClearIcon?: ShowClearIcon;
    /**
     * Cостояние валидации при предупреждении.
     */
    warning?: boolean;
    width?: string | number;
    maxMenuHeight?: number | string;
    renderNotFound?: () => React.ReactNode;
    renderTotalCount?: (found: number, total: number) => React.ReactNode;
    renderItem: (item: T, state?: MenuItemState) => React.ReactNode;
    itemWrapper?: (item: T) => React.ComponentType;
    renderValue: (value: T) => React.ReactNode;
    renderAddButton?: (query?: string) => React.ReactNode;
    valueToString: (value: T) => string;
    itemToValue: (item: T) => string | number;
    getItems: (query: string) => Promise<Array<ComboBoxExtendedItem<T>>>;
    inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];
    onBeforePasteInMask?: MaskedInputOnBeforePasteValue;
    viewMode?: ComboBoxViewMode;
    maxRows?: number;
}
export interface CustomComboBoxState<T> {
    editing: boolean;
    loading: boolean;
    opened: boolean;
    textValue: string;
    items: Nullable<Array<ComboBoxExtendedItem<T>>>;
    inputChanged: boolean;
    focused: boolean;
    repeatRequest: () => void;
    requestStatus: ComboBoxRequestStatus;
}
export declare const DELAY_BEFORE_SHOW_LOADER = 300;
export declare const LOADER_SHOW_TIME = 1000;
export declare const DefaultState: {
    inputChanged: boolean;
    editing: boolean;
    items: null;
    loading: boolean;
    opened: boolean;
    focused: boolean;
    textValue: string;
    repeatRequest: () => undefined;
    requestStatus: ComboBoxRequestStatus;
};
export declare class CustomComboBox<T> extends React.PureComponent<CustomComboBoxProps<T>, CustomComboBoxState<T>> {
    static __KONTUR_REACT_UI__: string;
    static displayName: string;
    state: CustomComboBoxState<T>;
    input: Nullable<Input | InternalTextareaWithLayout>;
    menu: Nullable<Menu>;
    inputLikeText: Nullable<InputLikeText>;
    requestId: number;
    loaderShowDelay: Nullable<Promise<void>>;
    private focused;
    private cancelationToken;
    private isMobileLayout;
    private featureFlags;
    private canOpenPopup;
    private reducer;
    cancelLoaderDelay: () => void;
    /**
     * @public
     */
    focus: (opts?: {
        withoutOpenDropdown?: boolean;
    }) => void;
    /**
     * @public
     */
    selectInputText: () => void;
    /**
     * @public
     */
    blur: () => void;
    getRootNode: TGetRootNode;
    private setRootNode;
    private size;
    /**
     * @public
     */
    search(query?: string): Promise<void>;
    /**
     * @public
     */
    cancelSearch(): void;
    /**
     * @public
     */
    open(): void;
    /**
     * @public
     */
    close(): void;
    render(): React.JSX.Element;
    componentDidMount(): void;
    componentDidUpdate(prevProps: CustomComboBoxProps<T>, prevState: CustomComboBoxState<T>): void;
    /**
     * @public
     */
    reset(): void;
    private dispatch;
    private handleEffect;
    private getProps;
    private getState;
    private handleValueChange;
    private handleFocus;
    private handleMobileClose;
    private handleClickOutside;
    private handleBlur;
    private handleInputBlur;
    private handleInputClick;
}
