import { CftRequest } from '../types.cjs';

type SpyFactoryGetter = (request: CftRequest) => SpyFactory | undefined;
/**
 * Creates method spies that abstract the spy library implementation.
 * @param container - An object whose method is to be spied on.
 * @param methodName - The key of the method to spy on, such as `"log"`.
 */
type SpyFactory = (container: unknown, methodName: string) => MethodSpy;
/**
 * Record for a single method being spied upon.
 */
interface MethodSpy {
    /**
     * @returns For each call to the spy, its arguments.
     */
    getCalls(): SpyCallArgs[];
    /**
     * Restores the original method on the container.
     */
    restore(): void;
}
type SpyCallArgs = unknown[];

export type { MethodSpy, SpyCallArgs, SpyFactory, SpyFactoryGetter };
