import type { ICancelEventDetail, IEventDetail } from '@breadstone/mosaik-elements'; /** * Represents the event detail for chat submit events. * * @public */ export interface IChatSubmitEventDetail extends IEventDetail { /** * The message content. */ readonly message: TMessage; /** * The attachments included with the message. */ readonly attachments?: ReadonlyArray; } /** * Event fired when a chat message is submitted. * * @public */ export type ChatSubmitEvent = CustomEvent>; /** * Represents the event detail for attachment add events. * * @public */ export interface IAttachmentAddEventDetail extends IEventDetail { /** * The file being attached. */ readonly file: File; } /** * Event fired when an attachment is added. * * @public */ export type AttachmentAddEvent = CustomEvent; /** * Represents the event detail for attachment remove events. * * @public */ export interface IAttachmentRemoveEventDetail extends IEventDetail { /** * The file being removed. */ readonly file: File; } /** * Event fired when an attachment is removed. * * @public */ export type AttachmentRemoveEvent = CustomEvent; /** * Represents the event detail for attachment reject events. * * @public */ export interface IAttachmentRejectEventDetail extends ICancelEventDetail { /** * The file being rejected. */ readonly file: File; /** * The reason for rejection. */ readonly reason: 'size' | 'type' | 'count'; } /** * Event fired when an attachment is rejected. * * @public */ export type AttachmentRejectEvent = CustomEvent; /** * Represents the event detail for attachment upload change events. * * @public */ export interface IAttachmentUploadChangeEventDetail extends IEventDetail { /** * The file being uploaded. */ readonly file: File; /** * The upload progress (0-100). */ readonly progress: number; } /** * Event fired when attachment upload progress changes. * * @public */ export type AttachmentUploadChangeEvent = CustomEvent; /** * Represents the event detail for attachment upload cancel events. * * @public */ export interface IAttachmentUploadCancelEventDetail extends ICancelEventDetail { /** * The file upload being cancelled. */ readonly file: File; } /** * Event fired when attachment upload is cancelled. * * @public */ export type AttachmentUploadCancelEvent = CustomEvent; /** * Represents the event detail for attachment upload fail events. * * @public */ export interface IAttachmentUploadFailEventDetail extends IEventDetail { /** * The file that failed upload. */ readonly file: File; /** * The error that occurred. */ readonly error: Error; } /** * Event fired when attachment upload fails. * * @public */ export type AttachmentUploadFailEvent = CustomEvent; declare global { interface HTMLElementEventMap { chatSubmit: ChatSubmitEvent; attachmentAdd: AttachmentAddEvent; attachmentRemove: AttachmentRemoveEvent; attachmentReject: AttachmentRejectEvent; attachmentUploadChange: AttachmentUploadChangeEvent; attachmentUploadCancel: AttachmentUploadCancelEvent; attachmentUploadFail: AttachmentUploadFailEvent; } } //# sourceMappingURL=ChatEvents.d.ts.map