mira-consciousness
Version:
Memory & Intelligence Retention Archive - Preserving The Spark
41 lines • 1.22 kB
TypeScript
/**
* AST-Based Import Analyzer
* Replaces the naive string-based import detection that caused the emergency
* Uses proper Abstract Syntax Tree parsing for accurate import/usage analysis
*/
import { UnusedImport } from './types.js';
export declare class ASTImportAnalyzer {
private projectRoot;
constructor(projectRoot: string);
/**
* Analyze imports in a file using AST parsing
*/
analyzeFileImports(filePath: string): Promise<UnusedImport[]>;
/**
* Parse import statements using AST
*/
private parseImports;
/**
* Parse usage of imported identifiers using AST
*/
private parseUsage;
/**
* Check if an import is actually used
*/
private isImportUsed;
/**
* Calculate confidence score for unused import detection
*/
private calculateConfidence;
private hasPropertyAccess;
private hasDestructuringUsage;
private hasTemplateLiteralUsage;
private hasDynamicPropertyAccess;
private hasCommentUsage;
private hasAliasedUsage;
private walkAST;
private extractImportsFromDeclaration;
private parseImportsRegex;
private getBabelParser;
}
//# sourceMappingURL=ASTImportAnalyzer.d.ts.map