/// import type { EditorView } from 'prosemirror-view'; import { type EditorActions, type SuggestionAnchor, type SuggestionGroup, type SuggestionState } from '../editor'; import type { PromptInputMention } from './prompt-input-context'; import type { PromptInputMentionItem, PromptInputMentionRegistry } from './prompt-input-mention-registry'; /** * Re-renders whatever reads the registry when a config or an item lands. * `useSyncExternalStore` rather than a subscribe-and-bump effect, because * `Mentions` registers its trigger from an effect that runs *before* a later * sibling `Editor` gets to subscribe — the store re-reads its snapshot after * subscribing, so that first registration is never missed. */ export declare function useMentionRegistryVersion(registry: PromptInputMentionRegistry): void; /** * Groups render in first-appearance order of `group` within the results, so * consumers control section order by ordering their data. Ungrouped items lead * in a headerless section, and a group that filters down to nothing disappears. */ export declare function toGroups(items: PromptInputMentionItem[]): SuggestionGroup[]; /** Sync data filtering — match-sorter on the label, best matches first. */ export declare function filterItems(items: PromptInputMentionItem[], query: string): PromptInputMentionItem[]; export interface UseMentionMenuOptions { viewRef: React.RefObject; actions: EditorActions; registry: PromptInputMentionRegistry; suggestion: SuggestionState | null; disabled: boolean; listboxId: string; } export interface UseMentionMenuResult { open: boolean; anchor: SuggestionAnchor; groups: SuggestionGroup[]; highlightedIndex: number; setHighlightedIndex: (index: number) => void; loading: boolean; loadingRowCount: number; emptyMessage: React.ReactNode; select: (item: PromptInputMentionItem) => void; close: () => void; activeOptionId: string | undefined; /** Routed from the ProseMirror plugin while a query is active. */ handleKeyDown: (event: KeyboardEvent, state: SuggestionState) => boolean; } export declare function useMentionMenu({ viewRef, actions, registry, suggestion, disabled, listboxId }: UseMentionMenuOptions): UseMentionMenuResult; /** * `icon`, `trailing` and `data` cannot survive serialization, so a chip parsed * from `defaultValue` starts label-only and fills in when the consumer's * `resolveMentions` resolves — the same progressive enhancement `Select.Value` * uses when it falls back to the raw value until an item registers. A rejection * or a missing item leaves the chip label-only; it is never an error state and * the chip is never removed. */ export declare function useMentionResolution(registry: PromptInputMentionRegistry, mentions: PromptInputMention[], actions: EditorActions): void; //# sourceMappingURL=use-mention-menu.d.ts.map