import { type RetryConfig } from "./retry"; export type RequestIdProvider = () => string | null | undefined; export interface RequestFreshnessOptions { enabled: boolean; nonceFn?: () => string; timestampFn?: () => number; } export interface HttpTransportOptions { baseUrl: string; apiKey: string; timeoutMs?: number; requestId?: string; requestIdProvider?: RequestIdProvider; requestFreshness?: RequestFreshnessOptions; /** When set, non-streaming requests are automatically retried on transient errors. */ retryConfig?: RetryConfig; } export declare class HttpTransport { private readonly baseUrl; private readonly apiKey; private readonly timeoutMs; private readonly fetchImpl; private readonly requestId?; private readonly requestIdProvider?; private readonly requestFreshness?; private readonly retryConfig?; constructor(options: HttpTransportOptions); post(path: string, body?: unknown, timeoutMs?: number): Promise; postWithMeta(path: string, body?: unknown, timeoutMs?: number): Promise<{ payload: T; request_id?: string; }>; get(path: string, query?: Record, timeoutMs?: number): Promise; getWithMeta(path: string, query?: Record, timeoutMs?: number): Promise<{ payload: T; request_id?: string; }>; delete(path: string, timeoutMs?: number): Promise; postStream(path: string, body?: unknown, timeoutMs?: number): Promise; getRaw(path: string, query?: Record): Promise; private requestJson; /** Wraps requestJson with retry logic when retryConfig is set. */ private requestJsonWithRetry; private buildHeaders; private attachFreshnessHeaders; private resolveRequestId; private parseJson; private extractRequestId; extractErrorInfo(payload: unknown, fallback: string): { message: string; code?: string; field?: string; }; }