/** * The ExcelJS-backed workbook {@link @nhtio/adk/batteries/media/contracts!MediaEngine}: the * fidelity-preserving structural editor for xlsx, plus in-process blank-workbook generation. * * @module @nhtio/adk/batteries/media/engines/exceljs * * @remarks * ExcelJS models the parts of a workbook that matter to humans — fonts, fills, comments, * merged ranges, data validations — and carries them through a read→edit→write cycle intact. * That is this engine's whole reason to exist: the `sheet.*` verbs mutate workbooks users * hand us, and an edit that strips the user's formatting as a side effect is corruption with * good intentions. Compose this engine FIRST in the engines array when fidelity matters; the * sheetjs engine edits a far wider read matrix (ODS, XLS, NUMBERS, …) but SheetJS Community * Edition strips styling in the process. * * Capabilities: * * - **generate**: `EMPTY_MIME` → xlsx (a blank workbook with one `Sheet1` — every sheet step * expects at least one worksheet). * - **edit**: the ten `sheet.*` structural ops over xlsx, styling preserved. * * `exceljs` is an optional peer dependency, lazily imported on first actual use. Cross-env by * construction: no `node:*` imports, `Uint8Array` in and out (ExcelJS ships a browser build * via its `browser` field). */ import type { default as ExcelJSNS } from 'exceljs'; import type { MediaEngine } from "../contracts"; type ExcelJSModule = typeof ExcelJSNS; /** Options for {@link exceljsEngine}. */ export interface ExceljsEngineOptions { /** Override the module resolution (tests / custom builds). Default: `import('exceljs')`. */ exceljs?: () => ExcelJSModule | Promise; } /** * Construct the ExcelJS-backed workbook engine. * * @param options - Optional module resolver override. * @returns The engine. */ export declare const exceljsEngine: (options?: ExceljsEngineOptions) => MediaEngine; export {};