1+ import * as React from 'react' ;
2+ import * as Dropzone from 'dropzone' ;
3+
4+ /* type aliases for callbacks */
5+ type VoidCallback = ( ) => any ;
6+ type InitCallback = ( dropzone : Dropzone ) => any ;
7+ type DragEventCallback = ( event : DragEvent ) => any ;
8+ type FileCallback = ( file : Dropzone . DropzoneFile ) => any ;
9+ type FileArrayCallback = ( files : Dropzone . DropzoneFile [ ] ) => any ;
10+ type ThumbnailCallback = ( file : Dropzone . DropzoneFile , dataUrl : string ) => any ;
11+ type ErrorCallback = ( file : Dropzone . DropzoneFile , message : string | Error ) => any ;
12+ type ErrorMultipleCallback = ( files : Dropzone . DropzoneFile [ ] , message : string | Error ) => any ;
13+ type UploadProgressCallback = ( file : Dropzone . DropzoneFile , progress : number , bytesSent : number ) => any ;
14+ type TotalUploadProgressCallback = ( totalProgress : number , totalBytes : number , totalBytesSent : number ) => any ;
15+ type SendingCallback = ( file : Dropzone . DropzoneFile , xhr : XMLHttpRequest , formData : FormData ) => any ;
16+ type SendingMultipleCallback = ( files : Dropzone . DropzoneFile [ ] , xhr : XMLHttpRequest , formData : FormData ) => any ;
17+
18+ /* handlers based on ts definitions for Dropzone.js (@types/dropzone) */
19+ export declare interface DropzoneComponentHandlers {
20+ init ?: InitCallback | InitCallback [ ] ;
21+
22+ // All of these receive the event as first parameter:
23+ drop ?: DragEventCallback | DragEventCallback [ ] ;
24+ dragstart ?: DragEventCallback | DragEventCallback [ ] ;
25+ dragend ?: DragEventCallback | DragEventCallback [ ] ;
26+ dragenter ?: DragEventCallback | DragEventCallback [ ] ;
27+ dragover ?: DragEventCallback | DragEventCallback [ ] ;
28+ dragleave ?: DragEventCallback | DragEventCallback [ ] ;
29+ paste ?: DragEventCallback | DragEventCallback [ ] ;
30+
31+ reset ?: VoidCallback | VoidCallback [ ] ;
32+
33+ addedfile ?: FileCallback | FileCallback [ ] ;
34+ addedfiles ?: FileArrayCallback | FileArrayCallback [ ] ;
35+ removedfile ?: FileCallback | FileCallback [ ] ;
36+ thumbnail ?: ThumbnailCallback | ThumbnailCallback [ ] ;
37+
38+ error ?: ErrorCallback | ErrorCallback [ ] ;
39+ errormultiple ?: ErrorMultipleCallback | ErrorMultipleCallback [ ] ;
40+
41+ processing ?: FileCallback | FileCallback [ ] ;
42+ processingmultiple ?: FileArrayCallback | FileArrayCallback [ ] ;
43+
44+ uploadprogress ?: UploadProgressCallback | UploadProgressCallback [ ] ;
45+ totaluploadprogress ?: TotalUploadProgressCallback | TotalUploadProgressCallback [ ] ;
46+
47+ sending ?: SendingCallback | SendingCallback [ ] ;
48+ sendingmultiple ?: SendingMultipleCallback | SendingMultipleCallback [ ] ;
49+
50+ success ?: FileCallback | FileCallback [ ] ;
51+ successmultiple ?: FileArrayCallback | FileArrayCallback [ ] ;
52+
53+ canceled ?: FileCallback | FileCallback [ ] ;
54+ canceledmultiple ?: FileArrayCallback | FileArrayCallback [ ] ;
55+
56+ complete ?: FileCallback | FileCallback [ ] ;
57+ completemultiple ?: FileArrayCallback | FileArrayCallback [ ] ;
58+
59+ maxfilesexceeded ?: FileCallback | FileCallback [ ] ;
60+ maxfilesreached ?: FileArrayCallback | FileArrayCallback [ ] ;
61+
62+ queuecomplete ?: VoidCallback | VoidCallback [ ] ;
63+ }
64+
65+ export declare interface DropzoneComponentConfig {
66+ showFiletypeIcon ?: boolean ;
67+ iconFiletypes ?: string [ ] ;
68+ postUrl ?: string ;
69+ dropzoneSelector ?: string ;
70+ }
71+
72+ interface DropzoneComponentProps {
73+ djsConfig ?: Dropzone . DropzoneOptions ;
74+ config ?: DropzoneComponentConfig ;
75+ eventHandlers ?: DropzoneComponentHandlers ;
76+ className ?: string ;
77+ action ?: string ;
78+ }
79+
80+ export declare class DropzoneComponent extends React . Component < DropzoneComponentProps , { } > {
81+ }
0 commit comments