@chief-editor/ui
Version:
UI Component for chief editor
32 lines (31 loc) • 952 B
TypeScript
import { IBaseFile, IFile, IRequest } from '../types/interface';
import { FileStatus, FileType } from '../types/enum';
declare type IFileClass<T> = Omit<IFile<T>, 'id'>;
export declare class FileClass<T> implements IFileClass<T> {
readonly id: string;
name: string;
fileType: FileType;
data?: T;
originUrl?: string;
originFile?: File;
file?: File;
size?: number;
url: string;
previewUrl: string;
fileStatus: FileStatus;
errmsg: string;
request?: IRequest;
private progress;
constructor(props: Partial<IFile<T>>);
updateFile(options: Partial<IBaseFile<T>>): this;
getFileName(): string | undefined;
setStatus(status: FileStatus): void;
getProgress(): number;
setProgress(progress: number): void;
getName(path: string): string;
getExtName(path: string): string;
isImageUrl(file: File): boolean;
getBaseFile(): IBaseFile<T>;
destroy(): void;
}
export {};