/** * HTTP Client Utilities using Axios * * Simplified HTTP client utilities that use axios directly with recommended * configuration for scalability and performance. */ import { AxiosInstance, AxiosRequestConfig } from 'axios'; /** * Augment the axios InternalAxiosRequestConfig to carry timing metadata. * This is attached by the request interceptor and consumed by the response * interceptor to calculate per-request duration. */ declare module 'axios' { interface InternalAxiosRequestConfig { metadata?: { startTime?: number; duration?: number; [key: string]: unknown; }; } } /** Shared connection-pooling agents (created once, reused for all requests). */ declare const httpsAgent: import("https").Agent; declare const httpAgent: import("http").Agent; /** * Create a configured axios instance with connection pooling. * * @param options - Axios configuration options merged on top of the defaults * @returns Configured axios instance */ declare function createHttpClient(options?: AxiosRequestConfig): AxiosInstance; /** Default shared axios instance (with monitoring interceptors attached). */ declare const httpClient: AxiosInstance; /** * Attach request/response monitoring interceptors to an axios instance. * * - Request interceptor: stamps `config.metadata.startTime`. * - Response interceptor: computes duration, warns on slow requests (> 5 s), * and forwards errors through qerrors for structured logging. * * @param instance - The axios instance to enhance */ declare function addMonitoringInterceptors(instance: AxiosInstance): void; /** Destroy the shared connection pools. Called automatically on process exit signals. */ declare function cleanup(): void; export { httpClient, createHttpClient, addMonitoringInterceptors, cleanup, httpsAgent, httpAgent, }; //# sourceMappingURL=httpClient.d.ts.map