import React from 'react';
import { type MentionUser } from '../lib/mention-picker.js';
/**
 * `<MentionableTextarea />` — drop-in replacement for `<textarea>` /
 * `<input type="text">` that opens a Radix-styled mention picker
 * whenever the user types `@`.
 *
 * Behaviour
 * ─────────
 * - The picker appears anchored to the textarea, below the input.
 *   We intentionally do NOT track the caret pixel position (that
 *   requires a textarea-mirror trick which doesn't add enough UX to
 *   justify the complexity); GitHub, Linear, and Asana all anchor
 *   their pickers this way on simple textareas.
 * - Arrow Up / Arrow Down move the highlight. Enter / Tab commit the
 *   selection. Escape closes the picker without inserting anything.
 *   Mouse click on a row also commits.
 * - The picker only fires server queries while a real mention is
 *   being typed; it short-circuits an empty `query` so the dropdown
 *   shows up immediately after `@` is typed (with an empty state)
 *   and only flips to "no matches" once the user has typed at least
 *   one character.
 * - The textarea value is fully controlled by the parent — we never
 *   keep a separate copy. `onChange` is called with the next value
 *   on every keystroke AND every mention insertion.
 *
 * Dependency-injection seam
 * ─────────────────────────
 * The `search` prop accepts an override so tests can substitute a
 * synchronous fake. Production callers leave it unset and the
 * component uses the real `searchMentionUsers()` REST helper.
 */
export interface MentionableTextareaProps {
    value: string;
    onChange: (next: string) => void;
    /** Forwarded to the underlying textarea. */
    placeholder?: string;
    /** Forwarded to the underlying textarea. */
    rows?: number;
    className?: string;
    /** Forwarded — useful for keyboard shortcuts the parent owns. */
    onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
    /** Forwarded — useful for click-to-stop-propagation in nested cards. */
    onClick?: (event: React.MouseEvent<HTMLTextAreaElement>) => void;
    /** Test hook — required when rendering with React state assertions. */
    'data-testid'?: string;
    /**
     * Override the user search. The default uses the REST helper.
     * Tests inject an in-memory fake so dropdown contents are
     * deterministic without HTTP mocking.
     */
    search?: (query: string) => Promise<MentionUser[]>;
    /**
     * Optional fixed id for the picker dropdown — pass when the parent
     * wires up `aria-controls`. We generate one with `useId()` when
     * unset.
     */
    pickerId?: string;
    /**
     * Format the displayed token. By default we show `@<name>` while
     * the underlying value stores `@<userId>`. A future slice can swap
     * to a rich-text editor where these diverge; the prop lets that
     * land without changing the picker.
     */
    formatLabel?: (user: MentionUser) => string;
}
export declare function MentionableTextarea({ value, onChange, placeholder, rows, className, onKeyDown, onClick, 'data-testid': testId, search, pickerId: pickerIdProp, formatLabel, }: MentionableTextareaProps): React.JSX.Element;
//# sourceMappingURL=MentionableTextarea.d.ts.map