import { ProcessorInput } from '../utils/io'; import { BaseProcessor, ExtractStringsResult, TranslatedString, SourceString } from '../core/baseProcessor'; import { AACTree } from '../core/treeStructure'; /** * Excel Processor for converting AAC grids to Excel format * Converts AAC tree structures to Excel workbooks with each page as a worksheet * Supports visual styling, navigation links, and vocabulary analysis workflows */ export declare class ExcelProcessor extends BaseProcessor { readonly capabilities: { wordList: "none"; preservesAssetsOnSave: boolean; newCellCreation: "allowed"; }; private static readonly NAVIGATION_BUTTONS; /** * Extract all text content from an Excel file * @param filePathOrBuffer - Path to Excel file or Buffer containing Excel data * @returns Promise resolving to all text content found in the Excel file */ extractTexts(_filePathOrBuffer: ProcessorInput): Promise; /** * Load Excel file into AACTree structure * @param filePathOrBuffer - Path to Excel file or Buffer containing Excel data * @returns Promise resolving to an AACTree representation of the Excel file */ loadIntoTree(_filePathOrBuffer: ProcessorInput): Promise; /** * Process texts in Excel file (apply translations) * @param filePathOrBuffer - Path to Excel file or Buffer containing Excel data * @param translations - Map of original text to translated text * @param outputPath - Path where translated Excel file should be saved * @returns Promise resolving to a buffer containing the translated Excel file */ processTexts(_filePathOrBuffer: ProcessorInput, _translations: Map, outputPath: string): Promise; /** * Convert an AAC page to an Excel worksheet * @param workbook - Excel workbook to add worksheet to * @param page - AAC page to convert * @param tree - Full AAC tree for navigation context * @param usedNames - Set of already used worksheet names to avoid duplicates */ private convertPageToWorksheet; /** * Calculate optimal grid dimensions for buttons * @param page - AAC page to analyze * @returns Object with rows and cols dimensions */ private calculateGridDimensions; /** * Convert grid layout to Excel cells * @param worksheet - Excel worksheet * @param grid - 2D array of AAC buttons * @param startRow - Starting row number */ private convertGridLayout; /** * Convert button list to grid layout in Excel * @param worksheet - Excel worksheet * @param buttons - Array of AAC buttons * @param rows - Number of rows in grid * @param cols - Number of columns in grid * @param startRow - Starting row number */ private convertButtonsToGrid; /** * Set button data and formatting for an Excel cell * @param worksheet - Excel worksheet * @param button - AAC button to represent * @param row - Excel row number * @param col - Excel column number */ private setButtonCell; /** * Apply AAC button styling to Excel cell * @param cell - Excel cell to style * @param style - AAC style object */ private applyCellStyling; /** * Convert color string to ARGB format for Excel * @param color - Color string (hex, rgb, etc.) * @returns ARGB color string */ private convertColorToArgb; /** * Add navigation link to cell for worksheet navigation * @param cell - Excel cell to add link to * @param targetPageId - Target page ID to link to */ private addNavigationLink; /** * Set appropriate cell size for button representation * @param worksheet - Excel worksheet * @param row - Row number * @param col - Column number */ private setCellSize; /** * Add navigation row with standard AAC navigation buttons * @param worksheet - Excel worksheet * @param page - Current AAC page * @param tree - Full AAC tree for navigation context */ private addNavigationRow; /** * Apply general formatting to the worksheet * @param worksheet - Excel worksheet * @param rows - Number of content rows * @param cols - Number of content columns * @param startRow - Starting row for content */ private formatWorksheet; /** * Sanitize worksheet name for Excel compatibility * @param name - Original name * @returns Sanitized name safe for Excel worksheet */ private sanitizeWorksheetName; /** * Get a unique worksheet name by appending a number if needed * @param name - Original name * @param usedNames - Set of already used names (case-insensitive) * @returns Unique worksheet name */ private getUniqueWorksheetName; /** * Check if navigation row should be added (configurable feature) * @returns True if navigation row should be added */ private shouldAddNavigationRow; /** * Override saveFromTree to handle async nature of Excel operations * Note: This method is async but maintains the sync interface for compatibility */ saveFromTree(tree: AACTree, outputPath: string): Promise; /** * Async version of saveFromTree for internal use */ private saveFromTreeAsync; /** * Extract strings with metadata for aac-tools-platform compatibility * Uses the generic implementation from BaseProcessor */ extractStringsWithMetadata(filePath: string): Promise; /** * Generate translated download for aac-tools-platform compatibility * Uses the generic implementation from BaseProcessor */ generateTranslatedDownload(filePath: string, translatedStrings: TranslatedString[], sourceStrings: SourceString[]): Promise; }