vue-files-preview
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
32 lines (31 loc) • 725 B
TypeScript
import { Component } from 'vue';
/**
* VueFilesPreview
*/
export interface IPreviewRule {
name: string;
type: PreviewType;
accept: Array<string>;
component: Component;
}
export declare enum PreviewType {
NONE = "none",// 无类型
CODE = "code",// 代码类型
DOC = "doc",
DOCX = "docx",// WORD文档
XLSX = "xlsx",// Excel文件
PDF = "pdf",// PDF
PIC = "pic",// 图片
TXT = "txt",// 文本
MD = "md",// Markdown
EPUB = "epub",// epub
PPT = "ppt",
AUDIO = "audio",
VIDEO = "video"
}
export type FileRenderType = 'text' | 'image' | 'pdf' | 'arrayBuffer' | 'video';
export interface PreviewProps {
file?: File;
url?: string;
name?: string;
}