import * as React from "react"; export { FileWithPath } from "file-selector"; export default function Dropzone( props: DropzoneProps & React.RefAttributes ): JSX.Element; export function useDropzone(options?: DropzoneOptions): DropzoneState; export interface DropzoneProps extends DropzoneOptions { children?(state: DropzoneState): JSX.Element; } export enum ErrorCode { FileInvalidType = "file-invalid-type", FileTooLarge = "file-too-large", FileTooSmall = "file-too-small", TooManyFiles = "too-many-files", } export interface FileError { message: string; code: ErrorCode | string; } export interface FileRejection { file: File; errors: FileError[]; } export type DropzoneOptions = Pick, PropTypes> & { accept?: Accept; minSize?: number; maxSize?: number; maxFiles?: number; preventDropOnDocument?: boolean; noClick?: boolean; noKeyboard?: boolean; noDrag?: boolean; noDragEventsBubbling?: boolean; disabled?: boolean; onDrop?: ( acceptedFiles: T[], fileRejections: FileRejection[], event: DropEvent ) => void; onDropAccepted?: (files: T[], event: DropEvent) => void; onDropRejected?: (fileRejections: FileRejection[], event: DropEvent) => void; getFilesFromEvent?: ( event: DropEvent ) => Promise>; onFileDialogCancel?: () => void; onFileDialogOpen?: () => void; onError?: (err: Error) => void; validator?: (file: T) => FileError | FileError[] | null; useFsAccessApi?: boolean; autoFocus?: boolean; }; export type DropEvent = | React.DragEvent | React.ChangeEvent | DragEvent | Event; export type DropzoneState = DropzoneRef & { isFocused: boolean; isDragActive: boolean; isDragAccept: boolean; isDragReject: boolean; isFileDialogActive: boolean; acceptedFiles: File[]; fileRejections: FileRejection[]; rootRef: React.RefObject; inputRef: React.RefObject; getRootProps: (props?: T) => T; getInputProps: (props?: T) => T; }; export interface DropzoneRef { open: () => void; } export interface DropzoneRootProps extends React.HTMLAttributes { refKey?: string; [key: string]: any; } export interface DropzoneInputProps extends React.InputHTMLAttributes { refKey?: string; } type PropTypes = "multiple" | "onDragEnter" | "onDragOver" | "onDragLeave"; export interface Accept { [key: string]: string[]; }