/** * HTTP Utilities * * Helper types and functions for HTTP requests that work * around Bun's type system conflicts with globalThis.Response. */ import type { Result } from './types'; /** * Standard HTTP response interface for API calls. * This avoids conflicts with Bun's Response type overrides. */ export interface HttpResponse { ok: boolean; status: number; headers: { get(name: string): string | null; }; text(): Promise; json(): Promise; arrayBuffer(): Promise; } /** * Perform a fetch request and return a typed response. * * @throws UncachedHttpRequestError when HTTP requests are blocked (CI tests or E2E locked mode) */ export declare function httpFetch(url: string, init?: RequestInit): Promise; /** * Guarded fetch for scrapers - throws when HTTP requests are blocked. * Use this as the default instead of global fetch. * Type assertion needed to match FetchFn = typeof fetch. */ export declare const guardedFetch: typeof fetch; /** * Handle HTTP error responses uniformly across all API modules. */ export declare function handleHttpError(response: HttpResponse): Promise>; /** * Handle network errors uniformly across all API modules. */ export declare function handleNetworkError(error: unknown): Result; /** * Create an error result for empty API responses. */ export declare function emptyResponseError(): Result; //# sourceMappingURL=http.d.ts.map