11/**
2- * @flow
32 * @file Base class for the Content Uploader ES6 wrapper
43 * @author Box
54 */
@@ -11,21 +10,14 @@ import { render } from 'react-dom';
1110import ES6Wrapper from './ES6Wrapper' ;
1211import ContentUploaderPopup from '../content-uploader/ContentUploaderPopup' ;
1312import WrappedContentUploaderComponent from '../content-uploader/ContentUploader' ;
14- // @ts -ignore
15- import type { UploadFileWithAPIOptions } from '../../common/types/upload' ;
16- // @ts -ignore
17- import type { BoxItem } from '../../common/types/core' ;
18- // @ts -ignore
19- import type { ModalOptions } from '../common/flowTypes' ;
2013
2114class ContentUploader extends ES6Wrapper {
2215 /**
2316 * Callback on closing uploader. Emits 'close' event.
2417 *
2518 * @return {void }
2619 */
27- // @ts -ignore
28- onClose = ( ) : void => {
20+ onClose = ( ) => {
2921 this . emit ( 'close' ) ;
3022 } ;
3123
@@ -35,8 +27,7 @@ class ContentUploader extends ES6Wrapper {
3527 * @param {Array } data - Completed upload items
3628 * @return {void }
3729 */
38- // @ts -ignore
39- onComplete = ( data : BoxItem [ ] ) : void => {
30+ onComplete = data => {
4031 this . emit ( 'complete' , data ) ;
4132 } ;
4233
@@ -46,8 +37,7 @@ class ContentUploader extends ES6Wrapper {
4637 * @param {Object } data - File and error info about failed upload
4738 * @return {void }
4839 */
49- // @ts -ignore
50- onError = ( data : any ) : void => {
40+ onError = data => {
5141 this . emit ( 'error' , data ) ;
5242 } ;
5343
@@ -57,8 +47,7 @@ class ContentUploader extends ES6Wrapper {
5747 * @param {Object } data - Upload item
5848 * @return {void }
5949 */
60- // @ts -ignore
61- onBeforeUpload = ( data : UploadFileWithAPIOptions | File ) : void => {
50+ onBeforeUpload = data => {
6251 this . emit ( 'beforeupload' , data ) ;
6352 } ;
6453
@@ -68,15 +57,13 @@ class ContentUploader extends ES6Wrapper {
6857 * @param {BoxItem } data - Successfully uploaded item
6958 * @return {void }
7059 */
71- // @ts -ignore
72- onUpload = ( data : BoxItem ) : void => {
60+ onUpload = data => {
7361 this . emit ( 'upload' , data ) ;
7462 } ;
7563
7664 /** @inheritdoc */
7765 render ( ) {
78- // @ts -ignore
79- const { modal, ...rest } : { modal ?: ModalOptions } = this . options ;
66+ const { modal, ...rest } = this . options ;
8067 const UploaderComponent = modal ? ContentUploaderPopup : WrappedContentUploaderComponent ;
8168
8269 render (
@@ -91,7 +78,7 @@ class ContentUploader extends ES6Wrapper {
9178 onError = { this . onError }
9279 onBeforeUpload = { this . onBeforeUpload }
9380 onUpload = { this . onUpload }
94- modal = { ( ( modal : any ) : ModalOptions ) }
81+ modal = { modal }
9582 { ...rest }
9683 /> ,
9784 this . container ,
0 commit comments