import { MessageState } from "../../../state/ConversationState"; import { CSSProps } from "../../CSSProps"; import { MessageStyle } from "../MessagingCanvas"; /** * A object properties representing a message in message list. * * @typedef MessageListItem.MessageListItemProps * @property {string} conversationSid - Sid of the conversation. * @property {MessageState} message - An object which represents a single message. * @property {boolean} [showReadStatus] - Should show read status. * @property {MessageStyle} [messageStyle] - Identifies how the message should be displayed. * @property {boolean} [useFriendlyName=true] - An override to use the friendly name passed in member. * @property {string} [authorName] - A custom author name to be used. * @property {string} [avatarUrl] - Url to the avatar of the author. * @property {boolean} [hasMarkdownSupport] - Whether Markdown feature is enabled or not * @property {object} [participant] - Object containing a pre-defined participant name. * @property {string} participant.friendlyName - Predefined participant name. * @property {object} [member] - Object containing a pre-defined author name. * @property {string} member.friendlyName - Predefined author name. * @property {Function} timestampFormatter - A custom formatter for the message timestamp. Takes a Date argument and returns string. * @property {boolean} focusable - Whether the the MessageListItem can be focused * @property {Function} updateFocus - A helper function to inform parent components of currently focused item */ export interface MessageListItemProps { channelSid: string; conversationSid: string; message: MessageState; showReadStatus?: boolean; messageStyle?: MessageStyle; useFriendlyName?: boolean; authorName?: string; avatarUrl?: string; hasMarkdownSupport?: boolean; participant?: { friendlyName: string; }; member?: { friendlyName: string; }; timestampFormatter?: (timestamp: Date) => string; focusable?: boolean; updateFocus?: (newFocus: number, isMessageBubbleClicked?: boolean) => void; } interface MediaMessageThemeProps { Container: CSSProps & { lightHover?: boolean; disabled?: CSSProps; }; Actions: CSSProps; } /** * @typedef Theme.MessageThemeProps * @property {CSSProps} Avatar Styles for the message avatar component * @property {CSSProps} Bubble Styles for the message bubble component * @property {CSSProps} Header Styles for the header of the message */ interface MessageThemeProps { Avatar: CSSProps; Bubble: CSSProps; Header: CSSProps; Media: MediaMessageThemeProps; } /** * @typedef Theme.MessageListItemThemeProps * @property {MessageThemeProps} FromMe - Styles that represent how user sees their own messages * @property {MessageThemeProps} FromOthers - Styles that represent how user sees messages from everyone else * @property {MessageThemeProps} FromCCAIVirtualAgent - Styles that represent how user sees messages from a virtual agent * @property {CSSProps} ReadStatus - Styles for the "read" status text */ export interface MessageListItemThemeProps { FromMe: MessageThemeProps; FromOthers: MessageThemeProps; FromCCAIVirtualAgent?: MessageThemeProps; ReadStatus: CSSProps; ErrorStatus: CSSProps; } export declare enum MessageListItemChildrenKeys { mediaTransferError = "media-transfer-error", content = "content", readStatus = "read-status" } export {};