import { AttachmentRecord } from './Schema.js'; /** * SyncErrorHandler provides custom error handling for attachment sync operations. * Implementations determine whether failed operations should be retried or archived. * * @experimental * @alpha This is currently experimental and may change without a major version bump. */ export interface AttachmentErrorHandler { /** * Handles a download error for a specific attachment. * @param attachment The attachment that failed to download * @param error The error encountered during the download * @returns `true` to retry the operation, `false` to archive the attachment */ onDownloadError(attachment: AttachmentRecord, error: unknown): Promise; /** * Handles an upload error for a specific attachment. * @param attachment The attachment that failed to upload * @param error The error encountered during the upload * @returns `true` to retry the operation, `false` to archive the attachment */ onUploadError(attachment: AttachmentRecord, error: unknown): Promise; /** * Handles a delete error for a specific attachment. * @param attachment The attachment that failed to delete * @param error The error encountered during the delete * @returns `true` to retry the operation, `false` to archive the attachment */ onDeleteError(attachment: AttachmentRecord, error: unknown): Promise; }