import { FileRequest, FileCheckoutResultValue } from '../core/event-adapter'; export interface FileDownloadProgress { fileUnique: bigint; fileName: string; progress: number; } export interface DownloadedFile { data: Blob; name?: string; } export declare class FileDownloadManager { private dataChannel; private onFileTransferApply?; private onProgress?; private onReceivedFile?; private fileReceivedMap; private cdPromiseMap; private coPromiseMap; /** * use the FileSystemAccess API to download file. * * @default false */ private useFileSystemAPI; /** * When the file size is less than the threshold (byte-based), the original method will be used. * * @default 524288000 - 500 MB */ private fileSystemAPIThreshold; constructor(dataChannel: RTCDataChannel, onFileTransferApply?: ((payload: FileRequest) => void) | undefined, onProgress?: ((payload: FileDownloadProgress) => void) | undefined, onReceivedFile?: ((payload: DownloadedFile) => void) | undefined); private handleMessage; private removeAllListeners; private handleClose; private handleFileRequest; private emitProgressEvent; private handleFileContent; private handleFileContentWithOriginalMethod; private handleFileContentWithFileSystemAccessAPI; private handleFileDownloadDirectory; private handleFileCheckout; private showSaveFilePicker; replyFileTransferApply(fileUnique: bigint, allowed: boolean): void; changeDirectory(path?: string): Promise; checkout(fileName: string): Promise; /** * enable File System Access API to download file * @param {number} [threshold=524288000] When the file size is less than the threshold (byte-based, default 500 MB), the original method will be used. */ enableFileSystemAccessAPI(threshold?: number): void; /** * disable File System Access API to download file */ disableFileSystemAccessAPI(): void; destroy(): void; }