/** * Markdown normalizer — clean markdown for Feishu docx API. * * Ported from feishu_tool.py normalize_markdown_for_feishu. */ export interface NormalizationReport { tableSeparatorFixed: number; duplicateLooseMetaRemoved: boolean; htmlPresent: boolean; addOnsMermaidConverted: number; mermaidThemeApplied: number; calloutDslConverted: number; quoteContainerConverted: number; } export declare const MERMAID_EDGE_LABEL_BG = "#f4deff"; export declare function applyMermaidTheme(source: string): { text: string; themed: boolean; }; export declare function themeMermaidFences(md: string): { text: string; themed: number; }; /** * Convert Feishu mermaid blocks to ```mermaid fences. * * Fetch returns mermaid diagrams as a single-line tag: * * * lark-cli docs +create (v1.0.6+) accepts ```mermaid fences and creates whiteboard blocks. * This conversion enables round-trip upload of mermaid diagrams. * * JSON.parse handles \n → newline and \u003e → > inside the data field automatically. */ export declare function convertAddOnsToMermaid(md: string): { text: string; converted: number; }; /** * Lint markdown for common Feishu issues. * Returns list of warnings (informational only). */ export declare function lintMarkdown(mdText: string): string[]; /** * Unescape \| → | inside lark-table blocks. * In markdown tables, | is a cell delimiter so unescaping would break parsing. * Safe to call twice: before lark-table conversion (no-op for markdown tables) * and after (converts escaped pipes in lark-table cells). * Code fences are always skipped. */ export declare function unescapePipes(md: string): string; /** * Convert ... for lark-cli upload. * * appears in documents fetched from Feishu (lark-cli emits this XML * to represent QuoteContainer blocks). However lark-cli's upload path has no parser for * — it is fetch-only. Uploading it silently drops the block. * * Context-dependent conversion: * - Inside : → (grey) — blockquotes don't work in table cells. * - Outside : → blockquote `>` — native markdown, renders natively in Feishu. */ export declare function convertQuoteContainerToCallout(md: string): { text: string; converted: number; }; /** * Convert [!callout attrs]...content...[/callout] DSL to ...content... XML. * * The bracket DSL is an alternative authoring syntax (also appears in some Feishu exports). * Converting it early ensures all downstream steps (hasOpeningCallout, injectOpeningCallout, * convertBlockquotesToCallouts) see a single canonical XML form. */ export declare function convertCalloutDslToXml(md: string): { text: string; converted: number; }; /** * Full normalization pipeline. */ export declare function normalizeMarkdown(mdText: string): { text: string; report: NormalizationReport; }; /** * Bold table header cells (rows directly above a separator row). */ export declare function boldTableHeaders(md: string): string; //# sourceMappingURL=normalize.d.ts.map