Urara-Blog/node_modules/.pnpm-store/v3/files/66/2fbf197ab2bbccfc452b85de072a5ad0ac3d59abc55ae2e4d42a062cfdfd3675a7011b6be4bd020baa176c92930c1a78bfe0e355330b1975afd6176400cfc0
2022-08-14 01:14:53 +08:00

25 lines
986 B
Text

import Pool = require('./pool')
import MockAgent = require('./mock-agent')
import { Interceptable, MockInterceptor } from './mock-interceptor'
import Dispatcher = require('./dispatcher')
export = MockPool
/** MockPool extends the Pool API and allows one to mock requests. */
declare class MockPool extends Pool implements Interceptable {
constructor(origin: string, options: MockPool.Options);
/** Intercepts any matching requests that use the same origin as this mock pool. */
intercept(options: MockInterceptor.Options): MockInterceptor;
/** Dispatches a mocked request. */
dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean;
/** Closes the mock pool and gracefully waits for enqueued requests to complete. */
close(): Promise<void>;
}
declare namespace MockPool {
/** MockPool options. */
export interface Options extends Pool.Options {
/** The agent to associate this MockPool with. */
agent: MockAgent;
}
}