Project Files
dist / utils / workbook.d.ts
import ExcelJS from "exceljs";
/**
* Load any Excel/CSV format into an ExcelJS Workbook.
* ExcelJS handles .xlsx/.xlsm/.csv natively.
* SheetJS converts .xls/.xlsb/.ods/.tsv → xlsx buffer → ExcelJS.
*/
export declare function loadWorkbook(filePath: string): Promise<ExcelJS.Workbook>;
/** Save workbook — always as .xlsx */
export declare function saveWorkbook(wb: ExcelJS.Workbook, filePath: string): Promise<void>;
export declare function getSheet(wb: ExcelJS.Workbook, name?: string): ExcelJS.Worksheet | string;
export declare function getCellValue(cell: ExcelJS.Cell): unknown;
export declare function worksheetToJson(ws: ExcelJS.Worksheet): Record<string, unknown>[];
export interface WriteOptions {
boldHeaders?: boolean;
autoWidth?: boolean;
headerFill?: string;
}
export declare function jsonToWorksheet(ws: ExcelJS.Worksheet, data: Record<string, unknown>[], opts?: WriteOptions): void;
export interface FilterCondition {
column: string;
operator: "=" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith" | "endsWith" | "regex" | "isNull" | "isNotNull";
value?: string | number;
}
export declare function matchesFilters(row: Record<string, unknown>, filters: FilterCondition[]): boolean;
export declare function colIndexToLetter(n: number): string;
export declare function preview(rows: Record<string, unknown>[], n?: number): Record<string, unknown>[];