import { IconComponent, IconPropSize } from '@consta/icons/Icon';
import React from 'react';
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
import { PropForm, PropSize, PropStatus, PropView, RenderItemProps } from '../SelectComponents/types';
export type SelectItemDefault = {
    label: string;
    id: string | number;
    groupId?: string | number;
    disabled?: boolean;
};
export type SelectGroupDefault = {
    label: string;
    id: string | number;
};
type SelectPropValue<ITEM> = ITEM | null | undefined;
type SelectRenderValueProps<ITEM> = {
    item: ITEM;
};
export type SelectPropGetItemLabel<ITEM> = (item: ITEM) => string;
export type SelectPropGetItemKey<ITEM> = (item: ITEM) => string | number;
export type SelectPropGetItemGroupKey<ITEM> = (item: ITEM) => string | number | undefined;
export type SelectPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
export type SelectPropGetGroupKey<GROUP> = (group: GROUP) => string | number;
export type SelectPropGetGroupLabel<GROUP> = (group: GROUP) => string;
export type PropRenderItem<ITEM> = (props: RenderItemProps<ITEM>) => React.ReactElement | null;
export type PropRenderValue<ITEM> = (props: SelectRenderValueProps<ITEM>) => React.ReactElement | null;
export type SelectPropOnChange<ITEM> = (value: ITEM | null, props: {
    e: React.SyntheticEvent;
}) => void;
export type SelectProps<ITEM = SelectItemDefault, GROUP = SelectGroupDefault> = PropsWithHTMLAttributesAndRef<{
    items: ITEM[];
    onChange: SelectPropOnChange<ITEM>;
    disabled?: boolean;
    form?: PropForm;
    dropdownForm?: 'default' | 'brick' | 'round';
    size?: PropSize;
    view?: PropView;
    status?: PropStatus;
    focused?: boolean;
    placeholder?: string;
    ariaLabel?: string;
    dropdownClassName?: string;
    dropdownRef?: React.RefObject<HTMLDivElement>;
    required?: boolean;
    name?: string;
    isLoading?: boolean;
    labelForEmptyItems?: string;
    value?: SelectPropValue<ITEM>;
    renderItem?: PropRenderItem<ITEM>;
    renderValue?: PropRenderValue<ITEM>;
    onFocus?: React.FocusEventHandler<HTMLInputElement>;
    onBlur?: React.FocusEventHandler<HTMLInputElement>;
    inputRef?: React.RefObject<HTMLInputElement>;
    groups?: GROUP[];
    getItemLabel?: SelectPropGetItemLabel<ITEM>;
    getItemKey?: SelectPropGetItemKey<ITEM>;
    getItemGroupKey?: SelectPropGetItemGroupKey<ITEM>;
    getItemDisabled?: SelectPropGetItemDisabled<ITEM>;
    getGroupLabel?: SelectPropGetGroupLabel<GROUP>;
    getGroupKey?: SelectPropGetGroupKey<GROUP>;
    label?: string;
    labelIcon?: IconComponent;
    labelPosition?: 'top' | 'left';
    caption?: string;
    virtualScroll?: boolean;
    onScrollToBottom?: (length: number) => void;
    onDropdownOpen?: (isOpen: boolean) => void;
    dropdownOpen?: boolean;
    ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;
}, HTMLDivElement> & (ITEM extends {
    label: SelectItemDefault['label'];
} ? {} : {
    getItemLabel: SelectPropGetItemLabel<ITEM>;
}) & (ITEM extends {
    id: SelectItemDefault['id'];
} ? {} : {
    getItemKey: SelectPropGetItemKey<ITEM>;
}) & (GROUP extends {
    label: SelectGroupDefault['label'];
} ? {} : {
    getGroupLabel: SelectPropGetGroupLabel<GROUP>;
}) & (GROUP extends {
    id: SelectGroupDefault['id'];
} ? {} : {
    getGroupKey: SelectPropGetGroupKey<GROUP>;
});
export type SelectComponent = <ITEM = SelectItemDefault, GROUP = SelectGroupDefault>(props: SelectProps<ITEM, GROUP>) => React.ReactElement | null;
export declare const defaultGetItemKey: SelectPropGetItemKey<SelectItemDefault>;
export declare const defaultGetItemLabel: SelectPropGetItemLabel<SelectItemDefault>;
export declare const defaultGetItemGroupKey: SelectPropGetItemGroupKey<SelectItemDefault>;
export declare const defaultGetItemDisabled: SelectPropGetItemDisabled<SelectItemDefault>;
export declare const defaultGetGroupKey: SelectPropGetGroupKey<SelectGroupDefault>;
export declare const defaultGetGroupLabel: SelectPropGetGroupLabel<SelectGroupDefault>;
export declare function withDefaultGetters<ITEM, GROUP>(props: SelectProps<ITEM, GROUP>): {
    items: ITEM[];
    onChange: SelectPropOnChange<ITEM>;
    disabled?: boolean;
    form?: PropForm;
    dropdownForm?: "default" | "brick" | "round";
    size?: PropSize;
    view?: PropView;
    status?: PropStatus;
    focused?: boolean;
    placeholder?: string;
    ariaLabel?: string;
    dropdownClassName?: string;
    dropdownRef?: React.RefObject<HTMLDivElement>;
    required?: boolean;
    name?: string;
    isLoading?: boolean;
    labelForEmptyItems?: string;
    value?: SelectPropValue<ITEM>;
    renderItem?: PropRenderItem<ITEM> | undefined;
    renderValue?: PropRenderValue<ITEM> | undefined;
    onFocus?: React.FocusEventHandler<HTMLInputElement>;
    onBlur?: React.FocusEventHandler<HTMLInputElement>;
    inputRef?: React.RefObject<HTMLInputElement>;
    groups?: GROUP[] | undefined;
    getItemLabel?: SelectPropGetItemLabel<ITEM> | undefined;
    getItemKey?: SelectPropGetItemKey<ITEM> | undefined;
    getItemGroupKey?: SelectPropGetItemGroupKey<ITEM> | undefined;
    getItemDisabled?: SelectPropGetItemDisabled<ITEM> | undefined;
    getGroupLabel?: SelectPropGetGroupLabel<GROUP> | undefined;
    getGroupKey?: SelectPropGetGroupKey<GROUP> | undefined;
    label?: string;
    labelIcon?: IconComponent;
    labelPosition?: "top" | "left";
    caption?: string;
    virtualScroll?: boolean;
    onScrollToBottom?: (length: number) => 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" | "required" | "inputRef" | "items" | "dropdownForm" | "focused" | "ariaLabel" | "dropdownClassName" | "dropdownRef" | "isLoading" | "labelForEmptyItems" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey" | "labelIcon" | "labelPosition" | "onScrollToBottom" | "onDropdownOpen" | "dropdownOpen" | "ignoreOutsideClicksRefs" | "virtualScroll"> & React.RefAttributes<HTMLDivElement> & (ITEM extends {
    label: SelectItemDefault["label"];
} ? {} : {
    getItemLabel: SelectPropGetItemLabel<ITEM>;
}) & (ITEM extends {
    id: SelectItemDefault["id"];
} ? {} : {
    getItemKey: SelectPropGetItemKey<ITEM>;
}) & (GROUP extends {
    label: SelectGroupDefault["label"];
} ? {} : {
    getGroupLabel: SelectPropGetGroupLabel<GROUP>;
}) & (GROUP extends {
    id: SelectGroupDefault["id"];
} ? {} : {
    getGroupKey: SelectPropGetGroupKey<GROUP>;
}) & {
    getItemLabel: SelectPropGetItemLabel<SelectItemDefault> | SelectPropGetItemLabel<ITEM>;
    getItemKey: SelectPropGetItemKey<SelectItemDefault> | SelectPropGetItemKey<ITEM>;
    getItemGroupKey: SelectPropGetItemGroupKey<SelectItemDefault> | SelectPropGetItemGroupKey<ITEM>;
    getItemDisabled: SelectPropGetItemDisabled<SelectItemDefault> | SelectPropGetItemDisabled<ITEM>;
    getGroupLabel: SelectPropGetGroupLabel<SelectGroupDefault> | SelectPropGetGroupLabel<GROUP>;
    getGroupKey: SelectPropGetGroupKey<SelectGroupDefault> | SelectPropGetGroupKey<GROUP>;
};
export declare const iconSizeMap: Record<PropSize, IconPropSize>;
export {};
