/// /// import { RequestError } from 'got'; import { infer as Infer, type ZodError, ZodType } from 'zod'; import { type AsyncResult } from '../result'; import { Throttle } from './throttle'; import type { HttpOptions, HttpResponse, InternalHttpOptions } from './types'; import './legacy'; export { RequestError as HttpError }; export declare class EmptyResultError extends Error { } export type SafeJsonError = RequestError | ZodError | EmptyResultError; export declare class Http { protected hostType: string; private options?; constructor(hostType: string, options?: HttpOptions); protected getThrottle(url: string): Throttle | null; protected request(requestUrl: string | URL, httpOptions: InternalHttpOptions): Promise>; get(url: string, options?: HttpOptions): Promise; head(url: string, options?: HttpOptions): Promise; getBuffer(url: string, options?: HttpOptions): Promise>; private requestJson; private resolveArgs; getPlain(url: string, options?: Opts): Promise; getJson(url: string, options?: Opts): Promise>; getJson = ZodType>(url: string, schema: Schema): Promise>>; getJson = ZodType>(url: string, options: Opts, schema: Schema): Promise>>; getJsonSafe, Schema extends ZodType = ZodType>(url: string, schema: Schema): AsyncResult, SafeJsonError>; getJsonSafe, Schema extends ZodType = ZodType>(url: string, options: Opts, schema: Schema): AsyncResult, SafeJsonError>; headJson(url: string, httpOptions?: Opts): Promise>; postJson(url: string, options?: Opts): Promise>; postJson = ZodType>(url: string, schema: Schema): Promise>>; postJson = ZodType>(url: string, options: Opts, schema: Schema): Promise>>; putJson(url: string, options?: Opts): Promise>; putJson = ZodType>(url: string, schema: Schema): Promise>>; putJson = ZodType>(url: string, options: Opts, schema: Schema): Promise>>; patchJson(url: string, options?: Opts): Promise>; patchJson = ZodType>(url: string, schema: Schema): Promise>>; patchJson = ZodType>(url: string, options: Opts, schema: Schema): Promise>>; deleteJson(url: string, options?: Opts): Promise>; deleteJson = ZodType>(url: string, schema: Schema): Promise>>; deleteJson = ZodType>(url: string, options: Opts, schema: Schema): Promise>>; stream(url: string, options?: HttpOptions): NodeJS.ReadableStream; }