import { CompiledTemplate } from "../../../Template"; import { Strings } from "../../../localization/Strings"; import { ChannelState } from "../../../state/ChannelState"; import { ConversationState } from "../../../state/ConversationState"; import { CSSProps } from "../../CSSProps"; import { CombinedParticipant, ParticipantLevelType } from "../email/EmailEditor/EmailEditor.definitions"; export declare enum MessagingCanvasChildrenKeys { list = "list", input = "input", tray = "tray" } /** * @typedef {"Rounded" | "Squared" | "Minimal" | "Wide"} MessageStyle - Represents the style of a message. * @memberof MessagingCanvas */ export type MessageStyle = "Rounded" | "Squared" | "Minimal" | "Wide"; /** * @typedef Theme.MessagingCanvasThemeProps * @property {CSSProps} Container - Styles for the messaging canvas container */ export interface MessagingCanvasThemeProps { Container: CSSProps; } /** * Chat member display configuration * @typedef {object} MemberDisplayOptions * @property {string} [yourDefaultName] Default string shown for local user's name * @property {string} [theirDefaultName] Default string shown for remote user's name * @property {boolean} [yourFriendlyNameOverride] Should the user's friendly name be displayed as name for this user's messages? * @property {boolean} [theirFriendlyNameOverride] Should the user's friendly name be displayed as name for this other user's messages? * @memberof MessagingCanvas */ export interface MemberDisplayOptions { yourDefaultName?: string; theirDefaultName?: string; yourFriendlyNameOverride?: boolean; theirFriendlyNameOverride?: boolean; } /** * Callback to return URL to the avatar image for message sender/user. * @typedef AvatarCallback * @callback AvatarCallback * @return {string} URL to the avatar image * @param {string} identity Identity of a user * @memberof MessagingCanvas */ type AvatarCallback = (identity: string) => string; /** * An object properties representing the PredefinedMessage * @typedef {object} MessagingCanvas.PredefinedMessage * @property {string} body - content of the message * @property {string} authorName - name of the author * @property {boolean} isFromMe - whether it appears as message from the current user or not. */ export interface PredefinedMessage { body: string | keyof Strings; authorName: string | keyof Strings; isFromMe: boolean; } /** * An object properties representing the MessagingCanvas * @typedef {object} MessagingCanvas.MessagingCanvasProps * @property {string} sid - The identifier of the Chat channel or Conversation. * @property {string} [inputDisabledReason] - A reason on why the input element is disabled. * @property {MessagingCanvas.AvatarCallback} [avatarCallback] - A handler to request for avatar. * @property {MessagingCanvas.MemberDisplayOptions} [memberDisplayOptions] - Chat member display configuration. * @property {MessagingCanvas.MessageStyle} [messageStyle] - Identifies how the message should be displayed. * @property {boolean} [showTypingIndicator] - Should the typing indicator be shown. * @property {boolean} [showReadStatus] - Should the read status be shown. * @property {boolean} [showTrayOnInactive] - Should MessageTray to be shown when conversation is inactive. * @property {boolean} [showWelcomeMessage] - Should a welcome message to be shown. * @property {CompiledTemplate} [welcomeMessageText] - string representing the welcome message. * @property {number} [charLimit] - Identifies character limit for a single message. * @property {MessagingCanvas.PredefinedMessage} [predefinedMessage] - Defines the predefined, introductory message to be shown to a customer. * @property {boolean} [hasMarkdownSupport] - If set to true, messages bodies will be parsed as markdown. */ export interface MessagingCanvasProps { sid: string; participants: Record; inputDisabledReason?: string; customerRef?: string; avatarCallback?: AvatarCallback; memberDisplayOptions?: MemberDisplayOptions; messageStyle?: MessageStyle; showTypingIndicator?: boolean; showReadStatus?: boolean; showTrayOnInactive?: boolean; showWelcomeMessage?: boolean; charLimit?: number; maxEmailContentSize?: number; welcomeMessageText?: CompiledTemplate; predefinedMessage?: PredefinedMessage; autoInitConversation?: boolean; autoInitChannel?: boolean; hasMarkdownSupport?: boolean; hideFooterOnInactive?: boolean; conversationType?: "chat" | "email"; welcomeMessageIcon?: string; preventConversationUnload?: boolean; hideFooter?: boolean; showDisabledOverlay?: boolean; } /** * @typedef {object} MessagingCanvas.MessagingCanvasChildrenProps * @extends MessagingCanvas.MessagingCanvasProps * @property {ConversationState} [conversation] state of conversation * @property {number} [charLimit] character limit */ export interface MessagingCanvasChildrenProps extends MessagingCanvasProps { channel?: ChannelState; conversation?: ConversationState; charLimit?: number; maxEmailContentSize: number; } export {};