import { IconComponent, IconPropSize } from '@consta/icons/Icon';
import React from 'react';
import { PropForm, PropSize, PropStatus, PropView, RenderItemProps } from '../SelectComponents/types';
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
export type ComboboxItemDefault = {
    label: string;
    id: string | number;
    groupId?: string | number;
    disabled?: boolean;
};
export type ComboboxGroupDefault = {
    label: string;
    id: string | number;
};
type RenderValueProps<ITEM> = {
    item: ITEM;
    handleRemove?: (e: React.SyntheticEvent) => void;
};
export type ComboboxPropGetItemLabel<ITEM> = (item: ITEM) => string;
export type ComboboxPropGetItemKey<ITEM> = (item: ITEM) => string | number;
export type ComboboxPropGetItemGroupKey<ITEM> = (item: ITEM) => string | number | undefined;
export type ComboboxPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
export type ComboboxPropGetGroupKey<GROUP> = (group: GROUP) => string | number;
export type ComboboxPropGetGroupLabel<GROUP> = (group: GROUP) => string;
type ComboboxPropSearchFunction<ITEM> = (item: ITEM, searchValue: string) => boolean;
type ComboboxPropOnChange<ITEM, MULTIPLE extends boolean> = (value: (MULTIPLE extends true ? ITEM[] : ITEM) | null, props: {
    e: React.SyntheticEvent;
}) => void;
type ComboboxPropValue<ITEM, MULTIPLE extends boolean> = (MULTIPLE extends true ? ITEM[] : ITEM) | null | undefined;
export type ComboboxPropRenderItem<ITEM> = (props: RenderItemProps<ITEM>) => React.ReactElement | null;
export type ComboboxPropRenderValue<ITEM> = (props: RenderValueProps<ITEM>) => React.ReactElement | null;
type ComboboxPropOnCreate = (label: string, props: {
    e: React.SyntheticEvent;
}) => void;
export type ComboboxProps<ITEM = ComboboxItemDefault, GROUP = ComboboxGroupDefault, MULTIPLE extends boolean = false> = PropsWithHTMLAttributesAndRef<{
    items: ITEM[];
    onChange: ComboboxPropOnChange<ITEM, MULTIPLE>;
    disabled?: boolean;
    form?: PropForm;
    dropdownForm?: 'default' | 'brick' | 'round';
    size?: PropSize;
    view?: PropView;
    placeholder?: string;
    ariaLabel?: string;
    status?: PropStatus;
    isLoading?: boolean;
    dropdownClassName?: string;
    dropdownRef?: React.Ref<HTMLDivElement>;
    name?: string;
    renderItem?: ComboboxPropRenderItem<ITEM>;
    renderValue?: ComboboxPropRenderValue<ITEM>;
    onFocus?: React.FocusEventHandler<HTMLInputElement>;
    onBlur?: React.FocusEventHandler<HTMLInputElement>;
    onCreate?: ComboboxPropOnCreate;
    inputRef?: React.Ref<HTMLInputElement>;
    labelForNotFound?: string;
    required?: boolean;
    labelForCreate?: string;
    labelForEmptyItems?: string;
    searchFunction?: ComboboxPropSearchFunction<ITEM>;
    searchValue?: string;
    multiple?: MULTIPLE;
    value?: ComboboxPropValue<ITEM, MULTIPLE>;
    groups?: GROUP[];
    getItemLabel?: ComboboxPropGetItemLabel<ITEM>;
    getItemKey?: ComboboxPropGetItemKey<ITEM>;
    getItemGroupKey?: ComboboxPropGetItemGroupKey<ITEM>;
    getItemDisabled?: ComboboxPropGetItemDisabled<ITEM>;
    getGroupLabel?: ComboboxPropGetGroupLabel<GROUP>;
    getGroupKey?: ComboboxPropGetGroupKey<GROUP>;
    label?: string;
    labelIcon?: IconComponent;
    caption?: string;
    labelPosition?: 'top' | 'left';
    virtualScroll?: boolean;
    onScrollToBottom?: (length: number) => void;
    onSearchValueChange?: (value: string) => void;
    onDropdownOpen?: (isOpen: boolean) => void;
    dropdownOpen?: boolean;
    ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;
}, HTMLDivElement> & (MULTIPLE extends true ? {
    selectAll?: boolean;
    allSelectedAllLabel?: string;
} : {
    selectAll?: never;
    allSelectedAllLabel?: never;
}) & (ITEM extends {
    label: ComboboxItemDefault['label'];
} ? {} : {
    getItemLabel: ComboboxPropGetItemLabel<ITEM>;
}) & (ITEM extends {
    id: ComboboxItemDefault['id'];
} ? {} : {
    getItemKey: ComboboxPropGetItemKey<ITEM>;
}) & (GROUP extends {
    label: ComboboxGroupDefault['label'];
} ? {} : {
    getGroupLabel: ComboboxPropGetGroupLabel<GROUP>;
}) & (GROUP extends {
    id: ComboboxGroupDefault['id'];
} ? {} : {
    getGroupKey: ComboboxPropGetGroupKey<GROUP>;
});
export type ComboboxComponent = <ITEM = ComboboxItemDefault, GROUP = ComboboxGroupDefault, MULTIPLE extends boolean = false>(props: ComboboxProps<ITEM, GROUP, MULTIPLE>) => React.ReactElement | null;
export declare const defaultGetItemKey: ComboboxPropGetItemKey<ComboboxItemDefault>;
export declare const defaultGetItemLabel: ComboboxPropGetItemLabel<ComboboxItemDefault>;
export declare const defaultGetItemGroupKey: ComboboxPropGetItemGroupKey<ComboboxItemDefault>;
export declare const defaultGetItemDisabled: ComboboxPropGetItemDisabled<ComboboxItemDefault>;
export declare const defaultGetGroupKey: ComboboxPropGetGroupKey<ComboboxGroupDefault>;
export declare const defaultGetGroupLabel: ComboboxPropGetGroupLabel<ComboboxGroupDefault>;
export declare const isMultipleParams: <ITEM, GROUP>(params: ComboboxProps<ITEM, GROUP, boolean>) => params is ComboboxProps<ITEM, GROUP, true>;
export declare const isNotMultipleParams: <ITEM, GROUP>(params: ComboboxProps<ITEM, GROUP, boolean>) => params is ComboboxProps<ITEM, GROUP, false>;
export declare function withDefaultGetters<ITEM = ComboboxItemDefault, GROUP = ComboboxGroupDefault, MULTIPLE extends boolean = false>(props: ComboboxProps<ITEM, GROUP, MULTIPLE>): {
    items: ITEM[];
    onChange: ComboboxPropOnChange<ITEM, MULTIPLE>;
    disabled?: boolean;
    form?: PropForm;
    dropdownForm?: "default" | "brick" | "round";
    size?: PropSize;
    view?: PropView;
    placeholder?: string;
    ariaLabel?: string;
    status?: PropStatus;
    isLoading?: boolean;
    dropdownClassName?: string;
    dropdownRef?: React.Ref<HTMLDivElement>;
    name?: string;
    renderItem?: ComboboxPropRenderItem<ITEM> | undefined;
    renderValue?: ComboboxPropRenderValue<ITEM> | undefined;
    onFocus?: React.FocusEventHandler<HTMLInputElement>;
    onBlur?: React.FocusEventHandler<HTMLInputElement>;
    onCreate?: ComboboxPropOnCreate;
    inputRef?: React.Ref<HTMLInputElement>;
    labelForNotFound?: string;
    required?: boolean;
    labelForCreate?: string;
    labelForEmptyItems?: string;
    searchFunction?: ComboboxPropSearchFunction<ITEM> | undefined;
    searchValue?: string;
    multiple?: MULTIPLE | undefined;
    value?: ComboboxPropValue<ITEM, MULTIPLE>;
    groups?: GROUP[] | undefined;
    getItemLabel?: ComboboxPropGetItemLabel<ITEM> | undefined;
    getItemKey?: ComboboxPropGetItemKey<ITEM> | undefined;
    getItemGroupKey?: ComboboxPropGetItemGroupKey<ITEM> | undefined;
    getItemDisabled?: ComboboxPropGetItemDisabled<ITEM> | undefined;
    getGroupLabel?: ComboboxPropGetGroupLabel<GROUP> | undefined;
    getGroupKey?: ComboboxPropGetGroupKey<GROUP> | undefined;
    label?: string;
    labelIcon?: IconComponent;
    caption?: string;
    labelPosition?: "top" | "left";
    virtualScroll?: boolean;
    onScrollToBottom?: (length: number) => void;
    onSearchValueChange?: (value: string) => void;
    onDropdownOpen?: (isOpen: boolean) => void;
    dropdownOpen?: boolean;
    ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;
} & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "size" | "view" | "caption" | "form" | "label" | "status" | "name" | "disabled" | "value" | "multiple" | "required" | "inputRef" | "items" | "dropdownForm" | "ariaLabel" | "dropdownClassName" | "dropdownRef" | "isLoading" | "labelForEmptyItems" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey" | "labelIcon" | "labelPosition" | "onScrollToBottom" | "labelForCreate" | "searchFunction" | "searchValue" | "onDropdownOpen" | "onSearchValueChange" | "dropdownOpen" | "ignoreOutsideClicksRefs" | "labelForNotFound" | "virtualScroll" | "onCreate"> & React.RefAttributes<HTMLDivElement> & (MULTIPLE extends true ? {
    selectAll?: boolean;
    allSelectedAllLabel?: string;
} : {
    selectAll?: never;
    allSelectedAllLabel?: never;
}) & (ITEM extends {
    label: ComboboxItemDefault["label"];
} ? {} : {
    getItemLabel: ComboboxPropGetItemLabel<ITEM>;
}) & (ITEM extends {
    id: ComboboxItemDefault["id"];
} ? {} : {
    getItemKey: ComboboxPropGetItemKey<ITEM>;
}) & (GROUP extends {
    label: ComboboxGroupDefault["label"];
} ? {} : {
    getGroupLabel: ComboboxPropGetGroupLabel<GROUP>;
}) & (GROUP extends {
    id: ComboboxGroupDefault["id"];
} ? {} : {
    getGroupKey: ComboboxPropGetGroupKey<GROUP>;
}) & {
    getItemLabel: ComboboxPropGetItemLabel<ComboboxItemDefault> | ComboboxPropGetItemLabel<ITEM>;
    getItemKey: ComboboxPropGetItemKey<ComboboxItemDefault> | ComboboxPropGetItemKey<ITEM>;
    getItemGroupKey: ComboboxPropGetItemGroupKey<ComboboxItemDefault> | ComboboxPropGetItemGroupKey<ITEM>;
    getItemDisabled: ComboboxPropGetItemDisabled<ComboboxItemDefault> | ComboboxPropGetItemDisabled<ITEM>;
    getGroupLabel: ComboboxPropGetGroupLabel<ComboboxGroupDefault> | ComboboxPropGetGroupLabel<GROUP>;
    getGroupKey: ComboboxPropGetGroupKey<ComboboxGroupDefault> | ComboboxPropGetGroupKey<GROUP>;
};
export declare const clearSizeMap: Record<PropSize, IconPropSize>;
export declare const iconSizeMap: Record<PropSize, IconPropSize>;
export {};
