import type { MethodSpecificRequestInit, RequestInitSansMethod, RequestInitSansMethodAndBody } from "../types/HttpClient.js"; export default class HttpClient { userAgent?: string | undefined; /** * Creates an instance of the {@link HttpClient} class. * * This is a bare bones abstraction around cross-fetch, meant to provide some simple interfaces for making HTTP requests. * * @constructor * @param userAgent The user agent to use for all requests */ constructor(userAgent?: string | undefined); /** * Make a HEAD request. * * Note: HEAD requests cannot contain bodies, and so any body provided in the RequestInit will be ignored. * * @param requestUrl The URL to make the request to * @param requestInit The settings for how the request should be made * @returns a {@link Response} object */ head(requestUrl: URL, requestInit?: RequestInitSansMethodAndBody): Promise; /** * Make an OPTIONS request. * * @param requestUrl The URL to make the request to * @param requestInit The settings for how the request should be made * @returns a {@link Response} object */ options(requestUrl: URL, requestInit?: RequestInitSansMethod): Promise; /** * Make a GET request. * * Note: GET requests cannot contain bodies, and so any body provided in the RequestInit will be ignored. * * @param requestUrl The URL to make the request to * @param requestInit The settings for how the request should be made * @returns a {@link Response} object */ get(requestUrl: URL, requestInit?: RequestInitSansMethodAndBody): Promise; /** * Make a DELETE request. * * @param requestUrl The URL to make the request to * @param requestInit The settings for how the request should be made * @returns a {@link Response} object */ delete(requestUrl: URL, requestInit?: RequestInitSansMethod): Promise; /** * Make a POST request. * * @param requestUrl The URL to make the request to * @param requestInit The settings for how the request should be made * @returns a {@link Response} object */ post(requestUrl: URL, requestInit?: RequestInitSansMethod): Promise; /** * Make a PATCH request. * * @param requestUrl The URL to make the request to * @param requestInit The settings for how the request should be made * @returns a {@link Response} object */ patch(requestUrl: URL, requestInit?: RequestInitSansMethod): Promise; /** * Make a PUT request. * * @param requestUrl The URL to make the request to * @param requestInit The settings for how the request should be made * @returns a {@link Response} object */ put(requestUrl: URL, requestInit?: RequestInitSansMethod): Promise; /** * Makes a raw fetch request. * All other methods such as get, post, patch, and request ultimately call this. * The normal get, post, patch, et all methods should be preferred. * * @param requestUrl The URL to make the request to * @param requestInit The {@link MethodSpecificRequestInit} settings for how the request should be made * @returns a {@link Response} object */ request(requestUrl: URL, requestInit: MethodSpecificRequestInit): Promise; /** * Create the {@link Headers} object to be used for the request. * * A {@link Headers} object is preferred by cross-fetch for the headers. It also allows for case-insensitive * lookups of header keys, which is convenient. * * @param headers The {@link HeadersInit} settings that will be used to produce the headers for the request * @returns The formed {@link Headers} object */ private _getHeadersWithUserAgentMixedIn; } //# sourceMappingURL=HttpClient.d.ts.map