UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

66 lines (65 loc) 2.44 kB
import { Ref } from 'vue'; import { Emits, Props, UploadFile } from '../types'; /** * hook * * @param props 组件属性 * @param fileInputRef 实例 * @param emits 组件事件 */ export declare const useUpload: (props: Props, fileInputRef: Ref<HTMLInputElement | null>, emits: Emits) => { isDragging: Ref<boolean, boolean>; isError: Ref<boolean, boolean>; uploadFiles: Ref<{ uid?: string | undefined; name: string; size?: number | undefined; status?: "ready" | "uploading" | "success" | "error" | undefined; percent?: number | undefined; response?: any; error?: string | undefined; raw?: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise<ArrayBuffer>; bytes: () => Promise<Uint8Array<ArrayBuffer>>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream<Uint8Array<ArrayBuffer>>; text: () => Promise<string>; } | undefined; url: string; }[], UploadFile[] | { uid?: string | undefined; name: string; size?: number | undefined; status?: "ready" | "uploading" | "success" | "error" | undefined; percent?: number | undefined; response?: any; error?: string | undefined; raw?: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise<ArrayBuffer>; bytes: () => Promise<Uint8Array<ArrayBuffer>>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream<Uint8Array<ArrayBuffer>>; text: () => Promise<string>; } | undefined; url: string; }[]>; isDisplay: import('vue').ComputedRef<boolean>; handleImagePreview: (imgUrl: string) => void; onFileInput: () => void; handleDragOver: () => void; handleDragLeave: () => void; handleDrop: (e: DragEvent) => void; handleFileChange: (e: Event) => void; removeFile: (file: UploadFile) => void; formatFileSize: (bytes: number) => string; };