import { EventPayload } from './types'; interface HttpClientConfig { maxRetries: number; retryDelay: number; timeout: number; apiKey: string; workspaceId?: string; debug: boolean; useServerTracking?: boolean; } interface HttpResponse { success: boolean; status: number; data?: any; error?: string; authPending?: boolean; } export declare class HttpClient { private config; private endpoint; private requestTimes; constructor(endpoint: string, config: HttpClientConfig); /** * Send a single event with retry logic */ sendEvent(payload: EventPayload): Promise; /** * Send multiple events in a batch */ sendBatch(payloads: EventPayload[]): Promise; /** * Send request with exponential backoff retry */ private sendWithRetry; /** * Sliding-window rate limiter with backpressure. Keeps timestamps of recent sends; * once the window is full it WAITS until the oldest falls out instead of throwing/ * dropping, so a burst slows down rather than losing events. Bounded: after the wait * the oldest is guaranteed outside the window, so the recursion terminates. */ private enforceRateLimit; /** * Determine if an error should trigger a retry */ private shouldRetry; /** * Calculate exponential backoff delay. Honors a server Retry-After (encoded by * sendWithRetry into the 429/408 error message) when present. */ private calculateRetryDelay; /** * Parse an HTTP Retry-After header value (delta-seconds or an HTTP-date) to ms. */ private parseRetryAfter; /** * Promise-based delay */ private delay; /** * Transform payload for server-side API format */ private transformForServerAPI; /** * Test connectivity to the endpoint */ testConnection(): Promise; /** * Update endpoint URL */ updateEndpoint(endpoint: string): void; /** * Update configuration */ updateConfig(config: Partial): void; } /** * Default HTTP client factory */ export declare const createHttpClient: (endpoint: string, config?: Partial) => HttpClient; export {};