/** * F5 CLI - Excel Processor * Parse Excel files and extract requirements with auto-detection * * @module @f5/cli/core/excel-processor * @version 1.1.0 */ import type { ImageExtractionResult } from './excel-image-extractor.js'; import type { FormulaAnalysisResult, BusinessRule } from './excel-formula-handler.js'; import type { ExcelAnalysisReport, AnalysisOptions } from './excel-analysis-report.js'; export interface ColumnMappings { [key: string]: string[]; } export interface RequirementSource { file: string; sheet: string; row: number; fullPath: string; } export interface Requirement { id: string | null; description: string; priority: 'Critical' | 'High' | 'Medium' | 'Low'; status: string; notes: string; category: 'Functional' | 'Non-Functional' | 'Business Rule' | 'Use Case' | 'Other'; owner: string; source: RequirementSource; hash: string; importedAt: string; } export interface SheetData { sheetName: string; headers: string[]; columnMap: Record; rowCount: number; requirements: Requirement[]; } export interface ParsedFile { fileName: string; filePath: string; sheets: Record; requirements: Requirement[]; metadata: { parsedAt: string; sheetCount: number; }; } export interface ParseResult { files: ParsedFile[]; allRequirements: Requirement[]; stats: ParserStats; } export interface ParserStats { filesProcessed: number; sheetsProcessed: number; rowsProcessed: number; requirementsExtracted: number; skippedRows: number; errors: Array<{ file: string; error: string; }>; } export interface ExcelProcessorOptions { autoDetectColumns?: boolean; columnMappings?: ColumnMappings; idPattern?: RegExp | null; allowAutoId?: boolean; skipEmptyRows?: boolean; extractImages?: boolean; analyzeFormulas?: boolean; outputDir?: string; } export interface EnhancedParsedFile extends ParsedFile { images?: ImageExtractionResult; formulas?: FormulaAnalysisResult; analysisReport?: ExcelAnalysisReport; } export interface EnhancedParseResult extends ParseResult { files: EnhancedParsedFile[]; totalImages: number; totalFormulas: number; businessRules: BusinessRule[]; } export declare const DEFAULT_COLUMN_MAPPINGS: ColumnMappings; export declare class ExcelProcessor { private options; private stats; constructor(options?: ExcelProcessorOptions); /** * Create empty stats object */ private createEmptyStats; /** * Parse single Excel file */ parseFile(filePath: string): ParsedFile | null; /** * Parse multiple Excel files */ parseFiles(filePaths: string[]): ParseResult; /** * Parse single sheet */ private parseSheet; /** * Auto-detect column indices */ private detectColumns; /** * Extract requirement from row */ private extractRequirement; /** * Generate hash for requirement (for change detection) */ private generateHash; /** * Normalize priority value */ private normalizePriority; /** * Detect category from ID prefix or description */ private detectCategory; /** * Check if row is empty */ private isEmptyRow; /** * Deduplicate requirements */ private deduplicateRequirements; /** * Get parsing statistics */ getStats(): ParserStats; /** * Reset statistics */ resetStats(): void; /** * Parse file with enhanced analysis (images, formulas, business rules) */ parseFileEnhanced(filePath: string): Promise; /** * Parse multiple files with enhanced analysis */ parseFilesEnhanced(filePaths: string[]): Promise; /** * Generate full analysis report for an Excel file */ analyzeFile(filePath: string, options?: AnalysisOptions): Promise; /** * Check if file has embedded images */ hasImages(filePath: string): Promise; /** * Extract images only */ extractImages(filePath: string, outputDir?: string): Promise; /** * Analyze formulas only */ analyzeFormulas(filePath: string): FormulaAnalysisResult; } export { ExcelImageExtractor, ExtractedImage, ImageExtractionResult, extractExcelImages, hasEmbeddedImages, } from './excel-image-extractor.js'; export { ExcelFormulaHandler, FormulaAnalysisResult, FormulaInfo, MergedCellInfo, ColorHighlight, BusinessRule, analyzeExcelFormulas, } from './excel-formula-handler.js'; export { ExcelAnalysisReportGenerator, ExcelAnalysisReport, analyzeExcelFile, AnalysisOptions, } from './excel-analysis-report.js'; export default ExcelProcessor;