import * as XLSX from 'xlsx'; import type { drive_v3 } from 'googleapis'; export declare const EXCEL_MIME_TYPES: { xlsx: string; xls: string; }; export type CellValue = string | number | boolean | Date | null | undefined; /** * Check if a file is an Excel file based on its MIME type */ export declare function isExcelFile(mimeType: string | null | undefined): boolean; /** * Download an Excel file from Google Drive and parse it into a workbook */ export declare function downloadAndParseExcel(drive: drive_v3.Drive, fileId: string): Promise<{ workbook: XLSX.WorkBook; fileName: string; mimeType: string; }>; /** * Upload a workbook back to Google Drive, replacing the existing file */ export declare function uploadExcel(drive: drive_v3.Drive, fileId: string, workbook: XLSX.WorkBook, mimeType?: string): Promise; /** * Get list of sheet names in a workbook */ export declare function getSheetNames(workbook: XLSX.WorkBook): string[]; /** * Get a worksheet by name, throwing an error if not found */ export declare function getWorksheet(workbook: XLSX.WorkBook, sheetName?: string): XLSX.WorkSheet; /** * Parse A1 notation range into column/row components * e.g., "A1" -> { col: 0, row: 0 } * e.g., "B3:D5" -> { startCol: 1, startRow: 2, endCol: 3, endRow: 4 } */ export interface CellRef { col: number; row: number; } export interface RangeRef { start: CellRef; end: CellRef; } export declare function parseA1Notation(a1: string): CellRef | RangeRef; /** * Convert column index (0-based) to A1 notation letters */ export declare function colIndexToLetter(col: number): string; /** * Convert cell ref to A1 notation string */ export declare function cellRefToA1(ref: CellRef): string; /** * Read a range of cells from a worksheet */ export declare function readRange(sheet: XLSX.WorkSheet, range: string): CellValue[][]; /** * Read a single cell from a worksheet */ export declare function readCell(sheet: XLSX.WorkSheet, cellRef: string): CellValue; /** * Write a value to a single cell */ export declare function writeCell(sheet: XLSX.WorkSheet, cellRef: string, value: CellValue): void; /** * Write a 2D array of values to a range starting at a cell */ export declare function writeRange(sheet: XLSX.WorkSheet, startCell: string, values: CellValue[][]): { updatedCells: number; updatedRows: number; updatedColumns: number; }; /** * Append rows to the end of data in a sheet */ export declare function appendRows(sheet: XLSX.WorkSheet, values: CellValue[][], startColumn?: string): { appendedRows: number; startingRow: number; }; /** * Clear a range of cells */ export declare function clearRange(sheet: XLSX.WorkSheet, range: string): number; /** * Get info about a worksheet (dimensions, row/col count) */ export interface SheetInfo { name: string; rowCount: number; columnCount: number; range: string; usedRange: string | null; } export declare function getSheetInfo(workbook: XLSX.WorkBook, sheetName: string): SheetInfo; /** * Create a new sheet in a workbook */ export declare function addSheet(workbook: XLSX.WorkBook, sheetName: string): XLSX.WorkSheet; /** * Delete a sheet from a workbook */ export declare function deleteSheet(workbook: XLSX.WorkBook, sheetName: string): void; /** * Rename a sheet in a workbook */ export declare function renameSheet(workbook: XLSX.WorkBook, oldName: string, newName: string): void; //# sourceMappingURL=excelHelpers.d.ts.map