export interface MentionUser {
    id: string;
    name: string;
    email: string;
}
export type MentionSearchOutcome = {
    ok: true;
    result: MentionUser[];
} | {
    ok: false;
    error: string;
    status: number;
};
export declare function searchMentionUsers(query: string): Promise<MentionSearchOutcome>;
/**
 * Description of an active `@`-mention being typed in a textarea / input.
 *
 *  - `start` and `end` are character offsets into the field value: the
 *    `@` itself sits at `start`, and `end` is the caret position
 *    (exclusive end of the query slice).
 *  - `query` is the substring between the `@` and the caret — exactly
 *    what we should pass to `searchMentionUsers()`.
 *
 * Callers replace `value.slice(start, end)` with the chosen token
 * (`@<userId> `, including the trailing space) to commit a selection.
 */
export interface MentionContext {
    start: number;
    end: number;
    query: string;
}
/**
 * Find an active mention at the caret. Mirrors the server-side
 * `extractMentionedUserIds` regex
 * (`/(^|\s)@[a-zA-Z0-9_-]{3,64}\b/g`) so the picker's intuition
 * about what counts as a mention can never disagree with the
 * server's notification routing.
 *
 * Returns `null` whenever:
 *   - the caret is at offset 0,
 *   - there is no `@` between the caret and the previous whitespace
 *     boundary,
 *   - the `@` is preceded by a non-whitespace, non-newline character
 *     (so an email address mid-word like `foo@bar` does NOT open
 *     the picker), or
 *   - the candidate query contains a character outside the mention
 *     charset (`[a-zA-Z0-9_-]`).
 *
 * The picker DOES open with a 0–2 character query — that's the
 * "you've started typing a mention" UX. But it can NEVER commit
 * such a token: `insertMentionToken` only fires for a `MentionUser`
 * which always has an id of at least 3 chars, matching the server
 * regex's min-length requirement.
 */
export declare function detectMentionContext(value: string, caret: number): MentionContext | null;
/**
 * Apply a mention selection to a text value. Returns the new value
 * plus the caret position where the next keystroke should land.
 *
 * Inserts `@<userId> ` (trailing space) so the user can keep typing
 * without manually moving the cursor past the token. If the caret
 * already sits before a space, we don't insert a duplicate space.
 */
export interface MentionInsertion {
    value: string;
    caret: number;
}
export declare function insertMentionToken(value: string, context: MentionContext, userId: string): MentionInsertion;
//# sourceMappingURL=mention-picker.d.ts.map