import type { ReactNode } from 'react'; export interface SuggestionMenuItem { id: string; label: string; type?: string; icon?: ReactNode; trailing?: ReactNode; group?: string; disabled?: boolean; data?: unknown; } /** Rendered in first-appearance order; the leading group has no label. */ export interface SuggestionGroup { label?: string; items: SuggestionMenuItem[]; } /** A zero-width caret rect, re-measured by the positioner as the caret moves. */ export interface SuggestionAnchor { getBoundingClientRect: () => DOMRect; /** * The editing host. A virtual element has nothing for the positioner to * observe on its own, so without this the menu would not follow the trigger * when the composer grows a line or its scroll ancestors move. */ contextElement?: Element; } export interface SuggestionMenuProps { open: boolean; anchor: SuggestionAnchor | null; /** Listbox id, referenced by the editor's `aria-controls`. */ id: string; groups: SuggestionGroup[]; /** Index into the flattened item list, or -1. */ highlightedIndex: number; onHighlightChange: (index: number) => void; onSelect: (item: SuggestionMenuItem, index: number) => void; onOpenChange: (open: boolean) => void; loading?: boolean; /** @defaultValue 3 */ loadingRowCount?: number; /** @defaultValue "No results" */ emptyMessage?: ReactNode; /** Width the popup takes, in pixels — the composer frame's width. */ width?: number; 'aria-label'?: string; } /** Row ids are derived, so the editor can name the highlighted one. */ export declare function suggestionOptionId(listId: string, index: number): string; export declare function SuggestionMenu({ open, anchor, id, groups, highlightedIndex, onHighlightChange, onSelect, onOpenChange, loading, loadingRowCount, emptyMessage, width, 'aria-label': ariaLabel }: SuggestionMenuProps): import("react/jsx-runtime").JSX.Element; export declare namespace SuggestionMenu { var displayName: string; } //# sourceMappingURL=suggestion-menu.d.ts.map