@tech-arelius/api-client
Version:
Configurable HTTP client with builder pattern for Node.js/TypeScript
22 lines • 1.22 kB
TypeScript
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import { Interceptor } from '../interceptor/Interceptor';
/**
* Main API client with prebuilt methods and convenience functions
*/
export declare class ApiClient {
private axiosInstance;
private defaultHeaders;
constructor(baseUrl?: string, timeout?: number, defaultHeaders?: Record<string, string>, interceptors?: Interceptor[]);
/**
* Core HTTP methods - direct axios pass-throughs
*/
get(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse>;
post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse>;
put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse>;
delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse>;
patch<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse>;
head<T = any>(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse>;
options<T = any>(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse>;
request<T = any>(config: AxiosRequestConfig): Promise<AxiosResponse>;
}
//# sourceMappingURL=ApiClient.d.ts.map