/** * HTML to Markdown Converter * * Converts HTML content to Markdown format for ADO work item fields. * Used for auto-converting HTML fields to markdown when syncing. */ /** * Convert HTML content to Markdown * * @param html - HTML content string * @returns Markdown formatted string */ export declare function htmlToMarkdown(html: string): string; /** * Normalise Markdown body text for change-detection comparison. * * On push we compare the local Markdown against `htmlToMarkdown(adoHtml)` to * decide whether an HTML-stored body field was actually edited. Both sides must * be normalised the same way `htmlToMarkdown` finishes (CRLF→LF, collapse 3+ * blank lines, trim) so cosmetic whitespace differences don't read as a real * edit and trigger a needless re-push — which would flip the field to Markdown * format and overwrite a complex table with the lossy pulled Markdown. */ export declare function normalizeMarkdownForCompare(s: string): string; /** * True if the HTML contains a table element. * * HTML tables cannot round-trip losslessly to Markdown — merged cells, * colspans, and cell styling have no Markdown equivalent — so any field that * holds one is flagged "lossy" when converted, telling the agent the ADO * original is the higher-fidelity copy. */ export declare function htmlHasTable(html: string | null | undefined): boolean; /** * Convert HTML fields to Markdown IN MEMORY. Mutates `fields` in place. * * This NEVER writes to ADO. The work item in ADO is left exactly as the client * authored it (HTML, tables and all); only the in-memory copy — destined for * the local markdown file — is converted. The ADO copy therefore stays the * lossless source of truth and can be re-read at any time. * * @param fields - Work item field map (mutated in place) * @param fieldsToConvert - Refnames to convert if they currently hold HTML * @returns `converted` (refnames converted) and `lossy` (the subset that held a * table and may have lost fidelity in conversion) */ export declare function convertFieldsToMarkdownInMemory(fields: Record, fieldsToConvert: string[]): { converted: string[]; lossy: string[]; }; //# sourceMappingURL=html-converter.d.ts.map