/// /** * An extension to `jest.Mock` that allows waiting for asynchronous calls. * * @typeParam T return type of the mock implementation * @typeParam Y argument types of the mock implementation */ export interface DeferredMock extends jest.Mock { /** * Wait for next call to the mocked function. * * @param timeout maximum amount of milliseconds to wait for the call before throwing a time-out exception (default is ˙300˙) * @returns promise of this mock function for each */ afterNextCall: (timeout?: number) => Promise>; /** * Wait for Nth call to the mocked function from the moment this function is called. * * @param callCount number of calls to wait for * @param timeout maximum amount of milliseconds to wait for the Nth call before throwing a time-out exception (default is ˙300˙) * @returns promise of this mock function */ afterNthCall: (callCount: number, timeout?: number) => Promise>; } export declare function deferredFn(): DeferredMock; export declare function deferredFn(implementation?: (...args: Y) => T): DeferredMock; //# sourceMappingURL=deferred-fn.d.ts.map