/** * @file Node-side HTTP request layer — the public surface (`httpJson`, * `httpText`, `httpRequest`, `HttpResponseError`) for consumers on Node. * Pairs with `./browser` (browser-safe variant via `fetch`); both files * expose the same named exports so the package.json `'browser'` condition can * swap them by platform without consumers changing their imports. `httpJson` * and `httpText` live here directly; `httpRequest` and the shared types are * re-exported from their dedicated leaves so the sub-imports * (`./http-request/request`, `./http-request/response-types`) stay loadable * individually for callers that don't want the convenience wrappers in their * bundle. */ import type { HttpRequestOptions } from './request-types.js'; export { httpRequest } from './request.js'; export { HttpResponseError } from './response-types.js'; export type { HttpResponse } from './response-types.js'; export type { HttpRequestOptions } from './request-types.js'; /** * GET / POST a binary endpoint, returning the response bytes undecoded. * * Sets `Accept: application/octet-stream`; user-supplied headers always win. * Use this instead of `httpText` for any `application/octet-stream` reply — a * tarball or other binary payload run through UTF-8 text decoding is corrupted * silently, because every byte sequence that is not valid UTF-8 is replaced * rather than rejected. Throws `HttpResponseError` on non-2xx. */ export declare function httpBytes(url: string, options?: HttpRequestOptions | undefined): Promise; /** * GET / POST a JSON endpoint. Automatically sets `Accept: application/json` and * `Content-Type: application/json` when a body is present; user-supplied * headers always win. Throws `HttpResponseError` on non-2xx. */ export declare function httpJson(url: string, options?: HttpRequestOptions | undefined): Promise; /** * GET / POST a text endpoint. Sets `Accept: text/plain` (and `Content-Type: * text/plain` on bodies); user headers override. Throws `HttpResponseError` on * non-2xx. */ export declare function httpText(url: string, options?: HttpRequestOptions | undefined): Promise;