import { DropdownStatusProps } from '../../internal/components/dropdown-status/interfaces';
import { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';
import { HighlightedOptionHandlers, HighlightedOptionState } from '../../internal/components/options-list/utils/use-highlight-option';
import { PromptInputProps } from '../interfaces';
export type MenuItem = (OptionDefinition | OptionGroup) & {
    type?: 'parent' | 'child' | 'use-entered';
    option: OptionDefinition | OptionGroup;
};
/** Props for the useMenuItems hook. */
export interface UseMenuItemsProps {
    menu: PromptInputProps.MenuDefinition;
    filterText: string;
    onSelectItem: (option: MenuItem) => void;
}
/** Current state of the menu items list, including highlight tracking. */
export interface MenuItemsState extends HighlightedOptionState<MenuItem> {
    items: readonly MenuItem[];
    showAll: boolean;
    getItemGroup: (item: MenuItem) => undefined | OptionGroup;
}
/** Handlers for navigating and selecting menu items via keyboard and mouse. */
export interface MenuItemsHandlers extends HighlightedOptionHandlers<MenuItem> {
    selectHighlightedOptionWithKeyboard(): boolean;
    highlightVisibleOptionWithMouse(index: number): void;
    selectVisibleOptionWithMouse(index: number): void;
}
interface UseMenuLoadMoreProps {
    menu: PromptInputProps.MenuDefinition;
    statusType: DropdownStatusProps.StatusType;
    onLoadItems: (detail: PromptInputProps.MenuLoadItemsDetail) => void;
    onLoadMoreItems?: () => void;
}
interface MenuLoadMoreHandlers {
    fireLoadMoreOnScroll(): void;
    fireLoadMoreOnRecoveryClick(): void;
    fireLoadMoreOnMenuOpen(): void;
    fireLoadMoreOnInputChange(filteringText: string): void;
}
/** Manages menu item filtering, highlighting, and selection for a trigger menu. */
export declare const useMenuItems: ({ menu, filterText, onSelectItem, }: UseMenuItemsProps) => [MenuItemsState, MenuItemsHandlers];
/** Manages pagination and load-more behavior for menu items. */
export declare const useMenuLoadMore: ({ menu, statusType, onLoadItems, onLoadMoreItems, }: UseMenuLoadMoreProps) => MenuLoadMoreHandlers;
export interface MenuSelectionResult {
    tokens: PromptInputProps.InputToken[];
    caretPosition: number;
    insertedToken: PromptInputProps.ReferenceToken;
}
/** Replaces a trigger token with a reference token (or pinned token) after menu selection. */
export declare function handleMenuSelection(tokens: readonly PromptInputProps.InputToken[], selectedOption: {
    value: string;
    label?: string;
}, menuId: string, isPinned: boolean, activeTrigger: PromptInputProps.TriggerToken): MenuSelectionResult;
export {};
//# sourceMappingURL=menu-state.d.ts.map