From fa5d5e0a9600ef688da42a9298250910ffec2381 Mon Sep 17 00:00:00 2001 From: DiamondYuan Date: Wed, 29 May 2019 13:52:35 +0800 Subject: [PATCH 1/2] fix: fix type of RcFile --- components/upload/interface.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx index b46711ac725e..b121f32a53a1 100755 --- a/components/upload/interface.tsx +++ b/components/upload/interface.tsx @@ -8,7 +8,12 @@ export interface HttpRequestHeader { export interface RcFile extends File { uid: string; - lastModifiedDate: Date; + readonly name: string; + readonly type: string; + readonly lastModified: number; + readonly lastModifiedDate: Date; + readonly size: number; + readonly webkitRelativePath: string; } export interface UploadFile { From c7bc6b743cdad910c83df31ca948be588f6988e0 Mon Sep 17 00:00:00 2001 From: DiamondYuan Date: Wed, 29 May 2019 13:53:33 +0800 Subject: [PATCH 2/2] fix: fix type of action in UploadProps --- components/upload/interface.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx index b121f32a53a1..dc571ccdf451 100755 --- a/components/upload/interface.tsx +++ b/components/upload/interface.tsx @@ -32,7 +32,6 @@ export interface UploadFile { error?: any; linkProps?: any; type: string; - webkitRelativePath?: string; } export interface UploadChangeParam { @@ -64,7 +63,7 @@ export interface UploadProps { name?: string; defaultFileList?: Array; fileList?: Array; - action?: string | ((file: UploadFile) => string) | ((file: UploadFile) => PromiseLike); + action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike); directory?: boolean; data?: Object | ((file: UploadFile) => any); headers?: HttpRequestHeader;