/** * @fileoverview Before/After cancelable event argument classes for the * Record Attachments widget. * * Follows MemberJunction's established Before/After cancelable event pattern: * - Action events come in `Before*` / `After*` pairs. * - `Before*` event carries an args object extending {@link CancellableAttachmentEventArgs} * with a `Cancel: boolean` property the listener can set to true to halt the operation. * - Component checks `if (event.Cancel) return;` before proceeding and emits the * corresponding `After*` only on the successful, non-canceled path. * * @module @memberjunction/ng-file-storage */ import { RecordAttachmentItem } from './record-attachments.types'; import { MJFileEntity } from '@memberjunction/core-entities'; /** * Base class for cancelable attachment events. Listeners set `Cancel = true` to * halt default behavior; the matching `After*` event will NOT fire. */ export declare class CancellableAttachmentEventArgs { /** * Set to true to cancel the default action. * Default: false */ Cancel: boolean; /** * Optional reason string for cancellation (for debugging/notifications). */ CancelReason?: string; } /** * Fired BEFORE selected files are uploaded and linked to the record. * Listeners can cancel (e.g., custom file validation, virus check, budget caps). */ export declare class BeforeUploadAttachmentEventArgs extends CancellableAttachmentEventArgs { readonly Files: File[]; readonly StorageAccountID?: string | undefined; readonly CategoryID?: string | undefined; constructor(Files: File[], StorageAccountID?: string | undefined, CategoryID?: string | undefined); } /** * Fired AFTER files have been uploaded and linked to the record. */ export declare class AfterUploadAttachmentEventArgs { readonly Attachments: RecordAttachmentItem[]; readonly UploadedFiles: MJFileEntity[]; constructor(Attachments: RecordAttachmentItem[], UploadedFiles: MJFileEntity[]); } /** * Fired BEFORE an attachment is hard-deleted from storage and the database. */ export declare class BeforeDeleteAttachmentEventArgs extends CancellableAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; readonly HardDelete: boolean; constructor(Attachment: RecordAttachmentItem, HardDelete?: boolean); } /** * Fired AFTER an attachment has been deleted. */ export declare class AfterDeleteAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; readonly HardDeleted: boolean; constructor(Attachment: RecordAttachmentItem, HardDeleted: boolean); } /** * Fired BEFORE an attachment is unlinked from the record (keeping file in storage). */ export declare class BeforeUnlinkAttachmentEventArgs extends CancellableAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; constructor(Attachment: RecordAttachmentItem); } /** * Fired AFTER an attachment has been unlinked from the record. */ export declare class AfterUnlinkAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; constructor(Attachment: RecordAttachmentItem); } /** * Fired BEFORE a signed download URL is requested or launched. */ export declare class BeforeDownloadAttachmentEventArgs extends CancellableAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; constructor(Attachment: RecordAttachmentItem); } /** * Fired AFTER a download URL has been resolved. */ export declare class AfterDownloadAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; readonly DownloadUrl: string; constructor(Attachment: RecordAttachmentItem, DownloadUrl: string); } /** * Fired BEFORE an attachment preview is opened. Listeners can cancel or open a custom previewer. */ export declare class BeforePreviewAttachmentEventArgs extends CancellableAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; constructor(Attachment: RecordAttachmentItem); } /** * Fired AFTER an attachment preview is opened. */ export declare class AfterPreviewAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; constructor(Attachment: RecordAttachmentItem); } /** * Fired BEFORE an existing attachment is replaced with a newly uploaded file. */ export declare class BeforeReplaceAttachmentEventArgs extends CancellableAttachmentEventArgs { readonly Attachment: RecordAttachmentItem; readonly NewFile: File; constructor(Attachment: RecordAttachmentItem, NewFile: File); } /** * Fired AFTER an attachment has been replaced with a new file. */ export declare class AfterReplaceAttachmentEventArgs { readonly OldAttachment: RecordAttachmentItem; readonly NewAttachment: RecordAttachmentItem; constructor(OldAttachment: RecordAttachmentItem, NewAttachment: RecordAttachmentItem); } //# sourceMappingURL=record-attachments.events.d.ts.map