/** * The `Http` class provides a simple wrapper for the Fetch API. * * @author Leonid Vinikov */ import { E_HTTP_METHOD_TYPE } from "../interfaces"; import { ObjectBase } from "../bases/object-base"; import type { TErrorHandlerCallbackType, TResponseFilterCallbackType, TResponseHandlerCallbackType } from "../interfaces"; export declare class Http extends ObjectBase { private readonly logger; private readonly apiBaseUrl; private readonly requestInit; private errorHandler?; private responseFilter?; private responseHandler?; static getName(): string; /** * Initializes the base class and sets up configuration parameters. */ constructor(apiBaseUrl?: string, requestInit?: RequestInit); /** * Fetches data from the specified path using the given HTTP method and optional request body. */ fetch(path: string, method: E_HTTP_METHOD_TYPE, body?: any): Promise; /** * Sets the error handler callback for handling errors during fetch requests. */ setErrorHandler(callback: TErrorHandlerCallbackType): void; /** * Sets the response filter callback for filtering the response text. */ setResponseFilter(callback: TResponseFilterCallbackType): void; /** * Sets the response handler callback for handling the response data. */ setResponseHandler(callback: TResponseHandlerCallbackType): void; private applyErrorHandler; private applyResponseFilter; private applyResponseHandler; }