@notjustcoders/ioc-arise
Version:
Arise type-safe IoC containers from your code. Zero overhead, zero coupling.
44 lines • 1.87 kB
TypeScript
import { ClassInfo } from '../../types';
import { MockConfig } from '../../utils/configManager';
/**
* Utility class for resolving mock classes based on configuration
*/
export declare class MockClassResolver {
/**
* Resolves a mock class for the given target class if mock mode is enabled
* @param targetClass The class name to find a mock for
* @param availableClasses All available classes in the project
* @param mockConfig Mock configuration from ioc.config.json
* @returns Mock class name if found, null otherwise
*/
static resolveMockClass(targetClass: string, availableClasses: ClassInfo[], mockConfig?: MockConfig): string | null;
/**
* Checks if a class name matches a glob pattern
* @param className The class name to check
* @param globPattern The glob pattern (e.g., "*Mock*", "Mock*")
* @returns true if the class name matches the pattern
*/
private static matchesGlobPattern;
/**
* Determines if a mock class name is intended for the target class
* @param mockClassName The potential mock class name
* @param targetClassName The target class name
* @returns true if the mock is for the target
*/
private static isMockForTarget;
/**
* Performs fuzzy matching between mock and target class names
* @param mockName Cleaned mock class name
* @param targetName Target class name
* @returns true if names are similar enough
*/
private static fuzzyMatch;
/**
* Gets all available mock classes based on configuration
* @param availableClasses All available classes
* @param mockConfig Mock configuration
* @returns Array of mock class names
*/
static getAllMockClasses(availableClasses: ClassInfo[], mockConfig?: MockConfig): string[];
}
//# sourceMappingURL=mock-class-resolver.d.ts.map