UNPKG

@bernierllc/email-template-engine

Version:

Email template processing engine with compilation, rendering, and text generation

31 lines (30 loc) 1.67 kB
import { EmailTemplateEngine } from './EmailTemplateEngine'; import type { BaseTemplate, BuiltTemplate, CompilationOptions, TemplateResult, TemplateValidationResult, TemplateVariable, TextGenerationOptions } from './types'; export { EmailTemplateEngine }; export type { BaseTemplate, BuiltTemplate, CompilationOptions, TemplateResult, TemplateValidationError, TemplateValidationResult, TemplateVariable, TextGenerationOptions, Logger, } from './types'; export { defaultHelpers } from './helpers'; export { checkBalancedBraces, checkUnclosedBlocks, isBuiltInHelper, inferVariableType, } from './validation'; /** * Compile template to reusable function */ export declare function compileTemplate(template: string, options?: CompilationOptions): TemplateResult<HandlebarsTemplateDelegate>; /** * Render template with data */ export declare function renderTemplate(template: string, data: Record<string, unknown>, options?: CompilationOptions): TemplateResult<string>; /** * Build complete email template from base + content */ export declare function buildEmailTemplate(baseTemplate: BaseTemplate, content: string, variables?: Record<string, unknown>): Promise<TemplateResult<BuiltTemplate>>; /** * Generate plain text version from HTML */ export declare function generateTextFromHtml(html: string, options?: TextGenerationOptions): TemplateResult<string>; /** * Extract variables from template */ export declare function extractTemplateVariables(template: string): TemplateResult<TemplateVariable[]>; /** * Validate template syntax and structure */ export declare function validateEmailTemplate(template: string): TemplateResult<TemplateValidationResult>;