import type { AppClient, CellId } from "@holochain/client"; import { EntryHash } from "@holochain/client"; import { FileMetadata } from "./types"; export declare class FileStorageClient { client: AppClient; roleName: string; zomeName: string; cellId: CellId | undefined; /** * @param client connection to the holochain backend * @param roleName * @param zomeName the zome name of the file_storage zome in the given cell * @param cellId optional cellId parameter for use when client is associated with a clone-cell */ constructor(client: AppClient, roleName: string, zomeName?: string, cellId?: CellId | undefined); /** * Upload a file to the file_storage zome, splitting it into chunks * * @param file file to split and upload * @param chunkSize chunk size to split the file, default 256 KB */ uploadFile(file: File, onProgress?: undefined | ((percentatgeProgress: number, bytesSent: number) => void), chunkSize?: number): Promise; /** * Downloads the whole file with the given hash * @param fileHash * @param local whether to only check locally (default: true). Set to false to fetch from network. */ downloadFile(fileHash: EntryHash, local?: boolean): Promise; /** * Gets only the metadata of the file with the given hash * This is specially useful if you want to fetch the chunks one by one * @param fileHash the hash of the file * @param local whether to only check locally (default: true). Set to false to fetch from network. */ getFileMetadata(fileHash: EntryHash, local?: boolean): Promise; /** * Fetch the chunk identified with the given hash * This is useful if used with the chunk hashes received with `getFileMetadata` * @param fileChunkHash * @param local whether to only check locally (default: true). Set to false to fetch from network. */ fetchChunk(fileChunkHash: EntryHash, local?: boolean): Promise; /** Private helpers */ private _splitFile; private _createChunk; private _callZome; }