Options
All
  • Public
  • Public/Protected
  • All
Menu

The CloudDriveStore class provides abilities related the cloud drive.

Hierarchy

Index

Constructors

constructor

Properties

personalResources

personalResources: Map<string, CloudDriveResource>

Personal resources

uploadProgress

uploadProgress: Map<string, CloudDriveUploadingProgress>

Progresses of resources

Methods

addPersonalResource

  • Create a record that maps to the uploaded resource file

    Parameters

    Returns Promise<any>

calcResourceUuid

  • calcResourceUuid(resource: string | File): Promise<string>
  • Figure out a UUID for the resource file

    Parameters

    • resource: string | File

    Returns Promise<string>

    Resource file UUID

cancelUpload

  • cancelUpload(resourceUuid: string): Promise<void>
  • Cancels uploading the file

    Parameters

    • resourceUuid: string

      The resource ID

    Returns Promise<void>

fetchPersonalResources

  • Gets all personal resources

    Parameters

    Returns Promise<{ list: never[]; total: number }>

    Cloud disk resource page information

removePersonalResources

  • removePersonalResources(resourceUuids: string[]): Promise<undefined>
  • Removes files from personal resources

    Parameters

    • resourceUuids: string[]

      The resource IDs

    Returns Promise<undefined>

retryUpload

  • retryUpload(resourceUuid: string): void
  • Retries uploading the file

    Parameters

    • resourceUuid: string

      The resource ID

    Returns void

updatePersonalResource

  • updatePersonalResource(resourceUuid: string, resourceInfo: Pick<CloudDriveResourceInfo, "resourceName">): Promise<any>
  • Updates the cloud drive file info

    Parameters

    Returns Promise<any>

uploadPersonalResource

  • uploadPersonalResource(file: File, progressUuid: string, ext: string, contentType: string, conversion?: Partial<{ canvasVersion: boolean; outputFormat: string; preview: boolean; scale: number; type: string }>): Promise<undefined | { ext: string; resourceName: string; resourceUuid: any; url: string } | { ext?: undefined; resourceName?: undefined; resourceUuid?: undefined; url?: undefined }>
  • Uploads a file to personal resources, addPersonalResource is required to call after uploading, which creates a record that will show in cloud drive.

    Parameters

    • file: File

      The file

    • progressUuid: string

      Progress UUID

    • ext: string

      Extension name of the resource

    • contentType: string

      static or dynamic

    • Optional conversion: Partial<{ canvasVersion: boolean; outputFormat: string; preview: boolean; scale: number; type: string }>

      conversion options

    Returns Promise<undefined | { ext: string; resourceName: string; resourceUuid: any; url: string } | { ext?: undefined; resourceName?: undefined; resourceUuid?: undefined; url?: undefined }>

    Information about the uploaded file