import { WorkflowResult, ScanResult, ProcessingError, TextMatch, I18nIntegrationConfig } from '../types'; import { ComprehensiveValidationResult } from '../validator/validation-system'; /** * Report generation options */ export interface ReportOptions { format: 'json' | 'html' | 'markdown' | 'csv'; outputPath?: string; includeDetails: boolean; includeStatistics: boolean; includeRecommendations: boolean; } /** * Report data structure */ export interface Report { metadata: { generatedAt: string; version: string; executionTime: number; success: boolean; configUsed: Partial; }; summary: { totalFiles: number; processedFiles: number; foundStrings: number; generatedKeys: number; transformedFiles: number; errors: number; warnings: number; }; phases: { scan?: ScanPhaseReport; keyGeneration?: KeyGenerationReport; transformation?: TransformationReport; validation?: ValidationReport; }; coverage: TranslationCoverage; missingTranslations: MissingTranslationReport; orphanedKeys: OrphanedKeyReport; fileModifications: FileModificationReport; errors: ProcessingError[]; warnings: string[]; recommendations: string[]; statistics: ReportStatistics; } /** * Phase-specific report interfaces */ interface ScanPhaseReport { totalFiles: number; processedFiles: number; matchesFound: number; fileTypes: Record; directories: Record; errors: string[]; } interface KeyGenerationReport { totalKeys: number; averageConfidence: number; strategyUsed: string; duplicatesFound: number; keyLengthDistribution: Record; } interface TransformationReport { filesTransformed: number; importsAdded: number; replacementsMade: number; backupsCreated: number; errors: string[]; } interface ValidationReport { isValid: boolean; checksPerformed: string[]; issuesFound: number; missingKeys: string[]; orphanedKeys: string[]; syntaxErrors: string[]; } interface ReportStatistics { processingRate: number; averageFileSize: number; largestFile: string; mostComplexFile: string; textDensity: number; keyEfficiency: number; translationCompleteness: number; codeTransformationRate: number; } /** * Translation coverage analysis */ interface TranslationCoverage { totalStringsFound: number; stringsWithTranslations: number; stringsTransformed: number; coveragePercentage: number; coverageByFile: Record; coverageByDirectory: Record; } interface FileCoverage { filePath: string; totalStrings: number; transformedStrings: number; missingTranslations: number; coveragePercentage: number; unreplacedStrings: TextMatch[]; } interface DirectoryCoverage { directory: string; totalFiles: number; filesWithStrings: number; totalStrings: number; transformedStrings: number; coveragePercentage: number; } /** * Missing translation analysis */ interface MissingTranslationReport { totalMissing: number; missingByLocale: Record; missingByFile: Record; criticalMissing: string[]; suggestions: string[]; } /** * Orphaned key analysis */ interface OrphanedKeyReport { totalOrphaned: number; orphanedByLocale: Record; potentialOrphans: string[]; cleanupSuggestions: string[]; } /** * File modification tracking */ interface FileModificationReport { totalModified: number; modificationsByType: Record; backupsCreated: string[]; importChanges: ImportChangeReport[]; codeTransformations: CodeTransformationReport[]; largestChanges: FileChangeDetail[]; } interface ImportChangeReport { filePath: string; importsAdded: string[]; importType: 'useI18n' | 'other'; } interface CodeTransformationReport { filePath: string; totalReplacements: number; replacementDetails: { originalText: string; newKey: string; lineNumber: number; context: string; }[]; } interface FileChangeDetail { filePath: string; changeCount: number; changeTypes: string[]; sizeChange: number; } /** * Comprehensive report generator for workflow results */ export declare class ReportGenerator { /** * Generate comprehensive report from workflow result */ static generateReport(workflowResult: WorkflowResult, options: ReportOptions, config?: I18nIntegrationConfig): Promise; /** * Generate comprehensive validation report */ static generateValidationReport(validationResult: ComprehensiveValidationResult, options: ReportOptions, config?: I18nIntegrationConfig): Promise; /** * Save report to file */ static saveReport(workflowResult: WorkflowResult, options: ReportOptions, config?: I18nIntegrationConfig): Promise; /** * Save comprehensive validation report to file */ static saveValidationReport(validationResult: ComprehensiveValidationResult, options: ReportOptions, config?: I18nIntegrationConfig): Promise; /** * Generate summary report (brief overview) */ static generateSummaryReport(workflowResult: WorkflowResult): string; /** * Build comprehensive report data structure */ private static buildReport; /** * Build summary section */ private static buildSummary; /** * Build phase-specific reports */ private static buildPhaseReports; /** * Build scan phase report */ private static buildScanReport; /** * Build key generation report */ private static buildKeyGenerationReport; /** * Build transformation report */ private static buildTransformationReport; /** * Build validation report */ private static buildValidationReport; /** * Generate recommendations based on results */ private static generateRecommendations; /** * Calculate workflow statistics */ private static calculateStatistics; /** * Build translation coverage analysis */ private static buildTranslationCoverage; /** * Build missing translation report */ private static buildMissingTranslationReport; /** * Build orphaned key report */ private static buildOrphanedKeyReport; /** * Build file modification report */ private static buildFileModificationReport; /** * Find the most complex file (file with most text matches) */ private static findMostComplexFile; /** * Generate JSON report */ private static generateJSONReport; /** * Generate HTML report */ private static generateHTMLReport; /** private static generateHTMLReport(report: Report, options: ReportOptions): string { return ` i18n Integration Comprehensive Report

๐ŸŒ i18n Integration Comprehensive Report

Generated: ${report.metadata.generatedAt}

Execution Time: ${this.formatDuration(report.metadata.executionTime)}

Status: ${report.metadata.success ? 'โœ… Success' : 'โŒ F

๐Ÿ“Š Executive Summary

๐Ÿ“ File Processing

Processed: ${report.summary.processedFiles}

Total Scanned: ${report.summary.totalFiles}

Modified: ${report.fileModifications.totalModified}

๐Ÿ”ค Text Analysis

Strings Found: ${report.summary.foundStrings}

Keys Generated: ${report.summary.generatedKeys}

Transformed: ${report.coverage.stringsTransformed}

๐Ÿ“ˆ Coverage

Translation Coverage: ${report.coverage.coveragePercentage.toFixed(1)}%

โš ๏ธ Issues

Errors: ${report.summary.errors}

Warnings: ${report.summary.warnings}

Missing Translations: ${report.missingTranslations.totalMissing}

๐Ÿ“‹ Translation Coverage Analysis

Overall Coverage

Total Strings: ${report.coverage.totalStringsFound}

With Translations: ${report.coverage.stringsWithTranslations}

Coverage Rate: ${report.coverage.coveragePercentage.toFixed(1)}%

๐Ÿ“ Coverage by File (Click to expand)
${Object.values(report.coverage.coverageByFile).map(file => ` `).join('')}
File Path Total Strings Transformed Missing Coverage %
${file.filePath} ${file.totalStrings} ${file.transformedStrings} ${file.missingTranslations} ${file.coveragePercentage.toFixed(1)}%
๐Ÿ“‚ Coverage by Directory (Click to expand)
${Object.values(report.coverage.coverageByDirectory).map(dir => ` `).join('')}
Directory Files with Strings Total Strings Transformed Coverage %
${dir.directory} ${dir.filesWithStrings} ${dir.totalStrings} ${dir.transformedStrings} ${dir.coveragePercentage.toFixed(1)}%

๐Ÿ”ง File Modifications Report

Modification Summary

Total Modified: ${report.fileModifications.totalModified}

Backups Created: ${report.fileModifications.backupsCreated.length}

Import Changes: ${report.fileModifications.importChanges.length}

By File Type

${Object.entries(report.fileModifications.modificationsByType).map(([type, count]) => count > 0 ? `

.${type}: ${count}

` : '' ).join('')}
๐Ÿ”„ Code Transformations (Click to expand)
${report.fileModifications.codeTransformations.slice(0, 10).map(transform => ` `).join('')}
File Path Total Replacements Sample Transformations
${transform.filePath} ${transform.totalReplacements} ${transform.replacementDetails.slice(0, 3).map(detail => `
Line ${detail.lineNumber}: "${detail.originalText}" โ†’ $t('${detail.newKey}')
` ).join('')} ${transform.replacementDetails.length > 3 ? `
... and ${transform.replacementDetails.length - 3} more
` : ''}
${report.missingTranslations.totalMissing > 0 ? `

โš ๏ธ Missing Translations

Missing Translation Summary

Total Missing: ${report.missingTranslations.totalMissing}

Critical Missing: ${report.missingTranslations.criticalMissing.length}

${report.missingTranslations.suggestions.length > 0 ? `
๐Ÿ’ก Missing Translation Suggestions (Click to expand)
    ${report.missingTranslations.suggestions.map(suggestion => `
  • ${suggestion}
  • `).join('')}
` : ''}
` : ''} ${report.orphanedKeys.totalOrphaned > 0 ? `

๐Ÿ—‘๏ธ Orphaned Keys

Orphaned Key Summary

Total Orphaned: ${report.orphanedKeys.totalOrphaned}

Potential Orphans: ${report.orphanedKeys.potentialOrphans.length}

${report.orphanedKeys.cleanupSuggestions.length > 0 ? `
๐Ÿงน Cleanup Suggestions (Click to expand)
    ${report.orphanedKeys.cleanupSuggestions.map(suggestion => `
  • ${suggestion}
  • `).join('')}
` : ''}
` : ''}

๐Ÿ“ˆ Performance Statistics

Processing Performance

Processing Rate: ${report.statistics.processingRate} files/sec

Text Density: ${report.statistics.textDensity.toFixed(2)} strings/file

Key Efficiency: ${(report.statistics.keyEfficiency * 100).toFixed(1)}%

Transformation Metrics

Translation Completeness: ${report.statistics.translationCompleteness.toFixed(1)}%

Code Transformation Rate: ${report.statistics.codeTransformationRate.toFixed(1)}%

${report.statistics.mostComplexFile ? `

Most Complex File: ${report.statistics.mostComplexFile}

` : ''}
${report.errors.length > 0 ? `

โŒ Errors (${report.errors.length})

    ${report.errors.map(error => `
  • ${error.message}
  • `).join('')}
` : ''} ${report.warnings.length > 0 ? `

โš ๏ธ Warnings (${report.warnings.length})

    ${report.warnings.map(warning => `
  • ${warning}
  • `).join('')}
` : ''} ${report.recommendations.length > 0 ? `

๐Ÿ’ก Recommendations

    ${report.recommendations.map(rec => `
  • ${rec}
  • `).join('')}
` : ''}

โš™๏ธ Configuration Used

๐Ÿ“‹ Configuration Details (Click to expand)
  ${JSON.stringify(report.metadata.configUsed, null, 2)}
              

Generated by i18n Integration Tool v${report.metadata.version}

Report generated at ${report.metadata.generatedAt}

`; } /** * Get CSS class for coverage percentage */ private static getCoverageClass; /** * Generate Markdown report */ private static generateMarkdownReport; /** * Generate CSV report */ private static generateCSVReport; /** * Generate missing translations report */ static generateMissingTranslationsReport(scanResult: ScanResult, translationFiles: Record>, options: ReportOptions): Promise; /** * Generate orphaned keys report */ static generateOrphanedKeysReport(translationFiles: Record>, usedKeys: string[], options: ReportOptions): Promise; /** * Analyze missing translations */ private static analyzeMissingTranslations; /** * Analyze orphaned keys */ private static analyzeOrphanedKeys; /** * Generate key from text (simplified version) */ private static generateKeyFromText; /** * Generate missing translation suggestions */ private static generateMissingTranslationSuggestions; /** * Generate orphaned key suggestions */ private static generateOrphanedKeySuggestions; /** * Generate HTML report for missing translations */ private static generateMissingTranslationsHTML; /** * Generate Markdown report for missing translations */ private static generateMissingTranslationsMarkdown; /** * Generate HTML report for orphaned keys */ private static generateOrphanedKeysHTML; /** * Generate Markdown report for orphaned keys */ private static generateOrphanedKeysMarkdown; /** * Get default output path for report format */ private static getDefaultOutputPath; /** * Format duration in human-readable format */ private static formatDuration; } export {}; //# sourceMappingURL=report-generator.d.ts.map