/** * Implicit HTTP steps (P6.1) — low-level undici handler plumbing, split from * http-interceptor.ts: response synthesis from records, error delivery, * pass-through counting, and raw-header helpers. Pure functions only; the * interception policy lives in http-interceptor.ts. */ import { type HttpEffectRecord } from './http-effect.js'; /** Header the raw-fetch escape hatch sets to force pass-through for one call. */ export declare const RAW_FETCH_HEADER = "x-memoflow-raw"; /** * Feed a fresh Response — built from a recorded effect — into the user's * undici handler by driving its callback protocol from the recorded bytes. * The `x-memoflow-replayed: 1` header is added so it's visible at the fetch * layer too. */ export declare function deliverFromRecord(handler: any, record: HttpEffectRecord): void; /** * Wrap a real undici handler so pass-through-within-scope requests still * forward every callback untouched (byte-identical delivery) but fire `onDone` * exactly once when they settle, so the driver's in-flight counter is balanced. */ export declare function wrapCountingHandler(handler: any, onDone: () => void): any; export declare function deliverError(handler: any, err: Error): void; export declare function fullUrl(opts: any): string; export declare function parseRawHeaders(raw: Buffer[] | string[] | null): [string, string][]; export declare function headersToList(headers: any): [string, string][]; export declare function hasRawHeader(opts: any): boolean; /** * Add a request header to undici dispatch opts in whatever shape they carry * (flat array pairs or plain object). Used by the N2 auto-idempotency-key * injection; never overwrites an existing header of the same name. */ export declare function setHeaderIfAbsent(opts: any, name: string, value: string): void; export declare function stripRawHeader(opts: any): void;