From c127440207fa9c145a1d8db833ad3de079879a05 Mon Sep 17 00:00:00 2001 From: Simba Date: Tue, 8 Sep 2020 00:03:52 +0800 Subject: [PATCH] declare dom file type --- src/pages/matter/List.tsx | 2 +- src/react-app-env.d.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/matter/List.tsx b/src/pages/matter/List.tsx index ecdca91..e387546 100644 --- a/src/pages/matter/List.tsx +++ b/src/pages/matter/List.tsx @@ -301,7 +301,7 @@ export default class List extends TankComponent { uploadDirectory = async () => { const dirPathUuidMap: any = {}; // 存储已经创建好的文件夹map for (let i = 0; i < this.tempUploadList.length; i++) { - const file: any = this.tempUploadList[i]; + const file: File = this.tempUploadList[i]; const paths = file.webkitRelativePath.split("/"); const pPaths = paths.slice(0, paths.length - 1); const pPathStr = pPaths.join("/"); diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 9538ef4..772a351 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -79,3 +79,7 @@ declare module 'comma-separated-values' { import CSV from 'comma-separated-values'; export default CSV; } + +declare interface File { + webkitRelativePath: string; +}