@itwin/imodels-client-authoring
Version:
iModels API client wrapper for applications that author iModels.
24 lines • 1.17 kB
TypeScript
import { ClientStorage } from "@itwin/object-storage-core";
import { GenericAbortSignal } from "../base/types";
/** Function for reporting progress of the download. */
export type DownloadCallback = (bytesDownloaded: number) => void;
/** Parameters for downloading single file. */
export interface DownloadFileParams {
/** Storage client for downloading file. */
storage: ClientStorage;
/** URL of the file in the storage. */
url: string;
/** Type of storage where file is stored (e.g., "azure" or "google") */
storageType: string;
/** Absolute file path. */
localPath: string;
/** Function periodically called to report how many bytes of the file are downloaded. */
totalDownloadCallback?: DownloadCallback;
/** Function called to report how many bytes were downloaded with the latest chunk. */
latestDownloadedChunkSizeCallback?: DownloadCallback;
/** Abort signal for cancelling file download. */
abortSignal?: GenericAbortSignal;
}
/** Downloads file to path from provided storage. */
export declare function downloadFile(params: DownloadFileParams): Promise<void>;
//# sourceMappingURL=FileDownload.d.ts.map