/** * Handlebars Template Protection Utilities * * Protects Handlebars syntax ({{...}}, {{#each}}, {{/each}}, etc.) from being * corrupted by contentEditable browser normalization during visual editing. * * Strategy: * - Block helpers ({{#each}}, {{/each}}, {{#if}}, etc.) are converted to HTML comments * - Regular variables ({{variable}}) are replaced with placeholder spans */ interface PlaceholderMap { [key: string]: string; } /** * Convert Handlebars syntax to protected format * - Block helpers ({{#each}}, {{/each}}, etc.) → HTML comments * - Regular variables ({{variable}}) → placeholder spans * @param html - Raw HTML with Handlebars syntax * @returns HTML with protected syntax + mapping object */ export declare function protectHandlebars(html: string): { html: string; map: PlaceholderMap; }; /** * Restore Handlebars syntax from protected format * - HTML comments → Block helpers * - Placeholder spans → Regular variables * @param html - HTML with protected syntax * @param map - Mapping of placeholder IDs to original Handlebars syntax * @returns Original HTML with Handlebars syntax restored */ export declare function restoreHandlebars(html: string, map?: PlaceholderMap): string; /** * Check if HTML contains Handlebars syntax * @param html - HTML string to check * @returns true if Handlebars syntax is found */ export declare function containsHandlebars(html: string): boolean; /** * Auto-protect Handlebars in contentEditable on load * Call this when loading HTML into the editor */ export declare function prepareForEditing(html: string): { html: string; map: PlaceholderMap; }; /** * Auto-restore Handlebars when getting HTML from editor * Call this when saving/exporting HTML from the editor */ export declare function prepareForSaving(html: string, map?: PlaceholderMap): string; export {};