UNPKG

agora-edu-core-lb

Version:

For publishing npm package agora-edu-core (Web & Electron). Get more information from https://docs.agora.io

32 lines (31 loc) 1.39 kB
import { ZipReader } from '@zip.js/zip.js'; export declare type CacheResourceType = 'dynamicConvert' | 'staticConvert'; export declare class AgoraCaches { private downloadList; constructor(); private startObserver; private agoraCaches; openCache: (cachesName: string) => Promise<Cache>; deleteCache: () => Promise<void>; /** * 计算 cache 占用空间,大小单位为 Byte,/1024 为 KiB 大小。 */ calculateCache: () => Promise<number>; deleteTaskUUID: (uuid: string) => Promise<void>; clearAllCache: () => Promise<void>; hasTaskUUID: (uuid: string) => Promise<boolean>; startDownload: (taskUuid: string, type: string, onProgress?: ((progress: number, controller: AbortController) => void) | undefined) => Promise<void>; handleZipFile(response: Response): Promise<void>; cacheResources: (entries: any, type: CacheResourceType) => Promise<void>; private createZipReader; getZipReader: (file: Blob) => Promise<ZipReader>; getContentType: (filename: any) => string; getLocation: (filename?: string | undefined, type?: CacheResourceType | undefined) => string; cacheEntry: (entry: any, type: CacheResourceType) => Promise<void>; availableSpace: () => Promise<number>; } export declare type ProgressData = { progress: number; url: string; }; export declare const agoraCaches: AgoraCaches;