import { SdkResult } from "../Entity"; import { FileInfo } from "../../../model/Entity"; import { HChooseVideoOption } from "../../../model/Entity/HChooseVideoOption"; import { HChooseImageOptions } from "../../../model/Entity/HChooseImageOption"; import { HChooseVideoSuccess } from "../../../model/Entity/HChooseVideoSuccess"; export default interface IFile { /** * 获取文件信息 * @param filePath 文件路径 */ GetFileInfo(filePath: string): Promise>; /** * 选择图片 */ ChooseImage(option?: HChooseImageOptions): Promise>; /** * 录音 */ AudioRecord(): Promise>; /** * 选择视频 */ ChooseVideo(option?: HChooseVideoOption): Promise>; /** * 上传文件 * @param filePath * @param key * @param progressFun */ Upload(filePath: string, key: string, progressFun: Function): Promise>; /** * 在线预览文件 * @param fileName * @param url * @param type */ PreViewOnlineFile(fileName: string, url: string, extName: string, appId: string, closeSelf: boolean, isdown?: boolean): Promise>; /** * 下载 * @param filePath * @param progressFun * @param savePath [可选参数] 文件保存的路径, [注意:] 只支持PC端设置次参数 */ Download(filePath: string, progressFun: Function, savePath?: string): Promise>; /** * 图片预览 * @param url * @param imgList 图片数组 */ PreViewImage(url: string, imgList: string[]): Promise>; /** * 视频预览 * @param url */ PreViewVideo(url: string): Promise>; /** * 文件预览 * @param fileUrl * @param fileName * @param extName * @param size */ ViewFile(fileUrl: string, fileName: string, extName: string, size: number): Promise>; /** * 获取临时目录,一般用来存放临时文件,重启后有可能会自动删除 */ GetTempDir(): Promise>; /** * 压缩成Zip * @param dirPath * @param zipFilePath */ ZipCompress(dirPath: string, zipFilePath: string): Promise>; /** * 解Zip压缩 * @param filPath * @param targetDir */ ZipDecompress(filPath: string, targetDir: string): Promise>; /** * 保存base64文件 * @param base64Data base64数据字符串 * @param ext 扩展名 * @returns 返回本地路径 */ SaveBase64File(base64Data: string, ext: string): Promise>; /** * 播放音乐 * @param url */ PlayMusic(url: string): Promise>; /** * 获取签名 */ GetSignature(): Promise>; /** * 获取盖章图片 */ GetSealImage(index: 0 | 1 | 2): Promise>; /** * 打印Html * @param html */ PrintHtml(html: string): Promise>; }