import { AxiosInstance, AxiosError } from "axios"; import { ClientConfig } from "./base.types"; export declare abstract class BaseService { protected readonly clientConfig: ClientConfig; protected readonly client?: AxiosInstance; constructor(clientConfig: ClientConfig); /** * Validates and transforms a plain object against a DTO class. * * @param DTOType The DTO class to validate against. * @param data The plain object data to validate. * @returns A promise that resolves with the validated and transformed DTO instance. * @throws {BadRequestException} If validation fails, throws an exception with structured error messages. */ protected validateData(DTOType: new () => any, requestData: Record): Promise>; /** * Centralized error handler for API requests * @protected * @param error - The error object from axios */ protected handleError(error: AxiosError): never; /** * Make a GET request to the API * @protected * @param endpoint - API endpoint * @param params - Query parameters * @returns Promise with the response data */ protected get(endpoint: string, params?: Record): Promise; /** * Make a POST request to the API * @protected * @param endpoint - API endpoint * @param data - Request body * @returns Promise with the response data */ protected post(endpoint: string, data: Record): Promise; /** * Make a PUT request to the API * @protected * @param endpoint - API endpoint * @param data - Request body * @returns Promise with the response data */ protected put(endpoint: string, data: Record): Promise; /** * Make a DELETE request to the API * @protected * @param endpoint - API endpoint * @returns Promise with the response data */ protected delete(endpoint: string): Promise; }