//#region src/http/http.d.ts /** * HTTP transport primitives. Defines the {@link HttpClient} interface and a * {@link newFetchHttpClient} implementation backed by the Fetch API. * * @module */ /** HttpRequest represents an outgoing HTTP request. */ interface HttpRequest { /** The URL to send the request to. */ url: string; /** The HTTP method (GET, POST, etc.). */ method: string; /** The request headers. */ headers: Headers; /** The request body. */ body?: string | ArrayBuffer | Uint8Array | ReadableStream | null; /** An optional signal to abort the request. */ signal?: AbortSignal; } /** HttpResponse represents the response from an HTTP request. */ interface HttpResponse { /** The HTTP status code. */ statusCode: number; /** The response headers. */ headers: Headers; /** The raw response body stream. */ body: ReadableStream | null; } /** * HttpClient sends HTTP requests and returns responses. */ interface HttpClient { /** Sends an HTTP request and returns the response. */ send(request: HttpRequest): Promise; } /** * Creates a new HttpClient that uses the Fetch API as its transport. */ declare function newFetchHttpClient(): HttpClient; //#endregion export { HttpClient, HttpRequest, HttpResponse, newFetchHttpClient }; //# sourceMappingURL=http.d.ts.map