/** * Compiles a template string into a function that can render data. * The template can contain: * - `<%= ... %>` for escaped output * - `<%- ... %>` for raw output * - `<% ... %>` for plain JavaScript code execution * * @security WARNING: This function uses `new Function()` which is similar to `eval()`. * Only use with trusted template sources. Do NOT use with user-generated content. * For user-generated templates, consider using a sandboxed library like Handlebars or EJS. * * @param {string} template - The template string to compile. * @returns {function} A function that takes data and returns the rendered string. * @throws {Error} If template contains forbidden code patterns */ export declare function compile(template: string): (data: Record) => string; /** * Renders a template string with the provided data. * * @param {string} template - The template string to render. * @param {Record} data - The data to inject into the template. * @returns {string} The rendered string. */ export declare function render(template: string, data: Record): string; /** * Renders a template file with the provided data. * * @param {string} filePath - The path to the template file. * @param {Record} data - The data to inject into the template. * @returns {string} The rendered string. * @throws {Error} If path traversal is detected */ export declare function renderFile(filePath: string, data: Record): string; //# sourceMappingURL=template-engine.d.ts.map