/** * ParametersPassedIn - The arguments captured from one mock invocation. * Per CLAUDE.md: data-only structure = class. */ export declare class ParametersPassedIn { readonly args: unknown[]; constructor(args: unknown[]); } /** * ValueToReturn - One primed response: either a value supplier or an error * supplier (port of Java ValueToReturn). */ export declare class ValueToReturn { private readonly valueSupplier?; private readonly errorSupplier?; constructor(valueSupplier?: (() => unknown) | undefined, errorSupplier?: (() => Error) | undefined); /** * Resolve the primed entry: throws if primed as an exception, else returns. */ returnOrThrowValue(): unknown; } /** * MockHandler - The mock engine (port of Java MockSuperclass), keyed by * method name. * * Semantics identical to Java: * - Primed values form a QUEUE per method; each call dequeues one. * - Empty queue falls back to the method's default value. * - No queue entry and no default -> throws "test did not add enough return values". * - getCalledMethodList/getSingleRequestList DRAIN the recorded calls. * * Usually consumed through createMock() which wraps this in a typed Proxy; * use directly only when hand-writing a mock class. */ export declare class MockHandler { private returnValues; private defaultReturnValues; private calledMethods; /** * Queue a value to return on the next call to method. */ addValueToReturn(method: string, value: unknown): void; /** * Queue a computed value (supplier runs at call time). */ addCalculateRetValue(method: string, supplier: () => unknown): void; /** * Queue an exception to throw on the next call to method. */ addExceptionToThrow(method: string, errorSupplier: () => Error): void; /** * Fallback value returned when the queue for method is empty. */ setDefaultReturnValue(method: string, value: unknown): void; /** * Record a call and resolve its response (queue -> default -> throw). * Called by the createMock proxy for every api-method invocation. */ calledMethod(method: string, args: unknown[]): unknown; /** * DRAIN and return all recorded invocations of method (Java parity: the * list resets so a second assertion sees only new calls). */ getCalledMethodList(method: string): ParametersPassedIn[]; /** * DRAIN and return the FIRST argument of each recorded invocation - the * common single-request-DTO shape. */ getSingleRequestList(method: string): R[]; /** * Reset all primed values, defaults, and recorded calls. */ clear(): void; private queueFor; }