import type { ContentSegment, MentionData } from "./Mention.types";
export declare const MENTION_ATTR = "data-mention-id";
/**
 * Serialize segments to a plain text string.
 * Mentions become `trigger + label` (e.g. "@Sarah Wilson").
 */
export declare const serializeSegments: (segments: ContentSegment[]) => string;
/**
 * Serialize segments but replace mention content with a neutral placeholder.
 * This prevents `detectActiveMention` from matching trigger characters
 * that belong to already-resolved mentions.
 */
export declare const serializeSegmentsMasked: (segments: ContentSegment[]) => string;
/**
 * Merge adjacent text segments and ensure the array starts/ends with text.
 * Returns a new array (never mutates input).
 */
export declare const normalizeSegments: (segments: ContentSegment[]) => ContentSegment[];
/**
 * Insert a mention into the segments array at the given plain-text position.
 * `startIndex` is the position of the trigger character.
 * `replaceLength` includes the trigger + query length.
 */
export declare const insertMentionIntoSegments: (segments: ContentSegment[], mention: MentionData, startIndex: number, replaceLength: number) => ContentSegment[];
/**
 * Get the plain text offset of the current caret position within a
 * contentEditable container. Mention nodes count as their trigger+label length.
 */
export declare const getPlainTextOffset: (container: HTMLElement) => number | null;
/**
 * Parse the DOM of a contentEditable container back into segments.
 * Text nodes become TextSegments, elements with MENTION_ATTR become MentionSegments.
 */
export declare const parseDOMToSegments: (container: HTMLElement, mentionMap: Map<string, MentionData>) => ContentSegment[];
/**
 * Place the caret right after a given node inside a contentEditable container.
 */
export declare const setCaretAfterNode: (node: Node) => void;
/**
 * Set the caret at a specific plain-text offset within a contentEditable container.
 */
export declare const setCaretAtOffset: (container: HTMLElement, targetOffset: number) => void;
