import type { ApiSimulator } from './types.js'; export interface FetchHandlerOptions { maxBodyBytes?: number; } export interface SimulatorFetchOptions { /** * What to do when no simulated endpoint matches. * `throw` (default) raises `EndpointNotFoundError`. * `passthrough` forwards to `fetch` (or `globalThis.fetch`). */ unmatched?: 'throw' | 'passthrough'; /** Live fetch used for passthrough. Defaults to `globalThis.fetch`. */ fetch?: typeof globalThis.fetch; maxBodyBytes?: number; } /** * WHATWG Request/Response adapter for edge runtimes, Deno, Bun, and Next.js route handlers. * Unmatched requests return a 404 JSON body. */ export declare const createFetchHandler: (simulator: ApiSimulator, options?: FetchHandlerOptions) => (request: Request) => Promise; /** * Client-side `fetch` interceptor. Inject into vendor HTTP clients instead of * branching live vs simulation at each call site. * * Undici: pass the returned function as `fetch` (or as the `fetch` option on * `undici.fetch` / a custom Agent). This package does not bundle an undici * `Dispatcher` subclass. */ export declare const createSimulatorFetch: (simulator: ApiSimulator, options?: SimulatorFetchOptions) => typeof globalThis.fetch; //# sourceMappingURL=fetch.d.ts.map