communication-react-19
Version:
React library for building modern communication user experiences utilizing Azure Communication Services (React 19 compatible fork)
94 lines • 3.66 kB
TypeScript
/// <reference types="react" />
import { MessageThreadStrings, UpdateMessageCallback } from '../../MessageThread';
import { ChatMessage, ComponentSlotStyle, OnRenderAvatarCallback } from '../../../types';
import { BlockedMessage } from '../../../types';
import { AttachmentMenuAction } from '../../../types/Attachment';
import { AttachmentMetadata } from "../../../../../acs-ui-common/src";
import { MessageOptions } from "../../../../../acs-ui-common/src";
import { AttachmentMetadataInProgress } from "../../../../../acs-ui-common/src";
import { MentionOptions } from '../../MentionPopover';
import { InlineImageOptions } from '../ChatMessageContent';
/**
* Props for the ChatMyMessageComponent component.
*/
export type ChatMyMessageComponentProps = {
message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;
userId: string;
messageContainerStyle?: ComponentSlotStyle;
showDate?: boolean;
disableEditing?: boolean;
onUpdateMessage?: UpdateMessageCallback;
onCancelEditMessage?: (messageId: string) => void;
/**
* Callback to delete a message. Also called before resending a message that failed to send.
* @param messageId ID of the message to delete
*/
onDeleteMessage?: (messageId: string) => Promise<void>;
/**
* Callback to send a message
* @param content The message content to send
*/
onSendMessage?: (content: string, options?: MessageOptions) => Promise<void>;
strings: MessageThreadStrings;
messageStatus?: string;
/**
* Optional text to display when the message status is 'failed'.
*/
failureReason?: string;
/**
* Whether the status indicator for each message is displayed or not.
*/
showMessageStatus?: boolean;
/**
* Whether to overlap avatar and message when the view is width constrained.
*/
shouldOverlapAvatarAndMessage: boolean;
remoteParticipantsCount?: number;
onActionButtonClick: (message: ChatMessage, setMessageReadBy: (readBy: {
id: string;
displayName: string;
}[]) => void) => void;
/**
* Optional callback to override render of the avatar.
*
* @param userId - user Id
*/
onRenderAvatar?: OnRenderAvatarCallback;
/**
* Optional function to provide customized date format.
* @beta
*/
onDisplayDateTimeString?: (messageDate: Date) => string;
/**
* Optional props needed to lookup suggestions and display mentions in the mention scenario.
* @beta
*/
mentionOptions?: MentionOptions;
/**
* Optional callback called when an inline image is clicked.
* @beta
*/
inlineImageOptions?: InlineImageOptions;
/**
* Optional callback to render message attachments in the message component.
* @beta
*/
onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;
/**
* Optional callback to define custom actions for attachments.
* @beta
*/
actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];
isRichTextEditorEnabled?: boolean;
onPaste?: (event: {
content: DocumentFragment;
}) => void;
onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;
onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;
inlineImagesWithProgress?: AttachmentMetadataInProgress[];
};
/**
* @private
*/
export declare const ChatMyMessageComponent: (props: ChatMyMessageComponentProps) => JSX.Element;
//# sourceMappingURL=ChatMyMessageComponent.d.ts.map