// Type definitions for react-dropzone 4.2.3 // Project: https://github.com/okonet/react-dropzone // Definitions by: Mathieu Larouche Dube , // Ivo Jesus , // Luís Rodrigues , // Ben Bayard , // Karol Janyst , // Andris Causs , // Juraj Husar , // Monroe Ekilah // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import { CSSProperties, Component, DragEvent, InputHTMLAttributes } from "react"; export interface ImageFile extends File { preview?: string; } export type DropFileEventHandler = (acceptedOrRejected: ImageFile[], event: DragEvent) => void; export type DropFilesEventHandler = (accepted: ImageFile[], rejected: ImageFile[], event: DragEvent) => void; type PickedAttributes = "className" | "multiple" | "name" | "onClick" | "onDragStart" | "onDragEnter" | "onDragOver" | "onDragLeave" | "style"; export interface DropzoneProps extends Pick, PickedAttributes> { accept?: string | ReadonlyArray; disableClick?: boolean; disabled?: boolean; disablePreview?: boolean; preventDropOnDocument?: boolean; inputProps?: InputHTMLAttributes; maxSize?: number; minSize?: number; activeClassName?: string; acceptClassName?: string; rejectClassName?: string; disabledClassName?: string; activeStyle?: CSSProperties; acceptStyle?: CSSProperties; rejectStyle?: CSSProperties; disabledStyle?: CSSProperties; onDrop?: DropFilesEventHandler; onDropAccepted?: DropFileEventHandler; onDropRejected?: DropFileEventHandler; onFileDialogCancel?: () => void; } export default class Dropzone extends Component { open(): void; }