/** * Mock System - runtime-safe, extensible module mocking for qtests (TypeScript ESM) * * Provides a small API for registering module-level mocks and a safe require hook * that returns those mocks when the module id matches. It avoids path rewrites and * instead returns factory-produced instances directly, ensuring low overhead. * * Public API (exported via index.ts): * qtests.mock.module(name: string, factory: () => any): void * * Behavior: * - Idempotent install: _load hook is patched once per process. * - Stable instances: factories are invoked at first access; instance is cached. * - Late activation: on registration, best-effort cache busting purges require.cache * entries that obviously belong to the target module so subsequent require() returns * the mock (CJS only). ESM already-imported modules cannot be replaced; optional * loader hooks exist to intercept ESM early. */ type MockFactory = () => any; declare class MockRegistry { private map; private installed; private esmInstalled; private _origLoad; private _installing; private _esmInstalling; private _lockMap; private _importMap; register(name: string, factory: MockFactory): void; has(name: string): boolean; get(name: string): Promise; private _executeFactory; getSync(name: string): any; list(): string[]; installHooks(): Promise; installRequireHook(): void; installESMHook(): Promise; private setupImportMapFallback; private evictRequireCache; } export declare const mockRegistry: MockRegistry; export declare function registerDefaultMocks(): void; export declare function installMocking(): void; export declare const mockAPI: { module(name: string, factory: MockFactory): void; }; export {}; //# sourceMappingURL=mockSystem.d.ts.map