UNPKG

@cometchat/chat-uikit-react-native

Version:

Ready-to-use Chat UI Components for React Native

97 lines (81 loc) 8.11 kB
//@ts-ignore import { CometChat } from "@cometchat/chat-sdk-react-native"; import { CometChatMessageOption } from "../modals/CometChatMessageOption"; import { CometChatMessageTemplate } from "../modals/CometChatMessageTemplate"; import { CometChatTheme } from "../resources/CometChatTheme"; import { AudioBubbleStyleInterface } from "../views/CometChatAudioBubble"; import { FileBubbleStyleInterface } from "../views/CometChatFileBubble"; import { ImageBubbleStyleInterface } from "../views/CometChatImageBubble"; import { VideoBubbleStyleInterface } from "../views/CometChatVideoBubble"; import { CometChatMessageComposerActionInterface } from "../helper/types"; import { AIOptionsStyle } from "../../AI/AIOptionsStyle"; import { CardMessage, FormMessage, SchedulerMessage } from "../modals/InteractiveData"; import { FormBubbleStyle } from "../views/CometChatFormBubble/FormBubbleStyle"; import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle"; import { SchedulerBubbleStyles } from "../views/CometChatSchedulerBubble"; import { CometChatMentionsFormatter, CometChatTextFormatter, CometChatUrlsFormatter } from "../formatters"; import { AdditionalBubbleStylingParams, MessageBubbleAlignmentType } from "../base/Types"; export interface DataSource { //message options based on types getTextMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getFormMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getSchedulerMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getCardMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getVideoMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getImageMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getFileMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> getCommonOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group): Array<CometChatMessageOption> //views getBottomView(message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType): JSX.Element | null getDeleteMessageBubble(message: CometChat.BaseMessage, theme: CometChatTheme): JSX.Element getVideoMessageBubble(videoUrl: string, thumbnailUrl: string, message: CometChat.MediaMessage, theme: CometChatTheme, videoBubbleStyle: VideoBubbleStyleInterface): JSX.Element | null getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): JSX.Element | null getFormMessageBubble(message: FormMessage, theme: CometChatTheme, style?: FormBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element getSchedulerMessageBubble(message: SchedulerMessage, theme: CometChatTheme, style?: SchedulerBubbleStyles, onScheduleClick?: (data: any) => void): JSX.Element getCardMessageBubble(message: CardMessage, theme: CometChatTheme, style?: CardBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element getImageMessageBubble(imageUrl: string, caption: string, style: ImageBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null getAudioMessageBubble(audioUrl: string, title: string, style: AudioBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null getFileMessageBubble(fileUrl: string, title: string, style: FileBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null getGroupActionBubble(message: CometChat.BaseMessage, theme: CometChatTheme): JSX.Element | null //content views getTextMessageContentView(message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType, theme?: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): JSX.Element | null getFormMessageContentView(message: CometChat.BaseMessage | FormMessage, alignment?: MessageBubbleAlignmentType, theme?: CometChatTheme): JSX.Element getSchedulerMessageContentView(message: CometChat.BaseMessage | SchedulerMessage, alignment?: MessageBubbleAlignmentType, theme?: CometChatTheme): JSX.Element getCardMessageContentView(message: CometChat.BaseMessage | CardMessage, alignment?: MessageBubbleAlignmentType, theme?: CometChatTheme): JSX.Element getAudioMessageContentView(message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType, theme?: CometChatTheme): JSX.Element | null getVideoMessageContentView(message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType, theme?: CometChatTheme): JSX.Element | null getImageMessageContentView(message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType, theme?: CometChatTheme): JSX.Element | null getFileMessageContentView(message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType, theme?: CometChatTheme): JSX.Element | null //templates getTextMessageTemplate(theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): CometChatMessageTemplate | null getFormMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate getSchedulerMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate getCardMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate getAudioMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate getVideoMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate getImageMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate getFileMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate getAllMessageTemplates(theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): Array<CometChatMessageTemplate> getMessageTemplate(messageType: string, MessageCategory: string, theme: CometChatTheme): CometChatMessageTemplate | null getGroupActionTemplate(theme: CometChatTheme): CometChatMessageTemplate //attachment options // getAttachmentOptions(theme: CometChatTheme, conversation: CometChat.User | CometChat.Group): Array<CometChatMessageComposerAction> getAllMessageTypes(): Array<string> getAllMessageCategories(): Array<string> //auxiliary options getAuxiliaryOptions(user: CometChat.User, group: CometChat.Group, id: Map<string, any>, theme?: CometChatTheme): JSX.Element[] getId(): string //unknown getMessageTypeToSubtitle(messageType: string): string //Message Composer getAttachmentOptions: (user?: any, group?: any, composerId?: any) => any; getAuxiliaryButtonOptions: () => any; getLastConversationMessage(conversation: CometChat.Conversation): string getAuxiliaryHeaderAppbarOptions(user?: CometChat.User, group?: CometChat.Group, theme?: CometChatTheme): JSX.Element | null getAIOptions(user: CometChat.User | null, group: CometChat.Group | null, theme: CometChatTheme, id?: Map<String, any>, AIOptionsStyle?: AIOptionsStyle): Array<(CometChatMessageComposerActionInterface | CometChatMessageOption)> getAllTextFormatters(loggedInUser?: CometChat.User): CometChatTextFormatter[]; getMentionsFormatter(loggedInUser?: CometChat.User): CometChatMentionsFormatter; getUrlsFormatter(loggedInUser?: CometChat.User): CometChatUrlsFormatter; }