//#region src/types.d.ts /** * Type definitions for the HTML email importer. */ /** * Conversion status for each element processed in the import report. */ type ConversionStatus = "converted" | "approximated" | "html-fallback" | "skipped"; /** * A single entry in the import report. */ interface ImportReportEntry { /** The source HTML element tag name (e.g. "h1", "img", "table"). */ sourceTag: string; /** The Templatical block type produced, or null if skipped. */ templaticalBlockType: string | null; status: ConversionStatus; note?: string; } /** * The full import report returned alongside the converted template. */ interface ImportReport { entries: ImportReportEntry[]; warnings: string[]; summary: { total: number; converted: number; approximated: number; htmlFallback: number; skipped: number; }; } /** * The result of an HTML import operation. */ interface ImportResult { content: import("@templatical/types").TemplateContent; report: ImportReport; } //#endregion //#region src/converter.d.ts /** * Converts an HTML email template to Templatical TemplateContent. * * Designed for table-based marketing email HTML (output of MJML, Mailchimp, * SendGrid, Campaign Monitor, hand-coded emails). Modern HTML using flex/grid * layouts is preserved via HTML-fallback blocks. * * @param html - The raw HTML string (full document or body fragment). * @returns An ImportResult with the converted content and a detailed report. * * @example * ```ts * import { convertHtmlTemplate } from '@templatical/import-html'; * * const html = await fetch('/email.html').then((r) => r.text()); * const { content, report } = convertHtmlTemplate(html); * * const editor = init({ container: '#editor', content }); * * console.log(report.summary); * console.log(report.warnings); * ``` */ export declare function convertHtmlTemplate(html: string): ImportResult; //#endregion export type { ConversionStatus, ImportReport, ImportReportEntry, ImportResult }; //# sourceMappingURL=index.d.ts.map