UNPKG

@jrmc/adonis-attachment

Version:

Turn any field on your Lucid model to an attachment data type

26 lines 965 B
/** * @jrmc/adonis-attachment * * @license MIT * @copyright Jeremy Chaufourier <jeremy@chaufourier.fr> */ import type { Attachment as AttachmentType } from '../../types/attachment.js'; import type { RecordWithAttachment as RecordWithAttachmentImplementation } from '../../types/service.js'; export interface TransactionOptions { enabledRollback?: boolean; } export declare class AttachmentTransactionService { /** * During commit, we should cleanup the old detached files */ commit(detachedAttachments: AttachmentType[]): Promise<void>; /** * During rollback we should remove the attached files. */ rollback(attachedAttachments: AttachmentType[]): Promise<void>; /** * Handle transaction lifecycle with commit and rollback hooks */ handleTransaction(record: RecordWithAttachmentImplementation, options?: TransactionOptions): Promise<void>; } //# sourceMappingURL=attachment_transaction_service.d.ts.map