use-handlers.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import type { ShallowRef } from 'vue';
  2. import type { UploadContentInstance } from './upload-content';
  3. import type { UploadFile, UploadFiles, 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. readonly lastModified: number;
  17. readonly name: string;
  18. readonly webkitRelativePath: string;
  19. readonly size: number;
  20. readonly type: string;
  21. arrayBuffer: () => Promise<ArrayBuffer>;
  22. slice: (start?: number | undefined, end?: number | undefined, contentType?: string | undefined) => Blob;
  23. stream: () => ReadableStream<any>;
  24. text: () => Promise<string>;
  25. } | undefined;
  26. }[]> | import("vue").WritableComputedRef<UploadFiles>;
  27. abort: (file: UploadFile) => void;
  28. clearFiles: (states?: UploadStatus[]) => void;
  29. handleError: (err: import("./ajax").UploadAjaxError, rawFile: UploadRawFile) => void;
  30. handleProgress: (evt: import("./upload").UploadProgressEvent, rawFile: UploadRawFile) => void;
  31. handleStart: (rawFile: UploadRawFile) => void;
  32. handleSuccess: (response: any, rawFile: UploadRawFile) => unknown;
  33. handleRemove: (file: UploadFile | UploadRawFile, rawFile?: UploadRawFile | undefined) => void;
  34. submit: () => void;
  35. };