import { FormTypes } from '@oneblink/types'; import { FormSubmissionModel, FormElementKey } from './types/form'; import uploadAttachment, { UploadAttachmentConfiguration } from './services/uploadAttachment'; type AttachmentSaved = import('@oneblink/types').SubmissionTypes.FormSubmissionAttachment & { type?: undefined; }; type AttachmentBase = { _id: string; data?: Blob; fileName: string; isPrivate: boolean; }; type AttachmentNew = AttachmentBase & { type: 'NEW'; }; type AttachmentError = AttachmentBase & { type: 'ERROR'; errorType?: 'EXCEEDS_MAX_SIZE' | 'EMPTY_FILE'; errorMessage: string; }; type AttachmentUnsaved = AttachmentNew | AttachmentError; type Attachment = AttachmentSaved | AttachmentUnsaved; export { Attachment, AttachmentBase, AttachmentError, AttachmentNew, AttachmentSaved, AttachmentUnsaved, FormSubmissionModel, FormElementKey, uploadAttachment, UploadAttachmentConfiguration, }; /** * Check if the submission has attachments that are still uploading * * #### Example * * ```js * const isUploading = attachmentsService.checkIfAttachmentsAreUploading( * form, * submission, * ) * // handle attachments still in progress * ``` * * @param form * @param submission * @returns */ export declare function checkIfAttachmentsAreUploading(form: FormTypes.Form, submission: FormSubmissionModel): boolean; export type SubmissionAttachmentDetail = { needsToUpload: true; value: AttachmentUnsaved; } | { needsToUpload: false; value: AttachmentSaved; }; export declare function getSubmissionAttachmentDetails(formElements: FormTypes.FormElement[], submission: FormSubmissionModel): Array;