huijia-viewfile 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ import type { DefineComponent, Plugin } from "vue"
2
+
3
+ export type ViewFileType =
4
+ | "docx"
5
+ | "xlsx"
6
+ | "pdf"
7
+ | "pptx"
8
+ | "gif"
9
+ | "jpg"
10
+ | "jpeg"
11
+ | "bmp"
12
+ | "tiff"
13
+ | "tif"
14
+ | "png"
15
+ | "svg"
16
+ | "txt"
17
+ | "json"
18
+ | "js"
19
+ | "css"
20
+ | "java"
21
+ | "py"
22
+ | "html"
23
+ | "jsx"
24
+ | "ts"
25
+ | "tsx"
26
+ | "xml"
27
+ | "md"
28
+ | "log"
29
+ | string
30
+
31
+ export interface ViewFileInput {
32
+ filename?: string
33
+ type?: ViewFileType
34
+ fileBuffer?: ArrayBuffer | null
35
+ size?: number
36
+ name?: string
37
+ }
38
+
39
+ export const ViewFile: DefineComponent<{
40
+ file?: ViewFileInput
41
+ }>
42
+
43
+ export function getExtend(name: string): string
44
+ export function readBuffer(file: File): Promise<ArrayBuffer>
45
+ export function readDataURL(buffer: ArrayBuffer): Promise<string>
46
+ export function readText(buffer: ArrayBuffer): Promise<string>
47
+ export function render(buffer: ArrayBuffer, type: string, target: HTMLElement): Promise<any>
48
+
49
+ declare const plugin: Plugin
50
+ export default plugin