// @flow
import type { DropEvent, FileRejection } from 'react-dropzone';
import type { StylableProps } from '../../mixins/themes';
import type { TestingProps } from '../../mixins/testing';
import type { AriaProps } from '../../mixins/aria';

export type Attachment = $Shape<File> & { name: string };

type OnDrop = (
  acceptedFiles: Attachment[],
  fileRejections?: FileRejection[],
  event?: DropEvent,
) => void;

export type FileUploaderProps = {|
  ...StylableProps,
  ...TestingProps,
  ...AriaProps,
  onDropAttachmentHandler: OnDrop,
  onClickRemoveHandler: (attachment: Attachment) => void,
  attachments: Attachment[],
  attachmentsError?: ?string,
  acceptedFileTypes: string,
  baseHeight?: ?string,
  savePending: boolean,
  withoutFilesPrompt: string,
  withFilesPrompt: string,
  tip: string,
|};
