export interface HttpClientConfig { baseUrl: string; projectId: string; fetchFn: typeof globalThis.fetch; timeoutMs: number; getAccessToken: () => string | null; refreshAuth?: () => Promise; onAuthFailure?: () => void; } interface RequestOptions { token?: string; headers?: Record; projectId?: string | null; suppressAuthFailure?: boolean; timeoutMs?: number; onUploadProgress?: (progress: { loaded: number; total: number | null; }) => void; useXhrForFormData?: boolean; /** Caller cancellation. Aborting rejects with createAbortError(), never NetworkError. */ signal?: AbortSignal; } export declare class HttpClient { private readonly config; constructor(config: HttpClientConfig); get(path: string, options?: RequestOptions): Promise; post(path: string, body?: unknown, options?: RequestOptions): Promise; patch(path: string, body?: unknown, options?: RequestOptions): Promise; put(path: string, body?: unknown, options?: RequestOptions): Promise; postFormData(path: string, formData: FormData, options?: RequestOptions, hasRetriedAuth?: boolean): Promise; private postFormDataWithXhr; private request; private buildUrl; private buildProjectHeaders; private fetchWithTimeout; /** * Buffers the body while `signal` (deadline or caller) can still end the * request. A body that ignores the signal is abandoned when it aborts. Any * other read failure is left for handleResponse, as before. */ private readBodyBeforeSettling; private handleResponse; private shouldAttemptRefresh; private shouldNotifyAuthFailure; private getRequestAuthMode; /** * True only when the refresh endpoint itself rejected the request (4xx), * meaning the refresh token is invalid/expired. NetworkError (no statusCode) * and 5xx responses are transient and must not end the session. */ private isRefreshRejectedByServer; private retryOriginalRequest; } export {}; //# sourceMappingURL=http-client.d.ts.map