// @flow
// flow-typed signature: 4eac0b965818f7cdbe6b60cb9cf94d37
// flow-typed version: <<STUB>>/react-dropzone_v^11.0.1/flow_v0.127.0
import type {
  DragEvent,
  Ref,
  DetailedHTMLProps,
  RefAttributes,
  ChangeEvent,
} from 'react';

/**
 * This is an autogenerated libdef stub for:
 *
 *   'react-dropzone'
 *
 * Fill this stub out by replacing all the `any` types.
 *
 * Once filled out, we encourage you to share your work with the
 * community by sending a pull request to:
 * https://github.com/flowtype/flow-typed
 */

declare module 'react-dropzone' {
  declare export { FileWithPath } from "file-selector";

  declare export type DropzoneRef = {|
    open(): void;
  |}

  declare export type FileError = {|
    message: string;
    code: string;
  |}
  declare export type FileRejection = {
    file: File;
    errors: FileError[];
  }

  declare export type DropEvent =
  | DragEvent<HTMLElement>
  | ChangeEvent<HTMLInputElement>
  | DragEvent
  | Event;

  declare type DropzoneState = DropzoneRef & {
    isFocused: boolean,
    isDragActive: boolean,
    isDragAccept: boolean,
    isDragReject: boolean,
    isFileDialogActive: boolean,
    draggedFiles: File[],
    acceptedFiles: File[],
    fileRejections: FileRejection[],
    rootRef: Ref<HTMLElement>,
    inputRef: Ref<HTMLInputElement>,
    getRootProps(props?: DropzoneRootProps): DropzoneRootProps,
    getInputProps(props?: DropzoneInputProps): DropzoneInputProps,
  };


  declare type DropzoneOptions = Pick<DetailedHTMLProps<HTMLElement>, PropTypes> & {|
    accept?: string | string[],
    minSize?: number,
    maxSize?: number,
    preventDropOnDocument?: boolean,
    noClick?: boolean,
    noKeyboard?: boolean,
    noDrag?: boolean,
    noDragEventsBubbling?: boolean,
    disabled?: boolean,
    onDrop?: (
      acceptedFiles: $Shape<File>[],
      fileRejections: FileRejection[],
      event: DropEvent
    ) => void,
    onDropAccepted?: <T: File>(files: T[], event: DropEvent) => void,
    onDropRejected?: (fileRejections: FileRejection[], event: DropEvent) => void,
    getFilesFromEvent?: (
      event: DropEvent
    ) => Promise<Array<File | DataTransferItem>>,
    onFileDialogCancel?: () => void,
  |};

  declare export default function Dropzone(
    props: DropzoneProps & RefAttributes<DropzoneRef>
  ): JSX.Element;
  declare export function useDropzone(options?: DropzoneOptions): DropzoneState;
  declare type DropzoneProps = {|
    children?: (state: DropzoneState) => JSX.Element,
  |} & DropzoneOptions;


  declare type DropzoneRootProps = {
    refKey?: string,
    [key: string]: any,
  } & DetailedHTMLProps<HTMLElement>;
  declare type DropzoneInputProps = {
    refKey?: string,
  } & DetailedHTMLProps<HTMLInputElement>;
  declare type PropTypes =
    | "multiple"
    | "onDragEnter"
    | "onDragOver"
    | "onDragLeave";
}

/**
 * We include stubs for each file inside this npm package in case you need to
 * require those files directly. Feel free to delete any files that aren't
 * needed.
 */
declare module 'react-dropzone/commitlint.config' {
  declare module.exports: any;
}

declare module 'react-dropzone/dist/es' {
  declare module.exports: any;
}

declare module 'react-dropzone/dist/es/utils' {
  declare module.exports: any;
}

declare module 'react-dropzone/dist' {
  declare module.exports: any;
}

declare module 'react-dropzone/rollup.config' {
  declare module.exports: any;
}

declare module 'react-dropzone/src' {
  declare module.exports: any;
}

declare module 'react-dropzone/src/index.spec' {
  declare module.exports: any;
}

declare module 'react-dropzone/src/utils' {
  declare module.exports: any;
}

declare module 'react-dropzone/src/utils/index.spec' {
  declare module.exports: any;
}

declare module 'react-dropzone/styleguide.config' {
  declare module.exports: any;
}

declare module 'react-dropzone/testSetup' {
  declare module.exports: any;
}

// Filename aliases
declare module 'react-dropzone/commitlint.config.js' {
  declare module.exports: $Exports<'react-dropzone/commitlint.config'>;
}
declare module 'react-dropzone/dist/es/index' {
  declare module.exports: $Exports<'react-dropzone/dist/es'>;
}
declare module 'react-dropzone/dist/es/index.js' {
  declare module.exports: $Exports<'react-dropzone/dist/es'>;
}
declare module 'react-dropzone/dist/es/utils/index' {
  declare module.exports: $Exports<'react-dropzone/dist/es/utils'>;
}
declare module 'react-dropzone/dist/es/utils/index.js' {
  declare module.exports: $Exports<'react-dropzone/dist/es/utils'>;
}
declare module 'react-dropzone/dist/index' {
  declare module.exports: $Exports<'react-dropzone/dist'>;
}
declare module 'react-dropzone/dist/index.js' {
  declare module.exports: $Exports<'react-dropzone/dist'>;
}
declare module 'react-dropzone/rollup.config.js' {
  declare module.exports: $Exports<'react-dropzone/rollup.config'>;
}
declare module 'react-dropzone/src/index' {
  declare module.exports: $Exports<'react-dropzone/src'>;
}
declare module 'react-dropzone/src/index.js' {
  declare module.exports: $Exports<'react-dropzone/src'>;
}
declare module 'react-dropzone/src/index.spec.js' {
  declare module.exports: $Exports<'react-dropzone/src/index.spec'>;
}
declare module 'react-dropzone/src/utils/index' {
  declare module.exports: $Exports<'react-dropzone/src/utils'>;
}
declare module 'react-dropzone/src/utils/index.js' {
  declare module.exports: $Exports<'react-dropzone/src/utils'>;
}
declare module 'react-dropzone/src/utils/index.spec.js' {
  declare module.exports: $Exports<'react-dropzone/src/utils/index.spec'>;
}
declare module 'react-dropzone/styleguide.config.js' {
  declare module.exports: $Exports<'react-dropzone/styleguide.config'>;
}
declare module 'react-dropzone/testSetup.js' {
  declare module.exports: $Exports<'react-dropzone/testSetup'>;
}
