import { FileComponentSchema } from '@open-formulieren/types'; import { ArrayHelpers } from 'formik'; import { FileRejection } from 'react-dropzone'; import { FormikFileUpload } from './types'; type FileArrayHelpers = ArrayHelpers; /** * Return value for the `useFileUploads` hook. */ interface UseFileUploads { /** * Callback to invoke when files are added to the upload input, forward it to the * `UploadInput` component. */ onFilesAdded: (files: (File | FileRejection)[]) => Promise; /** * Callback to invoke when a file is removed from the uploaded files list. * * Takes the unique ID of the file, which is either the `clientId` or a server-side * unique identifier if `clientId` is absent. */ onFileRemove: (uniqueId: string) => Promise; /** * Map of `uniqueId` to error message, originating from react-dropzone. * * These errors are not tracked in the Formik errors state, because they are produced * *before* we can add the upload to the Formik state. */ localUploadErrors: Record; } /** * Implement the core file upload (drop/select) handling logic. * * Provides a callback for the `onFilesAdded` handler and manages the local error state * of file uploads, produced by react-dropzone. */ export declare const useFileUploads: (name: string, componentDefinition: FileComponentSchema, arrayHelpers: FileArrayHelpers) => UseFileUploads; export {};