UNPKG

@mertdeveci55/univer-import-export

Version:

Excel/CSV import and export library for Univer spreadsheets with full format preservation

46 lines (45 loc) 1.35 kB
/** * FormulaCleaner - Handles formula cleaning for Excel export * * This class fixes common issues with formulas when exporting to Excel: * 1. @ symbols incorrectly added by ExcelJS * 2. Double equals (==) issues * 3. Invalid formula syntax * 4. Special character handling */ export declare class FormulaCleaner { /** * Clean formula for Excel export * This is the main method that applies all cleaning rules */ static cleanFormula(formula: string): string; /** * Handle @ symbols intelligently based on formula type * For TRANSPOSE and other dynamic array formulas, @ symbols are REQUIRED in Excel 365 */ private static removeIncorrectAtSymbols; /** * Fix Excel function names and syntax */ private static fixFunctionNames; /** * Validate and fix basic formula syntax */ private static validateSyntax; /** * Handle special characters in formulas */ private static handleSpecialCharacters; /** * Get summary of changes made during cleaning */ private static getChanges; /** * Check if a formula is valid for Excel export */ static isValidFormula(formula: string): boolean; /** * Special handling for array formulas */ static cleanArrayFormula(formula: string, range?: string): string; }