import type { ReactNode } from 'react'; export interface PromptInputMentionItem { id: string; label: string; /** * Entity kind, serialized into the markup. A single `@` menu legitimately * returns several kinds, which is why this is per item and not per trigger. * @defaultValue "mention" */ type?: string; icon?: ReactNode; /** Trailing metadata — a badge, a shortcut, a timestamp. */ trailing?: ReactNode; /** Section heading. Groups render in first-appearance order. */ group?: string; disabled?: boolean; /** Opaque; handed back on submit. Never serialized. */ data?: unknown; } /** A reference parsed out of markup, before it has been resolved. */ export interface PromptInputMentionRef { type: string; id: string; label: string; } /** Everything `PromptInput.Mentions` contributes for one trigger. */ export interface PromptInputMentionsData { items?: PromptInputMentionItem[]; onSearch?: (query: string, context: { trigger: string; signal: AbortSignal; }) => Promise; resolveMentions?: (refs: PromptInputMentionRef[]) => Promise; onOpenChange?: (open: boolean) => void; emptyMessage?: ReactNode; loadingRowCount?: number; } export interface PromptInputMentionsConfig extends PromptInputMentionsData { trigger: string; } /** * Shared between `Mentions` (which writes the config), `Editor` (which reads * triggers, drives the menu and decorates chips) and Root (which reads `data` * back when assembling a message). * * `icon`, `trailing` and `data` cannot survive serialization, so they live here * rather than on the document — keyed by `trigger|type|id`, filled in when an * item is picked from the menu or returned by `resolveMentions`. * * Registration is split from data on purpose. The trigger is established once, * while the data is pushed after every `Mentions` render and compared field by * field — so an inline `items` array stays live without a config object whose * identity churns and restarts an in-flight search. */ export declare class PromptInputMentionRegistry { private configs; private items; private listeners; private revision; register(trigger: string): () => void; setData(trigger: string, data: PromptInputMentionsData): void; get(trigger: string): PromptInputMentionsConfig | undefined; triggers(): string[]; remember(trigger: string, item: PromptInputMentionItem): void; rememberAll(trigger: string, items: PromptInputMentionItem[]): void; lookup(trigger: string, type: string, id: string): PromptInputMentionItem | undefined; has(trigger: string, type: string, id: string): boolean; subscribe: (listener: () => void) => (() => void); /** * Bumped by every mutation. Read as a `useSyncExternalStore` snapshot, so a * reader that mounts after a writer has already emitted still sees the * change — `Mentions` registers its trigger in an effect that runs before a * later sibling `Editor` has subscribed. */ getRevision: () => number; private emit; } //# sourceMappingURL=prompt-input-mention-registry.d.ts.map