/// <reference types="react" />
import { Method } from 'axios';
import { DropError, DropzoneContentProps, DropzoneHookProps, QaTags } from '../../Dropzone/Dropzone.types';
import { UNSAFE_UploadFile } from '../../_hooks/useFileUploader';
import { ThumbnailListItem } from '../ThumbnailList/ThumbnailList.types';
export declare type ValueId = string | number;
export interface UploaderProps extends Omit<DropzoneHookProps, 'value'> {
    /**
     * Allow drag 'n' drop (or selection from the file dialog) of multiple files
     * @since 10.19.0
     */
    multiple: boolean;
    /**
     * @since 10.19.0
     */
    uploadedValue: ThumbnailListItem[];
    /**
     * Array of already selected items
     * @since 10.19.0
     */
    value: ThumbnailListItem[];
    /**
     * Callback function fired with currently selected array of items.
     * <CodeBlock>(items: ThumbnailListItem[]) => void</CodeBlock>
     * @since 10.19.0
     */
    onChange: (items: ThumbnailListItem[]) => void;
    /**
     * Callback function fired when a previously selected file is removed.
     * <br />
     * <br />
     * <Code>(item: ThumbnailListItem) => void</Code>
     * @since 10.19.0
     */
    onCancel?: (item: ThumbnailListItem) => void;
    /**
     * Error message if dropped files is rejected
     * <CodeBlock>
     *  {`{ type: DropErrorType, title: string, message: string }`}
     * </CodeBlock>
     * @since 10.19.0
     */
    dropError?: DropError;
    /**
     * @since 10.19.0
     */
    onDropError: (err: DropError) => void;
    /**
     * An optional content renderer for the dropzone. Accepts{' '}
     * <Code>{'{ open, disabled, errorMessage }'}</Code> as a single argument,
     * allowing to control the dropzone and display different content depending
     * on dropzone state
     * @since 10.19.0
     */
    dropzoneContentRenderer?: (props: DropzoneContentProps) => React.ReactNode;
    /**
     * @since 10.19.0
     */
    qa?: QaTags;
}
export interface LocalSourceProps {
    /**
     * @since 10.19.0
     */
    sourceId: string;
    /**
     * Callback function fired when a previously selected file is removed.
     * <br />
     * <br />
     * <Code>(item: ThumbnailListItem) => void</Code>
     * @since 10.19.0
     */
    onCancel?: UploaderProps['onCancel'];
    /**
     * Set accepted file types. Accepts everything if left undefined
     * @since 10.19.0
     */
    accept?: UploaderProps['accept'];
    /**
     * <Code>(file: File) => string</Code>
     * <br />
     * <br />A function returning an upload URL for a given file. An
     * alternative to <Code>uploadFile</Code> which allows manual control of
     * the network request for file upload.
     * @since 10.19.0
     */
    getEndpoint?: (file: File) => string;
    /**
     * <Code>(file: File) => HTTPRequestMethod</Code>
     * <br />
     * <br />A function returning an upload HTTP method for a given file.
     * Returns <Code>POST</Code> by default.
     * @since 10.19.0
     */
    getMethod?: (file: File) => Method;
    /**
     * <Code>(file: File) => FormData</Code>
     * <br />
     * <br />A function returning an upload payload <Code>FormData</Code>{' '}
     * object for a given file. When defined, <Code>getPayloadKey</Code> is
     * ignored.
     * @since 10.19.0
     */
    getPayload?: (file: File) => FormData;
    /**
     * Optional async function that is invoked when selecting or dropping in a
     * local file. If you want to restrict certain uploads, you can use this
     * callback. Returning true continues the upload, while false will prevent
     * upload.
     * <Code>{'(files: ThumbnailListItem[]) => Promise<boolean>'}</Code>
     * @since 10.19.0
     */
    beforeLocalFileUpload: (files: ThumbnailListItem[]) => Promise<boolean>;
    /**
     * <Code>(file: File) => string</Code>
     * <br />
     * <br />A function returning an upload payload <Code>FormData</Code> key
     * for a given file. Returns <Code>file</Code> by default.
     * @since 10.19.0
     */
    getPayloadKey?: (file: File) => string;
    /**
     * <Code>(file: File) => object</Code>
     * <br />
     * <br />A function returning an upload request headers. Returns empty
     * object by default.
     * @since 10.19.0
     */
    getHeaders?: (file: File) => Record<string, string>;
    /**
     * <Code>
     *  (file: File,{' '}
     *  {`{
     *    onProgress: (progress: number) => void
     *    onSuccess: (response: unknown) => void
     *    onError: (error: unknown) => void
     *  }`}
     *  ) => string
     * </Code>
     * <br />
     * <br />A function for manually controlling the network request for file
     * upload. An alternative to using <Code>getEndpoint</Code> which handles
     * the network request itself.
     * @since 10.19.0
     */
    uploadFile?: UNSAFE_UploadFile;
    /**
     * Maximum file size (in bytes)
     * @since 10.19.0
     */
    maxFileSize?: number;
    /**
     * Minimum file size (in bytes)
     * @since 10.19.0
     */
    minFileSize?: number;
    /**
     * An optional content renderer for the dropzone. Accepts{' '}
     * <Code>{'{ open, disabled, errorMessage }'}</Code> as a single argument,
     * allowing to control the dropzone and display different content depending
     * on dropzone state
     * @since 10.19.0
     */
    dropzoneContentRenderer?: (props: DropzoneContentProps) => React.ReactNode;
    /**
     * @since 10.19.0
     */
    qa?: UploaderProps['qa'];
}
