// Copyright © 2022-2026 Partium, Inc. DBA Partium import { DownloadStatus, FileTransferService, UploadStatus } from "../../../services/http/file-transfer/file-transfer.service.interface"; import { Observable } from "rxjs"; import { JsPFile } from "../../js-p-file"; /** * Implementation of the FileTransferService for providing basic file-transfer * functionality, such as upload and download, for browser-based applications. * * In an error case all the functions will return an SDK_ERROR_CODE. */ export declare class FetchAPIFileTransferService extends FileTransferService { private deviceStatusService; onCreate(): void; /** * Upload the given file-Blob to the given url and emit the upload status and * progress during the upload-process. * * Progress not supported for Fetch API * * @param fileToUpload JsPFile object that wraps the file-blob to upload * @param uploadUrl the target upload url (must be publicly available without authentication) * @returns Observable that emits the UploadStatus */ uploadFile(fileToUpload: JsPFile, uploadUrl: string): Observable; /** * Downloads a file-Blob. * * Progress not supported for Fetch API * * @param url the file-url to download * @returns Observable that emits the DownloadStatus and resolves with a JsPFile that wraps the file-blob */ downloadFile(url: string): Observable; /** * Check if there is internet connection and throw a NO_INTERNET, if so. * Rethrow the original error otherwise. */ private checkInternetConnectivity; /** * Process successful http-requests. * Might also throw an error if the response contains a server-side error. * * @param result the response of the request * @returns the requests response-data */ private processResponse; }