import { CommonProps } from '../common'; import { UploadedFile, UploadResponse } from './types'; import { UploadButtonProps } from './uploadButton/UploadButton'; import { UploadItemProps } from './uploadItem/UploadItem'; export type UploadInputProps = { /** * List of already existing, failed or in progress files * @default [] */ files?: readonly UploadedFile[]; /** * The key of the file in the returned FormData object (default: file) * @default 'file' */ fileInputName?: string; /** * Callback that handles form submission * * @param formData */ onUploadFile: (formData: FormData) => Promise; /** * Provide a callback if the file can be removed/deleted from the server * Your app is responsible for reloading the uploaded files list and updating the component to ensure that the file has in fact been deleted successfully * * @param id */ onDeleteFile?: (id: string | number) => Promise; /** * Provide a callback to trigger on validation error * * @param file */ onValidationError?: (file: UploadedFile) => void; /** * Provide a callback to trigger on change whenever the files are updated * * @param files */ onFilesChange?: (files: UploadedFile[]) => void; /** * Confirmation modal displayed on delete */ deleteConfirm?: { /** * The title of the confirmation modal on delete */ title?: string; /** * The body of the confirmation modal on delete */ body?: React.ReactNode; /** * The confirm button text of the confirmation modal on delete */ confirmText?: string; /** * The cancel button text of the confirmation modal on delete */ cancelText?: string; }; /** * Maximum number of files allowed, if provided, shows error below file item */ maxFiles?: number; /** * Error message to show when the maximum number of files are uploaded already */ maxFilesErrorMessage?: string; /** * Error message to show when files over allowed size limit are uploaded */ sizeLimitErrorMessage?: string; } & { /** @default false */ multiple?: UploadButtonProps['multiple']; /** @default ['.pdf,application/pdf', '.jpg,.jpeg,image/jpeg', '.png,image/png'] */ fileTypes?: UploadButtonProps['fileTypes']; /** @default 5000 */ sizeLimit?: UploadButtonProps['sizeLimit']; } & Pick & { onDownload?: UploadItemProps['onDownload']; } & CommonProps; /** * The component allows users to upload files, manage the list of uploaded files, * and handle file validation and deletion. * * @param {UploadInputProps} props - The properties for the UploadInput component. * * @see {@link UploadInput} for further information. * @see {@link https://storybook.wise.design/?path=/docs/forms-uploadinput--docs|Storybook Wise Design} */ declare const UploadInput: ({ files, fileInputName, className, deleteConfirm, disabled, multiple, fileTypes, sizeLimit, description, onUploadFile, onDeleteFile, onValidationError, onFilesChange, onDownload, maxFiles, maxFilesErrorMessage, id, sizeLimitErrorMessage, uploadButtonTitle, }: UploadInputProps) => import("react").JSX.Element; export default UploadInput; //# sourceMappingURL=UploadInput.d.ts.map