export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; export interface HttpParams { method?: HttpMethod; path?: string; headers?: Record; query?: Record; body?: any; timeout?: number | null; abortSignal?: AbortSignal | null; retryCount?: number; expectStatus?: HttpStatusPattern; } export type HttpStatusPattern = number | number[] | ((status: number) => boolean); export declare class HttpResponseException extends Error { readonly response: HttpResponse; constructor(response: HttpResponse, message?: string); get status(): number; get headers(): Headers; json(): Promise; text(): Promise; stream(): Promise> | null>; } export declare class HttpResponse { readonly raw: Response; protected readonly expectStatus?: HttpStatusPattern | undefined; constructor(raw: Response, expectStatus?: HttpStatusPattern | undefined); get status(): number; get headers(): Headers; header(key: string): string | null; get ok(): boolean; get failed(): boolean; get isExpectedStatus(): boolean; json(): Promise; text(): Promise; stream(): ReadableStream | NodeJS.ReadableStream | null; pipe(pipe: T): T; } export declare class Http { readonly baseUrl: string; protected readonly params: HttpParams; protected constructor(baseUrl: string, params?: HttpParams); get url(): string; get(path?: string): Http; post(path?: string): Http; put(path?: string): Http; patch(path?: string): Http; delete(path?: string): Http; withHeaders(headers: Record): Http; withHeader(name: string, value: string): Http; withParam(name: string, value: any): Http; withQuery(query: Record): Http; withJson(body: any): Http; withForm(body: FormData | Record): Http; withFormUrlEncoded(body: Record | URLSearchParams): Http; withBody(body: any): Http; timeout(ms: number): Http; retry(count: number): Http; abortSignal(signal: AbortSignal): Http; expectStatus(pattern: HttpStatusPattern): Http; send(): Promise>; json(): Promise; text(): Promise; stream(): Promise | NodeJS.ReadableStream | null>; protected clone(params?: HttpParams): Http; static base(url: string, params?: HttpParams): Http; static get(url: string): Http; static post(url: string): Http; static put(url: string): Http; static patch(url: string): Http; static delete(url: string): Http; }