import { G as UnstubbedCallHandler, F as Func, h as AddSpyMethodsByReturnTypes } from './types-BM3BcWj1.js'; /** * A spy's strict-mode guard: who owns it, and what to do about a call nobody configured. * * Carried per spy rather than looked up globally, because the message has to name the class, and * only the factory that read the prototype knows it. */ interface UnstubbedGuard { className: string | undefined; handle: UnstubbedCallHandler; } declare global { var __vitestAutoSpyStrictDefault__: { config: StrictResolution | undefined; } | undefined; var __vitestAutoSpyStrictViolations__: StrictViolations | undefined; } /** Every strict throw since the last {@link takeStrictViolations}, capped so an undrained run stays bounded. */ interface StrictViolations { readonly errors: Error[]; } /** * Hand back, and forget, every error a strict double threw since the last call. A test that provokes * one on purpose takes it here, or `setupAutoSpy` reports it as swallowed after the test. * * @example * ```ts * expect(() => cart.total()).toThrow('Nothing configured Cart.total'); * expect(takeStrictViolations()).toHaveLength(1); * ``` */ declare function takeStrictViolations(): Error[]; /** The two strict fields, required-but-nullable, as every resolved configuration carries them. */ interface StrictResolution { strict: boolean | undefined; onUnstubbedCall: UnstubbedCallHandler | undefined; } /** * Create a single host-runner-backed function spy with all return-type helpers attached. * * @example * ```ts * const load = createFunctionSpy<(id: number) => Promise>('load'); * * load.calledWith(1).resolveWith('value'); * await expect(load(1)).resolves.toBe('value'); * ``` * * @param name The method's name, used in every message this spy produces. * @param unstubbed What to do when the spy is called and nothing configured it — see * {@link resolveUnstubbedGuard}. Omitted by every non-strict double, which is the default. */ declare function createFunctionSpy(name: string, unstubbed?: UnstubbedGuard): AddSpyMethodsByReturnTypes; /** * Registered copies, keyed by identity and valued by package root, kept on `globalThis` so that * every copy — each of which has its own module scope, which is the very thing being detected — * writes into the same map. */ declare global { var __vitestAutoSpyPackageCopies__: Map | undefined; } /** * Every copy seen so far, as ` ()`. * * @example * ```ts * expect(getPackageCopies()).toHaveLength(1); * ``` */ declare function getPackageCopies(): string[]; /** * A ready-to-print explanation when more than one copy is loaded, or `undefined` when the process * holds exactly one. `setupAutoSpy()` turns this into a thrown error (or a warning). * * @example * ```ts * const report = describeDuplicateCopies(); * * if (report) { * throw new Error(report); * } * ``` */ declare function describeDuplicateCopies(): string | undefined; export { createFunctionSpy as c, describeDuplicateCopies as d, getPackageCopies as g, takeStrictViolations as t };