use-handlers.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import type { ShallowRef } from 'vue';
  2. import type { UploadContentInstance } from './upload-content';
  3. import type { UploadFile, UploadProps, UploadRawFile, UploadStatus } from './upload';
  4. export declare const useHandlers: (props: UploadProps, uploadRef: ShallowRef<UploadContentInstance | undefined>) => {
  5. /** @description two-way binding ref from props `fileList` */
  6. uploadFiles: import("vue").Ref<{
  7. name: string;
  8. percentage?: number | undefined;
  9. status: UploadStatus;
  10. size?: number | undefined;
  11. response?: unknown;
  12. uid: number;
  13. url?: string | undefined;
  14. raw?: {
  15. uid: number;
  16. isDirectory?: boolean | undefined;
  17. readonly lastModified: number;
  18. readonly name: string;
  19. readonly webkitRelativePath: string;
  20. readonly size: number;
  21. readonly type: string;
  22. arrayBuffer: () => Promise<ArrayBuffer>;
  23. slice: (start?: number, end?: number, contentType?: string) => Blob;
  24. stream: () => ReadableStream<Uint8Array>;
  25. text: () => Promise<string>;
  26. } | undefined;
  27. }[]>;
  28. abort: (file: UploadFile) => void;
  29. clearFiles: (states?: UploadStatus[]) => void;
  30. handleError: (err: import("./ajax").UploadAjaxError, rawFile: UploadRawFile) => void;
  31. handleProgress: (evt: import("./upload").UploadProgressEvent, rawFile: UploadRawFile) => void;
  32. handleStart: (rawFile: UploadRawFile) => void;
  33. handleSuccess: (response: any, rawFile: UploadRawFile) => unknown;
  34. handleRemove: (file: UploadFile | UploadRawFile, rawFile?: UploadRawFile) => void;
  35. submit: () => void;
  36. revokeFileObjectURL: (file: UploadFile) => void;
  37. };