Skip to content

Commit

Permalink
fix(upload): inst type (tusen-ai#5882)
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoDaiGua-Ray authored Aug 11, 2024
1 parent 7ede9be commit 590ad1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/upload/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ interface UploadCustomRequestOptions {
| --- | --- | --- | --- |
| clear | `() => void` | Clear current upload list. | 2.24.2 |
| openOpenFileDialog | `() => void` | Open the file dialog window. | |
| submit | `(fileId?: string \| number)` | Submit all files with pending status. | |
| submit | `(fileId?: string)` | Submit all files with pending status. | |

### Upload Slots

Expand Down
2 changes: 1 addition & 1 deletion src/upload/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ interface UploadCustomRequestOptions {
| --- | --- | --- | --- |
| clear | `() => void` | 清空上传列表 | 2.24.2 |
| openOpenFileDialog | `() => void` | 打开文件选择对话框 | |
| submit | `(fileId?: string \| number)` | 提交当前所有处于 pending 状态的文件 | |
| submit | `(fileId?: string)` | 提交当前所有处于 pending 状态的文件 | |

### Upload Slots

Expand Down
6 changes: 6 additions & 0 deletions src/upload/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ export interface XhrHandlers {
handleXHRError: (e: ProgressEvent) => void
}

export interface UploadInst {
openOpenFileDialog: () => void
submit: (fileId?: string) => void
clear: () => void
}

export type OnBeforeUpload = (data: {
file: UploadSettledFileInfo
fileList: UploadSettledFileInfo[]
Expand Down

0 comments on commit 590ad1e

Please sign in to comment.