/** * @file Helpers for responses whose body is left unread. A streaming request * resolves on headers and hands back the socket on `rawResponse`, which is * what keeps large scan payloads out of memory — but the error path still * needs the body to report what the API said, so it drains it here under a * size cap. */ import type { HttpResponse } from '@socketsecurity/lib/http-request/response-types'; /** * Drain a stream-mode error response so the error path has a body to report. * A streaming response resolves with an unread body, so `text()` is empty until * the stream is consumed — error handling reads that body for the API's message * and hint. Reads at most `MAX_RESPONSE_SIZE` bytes and releases the socket. * * @param response - The streaming response for a non-2xx status. * * @returns A response whose body accessors return the drained bytes. */ export declare function bufferStreamedErrorResponse(response: HttpResponse): Promise;