export declare const MENTION_DIRECTIVE_NAME = "mention"; export declare const MENTION_NODE_NAME = "mention"; export type MentionAttrs = { type: string; id: string; label: string; extra: Record; }; type DirectiveLike = { name?: string; attributes?: Record | null; children?: unknown[]; }; /** Collects mention label text from mdast phrasing children, unescaping directive escapes. */ export declare function phrasingToLabel(children: unknown[] | undefined): string; /** Reverses `\\` and `\\]` escapes in a mention directive label. */ export declare function unescapeMentionLabel(label: string): string; /** Escapes `\\` and `]` so a label is safe inside `:mention[...]`. */ export declare function escapeMentionLabel(label: string): string; /** Directive attributes other than `type` and `id` (e.g. `playbookId`). Drops keys/values that cannot live in `{...}`. */ export declare function extraAttrsFromRecord(attributes: Record | null | undefined): Record; /** True when the node is a `:mention` directive with `type`, `id`, and at least one ref attr. */ export declare function isValidMentionDirective(node: DirectiveLike): boolean; /** Parses a valid mention directive into normalized attrs, or null if invalid. */ export declare function readMentionAttrs(node: DirectiveLike): MentionAttrs | null; /** Merges `type`, `id`, and `extra` into one attribute map for markdown serialization. */ export declare function flattenMentionAttrs(attrs: MentionAttrs): Record; /** Normalizes ProseMirror mention node attrs (including legacy flat ref keys) into `MentionAttrs`. */ export declare function mentionAttrsFromNode(attrs: Record): MentionAttrs; /** Serializes attrs to a `:mention[label]{...}` text directive, or null if attrs fail the gate. */ export declare function formatMentionDirective(attrs: MentionAttrs): string | null; export {};