/// <reference types="react" />
import type { Method } from 'axios';
import type { DropError, DropzoneContentProps, DropzoneHookProps, QaTags } from '../../Dropzone/Dropzone.types';
import type { UNSAFE_UploadFile } from '../../_hooks/useFileUploader';
import type { 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.
     * ```
     * (items: ThumbnailListItem[]) => void
     * ```
     * @since 10.19.0
     */
    onChange: (items: ThumbnailListItem[]) => void;
    /**
     * Callback function fired when a previously selected file is removed.
     *
     * `(item: ThumbnailListItem) => void`
     * @since 10.19.0
     */
    onCancel?: (item: ThumbnailListItem) => void;
    /**
     * Error message if dropped files is rejected
     * ```
     * { type: DropErrorType, title: string, message: string }
     * ```
     * @since 10.19.0
     */
    dropError?: DropError;
    /**
     * @since 10.19.0
     */
    onDropError: (err: DropError) => void;
    /**
     * An optional content renderer for the dropzone.
     * Accepts `{ open, disabled, errorMessage }` 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.
     *
     * `(item: ThumbnailListItem) => void`
     * @since 10.19.0
     */
    onCancel?: UploaderProps['onCancel'];
    /**
     * Set accepted file types. Accepts everything if left undefined
     * @since 10.19.0
     */
    accept?: UploaderProps['accept'];
    /**
     * `(file: File) => string`
     *
     * A function returning an upload URL for a given file. An
     * alternative to `uploadFile` which allows manual control of
     * the network request for file upload.
     * @since 10.19.0
     */
    getEndpoint?: (file: File) => string;
    /**
     * `(file: File) => HTTPRequestMethod`
     *
     * A function returning an upload HTTP method for a given file.
     * Returns `POST` by default.
     * @since 10.19.0
     */
    getMethod?: (file: File) => Method;
    /**
     * `(file: File) => FormData`
     *
     * A function returning an upload payload `FormData` object for
     * a given file. When defined, `getPayloadKey` 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.
     * `(files: ThumbnailListItem[]) => Promise<boolean>`
     * @since 10.19.0
     */
    beforeLocalFileUpload: (files: ThumbnailListItem[]) => Promise<boolean>;
    /**
     * `(file: File) => string`
     *
     * A function returning an upload payload `FormData` key for
     * a given file. Returns `file` by default.
     * @since 10.19.0
     */
    getPayloadKey?: (file: File) => string;
    /**
     * `(file: File) => object`
     *
     * A function returning an upload request headers.
     * Returns empty object by default.
     * @since 10.19.0
     */
    getHeaders?: (file: File) => Record<string, string>;
    /**
     * ```
     *  (file: File, {
     *    onProgress: (progress: number) => void
     *    onSuccess: (response: unknown) => void
     *    onError: (error: unknown) => void
     *  }) => string
     * ```
     *
     * A function for manually controlling the network request for file
     * upload. An alternative to using `getEndpoint` 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 `{ open, disabled, errorMessage }` 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'];
}
