import { OnInit, OnDestroy, ChangeDetectorRef, ElementRef, OnChanges, SimpleChanges, TemplateRef, NgZone } from "@angular/core"; import { CometChat } from "@cometchat-pro/chat"; import { Subscription } from "rxjs"; import { DateStyle, AvatarStyle, MenuListStyle, ReceiptStyle, BaseStyle, DocumentBubbleStyle, ConfirmDialogStyle, FullScreenViewerStyle } from 'my-cstom-package-lit'; import { CometChatThemeService } from "../../CometChatTheme.service"; import { States, localize, MessageListAlignment, DatePatterns, TimestampAlignment, CometChatMessageTemplate, DocumentIconAlignment, CometChatUIKitConstants, CometChatTheme, MessageBubbleAlignment, CometChatMessageOption } from "uikit-resources-lerna"; import { MessageListStyle, MessageTranslationStyle, PollsBubbleStyle, ImageModerationStyle, SmartRepliesStyle, SmartRepliesConfiguration, CallscreenStyle } from "uikit-utils-lerna"; import { LinkPreviewStyle } from "uikit-utils-lerna"; /** * * CometChatMessageList is a wrapper component for messageBubble * * @version 1.0.0 * @author CometChatTeam * @copyright © 2022 CometChat Inc. * */ export declare class CometChatMessageListComponent implements OnInit, OnDestroy, OnChanges { private ngZone; private ref; private themeService; listScroll: ElementRef; bottom: ElementRef; top: ElementRef; textBubble: TemplateRef; threadMessageBubble: TemplateRef; fileBubble: TemplateRef; audioBubble: TemplateRef; videoBubble: TemplateRef; imageBubble: TemplateRef; stickerBubble: TemplateRef; documentBubble: TemplateRef; whiteboardBubble: TemplateRef; popoverRef: any; directCalling: TemplateRef; pollBubble: TemplateRef; hideError: boolean; errorStateView: TemplateRef; loadingStateView: TemplateRef; emptyStateView: TemplateRef; errorStateText: string; emptyStateText: string; loadingIconURL: string; user: CometChat.User; group: CometChat.Group; disableReceipt: boolean; disableSoundForMessages: boolean; customSoundForMessages: string; readIcon: string; deliveredIcon: string; sentIcon: string; waitIcon: string; errorIcon: string; alignment: MessageListAlignment; showAvatar: boolean; datePattern: DatePatterns; timestampAlignment: TimestampAlignment; DateSeparatorPattern: DatePatterns; templates: CometChatMessageTemplate[]; messagesRequestBuilder: CometChat.MessagesRequestBuilder; newMessageIndicatorText: string; scrollToBottomOnNewMessages: boolean; thresholdValue: number; onThreadRepliesClick: ((message: CometChat.BaseMessage, view: TemplateRef) => void) | null; headerView: TemplateRef; footerView: TemplateRef; parentMessageId: number; avatarStyle: AvatarStyle; backdropStyle: BaseStyle; dateSeparatorStyle: DateStyle; messageListStyle: MessageListStyle; onError: (error: any) => void; state: States; optionsStyle: MenuListStyle; receiptStyle: ReceiptStyle; documentBubbleAlignment: DocumentIconAlignment; callBubbleAlignment: DocumentIconAlignment; imageModerationStyle: ImageModerationStyle; timestampEnum: typeof TimestampAlignment; chatChanged: boolean; requestBuilder: any; closeImageModeration: any; timer: any; timeStampColor: string; timeStampFont: string; smartReplyStyle: SmartRepliesStyle; showSmartReply: boolean; ccHidePanel: Subscription; ccShowPanel: Subscription; smartReplyMessage: CometChat.BaseMessage | null; enableSmartReply: boolean; smartReplyConfig: SmartRepliesConfiguration; timeStampBackground: string; linkPreviewStyle: LinkPreviewStyle; unreadMessagesStyle: { height: string; width: string; background: string; display: string; justifyContent: string; buttonTextFont: string; color: string; border: string; borderRadius: string; }; dividerStyle: BaseStyle; pollBubbleStyle: PollsBubbleStyle; labelStyle: any; imageBubbleStyle: any; messagesList: CometChat.BaseMessage[]; bubbleDateStyle: DateStyle; whiteboardIconURL: string; documentIconURL: string; directCallIconURL: string; placeholderIconURL: string; downloadIconURL: string; translationStyle: MessageTranslationStyle; documentBubbleStyle: DocumentBubbleStyle; callBubbleStyle: DocumentBubbleStyle; whiteboardTitle: string; whiteboardSubitle: string; whiteboardButtonText: string; documentTitle: string; documentSubitle: string; documentButtonText: string; joinCallButtonText: string; topObserver: IntersectionObserver; bottomObserver: IntersectionObserver; localize: typeof localize; reinitialized: boolean; MessageTypesConstant: typeof CometChatUIKitConstants.MessageTypes; callConstant: string; typesMap: any; messageTypesMap: any; theme: CometChatTheme; msgListenerId: string; groupListenerId: string; callListenerId: string; loggedInUser: CometChat.User; states: typeof States; MessageCategory: Readonly<{ message: string; custom: string; action: string; call: string; }>; numberOfTopScroll: number; keepRecentMessages: boolean; messageTemplate: CometChatMessageTemplate[]; messageCount: number; isOnBottom: boolean; UnreadCount: CometChat.BaseMessage[]; newMessageCount: number | string; type: string; confirmText: string; cancelText: string; warningText: string; ccMessageDelete: Subscription; ccMessageReact: Subscription; ccMessageRead: Subscription; ccMessageEdit: Subscription; ccLiveReaction: Subscription; ccMessageSent: Subscription; ccMessageEdited: Subscription; ccGroupMemberAdded: Subscription; ccGroupLeft: Subscription; ccGroupMemberJoined: Subscription; ccGroupMemberKicked: Subscription; ccGroupMemberBanned: Subscription; ccOwnershipChanged: Subscription; ccGroupDeleted: Subscription; ccGroupCreated: Subscription; ccOutgoingCall: Subscription; ccCallRejected: Subscription; ccCallEnded: Subscription; ccGroupMemberScopeChanged: Subscription; threadedAlignment: MessageBubbleAlignment; openEmojiKeyboard: boolean; keyboardAlignment: string; popoverStyle: any; videoBubbleStyle: BaseStyle; threadViewAlignment: MessageBubbleAlignment; whiteboardURL: string | URL | undefined; enableDataMasking: boolean; enableThumbnailGeneration: boolean; enableLinkPreview: boolean; enablePolls: boolean; enableReactions: boolean; enableImageModeration: boolean; enableStickers: boolean; enableWhiteboard: boolean; enableDocument: boolean; showOngoingCall: boolean; enableCalling: boolean; ongoingCallStyle: CallscreenStyle; sessionId: string; getThreadViewStyle(message: CometChat.BaseMessage): { height: string; width: string; border: string; borderRadius: string; background: string; padding: string; buttonIconTint: string | undefined; display: string; flexFlow: string; alignItems: string; justifyContent: string; buttonTextColor: string | undefined; }; closeIconURL: string; threadOpenIcon: string; confirmDialogStyle: ConfirmDialogStyle; messageToReact: CometChat.BaseMessage | null; limit: number; types: string[]; categories: string[]; constructor(ngZone: NgZone, ref: ChangeDetectorRef, themeService: CometChatThemeService); ngOnChanges(changes: SimpleChanges): void; addReaction: (event: any) => void; getCallBubbleTitle(message: CometChat.BaseMessage): any; getCallActionMessage: (call: CometChat.Call) => string; reactToMessages(emoji: string): void; ngOnDestroy(): void; reactionsStyle(message: CometChat.BaseMessage): { height: string; width: string; border: string; borderRadius: string; background: string; textFont: string; textColor: string | undefined; activeTextColor: string | undefined; activeTextFont: string; addReactionIconTint: string | undefined; activeReactionBackground: string | undefined; reactionBackground: string; reactionBorder: string; reactionBorderRadius: string; addReactionIconBackground: string | undefined; }; showEmojiKeyboard: (id: number, event: any) => void; setBubbleView: () => void; openThreadView: (message: CometChat.BaseMessage) => void; threadCallback: (id: number) => void; deleteCallback: (id: number) => void; editCallback: (id: number) => void; copyCallback: (id: number) => void; getMessageById(id: number): false | CometChat.BaseMessage; isTranslated(message: CometChat.TextMessage): any; updateTranslatedMessage: (translation: any) => void; translateMessage: (id: number) => void; setOptionsCallback(options: CometChatMessageOption[]): CometChatMessageOption[]; /** * send message options based on type * @param {CometChat.BaseMessage} msgObject */ setMessageOptions(msgObject: CometChat.BaseMessage): CometChatMessageOption[]; /** * passing style based on message object * @param {CometChat.BaseMessage} messageObject */ setMessageBubbleStyle(msg: CometChat.BaseMessage): BaseStyle; getSessionId(message: CometChat.CustomMessage): any; getWhiteboardDocument(message: CometChat.CustomMessage): any; openLinkURL(event: any): void; getSticker(message: CometChat.CustomMessage): any; getContentView: (message: CometChat.BaseMessage) => TemplateRef | null; getHeaderView(message: CometChat.BaseMessage): TemplateRef | null; getFooterView(message: CometChat.BaseMessage): TemplateRef | null; setBubbleAlignment: (message: CometChat.BaseMessage) => MessageBubbleAlignment; getCallBubbleStyle(message: CometChat.BaseMessage): { titleFont: string; titleColor: string | undefined; iconTint: string | undefined; buttonTextFont: string; buttonTextColor: string | undefined; buttonBackground: string | undefined; width: string; }; getBubbleWrapper: (message: CometChat.BaseMessage) => TemplateRef | null; getBubbleAlignment(message: CometChat.BaseMessage): MessageBubbleAlignment.left | MessageBubbleAlignment.right; setTranslationStyle: (message: CometChat.BaseMessage) => MessageTranslationStyle; getCallTypeIcon(message: CometChat.BaseMessage): "assets/Audio-Call.svg" | "assets/Video-call.svg"; callStatusStyle(message: CometChat.BaseMessage): { buttonTextFont: string; buttonTextColor: string | undefined; borderRadius: string; border: string; buttonIconTint: string | undefined; background: string; iconBackground: string; padding: string; gap: string; height: string; justifyContent: string; } | null; setTextBubbleStyle: (message: CometChat.BaseMessage) => { textFont: string; textColor: string | undefined; }; setFileBubbleStyle(message: CometChat.BaseMessage): any; ngAfterViewInit(): void; startDirectCall: (sessionId: string) => void; launchCollaborativeWhiteboardDocument: (url: string) => void; /** * Extracting types and categories from template * */ checkMessageTemplate(): void; getPollBubbleData(message: CometChat.CustomMessage, type?: string): any; getThreadCount(message: CometChat.BaseMessage): string; showEnabledExtensions(): void; openConfirmDialog: boolean; openFullscreenView: boolean; imageurlToOpen: string; fullScreenViewerStyle: FullScreenViewerStyle; openImageInFullScreen(message: any): void; closeImageInFullScreen(): void; openWarningDialog(event: any): void; onConfirmClick: () => void; onCancelClick(): void; getTextMessage(message: CometChat.TextMessage): string; getLinkPreview(message: CometChat.TextMessage): any; downloadImage(imgUrl: string): Promise; getImageThumbnail(msg: CometChat.MediaMessage): string; getLinkPreviewDetails(key: string, message: CometChat.TextMessage): string; ngOnInit(): void; setOngoingCallStyle: () => void; setAvatarStyle(): void; setDateStyle(): void; setMessagesStyle(): void; setReceiptStyle(): void; createRequestBuilder(): void; /** * Listener To Receive Messages in Real Time * @param */ fetchPreviousMessages: () => void; fetchNextMessage: () => void; appendMessages: (messages: CometChat.BaseMessage[]) => void; addMessageEventListeners(): void; /** * * @param */ /** * Updates messageList on basis of user activity or group activity or calling activity * @param {any=null} key * @param {CometChat.MessageReceipt | CometChat.BaseMessage} message * @param {CometChat.Group | null=null} group * @param {any=null} options */ messageUpdate(key?: string | null, message?: CometChat.MessageReceipt | CometChat.BaseMessage | any, group?: CometChat.Group | null, options?: any): void; /** * translate message then call update message * @param {CometChat.BaseMessage} message */ /** * @param {CometChat.BaseMessage} message */ markMessageAsDelivered: (message: CometChat.BaseMessage) => void; /** * When Message is Received * @param message */ /** * @param {CometChat.BaseMessage} message */ messageReceived(message: CometChat.BaseMessage): void; /** * Updating the reply count of Thread Parent Message * @param {CometChat.BaseMessage} messages */ updateReplyCount(messages: CometChat.BaseMessage): void; /** * @param {CometChat.BaseMessage} message * @param {string} type */ messageReceivedHandler: (message: CometChat.BaseMessage, type: string) => void; playAudio(): void; reInitializeMessageList(): void; reInitializeMessageBuilder: () => void; getMessageReceipt(message: CometChat.BaseMessage): import("uikit-utils-lerna/dist/Utils/MessageReceiptUtils").receipts; messageReadAndDelivered(message: CometChat.MessageReceipt): void; /** * @param {CometChat.BaseMessage} readMessage */ markAllMessagAsRead(messageKey: number): void; markAllMessagAsDelivered(messageKey: number): void; /** * Emits an Action Indicating that a message was deleted by the user/person you are chatting with * @param {CometChat.BaseMessage} message */ /** * Detects if the message that was edit is your current open conversation window * @param {CometChat.BaseMessage} message */ messageEdited: (message: CometChat.BaseMessage) => void; /** * Emits an Action Indicating that a message was deleted by the user/person you are chatting with * @param {CometChat.BaseMessage} message */ updateEditedMessage: (message: CometChat.BaseMessage) => void; /** * Emits an Action Indicating that Group Data has been updated * @param */ /** * When custom messages are received eg. Poll, Stickers emits action to update message list * @param message */ /** * @param {CometChat.BaseMessage} message */ customMessageReceived(message: CometChat.BaseMessage): any; /** * @param {CometChat.BaseMessage} message * @param {string} type */ customMessageReceivedHandler: (message: CometChat.BaseMessage, type: string) => void; /** * TrackBy method to update UI when a change is detected */ /** * @param {number} index * @param {any} item */ getMessageId(index: number, item: any): any; /** * Compares two dates and sets Date on a a new day */ /** * @param {number} firstDate * @param {number} secondDate */ isDateDifferent(firstDate: number | undefined, secondDate: number | undefined): boolean; /** * prepend Fetched Messages * @param {CometChat.BaseMessage} messages */ prependMessages(messages: CometChat.BaseMessage[]): void; /** * listening to bottom scroll using intersection observer */ ioBottom(): void; /** * listening to top scroll using intersection observer */ ioTop(): void; addMessage: (message: CometChat.BaseMessage) => void; /** * callback for copy message * @param {CometChat.TextMessage} object */ onCopyMessage: (object: CometChat.TextMessage) => void; /** * callback for deleteMessage * @param {CometChat.BaseMessage} object */ /** * @param {CometChat.BaseMessage} messages */ messageSent(messages: CometChat.BaseMessage): void; /** * callback for editMessage option * @param {CometChat.BaseMessage} object */ onEditMessage: (object: CometChat.BaseMessage) => void; updateMessage(message: CometChat.BaseMessage, muid?: boolean): void; removeMessage: (message: CometChat.BaseMessage) => void; deleteMessage: (message: CometChat.BaseMessage) => void; scrollToBottom: () => void; showHeaderTitle(message: CometChat.BaseMessage): boolean; subscribeToEvents(): void; closeSmartReply: () => void; sendReply: (event: any) => void; getReplies(): string[] | null; unsubscribeToEvents(): void; /** * styling part */ chatsListStyle: () => { height: string | undefined; background: string | undefined; }; messageContainerStyle: () => { width: string | undefined; }; errorStyle: () => { textFont: string | undefined; textColor: string | undefined; }; emptyStyle: () => { textFont: string | undefined; textColor: string | undefined; }; loadingStyle: () => { iconTint: string | undefined; }; wrapperStyle: () => { height: string | undefined; width: string | undefined; background: string | undefined; border: string | undefined; borderRadius: string | undefined; }; }