import { Plugin, PluginKey } from 'prosemirror-state'; /** Live state of a trigger-character suggestion (mention or slash command). */ export interface SuggestionMatch { active: boolean; trigger: string; query: string; /** Doc range spanning trigger + query, to replace on selection. */ from: number; to: number; } export declare const INACTIVE_SUGGESTION: SuggestionMatch; export interface SuggestionOptions { /** Read live so trigger config can change without rebuilding state. */ getTriggers: () => string[]; /** Restrict to the start of an empty-ish textblock (slash commands). */ startOfLine?: boolean; /** Stay inactive until the query reaches this length (emoji ":" noise). */ minQueryLength?: number; /** Notified on every state change (including becoming inactive). */ onChange: (match: SuggestionMatch) => void; /** Intercept keys (arrows/Enter/Escape) while a suggestion is active. */ onKeyDown?: (event: KeyboardEvent, match: SuggestionMatch) => boolean; } /** * Generic trigger-character suggestion tracker. Recomputes the active * trigger/query from the selection on every transaction, notifies the host, * and softly highlights the query text. Insertion/UI is the host's job. */ export declare function suggestionPlugin(key: PluginKey, options: SuggestionOptions): Plugin;