@mertdeveci55/univer-import-export
Version:
Excel/CSV import and export library for Univer spreadsheets with full format preservation
73 lines (72 loc) • 1.9 kB
TypeScript
export interface ArrayFormulaInfo {
formula: string;
range: {
startRow: number;
endRow: number;
startCol: number;
endCol: number;
};
masterRow: number;
masterCol: number;
formulaId: string;
}
/**
* ArrayFormulaHandler - Handles array formulas (like TRANSPOSE) for Excel export
*
* This class detects array formulas from Univer data and applies them correctly
* to ExcelJS worksheets using fillFormula method.
*/
export declare class ArrayFormulaHandler {
private arrayFormulas;
private processedRanges;
/**
* Check if a cell is part of an array formula
*/
isArrayFormula(cell: any, sheetData: any, rowIndex: number, colIndex: number): boolean;
/**
* Get array formula info for a cell
*/
getArrayFormulaInfo(cell: any, sheetData: any): ArrayFormulaInfo | null;
/**
* Apply array formula to ExcelJS worksheet
* This should be called for the master cell of the array formula
*/
applyArrayFormula(worksheet: any, arrayFormula: ArrayFormulaInfo, startCellValue: any): boolean;
/**
* Check if a range has already been processed
*/
isRangeProcessed(range: {
startRow: number;
endRow: number;
startCol: number;
endCol: number;
}): boolean;
/**
* Reset handler for new worksheet
*/
reset(): void;
/**
* Debug: Log current state
*/
debugState(): void;
/**
* Clean formula for Excel compatibility
*/
private cleanFormula;
/**
* Validate range object structure
*/
private isValidRange;
/**
* Validate array formula structure
*/
private isValidArrayFormula;
/**
* Get statistics about processed array formulas
*/
getStatistics(): {
totalProcessed: number;
ranges: string[];
formulas: string[];
};
}