import { ProgressStatus } from "../progress-bar/ProgressStatus"; import type { FileUpload } from "./FileUpload"; export type OnCompleted = (file: File, url: string, thumbnail?: string) => void; export type UpdateStatus = () => void; export default class UploadFile { /** * 待上传的文件 */ readonly file: File; /** * 上传后的文件地址 */ private _url; /** * 上传的缩率图 * @private */ private _thumbnail; /** * 状态 */ private _status; /** * 已经上传的字节数 */ private _uploadedBytes; /** * 上传的实例 */ private loader?; private readonly onCompleted; private readonly uploadFile; private updateStatus; constructor(file: File, uploadFile: FileUpload, onCompleted: OnCompleted); private startUploading; restart(): void; get url(): string | null; get thumbnail(): string | undefined | null; get status(): ProgressStatus; get progress(): number; cancel(): Promise; setUpdateStatus(value: UpdateStatus): void; }