import { AxiosPromise, AxiosRequestConfig, AxiosProgressEvent } from 'axios'; import Config from '../config/Config'; import Route from '../routes/interface'; import Response from './Response'; declare class Requests { private static config; private static baseUrl; private static authToken; private static community_id?; constructor(config: Config); static setBaseUrl(url: string): void; static setAuthToken(token: string): void; static setCommunityID(community_id: string | undefined): void; /** * Build an absolute API URL using the currently configured base URL. * * This is useful for browser primitives such as EventSource that need a URL * string instead of an Axios request wrapper. */ static buildUrl(url: string, params?: Record): string; private static request; static get(url: string, params?: Record): AxiosPromise>; static download(url: string, params?: Record): AxiosPromise; static post(url: string, data: any, params?: Record): AxiosPromise>; static put(url: string, data: any, params?: Record): AxiosPromise>; static patch(url: string, data: any, params?: Record): AxiosPromise>; static delete(url: string, params?: Record): AxiosPromise>; static uploadFile(url: string, filename: string, file: File | Blob, data?: any, params?: Record, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void, options?: Pick & { excludeCommunityContext?: boolean; }): AxiosPromise>; static postFormData(url: string, formData: FormData, params?: Record, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise>; static uploadBlob(url: string, filename: string, blob: Blob, data?: any, params?: Record, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise>; static uploadFileInChunks(file: File, uploadUrl: string, onProgress?: (totalSize: number, amountUploaded: number) => void, data?: any, chunkSize?: number): Promise; static processRoute(route: Route, data?: object, routeReplace?: { [key: string]: any; }, params?: Record, options?: Pick & { excludeCommunityContext?: boolean; }): AxiosPromise>; } export default Requests;