/** * File scanner orchestrator that coordinates AST and template parsers * Implements recursive directory scanning with exclude patterns */ import { StringLiteralMatch } from './ast-parser'; import { VueTextMatch } from './vue-parser'; import { TextMatch, I18nIntegrationConfig } from '../types'; import { Logger } from '../utils/logger'; export interface ScanOptions { /** Directories to scan */ directories: string[]; /** File patterns to include (glob patterns) */ includePatterns: string[]; /** File patterns to exclude (glob patterns) */ excludePatterns: string[]; /** Maximum file size to process (in bytes) */ maxFileSize: number; /** Whether to follow symbolic links */ followSymlinks: boolean; /** Whether to scan recursively */ recursive: boolean; /** Maximum depth for recursive scanning */ maxDepth: number; } export interface ScanResult { /** All text matches found */ matches: TextMatch[]; /** Total files found */ totalFiles: number; /** Files successfully processed */ processedFiles: number; /** Errors encountered during scanning */ errors: string[]; /** Vue-specific matches */ vueMatches: VueTextMatch[]; /** JavaScript/TypeScript matches */ jsMatches: StringLiteralMatch[]; /** Scan statistics */ stats: ScanStats; /** Warnings */ warnings: string[]; } export interface ScanStats { /** Total files found */ totalFiles: number; /** Files successfully processed */ processedFiles: number; /** Files skipped */ skippedFiles: number; /** Files with errors */ errorFiles: number; /** Total matches found */ totalMatches: number; /** Vue files processed */ vueFiles: number; /** JS/TS files processed */ jsFiles: number; /** Processing time in milliseconds */ processingTime: number; /** File type breakdown */ fileTypes: Record; } export interface ScanError { filePath: string; error: string; type: 'parse' | 'read' | 'access' | 'size'; } /** * Default scan options */ export declare const DEFAULT_SCAN_OPTIONS: ScanOptions; /** * File scanner orchestrator */ export declare class FileScanner { private astParser; private vueParser; private logger; private options; constructor(configOrOptions: Partial | I18nIntegrationConfig, logger?: Logger); /** * Scan directories for Persian/Arabic text */ scan(): Promise; /** * Find all files matching the scan criteria */ private findFiles; /** * Process a batch of files */ private processBatch; /** * Process a single file */ private processFile; /** * Process Vue file */ private processVueFile; /** * Process JavaScript/TypeScript file */ private processJSFile; /** * Categorize error types */ private categorizeError; /** * Generate scan report */ generateReport(result: ScanResult): string; /** * Export matches to JSON */ exportMatches(result: ScanResult, outputPath: string): Promise; /** * Filter matches by criteria */ static filterMatches(matches: TextMatch[], criteria: { minLength?: number; maxLength?: number; context?: string; filePath?: string; }): TextMatch[]; /** * Group matches by file */ static groupMatchesByFile(matches: TextMatch[]): Record; /** * Get unique texts from matches */ static getUniqueTexts(matches: TextMatch[]): string[]; } export default FileScanner; //# sourceMappingURL=file-scanner.d.ts.map