import type { ReactElement, ReactNode } from 'react'; import type { MentionItem, MentionQuery } from '@rtif-sdk/web'; import type { MentionsApi } from './use-mentions.js'; /** Context handed to {@link MentionsPopupProps.renderItem} alongside the item. */ export interface MentionRenderContext { readonly index: number; /** Whether this row is the keyboard-highlighted one. */ readonly active: boolean; readonly query: MentionQuery; } /** Props for {@link MentionsPopup}. */ export interface MentionsPopupProps { readonly mentions: MentionsApi; /** Appended to the base `rtif-mentions-popup` class. */ readonly className?: string; /** Stable row keys (default: the item's `value` when it is a string, else the index). */ readonly getKey?: (item: TItem, index: number) => string | number; /** Row content (default: the item's `label` with its `value` as a dimmed detail). */ readonly renderItem?: (item: TItem, context: MentionRenderContext) => ReactNode; /** Content of the loading row shown while the FIRST search for a query is in flight. */ readonly renderLoading?: () => ReactNode; /** Empty-results content; without it the popup hides entirely on no matches. */ readonly renderEmpty?: (query: MentionQuery) => ReactNode; /** Failed-search content; without it the popup hides on errors (`api.error` still reports them). */ readonly renderError?: (error: unknown, query: MentionQuery) => ReactNode; } /** * The optional, unstyled default dropdown over {@link MentionsApi} * (architecture §9.1): an absolutely-positioned ARIA listbox with classes * `rtif-mentions-popup` / `-item` / `-loading` / `-empty` and zero shipped * CSS. Replace any row via the render props — or ignore this component and * render your own UI from the api. Rows prevent `mousedown` so the editor * keeps focus (and the query stays alive) until `click` runs the pick. */ export declare function MentionsPopup({ mentions, className, getKey, renderItem, renderLoading, renderEmpty, renderError, }: MentionsPopupProps): ReactElement | null; //# sourceMappingURL=mentions-popup.d.ts.map