index.d.ts 940 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import type { DefineComponent, Plugin } from "vue"
  2. export type ViewFileType =
  3. | "docx"
  4. | "xlsx"
  5. | "pdf"
  6. | "pptx"
  7. | "gif"
  8. | "jpg"
  9. | "jpeg"
  10. | "bmp"
  11. | "tiff"
  12. | "tif"
  13. | "png"
  14. | "svg"
  15. | "txt"
  16. | "json"
  17. | "js"
  18. | "css"
  19. | "java"
  20. | "py"
  21. | "html"
  22. | "jsx"
  23. | "ts"
  24. | "tsx"
  25. | "xml"
  26. | "md"
  27. | "log"
  28. | string
  29. export interface ViewFileInput {
  30. filename?: string
  31. type?: ViewFileType
  32. fileBuffer?: ArrayBuffer | null
  33. size?: number
  34. name?: string
  35. }
  36. export const ViewFile: DefineComponent<{
  37. file?: ViewFileInput
  38. }>
  39. export function getExtend(name: string): string
  40. export function readBuffer(file: File): Promise<ArrayBuffer>
  41. export function readDataURL(buffer: ArrayBuffer): Promise<string>
  42. export function readText(buffer: ArrayBuffer): Promise<string>
  43. export function render(buffer: ArrayBuffer, type: string, target: HTMLElement): Promise<any>
  44. declare const plugin: Plugin
  45. export default plugin