/** * Formats we accept as input for a document job. */ export declare const CONVERTIBLE_INPUTS: readonly ["doc", "docx", "odt", "rtf", "txt", "html", "htm"]; /** * Formats LibreOffice can actually produce in this WASM build. * * Verified by probe (2026-09): Writer supports pdf / docx / doc / odt / rtf / * txt only. `html` is listed in the converter's own format table but the save * step fails with "Failed to save document", so HTML output is NOT used here - * the prepare leg goes through {@link docxToEditableHtml} (mammoth) instead. */ export declare const CONVERTIBLE_OUTPUTS: readonly ["docx", "doc", "pdf", "odt", "rtf", "txt", "xlsx", "csv", "pptx"]; /** * Convert a buffer to `outputFormat`. `inputFormat` is passed as a hint when * the input has no reliable signature (an HTML string being turned into a * .docx, for example) - without it LibreOffice has to guess. Throws with a * readable message when the converter cannot load or the conversion fails. */ export declare function convertBuffer(input: Buffer, outputFormat: string, inputFormat?: string): Promise; /** Release the converter (daemon shutdown / CLI exit). */ export declare function shutdownConverter(): Promise; /** * Produce the editable body of a Word document as HTML. * * LibreOffice CANNOT do this in the WASM build (HTML export is advertised but * the save step fails), so mammoth is used instead: it maps the document's * semantic structure - headings, paragraphs, lists, tables, bold/italic, * links and images - onto the HTML subset the editor understands. Styling that * the editor cannot represent is dropped here; the original file version is * never modified, so nothing is lost irretrievably. */ export declare function docxToEditableHtml(input: Buffer): Promise; /** File extension for an output format (docx -> "docx"). */ export declare function extensionFor(format: string, fallback?: string): string; /** MIME type for a conversion output format (best-effort). */ export declare function mimeFor(format: string): string;