/** * Strict proxy for mock objects. * * Wraps an object in a `Proxy` that throws a descriptive error when any * unmocked property is accessed, instead of silently returning `undefined`. * * - Idempotent (double-wrapping is a no-op). * - Passthrough for well-known props (`then`, `toJSON`, `Symbol.iterator`, etc.). * - Class-name-aware error messages for class instances. * - Recursive proxying of nested plain objects (for partial mocks only). * * Overloads: * 1. `strictProxy(value, MockClass)` — `fromOriginalTypeN__`: infers T from * MockClass.prototype, overlays `__` methods via proxy. * 2. `strictProxy(value: T)` — constructors: infers T from argument. * 3. `strictProxy(partial)` — test mocking: typed via `PartialDeep`. * 4. `strictProxy(value)` — `asOriginalTypeN__`: explicit T, unchecked. */ import type { PartialDeep } from 'type-fest'; type MockClassLike = MockClassPrototypeRef & MockClassRef; interface MockClassPrototypeRef { prototype: T; } interface MockClassRef { name: string; prototype: object; } /** * Bypasses strict proxy. * * @param obj - The object to bypass. * @returns The object with the bypass accessor. */ export declare function bypassStrictProxy(object: T): T; export declare function strictProxy(value: unknown, mockClass: MockClassLike): T; export declare function strictProxy(value: T): T; export declare function strictProxy(value: PartialDeep): T; export declare function strictProxy(value: unknown): T; export {};