@barbarbar338/bhapi
Version:
Brawlhalla API wrapper for NodeJS and web
52 lines • 2.08 kB
TypeScript
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
/**
* Axios instance for Brawlhalla API. USE `bhapi.request` EXPORTS FOR CUSTOM REQUESTS
*/
export declare const apiClient: AxiosInstance;
/**
* Set the API key for authentication
*
* @param {string} key Brawlhalla API key
* @returns {string} The API key that was set
*/
export declare function setApiKey(key: string): string;
/**
* Request methods for Brawlhalla API
*/
export declare const request: {
/**
* Send a GET request to the Brawlhalla API
*
* @param {string} path API endpoint path
* @param {AxiosRequestConfig} config Axios request configuration
* @returns {Promise<AxiosResponse<T>>} Promise resolving to the API response
*/
get: <T>(path: string, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any>>;
/**
* Send a POST request to the Brawlhalla API
*
* @param {string} path API endpoint path
* @param {any} data Request payload
* @param {AxiosRequestConfig} config Axios request configuration
* @returns {Promise<AxiosResponse<T>>} Promise resolving to the API response
*/
post: <T>(path: string, data?: any, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any>>;
/**
* Send a PUT request to the Brawlhalla API
*
* @param {string} path API endpoint path
* @param {any} data Request payload
* @param {AxiosRequestConfig} config Axios request configuration
* @returns {Promise<AxiosResponse<T>>} Promise resolving to the API response
*/
put: <T>(path: string, data?: any, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any>>;
/**
* Send a DELETE request to the Brawlhalla API
*
* @param {string} path API endpoint path
* @param {AxiosRequestConfig} config Axios request configuration
* @returns {Promise<AxiosResponse<T>>} Promise resolving to the API response
*/
delete: <T>(path: string, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any>>;
};
//# sourceMappingURL=client.d.ts.map