/** * Mention parser for {{...}} inline references in concept text. * * Pure function: takes a raw mention body (the text inside * {{...}}) and returns a structured MentionParseResult. * * Convention: the ID always comes first, the display (render) text * always comes last. Every comma-separated form follows this: * * {{cite:key}} cite-key (source id) * {{cite:key, render term}} cite-key + render term * {{urn:...}} URN reference * {{urn:..., render term}} URN + render term * {{link:URL}} external link * {{link:URL, label}} external link with label * {{image:src}} embedded image * {{image:src, alt}} embedded image with alt text * {{bib:id}} bibliography record * {{bib:id, label}} bibliography record with label * {{numeric_id}} local concept ID * {{numeric_id, render term}} local concept ID + render term * {{designation}} designation matching * {{designation, render term}} designation + render term */ export type MentionKind = 'cite-ref' | 'urn-ref' | 'link-ref' | 'image-ref' | 'bib-ref' | 'numeric' | 'designation' | 'unresolved' | 'fig-ref' | 'table-ref' | 'formula-ref'; export interface MentionParseResult { kind: MentionKind; /** cite-ref / fig-ref / table-ref / formula-ref: the local key */ key?: string; /** urn-ref / link-ref: the URI */ uri?: string; /** image-ref: the image source path */ src?: string; /** image-ref: accessibility text */ alt?: string | null; /** bib-ref / numeric / designation: the identifier */ id?: string; /** render text (cite-ref, urn-ref, numeric, designation, bib-ref, fig/table/formula-ref) */ label?: string | null; raw: string; } export interface ParseOptions { /** * Called when a deprecated syntax is encountered (e.g. `<>`). * The callback receives a human-readable message and the source text. */ onDeprecated?: (message: string, source: string) => void; } /** * Parse the body of a {{...}} mention (without the braces). * * Pure: no I/O, no model lookups, no state. Resolution is the caller's job. */ export declare function parseMention(raw: string, _options?: ParseOptions): MentionParseResult; export interface ExtractedMention { /** The parsed mention result */ result: MentionParseResult; /** Full text including braces, e.g. `{{cite:foo}}` or `<>` */ fullMatch: string; /** Start offset in the source text */ start: number; /** End offset in the source text */ end: number; } /** * Extract all inline mentions from concept text. Handles both: * - `{{kind:target[,label]}}` — the canonical syntax * - `<>` — legacy AsciiDoc xref (deprecated) * * For `<<...>>` syntax, emits a deprecation warning via `options.onDeprecated` * and re-parses the inner content as if it were a `{{...}}` mention. * * The re-parse strategy: * - If the target looks like a fig/table/formula entity → treat as that kind * - Otherwise → treat as a cite (let the resolution cascade handle it) */ export declare function extractMentionsFromText(text: string, options?: ParseOptions): Generator; //# sourceMappingURL=reference-mention.d.ts.map