packageDocumentation module import * as https from "https" ; import { AccessToken , BentleyError , GetMetaDataFunction } from "@itwin/core-bentley" ; import { ProgressCallback } from "./Request" ; beta export interface CancelRequest { /** Returns true if cancel request was acknowledged */ cancel : ( ) => boolean ; } internal export class UserCancelledError extends BentleyError { public constructor ( errorNumber , message , getMetaData ? ) { super ( errorNumber , message , getMetaData ) ; this . name = "User cancelled operation" ; } } beta export class SasUrlExpired extends BentleyError { public constructor ( errorNumber , message , getMetaData ? ) { super ( errorNumber , message , getMetaData ) ; this . name = "SaS url has expired" ; } } internal export class DownloadFailed extends BentleyError { public constructor ( errorNumber , message , getMetaData ? ) { super ( errorNumber , message , getMetaData ) ; this . name = "Fail to download file" ; } } internal export interface FileHandler { agent ? : https . Agent ; param accessToken param downloadUrl param path param fileSize param progressCallback downloadFile ( accessToken , downloadUrl , path , fileSize ? , progress ? , cancelRequest ? ) : Promise < void > ; param accessToken param uploadUrl param path param progressCallback uploadFile ( accessToken , uploadUrlString , path , progress ? ) : Promise < void > ; param filePath returns getFileSize ( filePath ) : number ; param filePath returns isDirectory ( filePath ) : boolean ; param filePath returns exists ( filePath ) : boolean ; param filePath unlink ( filePath ) : void ; param filePath returns basename ( filePath ) : string ; param paths returns join ( ... paths ) : string ; }