/** * Posts data to a specified URL endpoint using fetch API * @param {Object} params - The parameters for the POST request * @param {string} params.url - The URL to send the POST request to * @param {Record} [params.data] - Optional data to be sent in the request body * @returns {Promise} The parsed JSON response from the server * @throws {Error} If the response is not ok, throws an error with the status message or error details */ export declare const postData: ({ url, data, }: { url: string; data?: Record; }) => Promise; /** * Represents progress information for file operations */ export type ProgressInfo = { loaded: number; total: number; ratio: number; }; /** * Downloads a file from a specified URL using XMLHttpRequest * @param {string} url - The URL to download the file from * @param {Object} [opts] - Optional configuration for the download * @param {string} [opts.method='GET'] - The HTTP method to use * @param {Record} [opts.headers] - Additional headers to include in the request * @param {(info: ProgressInfo) => void} [opts.onProgress] - Callback function to track download progress * @returns {Promise} The downloaded file as a Uint8Array * @throws {Object} Throws an object containing status and error message if download fails */ export declare function downloadFile(url: string, opts?: { method?: string; headers?: Record; onProgress?: (info: ProgressInfo) => void; }): Promise; /** * Uploads a file to a specified URL using XMLHttpRequest * @param {string} url - The URL to upload the file to * @param {File | Blob | FormData} content - The content to upload * @param {Object} [opts] - Optional configuration for the upload * @param {string} [opts.method='POST'] - The HTTP method to use * @param {Record} [opts.headers] - Additional headers to include in the request * @param {(info: ProgressInfo) => void} [opts.onProgress] - Callback function to track upload progress * @returns {Promise} The server response * @throws {Object} Throws an object containing status and error message if upload fails */ export declare function uploadFile(url: string, content: File | Blob | FormData, opts?: { method?: string; headers?: Record; onProgress?: (info: ProgressInfo) => void; }): Promise; //# sourceMappingURL=xhr.d.ts.map