import { ElementRef, EventEmitter } from '@angular/core'; import { ReceivedMessage, SentMessage } from './components/message-data/message-data'; export declare class ChatViewComponent { /** * ElementRef for chatlist to handle scrolling * @type {ElementRef} * @memberof ChatViewComponent */ chatlist: ElementRef; /** * Input messages (recieved or sent) array passed to component. * @type {(ReceivedMessage[] | SentMessage[])} * @memberof ChatViewComponent */ messages: (ReceivedMessage | SentMessage)[]; /** * Input property to set styling options to chat-view compoenents * @type {IChatViewOptions} * @memberof ChatViewComponent */ options: IChatViewOptions; /** * Event emitter for quick replies are clicked * @memberof ChatViewComponent */ onOptionClicked: EventEmitter; /** * Event emitter when send button is clicked * @memberof ChatViewComponent */ onInput: EventEmitter; oldMessages: any[]; constructor(); /** * Event emitter when send button is clicked. * Parent copmponent will recived users query. Then it can be added in sent message array. * @param {*} text * @memberof ChatViewComponent */ sendMessage(text: any): void; /** * Event emitter when quick replies are clicked. * Parent copmponent will recived selected option. Then it can be added in sent message array. * @param {*} text * @memberof ChatViewComponent */ optionClicked(option: any): void; /** * To scroll chatlist to the bottom * @memberof ChatViewComponent */ scrollToBottom(): void; /** * After every change detection cycle, check if new message is added in message array. * If yes, then scroll chat list to bottom. * @memberof ChatViewComponent */ ngDoCheck(): void; } /** * @export * @interface IChatViewOptions */ export interface IChatViewOptions { sentMessage?: IChatMessageOption; receivedMessage?: IChatMessageOption; header?: IChatMessageOption; inputBox?: { borderColor: string; textColor: string; maxLength?: number; sendIconColor: string; backgroundColor: string; }; quickReplies?: { textColor?: string; backgroundColor?: string; borderColor?: string; }; chatlistBackgroundColor: string; } /** * * @export * @interface IChatMessageOption */ export interface IChatMessageOption { textColor?: string; backgroundColor?: string; }