@notjustcoders/ioc-arise
Version:
Arise type-safe IoC containers from your code. Zero overhead, zero coupling.
28 lines • 1.04 kB
TypeScript
import { FactoryInfo } from '../types';
export declare class FactoryAnalyzer {
private astParser;
private sourceDir;
private factoryPattern?;
constructor(sourceDir: string, factoryPattern?: string);
collectTokens(filePaths: string[]): Promise<{
factoryNames: Set<string>;
interfaces: Set<string>;
}>;
analyzeFiles(filePaths: string[], tokens?: {
interfaces: Set<string>;
classNames: Set<string>;
factoryNames: Set<string>;
}): Promise<FactoryInfo[]>;
private analyzeFileFromAST;
private hasFactoryAnnotation;
private resolveDependencies;
private resolveDependenciesFromContextProperties;
private calculateImportPath;
/**
* Extracts the core interface name from a return type annotation.
* Handles: IFoo, Promise<IFoo>, Awaited<IFoo>, Awaited<Promise<IFoo>>
* Returns the interface name if it matches a known interface, otherwise null.
*/
private extractCoreInterfaceName;
}
//# sourceMappingURL=factory-analyzer.d.ts.map