import type { Logger } from "pino"; export interface HttpRequestOptions { method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; headers?: Record; body?: unknown; timeout?: number; /** * Number of retry attempts for transient failures (network errors, 5xx responses). * Retries use exponential backoff starting at 500ms. * @default 0 */ retries?: number; } export interface HttpResponse { status: number; ok: boolean; headers: Headers; data: T; } export declare class HttpClient { private readonly logger; constructor(logger: Logger); /** * Make an HTTP request. Uses Bun's native fetch under the hood. * * @param url The URL to request * @param options Request options (method, headers, body, timeout, retries) * @returns Typed response with parsed JSON body */ request(url: string, options?: HttpRequestOptions): Promise>; /** * Parse a delivered response body. Handles JSON, text, and empty * (`204`/no content) responses. On a JSON parse failure, throws a descriptive * error including the status and sanitized URL — this is a terminal error and * must NOT trigger a retry. */ private parseBody; /** Convenience: GET request */ get(url: string, headers?: Record): Promise>; /** Convenience: POST request */ post(url: string, body: unknown, headers?: Record): Promise>; /** Convenience: PUT request */ put(url: string, body: unknown, headers?: Record): Promise>; /** Convenience: PATCH request */ patch(url: string, body: unknown, headers?: Record): Promise>; /** Convenience: DELETE request */ del(url: string, headers?: Record): Promise>; } //# sourceMappingURL=http-client.d.ts.map