UNPKG

@notjustcoders/ioc-arise

Version:

Arise type-safe IoC containers from your code. Zero overhead, zero coupling.

39 lines 1.48 kB
import { ClassInfo } from '../types'; import { IoCError } from '../errors/index.js'; export declare class ModuleResolver { private moduleConfig; private sourceDirectory; constructor(moduleConfig: Record<string, string[]>, sourceDirectory: string); /** * Determines which module a file belongs to based on its path * @param filePath - Absolute path to the file * @returns Module name or null if no match found */ getModuleForFile(filePath: string): string | null; /** * Groups classes by their assigned modules * @param classes - Array of ClassInfo objects * @returns Map of module names to their classes */ groupClassesByModule(classes: ClassInfo[]): Map<string, ClassInfo[]>; /** * Checks if a file path matches a given pattern * @param filePath - Normalized relative file path * @param pattern - Pattern to match against * @returns True if the pattern matches */ private matchesPattern; /** * Converts absolute path to relative path from source directory * @param filePath - Absolute file path * @returns Normalized relative path */ private normalizeFilePath; /** * Validates module configuration * @param moduleConfig - Module configuration to validate * @returns Array of validation errors */ static validateModuleConfig(moduleConfig: Record<string, string[]>): IoCError[]; } //# sourceMappingURL=moduleResolver.d.ts.map