/// import FileTypes from '../@types'; import { IServer } from '../@types/client'; export default class FileClient { private client; private constructor(); private _fetchData; /** * * @param server 服务器地址信息 * @param region */ static create(server: IServer, config: FileTypes.Config): FileClient; listFiles(appid: string, prefix: string): Promise; readFile(appid: string, path: string): Promise; writeFile(appid: string, path: string, data: Buffer, contentType: string): Promise; deleteFile(appid: string, path: string): Promise; /** * 上传文件,设置默认权限为 public-read; * * @param appid 决定存储的位置和路径前缀 * @param path 文件路径 * @param data 文件内容 * @param contentType 文件的 MIME type * @returns 生成的 CDN 路径信息 */ uploadFile(appid: string, path: string, data: Buffer, contentType: string, contentMD5?: string | null): Promise; static downloadFile(downloadUrl: string, options: FileTypes.IDownloadParamsOptions): Promise; static parseFile2Buffer(file: FileTypes.UploadFileType): Promise; }