import React from 'react';
import { GroupBase, StylesConfig } from 'react-select';
import { FormControlWrapperPublicProps } from '../../FormLayout/components/FormControlWrapper';
import { FormControlCommonProps, SelectOption } from '../types.js';
import '../FormControls.css';
import { ExtractorType } from './utils';
import { CustomMenuListProps } from './components/CustomMenuList.js';
interface FilterOptionOption<Option> {
    readonly label: string;
    readonly value: string;
    readonly data: Option;
}
type SelectPropsBase<Options extends Record<any, any>[]> = FormControlCommonProps & FormControlWrapperPublicProps & {
    autoFocus?: boolean;
    /** Allow the user to create a new option that does not exist in the options list */
    allowCreate?: boolean;
    /** close dropdown menu when selecting an option. Defaults to true on single and false on multi.   */
    closeMenuOnSelect?: boolean;
    /** Show only the number of selected items. Selected items separated in list of options */
    combineSelected?: boolean;
    /** Function that overrides default filtering logic when isSearchable is true, accepts an Option and should return either true or false to determine which options should be shown. Can also be set to null disable filtering. */
    filterOption?: ((option: FilterOptionOption<Options[number]>, inputValue: string) => boolean) | null;
    /** Hide selected options from the list of options. Default: true */
    hideSelectedOptions?: boolean;
    /** Do not render selected values inside input. Default: false */
    hideValue?: boolean;
    /** Allows to clear the selected value. */
    isClearable?: boolean;
    /** Will show loading indicators */
    isLoading?: boolean;
    /** Override the built-in logic to detect whether an option is disabled */
    isOptionDisabled?: (option: Options[number]) => boolean;
    /** Lets you type on the select field to filter results */
    isSearchable?: boolean;
    /** Callback for fetching options from remote */
    loadOptions?: (options?: {
        additional?: boolean;
        text?: string;
    }) => void;
    /** Message to display when loading options */
    loadingMessage?: ExtractorType;
    /** The max height of options container */
    maxMenuHeight?: number;
    /** Menu stays open at all times */
    menuIsOpen?: boolean;
    /** Defaults to fixed for Modals compatibility. In cases where menu overlaps component, it should be set to absolute. */
    menuPosition?: 'absolute' | 'fixed';
    /** Custom & Tabbed Menu will be absolutely positioned. Default: false */
    menuOverlay?: boolean;
    noOptionMessage?: ((obj: {
        inputValue: string;
    }) => React.ReactNode) | undefined;
    /** Callback when a new option is created in the selected value, requires prop "allowCreate=true" */
    onCreateOption?: (option: SelectOption) => void;
    /** Available options list */
    options: Options;
    /** Resolves option data to a string to be displayed as the label by components */
    optionLabelExtractor?: (option: Options[number]) => React.ReactNode;
    /** Resolves option data to a string to compare options */
    optionValueExtractor?: (option: Options[number]) => any;
    /** Optionally provide a custom menu container for the Select options when the menu is open */
    RenderMenuList?: CustomMenuListProps['CustomComponent'];
    /** The component will be used to render list items options */
    RenderGroupHeading?: (group: GroupBase<any>) => React.ReactNode;
    /** The component will be used to render list items options.  */
    RenderListItem?: (option: Options[number], state?: {
        isDisabled?: boolean;
        isFocused?: boolean;
        isSelected?: boolean;
    }, selectOption?: (newValue: unknown) => void) => React.ReactNode;
    /** The component will be used to render selected list items options. */
    RenderSelectedListItem?: (option: any, state?: {
        isDisabled?: boolean;
        isFocused?: boolean;
        isSelected?: boolean;
    }, selectOption?: (newValue: unknown) => void) => React.ReactNode;
    /** The component will be used to render a selected option when `multi` is true */
    RenderSelectedMulti?: (option: Options[number], onRemove?: React.MouseEventHandler) => React.ReactElement;
    /** The component will be used to render a single selected option */
    RenderSelectedSingle?: (option: Options[number]) => React.ReactNode;
    /** The component will be used when there are no options available  */
    RenderNoOptions?: string | (() => React.ReactNode);
    /** Style modifier methods */
    styles?: StylesConfig;
    /** Place all options and selected options in separate tabs */
    tabbed?: boolean;
};
export type SelectProps<Options extends Record<any, any>[] = any> = SelectPropsBase<Options> & ({
    /** Allows for multiple value selection */
    multi?: false | never;
    /** Callback when the selected options change */
    onChangeOptions?: (selectedOptions: Options[number]) => void;
    /** Callback when the selected value changes */
    onChangeValue?: (selectedValue: any) => void;
    /** Currently selected option */
    value?: any;
} | {
    /** Allows for multiple value selection */
    multi: true;
    /** Callback when the selected options change */
    onChangeOptions?: (selectedOptions: Options) => void;
    /** Callback when the selected value changes */
    onChangeValue?: (selectedValue: any) => void;
    /** Currently selected option */
    value?: any;
});
declare const Select: <Options extends Record<any, any>[]>({ autoFocus, allowCreate, closeMenuOnSelect, combineSelected, error, disabled, filterOption, hideSelectedOptions, hideValue, hint, isClearable, isLoading, isOptionDisabled, isSearchable, label, labelBehavior, loadingMessage, loadOptions, maxMenuHeight, maxWidth, menuIsOpen, menuOverlay: _menuOverlay, menuPosition, minWidth, multi, name, noOptionMessage, onBlur, onChange, onChangeOptions, onChangeValue, onCreateOption, onFocus, options, optionLabelExtractor, optionValueExtractor, placeholder, RenderMenuList, RenderGroupHeading, RenderListItem, RenderSelectedListItem, RenderSelectedMulti, RenderSelectedSingle, RenderNoOptions, styles, showErrorMessage, subText, tabbed, value, }: SelectProps<Options>) => React.ReactElement;
export { Select };
