/** * Simple HTTP recorder for integration tests. * * Records real HTTP responses to gzipped fixture files on first run, * replays from fixtures on subsequent runs. */ import type { FetchFn } from '../types'; /** * Request input type that works with both string URLs and Request objects. */ type FetchInput = string | URL | { url: string; }; /** * Options for HttpRecorder.fetchWithName. */ interface FetchWithNameOptions { /** Readable fixture name (e.g., "wikidata-blood-clocktower") */ fixtureName: string; /** Request init options */ init?: RequestInit | undefined; } export declare class HttpRecorder { private fixturesDir; constructor(fixturesDir: string); /** * Get a fetch function that records/replays HTTP requests. * Uses URL-based fixture naming (can be ugly for long URLs). */ get fetch(): FetchFn; /** * Create a fetch function with a custom fixture name. * Use this for requests with long URLs (e.g., SPARQL queries). * * @example * const result = await resolveEntity('Blood on the Clocktower', 'physical_game', { * customFetch: recorder.createNamedFetch('wikidata-blood-clocktower') * }) */ createNamedFetch(fixtureName: string): FetchFn; /** * Fetch with a custom fixture name for readable filenames. * Use this for requests with long URLs (e.g., SPARQL queries). */ fetchWithName(input: FetchInput, options: FetchWithNameOptions): Promise; private handleRequest; private replay; private record; private getFixturePath; private getLegacyFixturePath; private hashString; } export {}; //# sourceMappingURL=http-recorder.d.ts.map