@@ -14,7 +14,7 @@ function getProxyButton(view: widgets.FileUploadView): HTMLButtonElement {
14
14
return elem as HTMLButtonElement ;
15
15
}
16
16
17
- function fileInputForModel ( model : widgets . FileUploadModel ) {
17
+ function fileInputForModel ( model : widgets . FileUploadModel ) : HTMLInputElement {
18
18
// For a given model, create and render a view and return the
19
19
// view's input.
20
20
const options = { model } ;
@@ -23,21 +23,23 @@ function fileInputForModel(model: widgets.FileUploadModel) {
23
23
return getFileInput ( view ) ;
24
24
}
25
25
26
- function proxyButtonForModel ( model : widgets . FileUploadModel ) {
26
+ function proxyButtonForModel (
27
+ model : widgets . FileUploadModel
28
+ ) : HTMLButtonElement {
27
29
const options = { model } ;
28
30
const view = new widgets . FileUploadView ( options ) ;
29
31
view . render ( ) ;
30
32
return getProxyButton ( view ) ;
31
33
}
32
34
33
- function simulateUpload ( fileInput : HTMLInputElement , files : Array < File > ) {
35
+ function simulateUpload ( fileInput : HTMLInputElement , files : Array < File > ) : void {
34
36
// The 'files' property on an input element is normally not writeable
35
37
// programmatically, so we explicitly overwrite it.
36
38
37
39
// The type of fileInput.files is FileList, an Array with an
38
40
// extra `.item` method.
39
41
const fileList : any = files ;
40
- fileList . item = ( index : number ) => files [ index ] ;
42
+ fileList . item = ( index : number ) : File => files [ index ] ;
41
43
Object . defineProperty ( fileInput , 'files' , {
42
44
value : fileList ,
43
45
writable : false
0 commit comments