/** * @file * * 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)` — infers `T` from `MockClass.prototype`, * overlays `__`-suffixed methods via the proxy. * 2. `strictProxy(value: T)` — infers `T` from the argument. * 3. `strictProxy(partial)` — test mocking: typed via `PartialDeep`. * 4. `strictProxy(value)` — explicit `T`, unchecked value (cross-type cast). */ import type { PartialDeep } from 'type-fest'; type MockClassLike = MockClassPrototypeRef & MockClassRef; interface MockClassPrototypeRef { prototype: T; } interface MockClassRef { name: string; prototype: object; } /** * Unwraps a strict-proxied object, returning the underlying target. * * Accessing unmocked properties on the returned object yields `undefined` * instead of throwing. Non-proxied values are returned as-is. * * @typeParam T - The type of the object. * @param object - The object to unwrap. * @returns The underlying target, or `object` if it is not a strict proxy. */ 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 {};