import axios, { AxiosRequestConfig, AxiosResponse } from "axios"; export type FetchRequestConfig = AxiosRequestConfig; export type FetchResponse = AxiosResponse; export class Fetcher { static async get>( endpoint: string, config?: FetchRequestConfig ) { const response = axios.get>(endpoint, config); return response; } static async post>( endpoint: string, data: DataType, config?: FetchRequestConfig ) { const response = await axios.post, DataType>( endpoint, data, config ); return response; } static async delete>( endpoint: string, config: FetchRequestConfig ) { const response = axios.delete>(endpoint, config); return response; } static async patch>( endpoint: string, config: FetchRequestConfig ) { const response = axios.patch>(endpoint, config); return response; } static async put>( endpoint: string, config: FetchRequestConfig ) { const response = axios.put>(endpoint, config); return response; } }