import { MonkApiConfig } from '@monkvision/network'; import { UploadEventHandlers } from '../../hooks/useUploadQueue'; /** * Parameters accepted by the useImagesCleanup hook. */ export interface ImagesCleanupParams { /** * The inspection ID. */ inspectionId: string; /** * The api config used to communicate with the API. */ apiConfig: MonkApiConfig; /** * Boolean indicating if previous images for a sight should be automatically deleted when a new image is taken. * * @default true */ autoDeletePreviousSightImages: boolean; } /** * Handle used to manage the images cleanup after a new one uploads. */ export interface ImagesCleanupHandle { /** * A set of event handlers listening to upload events. */ cleanupEventHandlers: UploadEventHandlers; /** * Function returning a promise that resolves when every pending image deletion request has settled. */ cleanupImages: () => Promise; } /** * Custom hook used to cleanup sights' images of the inspection by deleting the old ones * when a new image is added. */ export declare function useImagesCleanup({ inspectionId, apiConfig, autoDeletePreviousSightImages, }: ImagesCleanupParams): ImagesCleanupHandle;