UNPKG

@kotori-bot/tools

Version:
24 lines (23 loc) 867 B
import axios from 'axios'; import type { AxiosRequestConfig } from 'axios'; type HttpMethod<T = unknown> = (url: string, params?: { [key: string]: string | number | boolean; }, config?: AxiosRequestConfig<unknown>) => Promise<T>; export declare class Http { private instance; private config; private method; constructor(config?: AxiosRequestConfig); extend(config: AxiosRequestConfig): Http; readonly get: HttpMethod; readonly post: HttpMethod; readonly patch: HttpMethod; readonly put: HttpMethod; readonly delete: HttpMethod; readonly head: HttpMethod; readonly options: HttpMethod; ws(address: string, protocols?: string | string[] | undefined): WebSocket; request: (typeof axios)['interceptors']['request']['use']; response: (typeof axios)['interceptors']['response']['use']; } export default Http;