import React from 'react';
import { BoxProps } from '../Box/Box.types';
import { SearchHook } from '../Search/Search.types';
import { TypeaheadInputProps, TypeaheadProps } from '../Typeahead/Typeahead.types';
import { ListNavigationApi } from '../_hooks/ListNavigation';
import { ChangeEvent } from '../_hooks/TextEntry';
import { Props } from '../_utils/types';
export declare type ElementTypeChecker = (element: any, index?: number, list?: any[]) => boolean;
export interface MenuSelection {
    /**
     * @since 10.19.0
     */
    event: Event;
    /**
     * @since 10.19.0
     */
    group: boolean;
    /**
     * @since 10.19.0
     */
    item: any;
}
export interface MenuNavigationProps extends Props {
    /**
     * @since 10.19.0
     */
    index?: number;
    /**
     * @since 10.19.0
     */
    ref?: React.Ref<any>;
}
export interface MenuItemProps extends MenuNavigationProps {
    /**
     * @since 10.19.0
     */
    children?: React.ReactNode;
    /**
     * @since 10.19.0
     */
    className?: string;
    /**
     * Value which can be passed around various callback functions.
     * Can be anything!
     * @since 10.19.0
     */
    item?: any;
    /**
     * @since 10.19.0
     */
    onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => any;
    /**
     * Is the item selected
     * @default false
     * @since 10.19.0
     */
    selected?: boolean;
    /**
     * @since 10.19.0
     */
    suggested?: boolean;
}
export interface MenuGroupProps {
    /**
     * @since 10.19.0
     */
    className?: string;
    /**
     * Can the group item be clicked
     * @since 10.19.0
     */
    clickable?: boolean;
    /**
     * Value which can be passed around various callback functions.
     * Can be anything!
     * @since 10.19.0
     */
    item?: any;
}
export interface MenuOptionsProps {
    /**
     * @since 10.19.0
     */
    children?: React.ReactNode;
    /**
     * @since 10.19.0
     */
    className?: string;
    /**
     * @since 10.19.0
     */
    padding?: string;
    /**
     * @default true
     */
    scrollable?: boolean;
}
export interface MenuSearchProps extends Omit<TypeaheadProps, 'onChange'>, TypeaheadInputProps, Props {
    /**
     * The i18n key to use for the menu search's configurable strings. Defaults to
     * using the core library's default strings.
     * @since 10.19.0
     */
    i18nScope?: string;
    /**
     * @since 10.21.0
     */
    onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
}
export interface MenuHeaderProps extends Props {
    /**
     * @since 10.19.0
     */
    tabIndex?: number;
}
export interface MenuFooterProps extends Omit<BoxProps, 'as'> {
}
export interface MenuHookConfig {
    /**
     * @since 10.19.0
     */
    isSelectable?: MenuHook['isSelectable'];
    /**
     * @since 10.19.0
     */
    keyHandlerRef?: React.RefObject<HTMLElement>;
    /**
     * @since 10.19.0
     */
    multiple?: boolean;
    /**
     * @since 10.19.0
     */
    onScrollBottom?: MenuHook['onScrollBottom'];
    /**
     * @since 10.19.0
     */
    onSearch?: (event: ChangeEvent) => void;
    /**
     * @since 10.19.0
     */
    onSelect?: MenuHook['selectItem'];
    /**
     * @since 10.19.0
     */
    scrollable?: MenuHook['scrollable'];
    /**
     * @since 10.19.0
     */
    usingSearchHook?: SearchHook;
}
export interface MenuHook {
    /**
     * @since 10.19.0
     */
    domHandlers: {
        onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
    };
    /**
     * @since 10.19.0
     */
    highlighted: React.MutableRefObject<HTMLDivElement | null>;
    /**
     * @since 10.19.0
     */
    isSelectable: ElementTypeChecker;
    /**
     * @since 10.19.0
     */
    listNavigation: ListNavigationApi;
    /**
     * @since 10.19.0
     */
    multiple: boolean;
    /**
     * @since 10.19.0
     */
    onScrollBottom?: (e: Event) => void;
    /**
     * @since 11
     */
    onSearch?: (event: ChangeEvent) => void;
    /**
     * @default true
     */
    scrollable: boolean;
    /**
     * @since 10.19.0
     */
    selectItem: (selection: MenuSelection) => void;
}
export interface MenuProps extends Props, Omit<MenuOptionsProps, 'padding'> {
    /**
     * @deprecated
     *
     * The `isSelectable` prop has been deprecated and will be removed in a future version.
     * Menu item selection is now handled internally and there is no need to configure this
     * anymore.
     *
     * @deprecatedSince 10.20.0
     * @since 10.19.0
     */
    isSelectable?: ElementTypeChecker;
    /**
     * Ref object which will get the key handler listeners
     * @since 10.19.0
     */
    keyHandlerRef?: React.RefObject<HTMLElement>;
    /**
     * @since 10.19.0
     */
    onScrollBottom?: (e: Event) => void;
    /**
     * Callback for selecting an item from the menu. `item` will be the `item` prop supplied to the
     *  `Item` component. `group` will be `true` if the clicked item was a group label.
     * @since 10.19.0
     */
    onSelect?: (selection: MenuSelection) => any;
    /**
     * @since 11
     */
    onSearch?: (event: ChangeEvent) => void;
    /**
     * @deprecatedSince 9
     * @deprecated Never offically documented/supported. Please migrate to the other props like `onSelect` and `onSearch` on the `Menu` component. In v11, the **internal only** `useMenu` removed its search state. You should not be using `useMenu` nor this `usingHook` prop.
     * @since 10.19.0
     */
    usingHook?: MenuHook;
    /**
     * Unsafe, do not use
     * @deprecatedSince 9
     * @deprecated Never offically documented/supported
     * @since 10.19.0
     */
    UNSAFE_closesOnSelect?: boolean;
}
