/** Http request wrapper that returns a tuple with the response data or an error. */
export type HttpResponse<T> = [ok: true, error: null, data: T] | [ok: false, error: Error];
export interface HttpRequestOptions extends RequestInit {
    /**
     * The credential this request authenticates with. A 401 invalidates only this
     * credential, so a delayed response cannot remove a newer token persisted by another
     * process. Authenticated callers should always set it alongside the `Authorization`
     * header; omitting it falls back to invalidating all stored authentication.
     */
    credentialToken?: string;
    /** Internal requests which are themselves refreshing credentials must not recurse. */
    skipTokenCleanup?: boolean;
}
export type UrlString = string | URL | {
    path: string;
    base?: string;
    query: Record<string, string | number | boolean>;
};
/** Parses the URL string into a URL object */
export declare function parseUrl(urlStr: UrlString): URL;
/** Main HTTP request function that handles the request and response */
export declare function makeHttpRequest<T = void>(url: URL, options?: HttpRequestOptions, data?: string | Buffer): Promise<HttpResponse<T>>;
/** Creates a request that returns a promise for the HTTP response */
export declare function makeRequest<T = void>(urlStr: UrlString, options?: HttpRequestOptions, data?: string | Buffer): Promise<HttpResponse<T>>;
/** Transforms `Promise<HttpResponse<T>>` into `Promise<T>` */
export declare function unwrapResponse<T>(response: Promise<HttpResponse<T>>): Promise<T>;
//# sourceMappingURL=http-request.d.ts.map