import type { Project } from 'ts-morph'; import type { PublicApi } from '@angular-modernizer/api'; import type { LibraryExtractionOptions } from './library-extraction.orchestrator.js'; /** * Result of rewriting imports in a single file. */ export interface ImportRewriteResult { filePath: string; importsUpdated: number; updatedFrom: string[]; updatedTo: string[]; } /** * Rewrites import paths across the codebase after artifact migration. * * Algorithm: * 1. Build a map: absoluteArtifactPath → newImportSpecifier * 2. For each source file in the project, find imports whose resolved path * matches a migrated artifact * 3. Replace the import specifier with the library path */ export declare class ImportPathRewriter { /** * Rewrite all imports referencing the migrated artifacts. * * @param project - ts-morph Project for AST manipulation * @param libraryPath - Path of the created library * @param options - Library extraction options * @param api - PublicApi (for future use with SymbolLocator) * @returns Results per file that was updated */ rewrite(project: Project, libraryPath: string, options: LibraryExtractionOptions, _api: PublicApi): Promise; /** * Build a map from artifact absolute paths to new library import specifiers. * * For each artifact path, we derive the import specifier based on the * secondary entry point it belongs to or the root library package. * * Example: * /project/src/shared/ui/button.component.ts → @myapp/ui/button */ private buildArtifactMap; private findEntryPoint; private rewriteImportsInFile; } //# sourceMappingURL=import-path-rewriter.d.ts.map