import type { Dispatch, ReactElement, SetStateAction } from "react";
type FilterPickerFragment = Iterable<FilterPickerNode>;
type FilterPickerNode = ReactElement | FilterPickerFragment;
export interface FilterPickerProps {
    readonly children?: FilterPickerNode;
    /**
     * When `true`, `FilterPicker` will allow for multiple selections
     *
     * @default false
     */
    readonly multiSelect?: boolean;
    /**
     * The selected options of the FilterPicker.
     */
    readonly selected: FilterPickerOption[];
    /**
     * The encapsulating noun for the content of the combobox. Used
     * in the empty state, and search placeholder. Should be pluralized.
     */
    readonly subjectNoun?: string;
    /**
     * Callback function invoked upon the selection of an option. Provides the selected option(s) as an argument.
     */
    readonly onSelect: (selection: FilterPickerOption[]) => void;
    /**
     * Callback function invoked upon the selection of all options. Provides the selected option(s) as an argument.
     * This is only available when `multiSelect` is `true`.
     */
    readonly onSelectAll?: (selection: FilterPickerOption[]) => void;
    /**
     * Callback function invoked upon the clearing of all options.
     * This is only available when `multiSelect` is `true`.
     */
    readonly onClear?: () => void;
    /**
     * Callback function invoked upon the FilterPicker menu closing.
     */
    readonly onClose?: () => void;
    /**
     * Debounced callback function invoked on FilterPicker search input change. Receives the current search value as an argument.
     */
    readonly onSearch?: (searchValue: string) => void;
    /**
     * The amount of time in ms to debounce the onSearch callback. Defaults to 300ms.
     */
    readonly onSearchDebounce?: number;
    /**
     * Callback to load more options, this is called when the user scrolls to the bottom of the list.
     */
    readonly onLoadMore?: () => void;
    /**
     * The Chip heading for the trigger
     */
    readonly label?: string;
    /**
     * Should the FilterPicker display the loading state.
     */
    readonly loading?: boolean;
    /**
     * A ref to the default activator button element.
     */
    readonly defaultActivatorRef?: React.Ref<HTMLButtonElement>;
}
export interface FilterPickerCustomActivatorProps {
    /**
     * Required to describe the expanded state of the FilterPicker.
     * Automatically updates as open state is toggled.
     */
    ariaExpanded: boolean;
    /**
     * Required to describe the relationship between the toggle-able FilterPicker Menu and the activator.
     */
    ariaControls: string;
    /**
     * The aria-label attribute for the FilterPicker activator.
     */
    ariaLabel?: string;
    /**
     * Required to describe the interactive element which toggles the FilterPicker's visibility.
     */
    role: "combobox";
    /**
     * Method to open the FilterPicker. Closing is handled by the FilterPicker itself.
     */
    open: () => void;
}
export type FilterPickerActivatorAccessibility = Omit<FilterPickerCustomActivatorProps, "open">;
export interface FilterPickerActivatorProps {
    readonly children: React.ReactElement | ((props: FilterPickerCustomActivatorProps) => React.ReactElement);
}
export interface FilterPickerTriggerProps extends Pick<FilterPickerContentProps, "selected"> {
    readonly label?: string;
    readonly activatorRef?: React.Ref<HTMLButtonElement>;
}
export interface FilterPickerOptionProps {
    /**
     * A unique identifier for the option.
     */
    id: string | number;
    /**
     * The value to be visually displayed in the FilterPicker options list.
     */
    label: string;
    /**
     * An optional component to be displayed before the label.
     */
    prefix?: React.ReactNode;
    /**
     * Advanced: A custom render prop to completely control how this option is rendered.
     * The function receives the option's props, and a boolean indicating if the option is selected.
     */
    readonly customRender?: (option: Pick<FilterPickerOptionProps, "id" | "label" | "prefix"> & {
        isSelected: boolean;
        /** Render the default option content. */
        defaultContent: ReactElement;
    }) => React.ReactNode;
    /**
     * Callback function invoked when the option is clicked.
     */
    readonly onClick?: (option: FilterPickerOption) => void;
}
export type FilterPickerOption = FilterPickerOptionProps;
export interface FilterPickerContentProps {
    /**
     * The selected options of the FilterPicker.
     */
    readonly selected: FilterPickerOption[];
    /**
     * The encapsulating noun for the content of the combobox. Used
     * in the empty state, and search placeholder. Should be pluralized.
     */
    readonly subjectNoun?: string;
    /**
     * Action elements to be displayed at the bottom of the list.
     */
    readonly actionElements?: ReactElement[];
    /**
     * State setter for the selected options.
     */
    readonly selectedStateSetter: (selection: FilterPickerOption[]) => void;
    /**
     * Callback function to be called when an option is selected.
     */
    readonly handleSelection: (option: FilterPickerOption) => void;
    /**
     * Are multiple selections permitted.
     */
    readonly multiselect?: boolean;
    /**
     * The current search term.
     */
    readonly searchValue: string;
    /**
     * Setter for the current search term.
     */
    readonly setSearchValue: Dispatch<SetStateAction<string>>;
    /**
     * Function called when search input changes.
     */
    readonly handleSearchChange: (value: string) => void;
    /**
     * Callback to load more options, this is called when the user scrolls to the bottom of the list.
     */
    readonly onLoadMore?: () => void;
    /**
     * Reference to the wrapping div element of all the FilterPicker pieces
     */
    readonly wrapperRef: React.RefObject<HTMLDivElement | null>;
    /**
     * Is the FilterPicker open
     */
    readonly open: boolean;
    /**
     * The full set of options for the FilterPicker in the shape of data, not elements.
     */
    readonly options: FilterPickerOption[];
    /**
     * Should loading state be shown.
     */
    readonly loading?: boolean;
}
export interface FilterPickerSearchProps {
    /**
     * The placeholder for the search input.
     */
    placeholder?: string;
    /**
     * The value of the search input
     */
    searchValue: string;
    /**
     * The open state of the FilterPicker listbox.
     */
    open: boolean;
    /**
     * Setter for the search input value.
     */
    setSearchValue: Dispatch<SetStateAction<string>>;
    /**
     * Function called when search input changes.
     */
    readonly handleSearchChange: (value: string) => void;
}
export interface FilterPickerHeaderProps {
    /**
     * Does the FilterPicker have any options visible in the list.
     */
    readonly hasOptionsVisible: boolean;
    /**
     * The noun to be used in the header label.
     */
    readonly subjectNoun?: string;
    /**
     * The number of selected options.
     */
    readonly selectedCount: number;
    /**
     * The function to call when the clear all button is clicked.
     */
    readonly onClearAll: () => void;
    /**
     * The function to call when the select all button is clicked.
     */
    readonly onSelectAll: () => void;
}
export interface FilterPickerListProps {
    /**
     * The options to display in the list. May be the full set of the FilterPicker or could be filtered.
     */
    readonly options: FilterPickerOption[];
    /**
     * The currently selected options.
     */
    readonly selected: FilterPickerOption[];
    /**
     * A ref to the list element.
     */
    readonly optionsListRef: React.RefObject<HTMLUListElement | null>;
    /**
     * The current search term. Used in the no results message.
     */
    readonly searchValue: string;
    /**
     * Determines if it is a single selection or multi selection FilterPicker.
     */
    readonly multiselect?: boolean;
    /**
     * The noun to be used in the empty state message.
     */
    readonly subjectNoun?: string;
    /**
     * Should loading state be shown.
     */
    readonly loading?: boolean;
    /**
     * Callback to load more options, this is called when the user scrolls to the bottom of the list.
     */
    readonly onLoadMore?: () => void;
}
export interface FilterPickerActionProps {
    /**
     * The function to call when the action is clicked.
     */
    onClick(event: React.MouseEvent<HTMLButtonElement>, options: FilterPickerActionCallbackOptions): void;
    /**
     * The label text of the action.
     */
    readonly label: string | ((options: FilterPickerActionCallbackOptions) => string);
    /**
     * Determine if the action is visible for a given item.
     */
    readonly visible?: boolean | ((options: FilterPickerActionCallbackOptions) => boolean);
    /**
     * Keeps the FilterPicker open when the action is clicked.
     * @default false
     */
    readonly keepOpenOnClick?: boolean;
}
export interface FilterPickerActionCallbackOptions {
    readonly searchValue: string;
}
export {};
