/** * DocxTemplaterRenderer * * Renderer adapter for Word documents (.docx) using docxtemplater. * Extends BaseRendererAdapter. * * **Supported Formats**: WORD (.docx) * * **Pros**: * - Native Word document generation * - Template-based (use .docx templates with placeholders) * - Full Word features (styles, headers, footers) * - No HTML/browser required * * **Use Cases**: * - Contracts with placeholders * - Certificates * - Reports with complex formatting * - Legal documents */ import { type StorageRenderOptions, type StorageRenderResult, type StorageRendererHealthCheck } from '@plyaz/types/storage'; import { BaseRendererAdapter } from '../base/BaseRendererAdapter'; import type { StorageDocxTemplaterRendererConfig } from '@plyaz/types/storage'; /** * DocxTemplaterRenderer Adapter * * Generates Word documents from .docx templates with placeholders. * * @example * ```typescript * const renderer = new DocxTemplaterRenderer({ * name: 'docx-main', * type: STORAGE_RENDERER_TYPE.DOCXTEMPLATER, * enabled: true, * priority: 100, * supportedFormats: [OUTPUT_FORMAT.WORD], * config: { * templateBasePath: './templates/word' * } * }); * * // Contract template with {customerName}, {amount}, etc. placeholders * const result = await renderer.render({ * format: OUTPUT_FORMAT.WORD, * data: { * templatePath: 'contracts/service-agreement.docx', * data: { * customerName: 'John Doe', * amount: '$1,000', * startDate: '2025-01-01', * endDate: '2025-12-31' * } * }, * wordOptions: { * creator: 'My Company', * title: 'Service Agreement' * } * }); * ``` */ export declare class DocxTemplaterRenderer extends BaseRendererAdapter { private readonly templateBasePath; private readonly defaultOptions; constructor(config: StorageDocxTemplaterRendererConfig); /** * Render content */ render(options: StorageRenderOptions): Promise; /** * Generate Word document using docxtemplater * @private */ private generateWord; /** * Get document data from options * @private */ private getDocumentData; /** * Check renderer health */ checkHealth(): Promise; }