export declare const MENTION_TAG = "MENTION"; export declare const MENTION_TAG_LOWER: string; export declare const BLOCK_TAGS: Set; /** The trigger a chip falls back to when its markup carries no `trigger` attribute. */ export declare const DEFAULT_TRIGGER = "@"; /** * A collapsed selection sitting right after a `contenteditable=false` element is * not representable; Android resolves it *into* the element, the IME then finds * no editable context and hides the keyboard. A zero-width space after every chip * gives the caret a real text node to live in. It is stripped on serialize, so it * never reaches the public HTML, the v-model or the server. */ export declare const CARET_ANCHOR = "\u200B"; /** * The space a chip owns on its right. It must be a no-break space: Chrome * normalizes a trailing plain space away as soon as the next character is typed * into that text node, and the value loses the separation the chip was picked * with. Serialization turns it back into an ordinary space. */ export declare const CHIP_SEPARATOR = "\u00A0"; export declare function createCaretAnchor(): Text; /** * Length of the chip's own prefix — the caret anchor plus at most one separator — * at the start of `text`. Zero when the text does not start with an anchor. */ export declare function chipPrefixLength(text: Text): number; export declare function isMentionElement(node: Node | null | undefined): boolean; /** * Every chip in `root`. Pressing Enter nests content in block elements, so the * editor's direct children are not enough. */ export declare function queryMentionElements(root: ParentNode): HTMLElement[]; export declare function getMentionLabel(el: HTMLElement): string; export declare function createMentionElement(key: string, label: string, trigger?: string): HTMLElement; /** Escape plain text for paste fallback (newlines → `
`). */ export declare function escapePlainTextAsHtml(text: string): string; export interface MentionTreeHandlers { /** A text node, with the editor's NBSP glue and caret anchors normalised away. */ onText: (text: string) => void; /** A legal `` chip. */ onMention: (el: HTMLElement) => void; /** A `
`. */ onBreak: () => void; /** A block element that carries content: emit a line break where one is missing. */ onBlock: () => void; } /** * Walk a mention DOM tree in document order — chips, text, breaks and block * boundaries — for both the public parser and the serializer. */ export declare function walkMentionTree(root: Node, handlers: MentionTreeHandlers): void; /** * Serialize an editor DOM tree into the public HTML contract: * plain text + `label` only. */ export declare function serializeMentionHtml(root: HTMLElement): string; /** * Paste sanitizer: keep legal `` nodes; everything else becomes text. */ export declare function sanitizeMentionClipboardHtml(html: string): DocumentFragment; /** * Our copies carry the editor's edge line breaks as `\n`, so pasting them back would * add a blank line on every round trip. */ export declare function trimMentionEdgeBreaks(fragment: DocumentFragment): DocumentFragment; export declare function setMentionEditorContent(root: HTMLElement, html: string): void;