ai-meter
Version:
A javascript library designed to estimate AI models tokens and its API costs.
40 lines • 1.67 kB
TypeScript
import { AxiosRequestConfig } from 'axios';
import { HttpClient } from '@/types';
/**
* Class for making HTTP requests using Axios
*/
export declare class AxiosHttpClient implements HttpClient {
private readonly instance;
constructor();
/**
* Make a GET request
* @param {string} url - The URL to make the request to
* @param {AxiosRequestConfig} config - The configuration for the request
* @returns {Promise<T>} - The response from the server
*/
get<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
/**
* Make a POST request
* @param {string} url - The URL to make the request to
* @param {unknown} data - The data to send in the request
* @param {AxiosRequestConfig} config - The configuration for the request
* @returns {Promise<T>} - The response from the server
*/
post<T>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
/**
* Make a PUT request
* @param {string} url - The URL to make the request to
* @param {unknown} data - The data to send in the request
* @param {AxiosRequestConfig} config - The configuration for the request
* @returns {Promise<T>} - The response from the server
*/
put<T>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
/**
* Make a DELETE request
* @param {string} url - The URL to make the request to
* @param {AxiosRequestConfig} config - The configuration for the request
* @returns {Promise<T>} - The response from the server
*/
delete<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
}
//# sourceMappingURL=Axios.d.ts.map