/**
 * @file useTriggerMenu.tsx
 * @input Uses React, usePopover, SearchSource
 * @output Exports useTriggerMenu hook for trigger-based menus in contentEditable
 * @position Internal hook; consumed by ChatComposerInput
 *
 * Detects trigger characters (@ / etc.) typed inside a contentEditable,
 * opens a popover at the cursor position with filtered items, handles
 * keyboard navigation, and inserts tokens or text on selection.
 *
 * Reuses SearchSource from Typeahead for async/sync search with
 * cancel() support and debounce.
 *
 * SYNC: When modified, update:
 * - /packages/core/src/Chat/ChatComposerInput.tsx
 * - /packages/core/src/Chat/index.ts
 */
import { type ReactNode } from 'react';
import type { SearchableItem } from '../Typeahead/types';
import type { ChatComposerTrigger, ChatComposerToken } from './ChatComposerInput';
export interface TriggerMenuState {
    isActive: boolean;
    activeTrigger: ChatComposerTrigger | null;
    query: string;
    items: SearchableItem[];
    highlightedIndex: number;
    isLoading: boolean;
}
export interface UseTriggerMenuOptions {
    triggers?: ChatComposerTrigger[];
    editableRef: React.RefObject<HTMLDivElement | null>;
    onInsertToken: (token: ChatComposerToken) => void;
    onInsertText: (text: string) => void;
    onEmitChange: () => void;
    /**
     * Debounce delay in ms before triggering search after typing.
     * @default 150
     */
    debounceMs?: number;
}
export interface UseTriggerMenuReturn {
    state: TriggerMenuState;
    /** Call on every input event to check for trigger activation */
    handleInput: () => void;
    /** Call on keydown \u2014 returns true if the event was consumed */
    handleKeyDown: (e: React.KeyboardEvent) => boolean;
    /** Render the trigger menu popover */
    renderMenu: () => ReactNode;
    /** Reset/close the trigger menu */
    reset: () => void;
    /**
     * ARIA props to spread onto the editable element. When triggers are
     * configured the element becomes a `combobox` (which is the only role that
     * permits `aria-expanded`/`aria-haspopup`/`aria-controls`/
     * `aria-activedescendant`); otherwise it stays a plain `textbox` and no
     * combobox attributes are emitted.
     */
    ariaProps: {
        role: 'combobox' | 'textbox';
        'aria-expanded'?: boolean;
        'aria-controls'?: string;
        'aria-activedescendant'?: string;
        'aria-haspopup'?: 'listbox';
    };
}
export declare function useTriggerMenu(options: UseTriggerMenuOptions): UseTriggerMenuReturn;
//# sourceMappingURL=useTriggerMenu.d.ts.map