Skip to content

Commit a1b63c5

Browse files
committed
Upload: add ElUploadInternalRawFile interface
1 parent 9a04791 commit a1b63c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

types/upload.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ export interface FileListItem {
99
status?: FileUploadStatus
1010
}
1111

12+
export interface ElUploadInternalRawFile extends File {
13+
uid: number
14+
}
15+
1216
export interface ElUploadInternalFileDetail {
1317
status: FileUploadStatus,
1418
name: string,
1519
size: number,
1620
percentage: number,
1721
uid: number,
18-
raw: File,
22+
raw: ElUploadInternalRawFile,
1923
url?: string
2024
}
2125

@@ -83,7 +87,7 @@ export declare class ElUpload extends ElementUIComponent {
8387
onChange: (file: ElUploadInternalFileDetail, fileList: ElUploadInternalFileDetail[]) => void
8488

8589
/** Hook function before uploading with the file to be uploaded as its parameter. If false or a Promise is returned, uploading will be aborted */
86-
beforeUpload: (file: ElUploadInternalFileDetail) => boolean | Promise<File | boolean>
90+
beforeUpload: (file: ElUploadInternalRawFile) => boolean | Promise<File | Blob | boolean>
8791

8892
/** Whether thumbnail is displayed */
8993
thumbnailMode: boolean

0 commit comments

Comments
 (0)