Skip to content

Commit 4958954

Browse files
authored
fix: update type annotations in beforeUpload function (#646)
1 parent 9c9dc95 commit 4958954

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/examples/beforeUpload.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint no-console:0 */
22

3-
import { Action } from '@/interface';
3+
import type { Action, RcFile } from '@/interface';
44
import Upload from 'rc-upload';
55

66
const props = {
@@ -15,9 +15,9 @@ const props = {
1515
onError(err) {
1616
console.log('onError', err);
1717
},
18-
beforeUpload(file, fileList) {
18+
beforeUpload(file: RcFile, fileList: RcFile[]) {
1919
console.log(file, fileList);
20-
return new Promise<string>(resolve => {
20+
return new Promise<RcFile>(resolve => {
2121
console.log('start check');
2222
setTimeout(() => {
2323
console.log('check finshed');

0 commit comments

Comments
 (0)