import { PureComponent, SyntheticEvent, KeyboardEvent } from 'react';
import { SelectOption } from './types';
export declare class Dropdown extends PureComponent<Props, State> {
    private dropdownRef;
    private picklistRef;
    private debouncedOnTypeaheadChange;
    private resizePicklist;
    static defaultProps: {
        optional: boolean;
        options: never[];
        placeholder: string;
        filterable: boolean;
        multiselect: boolean;
        defaultValue: string;
        onChange: (...args: any[]) => void;
        onSelect: (...args: any[]) => void;
        onDeselect: (...args: any[]) => void;
        onShowPicker: (...args: any[]) => void;
        onHidePicker: (...args: any[]) => void;
        onTypeaheadChange: (...args: any[]) => void;
    };
    componentDidMount(): void;
    componentWillUnmount(): void;
    constructor(props: Props);
    render(): JSX.Element;
    /**
     *
     * @returns {JSX.Element}
     */
    renderHeader(): JSX.Element;
    renderPicklist(): JSX.Element | null;
    /**
     * Render an extra option in the picklist, displaying the placeholder value,
     * so users can "deselect" their current selection - ie. this dropdown is optional
     */
    renderDeselectOption(): JSX.Element | null;
    /**
     * Reset the users selected choice to null
     */
    clearSelection: () => void;
    /**
     * TODO: This should be handled by a separate component, so we don't need to
     * rerender the button on every change (which inadvertently dismisses open pickers)
     */
    renderPicklistItems(): JSX.Element | JSX.Element[] | null;
    renderItem({ key, value }: SelectOption): JSX.Element;
    renderSearch(): JSX.Element | null;
    setSearchValue: (event: SyntheticEvent<HTMLInputElement>) => void;
    onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
    renderClearIcon(): JSX.Element | null;
    renderArrowIcon(): JSX.Element;
    getSelectedValue(): string;
    showPicker: () => void;
    hidePicker: () => void;
    handleOutsideClick: (event: SyntheticEvent<HTMLElement> | Event) => void;
    togglePicker: () => void;
    onChange: (key: SelectOption['key']) => void;
    isDisabled: () => boolean;
    static getDerivedStateFromProps(props: Props, state: State): State;
}
export interface HeaderRenderer {
    /**
     * Display value of the current selection.
     * If multiple selections, this will be the phrase "N selected"
     */
    selectedValue: SelectOption['value'];
    /**
     * A Set containing the values of the selected items
     */
    selected: State['selected'];
    /**
     * Function to show the picker
     */
    show: (event: SyntheticEvent<HTMLElement>) => void;
    /**
     * Function to hide the picker
     */
    hide: (event: SyntheticEvent<HTMLElement> | Event) => void;
}
export interface PicklistRenderer {
    /**
     * onClick handler for when users select a picklist option
     */
    onClick: (key: SelectOption['key']) => void;
    /**
     * Options for picklist
     */
    options: SelectOption[];
    /**
     * Picklist items that are already selected and need to be disabled
     */
    selectedOptions?: string[];
}
export interface State {
    /**
     * Whether the picklist is visible
     */
    open: boolean;
    /**
     * Currently selected value(s)
     */
    selected: Set<SelectOption['key']>;
    /**
     * Current search filter
     */
    search: string;
    /**
     * Currently visible options
     */
    options: SelectOption[];
    /**
     * Value displayed for typeahead auto-fill
     */
    autofill: string;
}
export interface Props {
    /**
     * Custom header to use instead of the default placeholder select box
     */
    header?: (data: HeaderRenderer) => JSX.Element;
    /**
     * Custom picklist to use instead of the default picklist
     */
    picklist?: (data: PicklistRenderer) => JSX.Element;
    /**
     * Selected value (for use as a controlled component)
     */
    value?: SelectOption['key'] | null;
    /**
     * Placeholder text to display when no value is selected
     */
    placeholder: string;
    /**
     * Include search functionality in the picklist
     */
    filterable: boolean;
    /**
     * Make search the default behavior
     */
    typeahead: boolean;
    /**
     * Allow multiple values to be selected
     */
    multiselect: boolean;
    /**
     * Options to display
     */
    options: SelectOption[];
    /**
     * Classes for the wrapper div
     */
    className?: string;
    /**
     * Whether or not the dropdown is disabled
     */
    disabled?: boolean;
    /**
     * Selected values (requires multiselect: true, for use as a controlled component)
     */
    selected?: State['selected'] | Array<SelectOption['key']> | SelectOption['key'] | null;
    /**
     * Picklist items that are already selected and need to be disabled
     */
    selectedOptions?: string[];
    /**
     * Allow users to deselect the value, returning to the original placeholder
     */
    optional: boolean;
    /**
     * Initial value to be displayed (in typeaheads)
     */
    defaultValue: string;
    /**
     * Event fired for single selection dropdowns (multiselect: false)
     */
    onChange: (selected: SelectOption['key'] | null) => void;
    /**
     * Event fired for multiselect dropdowns (multiselect: true)
     */
    onSelect: (selected: SelectOption['key'] | null) => void;
    /**
     * Event fired when deselecting a multiselect value (multiselect: true)
     */
    onDeselect: (selected: SelectOption['key'] | null) => void;
    /**
     * Event fired when showing the picker
     */
    onShowPicker: () => void;
    /**
     * Event fired when hiding the picker
     */
    onHidePicker: () => void;
    /**
     * Event fired when hiding the picker
     */
    onTypeaheadChange: (value: string) => void;
    /**
     * zIndex for picklist
     */
    zIndex?: number;
}
