export { D as DocxMetadata, P as ParsedOOXML, a as ProcessTemplateOptions, b as ProcessTemplateResult, S as SerializeOptions, c as SerializeResult, d as StyleDef, g as getTemplateTags, p as parseDocxOOXML, e as patchDocumentXml, f as previewTemplate, h as processTemplate, r as readPageSetupFromDocx, i as rezipDocx, s as saveDocxSelective, j as serializeTipTapToOOXML, v as validateTemplate } from './template-Chw14UX7.js'; import { W as WatermarkConfig } from './watermark-DNRzAyyP.js'; interface PdfRenderInput { /** Schema-accurate content HTML — e.g. `docxEditor.getExportSnapshot().html`. */ html: string; /** CSS custom properties for page geometry/typography (`themeCSSVars` from `getExportSnapshot()`). */ themeCSSVars?: string; /** Watermark config, or null/undefined for none. */ watermark?: WatermarkConfig | null; /** Header HTML (repeats on every printed page), or '' for none. */ headerHTML?: string; /** Footer HTML (repeats on every printed page), or '' for none. */ footerHTML?: string; } interface PdfRenderOptions { /** Page width in inches. Default: 8.5 (US Letter, matching the editor's own default page width). */ pageWidthIn?: number; /** Page height in inches. Default: 11 (US Letter). */ pageHeightIn?: number; /** Extra CSS appended after the editor's stylesheet (highest priority — use for last-mile print tweaks). */ extraCSS?: string; /** Puppeteer launch options passthrough (e.g. `{ executablePath: ... }` for a specific Chromium install). */ launchOptions?: Record; } /** * Render a document to a PDF, via headless Chromium. See the module * docstring for why this approach and why it's Node-only. */ declare function renderHtmlToPdf(input: PdfRenderInput, options?: PdfRenderOptions): Promise; /** * Headless DOCX processing — server-side utilities with no DOM dependency. * * This module provides functions for processing .docx files without a browser: * - parseDocx(): extract text + structure from a .docx ArrayBuffer * - serializeDocx(): create a .docx from structured content * - extractText(): get plain text from a .docx * - extractStructure(): get block structure (headings, paragraphs, tables) * - mergeDocx(): merge multiple .docx files into one * * All functions work in Node.js (server-side) without any DOM. * * Usage: * import { parseDocx, extractText, processTemplate } from '@shashimadushan/docx-editor-editor/headless'; * * const buffer = fs.readFileSync('document.docx').buffer; * const text = await extractText(buffer); * const structure = await extractStructure(buffer); */ interface DocxBlock { type: 'heading' | 'paragraph' | 'table' | 'list' | 'image' | 'codeBlock' | 'blockquote' | 'horizontalRule' | 'unknown'; text?: string; level?: number; listType?: 'bullet' | 'ordered'; items?: string[]; rows?: string[][]; imageSrc?: string; } interface ParsedDocx { /** Plain text content of the document. */ text: string; /** HTML content (from mammoth). */ html: string; /** Structured blocks. */ blocks: DocxBlock[]; /** Document metadata (from core.xml). */ metadata: { title?: string; creator?: string; created?: string; modified?: string; subject?: string; description?: string; }; /** Conversion warnings from mammoth. */ warnings: Array<{ type: string; message: string; }>; } /** * Parse a .docx ArrayBuffer into text, HTML, structured blocks, and metadata. * * Works server-side (no DOM required). */ declare function parseDocx(buffer: ArrayBuffer): Promise; /** * Extract plain text from a .docx ArrayBuffer. * Server-side safe (no DOM). */ declare function extractText(buffer: ArrayBuffer): Promise; /** * Extract structured blocks (headings, paragraphs, tables, lists) from a .docx. * Server-side safe. */ declare function extractStructure(buffer: ArrayBuffer): Promise; /** * Extract document metadata (title, author, dates) from core.xml. */ declare function extractMetadata(buffer: ArrayBuffer, zip?: any): Promise; /** * Create a .docx ArrayBuffer from a simple content structure. * Uses the `docx` library to build the document. * * Server-side safe. */ declare function serializeDocx(blocks: DocxBlock[], options?: { title?: string; creator?: string; }): Promise; /** * Merge multiple .docx files into one. * Extracts text from each and creates a new combined document. */ declare function mergeDocx(buffers: ArrayBuffer[]): Promise; export { type DocxBlock, type ParsedDocx, type PdfRenderInput, type PdfRenderOptions, extractMetadata, extractStructure, extractText, mergeDocx, parseDocx, renderHtmlToPdf, serializeDocx };