import { type Dispatcher } from 'undici'; export interface PoolOptions { timeout?: number; retries?: number; maxConnections?: number; } export interface PoolRequestOptions { method?: Dispatcher.HttpMethod; path: string; headers?: Record; body?: string | Buffer | Uint8Array; timeout?: number; } /** * Respuesta cruda del backend, sin parsear ni filtrar por status. * Pensada para casos proxy/gateway que reenvían status, headers y body * (binarios incluidos) tal cual los emite el backend. */ export interface RawResponse { status: number; headers: Record; body: Buffer; } export declare class RegcheqPool { private readonly pool; private readonly timeout; private readonly retries; private readonly logRequests; constructor(origin: string, options?: PoolOptions); request(opts: PoolRequestOptions): Promise; /** * Ejecuta la request y devuelve el response completo SIN parsear el body * y SIN lanzar en 4xx/5xx. El proxy decide qué hacer con el status. * * Solo lanza HttpClientError(0, null) si la conexión de red falla. No * aplica withRetry: un proxy no debe reintentar automáticamente. * * Para multipart, el caller (gateway) debe pasar el Buffer del form * (p.ej. form.getBuffer()) junto con los headers de form.getHeaders(); * requestRaw no maneja FormData nativo. */ requestRaw(opts: PoolRequestOptions): Promise; destroy(): Promise; } export declare function createPool(origin: string, options?: PoolOptions): RegcheqPool; //# sourceMappingURL=pool.d.ts.map