@454creative/easy-email
Version:
A framework-agnostic email service library for Node.js with observability and monitoring
46 lines • 1.45 kB
TypeScript
/**
* Simple template engine for email templates
*
* Provides functions for rendering templates with context variables
*/
/**
* Template engine class for rendering email templates
*/
export declare class TemplateEngine {
private templatesDir;
/**
* Create a template engine instance
*
* @param templatesDir - Directory containing template files
*/
constructor(templatesDir: string);
/**
* Render a template with context variables
*
* @param templateName - Name of the template (without extension)
* @param context - Variables to inject into the template
* @returns string - Rendered template
*/
render(templateName: string, context?: Record<string, any>): string;
/**
* Check if a template exists
*
* @param templateName - Name of the template (without extension)
* @returns boolean - True if template exists
*/
templateExists(templateName: string): boolean;
/**
* Render template content with context variables
* @private
*/
private renderTemplate;
}
/**
* Render a template string with context variables
*
* @param template - Template string with {{variable}} placeholders
* @param context - Variables to inject into the template
* @returns string - Rendered template
*/
export declare function renderString(template: string, context?: Record<string, any>): string;
//# sourceMappingURL=template-engine.d.ts.map