import { GeoLoc } from "./GeoLoc"; import { Conversation } from "./Conversation"; import { DataStoreType } from "../../config/config.js"; export {}; /** * @class * @name Message * @public * @description * This class is used to represent a message in a conversation
* A message is exchanged when discussing in One-to-One or in a Bubble. */ declare class Message { /** * The Type of message. * @public * @enum {{ key: number, value: string }} * @readonly */ static Type: any; /** * The Status of the Receipt. * @public * @enum {number} * @readonly */ static ReceiptStatus: { /** No receipt received yet */ NONE: number; /** No receipt received after a while (The server doesn't answer) */ ERROR: number; /** Receipt in progress */ IN_PROGRESS: number; /** The server has confirmed the reception of the message */ SENT: number; /** The message has been received but not read */ UNREAD: number; /** The message has been read */ READ: number; }; /** * @private */ static ReceiptStatusText: string[]; /** * The Side of Message's from * @public * @enum {string} * @readonly */ static Side: { /** Message is from a recipient */ LEFT: string; /** Message is from me */ RIGHT: string; /** Specific admin message */ ADMIN: string; }; serverAckTimer: any; private index; id: string; type: any; date: Date; from: any; side: string; status: string; receiptStatus: number; fileId: string; fileName: string; isMarkdown: boolean; subject: string; geoloc: GeoLoc; voiceMessage: any; alternativeContent: any; attention: any; mentions: any; urgency: string; urgencyAck: boolean; urgencyHandler: any; historyIndex: string; fileErrorMsg: string; attachedMsgId: string; attachIndex: number; attachNumber: number; fromJid: any; resource: any; toJid: any; content: any; lang: any; cc: any; cctype: any; isEvent: any; event: any; oob: { url: string; mime: string; filename: string; filesize: string; }; fromBubbleJid: any; fromBubbleUserJid: any; answeredMsgId: string; answeredMsg: Message; answeredMsgDate: string; answeredMsgStamp: string; fileTransfer: any; eventJid: string; originalMessageReplaced: Message; confOwnerId: string; confOwnerDisplayName: string; confOwnerJid: string; conversation: Conversation; isForwarded: boolean; forwardedMsg: any; replacedByMessage: Message; deleted: boolean; modified: boolean; rainbowCpaas: any; datastoretypeOfMsg: DataStoreType; shortFileDescriptor: any; constructor(serverAckTimer: any, index: any, id: string, type: any, date: Date, from: any, side: string, status: string, receiptStatus: number, isMarkdown: boolean, subject: string, geoloc: GeoLoc, voiceMessage: any, alternativeContent: any, attention: any, mentions: any, urgency: string, urgencyAck: boolean, urgencyHandler: any, historyIndex: string, attachedMsgId: string, attachIndex: number, attachNumber: number, resource: any, toJid: any, content: any, lang: any, cc: any, cctype: any, isEvent: any, event: any, oob: { url: string; mime: string; filename: string; filesize: string; }, fromBubbleJid: any, fromBubbleUserJid: any, answeredMsg: Message, answeredMsgId: string, answeredMsgDate: string, answeredMsgStamp: string, eventJid: string, originalMessageReplaced: Message, confOwnerId: string, confOwnerDisplayName: string, confOwnerJid: string, isForwarded: boolean, forwardedMsg: any, deleted?: boolean, modified?: boolean, rainbowCpaas?: any, datastoretypeOfMsg?: DataStoreType); /** * @private * @method * @instance */ static create(serverAckTimer: any, index: any, id: string, type: any, date: Date, from: any, side: string, /* data: string ,*/ status: string, receiptStatus: number, /* fileId: string, */ /* fileName: string, */ isMarkdown: boolean, subject: string, geoloc: GeoLoc, voiceMessage: any, alternativeContent: any, attention: any, mentions: any, urgency: string, urgencyAck: boolean, urgencyHandler: any, /* translatedText: string = null, */ /* isMerged: boolean, */ historyIndex: string, /*showCorrectedMessages: boolean,*/ /* replaceMsgs: any[],*/ /* fileErrorMsg: string = null, */ attachedMsgId: string, attachIndex: number, attachNumber: number, /* fromJid: any, */ resource: any, toJid: any, content: any, lang: any, cc: any, cctype: any, isEvent: any, event: any, oob: { url: string; mime: string; filename: string; filesize: string; }, fromBubbleJid: any, fromBubbleUserJid: any, answeredMsg: Message, answeredMsgId: string, answeredMsgDate: string, answeredMsgStamp: string, /* fileTransfer: any,*/ eventJid: string, originalMessageReplaced: Message, confOwnerId: string, confOwnerDisplayName: string, confOwnerJid: string, isForwarded: boolean, forwardedMsg: any, deleted?: boolean, modified?: boolean, rainbowCpaas?: any, datastoretypeOfMsg?: DataStoreType): Message; /** * @private * @method * @instance */ static createFileSharingMessage(id: any, date: any, from: any, side: any, data: any, status: any, fileId: any): Message; /** * @private * @method * @instance */ static createWebRTCMessage(id: any, date: any, from: any, side: any, data: any, status: any): Message; /** * @private * @method * @instance */ static createFTMessage(id: any, date: any, from: any, side: any, data: any, status: any, fileTransfer: any): Message; /** * @private * @method * @instance */ static createBubbleAdminMessage(id: any, date: any, from: any, type: any, body: any, subject: any): Message; /** * @private * @method * @instance */ static createRecordingAdminMessage(id: any, date: any, from: any, type: any, cmd: any): Message; /** * Method extract fileId part of URL * * @private * @param {string} url * @returns {string} * * @memberof Conversation */ static extractFileIdFromUrl(url: any): any; updateMessage(data: any): this; /** * @function * @public * @name MessageFactory * @description * This class is used to create a message from data object */ static MessageFactory(): (data: any) => Message; } export { Message };