import type { CellValue } from '../cell/cell'; import type { XlsxSink } from '../io/sink'; import type { Alignment } from '../styles/alignment'; import type { Border } from '../styles/borders'; import type { Fill } from '../styles/fills'; import type { Font } from '../styles/fonts'; import type { Protection } from '../styles/protection'; export interface WriteOnlyOptions { /** Reserved — currently ignored (the buffered backend doesn't honour it). */ estimatedMaxRow?: number; } export interface WriteOnlyStyle { font?: Font; fill?: Fill; border?: Border; alignment?: Alignment; numberFormat?: string; protection?: Protection; } export type WriteOnlyRowItem = CellValue | { value: CellValue; style?: WriteOnlyStyle; }; export interface WriteOnlyWorksheet { readonly title: string; appendRow(row: WriteOnlyRowItem[]): Promise; setColumnWidth(col: number, width: number): void; close(): Promise; } export interface WriteOnlyWorkbook { /** Add a new worksheet. The previous worksheet must be `close()`d first. */ addWorksheet(title: string): Promise; /** Finalise the archive: emits styles / sharedStrings / workbook / manifest / rels. */ finalize(): Promise; /** * Release the sink without finalising the archive. Call this from a * surrounding catch block when the producer pipeline throws before * `finalize()` — without it, streaming destinations (`toFile` / * `toWritable`) keep the file descriptor / Writable open and the partial * xlsx looks valid on disk. * * Idempotent. Subsequent `addWorksheet` / `finalize` calls throw. */ abort(cause?: unknown): void; } /** Open a workbook for streaming write-only output. */ export declare function createWriteOnlyWorkbook(sink: XlsxSink, _opts?: WriteOnlyOptions): Promise;