vue-files-preview-light
Version:
A lightweight, optimized fork of vue-files-preview with lazy loading and security updates. A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
32 lines (31 loc) • 755 B
TypeScript
import { Component } from 'vue';
/**
* VueFilesPreview
*/
export interface IPreviewRule {
name: string;
type: PreviewType;
accept: Array<string>;
component: Component | (() => Promise<Component>) | null;
}
export declare enum PreviewType {
NONE = "none",// No type
CODE = "code",// Code type
DOC = "doc",
DOCX = "docx",// WORD document
XLSX = "xlsx",// Excel file
PDF = "pdf",// PDF
PIC = "pic",// Image
TXT = "txt",// Text
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;
}