/// <reference types="react" />
import { DropdownPlacement } from '../Dropdown/Dropdown.types';
import { MenuProps, MenuRef, Selection } from '../MenuImperative/MenuImperative.types';
import { OverlayTriggerProps } from '../OverlayTrigger';
export declare type ChangeEvent = React.ChangeEvent<HTMLInputElement>;
export declare type OptionItem = any;
export interface MultiSelectOptionProps {
    /**
     * @since 10.19.0
     */
    children?: React.ReactNode;
    /**
     * @since 10.19.0
     */
    className?: string;
    /**
     * @since 10.19.0
     */
    selected?: boolean;
    /**
     * @since 10.19.0
     */
    suggested?: boolean;
    /**
     * @since 10.19.0
     */
    disabled?: boolean;
    /**
     * @since 10.19.0
     */
    value: OptionItem;
}
export interface OptionRendererProps extends MultiSelectOptionProps {
    /**
     * @since 10.19.0
     */
    getId: MultiSelectConfig['getId'];
    /**
     * @since 10.19.0
     */
    getLabel: MultiSelectConfig['getLabel'];
    /**
     * @since 10.19.0
     */
    qa: QaTags;
}
export interface GroupItem {
    /**
     * @since 10.19.0
     */
    id: string;
    /**
     * @since 10.19.0
     */
    label: string;
}
export interface GroupHeader extends GroupItem {
    /**
     * @since 10.19.0
     */
    isGroupHeader: boolean;
}
export interface MultiSelectConfig {
    /**
     * @since 10.19.0
     */
    getGroup: (option: OptionItem) => number | string;
    /**
     * @since 10.19.0
     */
    getId: (option: OptionItem) => number | string;
    /**
     * @since 10.19.0
     */
    getLabel: (option: OptionItem) => string;
    /**
     * @since 10.19.0
     */
    menuRef: React.RefObject<MenuRef>;
    /**
     * @since 10.19.0
     */
    onChange?: (value: OptionItem[], event?: Event) => void;
    /**
     * @since 10.19.0
     */
    onSearch?: (e: ChangeEvent) => void;
    /**
     * @since 10.19.0
     */
    onSelect?: (selection: Selection) => void;
    /**
     * @since 10.19.0
     */
    optgroups?: GroupItem[];
    /**
     * @since 10.19.0
     */
    options: OptionItem[];
    /**
     * @since 10.19.0
     */
    value: OptionItem[];
}
export interface MultiSelectHook {
    /**
     * @since 10.19.0
     */
    ids: Set<number | string>;
    /**
     * @since 10.19.0
     */
    index: number | null;
    /**
     * @since 10.19.0
     */
    menuRef: React.RefObject<MenuRef>;
    /**
     * @since 10.19.0
     */
    options: (OptionItem | GroupHeader)[];
    /**
     * @since 10.19.0
     */
    search: string;
    /**
     * @since 10.19.0
     */
    clearToken: () => void;
    /**
     * @since 10.19.0
     */
    decrementToken: () => void;
    /**
     * @since 10.19.0
     */
    incrementToken: () => void;
    /**
     * @since 10.19.0
     */
    onSearch: (e: React.ChangeEvent<HTMLInputElement>) => void;
    /**
     * @since 10.19.0
     */
    onSelect: (selection: Selection) => void;
    /**
     * @since 10.19.0
     */
    removeToken: (index: number) => void;
    /**
     * @since 10.19.0
     */
    domHandlers: {
        onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
    };
}
export interface GroupedOptionsProps {
    /**
     * @since 10.19.0
     */
    multiselect: MultiSelectHook;
    /**
     * @since 10.19.0
     */
    groupHeaderRenderer: (group: GroupItem) => React.ReactNode;
    /**
     * @since 10.19.0
     */
    optionRenderer: (option: OptionItem, props: OptionRendererProps) => React.ReactNode;
    /**
     * @since 10.19.0
     */
    getId: MultiSelectConfig['getId'];
    /**
     * @since 10.19.0
     */
    getLabel: MultiSelectConfig['getLabel'];
    /**
     * @since 10.19.0
     */
    isOptionDisabled: (option: OptionItem) => boolean;
    /**
     * @since 10.19.0
     */
    qa: QaTags;
}
export interface QaTags {
    /**
     * @since 10.19.0
     */
    option?: (option: OptionItem) => string;
    /**
     * @since 10.19.0
     */
    token?: (option: OptionItem) => string;
    /**
     * @since 10.19.0
     */
    tokenClear?: (option: OptionItem) => string;
}
export interface TokenRendererProps {
    /**
     * @since 10.19.0
     */
    focused: boolean;
    /**
     * @since 10.19.0
     */
    disabled: boolean;
    /**
     * @since 10.19.0
     */
    option: OptionItem;
    /**
     * @since 10.19.0
     */
    removeToken: () => void;
    /**
     * @since 10.19.0
     */
    getLabel: (opt: OptionItem) => React.ReactNode;
    /**
     * @since 10.19.0
     */
    qa: QaTags;
}
export interface MultiSelectProps {
    /**
     * @since 10.19.0
     */
    afterHide?: OverlayTriggerProps['afterHide'];
    /**
     * @since 10.19.0
     */
    afterShow?: OverlayTriggerProps['afterShow'];
    /**
     * @since 10.19.0
     */
    beforeHide?: OverlayTriggerProps['beforeHide'];
    /**
     * @since 10.19.0
     */
    beforeShow?: OverlayTriggerProps['beforeShow'];
    /**
     * Callback for each entry in <Code>options</Code> to define relation to
     * group in <Code>groups</Code>
     * <CodeBlock>{'(option: OptionItem) => React.ReactNode'}</CodeBlock>
     * @since 10.19.0
     */
    getGroup?: MultiSelectConfig['getGroup'];
    /**
     * Callback for each entry in <Code>options</Code> for keying and
     * optimizations
     * <CodeBlock>{'(option: OptionItem) => number | string'}</CodeBlock>
     * @since 10.19.0
     */
    getId?: MultiSelectConfig['getId'];
    /**
     * Callback for each entry in <Code>options</Code> to generate the token
     * label.
     * <CodeBlock>{'(option: OptionItem) => string'}</CodeBlock>
     * @since 10.19.0
     */
    getLabel?: MultiSelectConfig['getLabel'];
    /**
     * Callback for when a user types into the multiselect input
     <CodeBlock>{'(event: KeyboardEvent) => void'}</CodeBlock>
     * @since 10.19.0
     */
    onSearch?: MultiSelectConfig['onSearch'];
    /**
     * Array of available option groups
     */
    optgroups?: MultiSelectConfig['optgroups'];
    /**
     * Array of available options
     * @since 10.19.0
     */
    options?: MultiSelectConfig['options'];
    /**
     * @since 10.19.0
     */
    onScrollBottom?: MenuProps['onScrollBottom'];
    /**
     * @since 10.19.0
     */
    block?: boolean;
    /**
     * @since 10.19.0
     */
    className?: string;
    /**
     * @since 10.19.0
     */
    disabled?: boolean;
    /**
     * @since 10.19.0
     */
    isOptionDisabled?: (option: OptionItem) => boolean;
    /**
     * @since 10.19.0
     */
    emptyMessage?: string;
    /**
     * @since 10.19.0
     */
    error?: boolean;
    /**
     * Callback for rendering header for each entry in <Code>groups</Code>
     * <CodeBlock>{'(group: GroupItem) => React.ReactNode'}</CodeBlock>
     * @since 10.19.0
     */
    groupHeaderRenderer?: (group: GroupItem) => React.ReactNode;
    /**
     * @since 10.19.0
     */
    loading?: boolean;
    /**
     * @since 10.19.0
     */
    onBlur?: React.SelectHTMLAttributes<HTMLDivElement>['onBlur'];
    /**
     * @since 10.19.0
     */
    onChange?: (value: OptionItem[], event?: Event) => void;
    /**
     * @since 10.19.0
     */
    onFocus?: React.SelectHTMLAttributes<HTMLDivElement>['onFocus'];
    /**
     * @since 10.19.0
     */
    optionRenderer?: (option: OptionItem) => React.ReactNode;
    /**
     * @since 10.19.0
     */
    placeholder?: string;
    /**
     * @since 10.19.0
     */
    placement?: DropdownPlacement;
    /**
     * @since 10.19.0
     */
    qa?: QaTags;
    /**
     * @since 10.19.0
     */
    tabIndex?: number;
    /**
     * Callback for rendering each selected value
     * <CodeBlock>
     *  {'(props: TokenRendererProps) => React.ReactNode'}
     * </CodeBlock>
     * @since 10.19.0
     */
    tokenRenderer?: (props: TokenRendererProps) => React.ReactNode;
    /**
     * Array of the currently selected values
     * @since 10.19.0
     */
    value?: OptionItem[];
    /**
     * @since 10.29.0
     */
    footer?: React.ReactNode;
    /**
     * @since 11.4.0
     */
    ['aria-labelledby']?: string;
}
