File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 4
4
import { CoreDOMWidgetModel } from './widget_core' ;
5
5
import { DOMWidgetView } from '@jupyter-widgets/base' ;
6
6
7
+ interface IFileUploaded {
8
+ content : any ;
9
+ name : string ;
10
+ size : number ;
11
+ type : string ;
12
+ lastModified : number ;
13
+ error : string ;
14
+ }
15
+
7
16
export class FileUploadModel extends CoreDOMWidgetModel {
8
17
defaults ( ) : Backbone . ObjectHash {
9
18
return {
@@ -58,16 +67,9 @@ export class FileUploadView extends DOMWidgetView {
58
67
} ) ;
59
68
60
69
this . fileInput . addEventListener ( 'change' , ( ) => {
61
- const promisesFile : Promise < {
62
- content : any ;
63
- name : string ;
64
- size : number ;
65
- type : string ;
66
- lastModified : number ;
67
- error : string ;
68
- } > [ ] = [ ] ;
69
-
70
- Array . from ( this . fileInput . files ?? [ ] ) . forEach ( file => {
70
+ const promisesFile : Promise < IFileUploaded > [ ] = [ ] ;
71
+
72
+ Array . from ( this . fileInput . files ?? [ ] ) . forEach ( ( file : File ) => {
71
73
promisesFile . push (
72
74
new Promise ( ( resolve , reject ) => {
73
75
const metadata = {
You can’t perform that action at this time.
0 commit comments