UNPKG

@cometchat/chat-uikit-react-native

Version:

Ready-to-use Chat UI Components for React Native

92 lines (91 loc) 3.62 kB
import { DataSource, DataSourceDecorator } from "../../shared/framework"; import { CometChat } from "@cometchat/chat-sdk-react-native"; import { CometChatMessageComposerAction } from "../../shared/helper/types"; import { CometChatMessageTemplate } from "../../shared/modals"; import { PollsConfigurationInterface } from "./PollsConfigurations"; import { JSX } from "react"; import { AdditionalAttachmentOptionsParams, AdditionalParams, MessageBubbleAlignmentType } from "../../shared/base/Types"; import { CometChatTheme } from "../../theme/type"; /** * * * @type {PollsConfigurationInterface} * @description Optional configuration for polls. */ export declare class PollsExtensionDecorator extends DataSourceDecorator { pollsConfiguration?: PollsConfigurationInterface; /** * * * @param {DataSource} dataSource - The data source to decorate. * @param {PollsConfigurationInterface} [pollsConfiguration] - Optional polls configuration. */ constructor(dataSource: DataSource, pollsConfiguration?: PollsConfigurationInterface); /** * * * @returns {boolean} * @description Returns true if the message is deleted. */ isDeletedMessage(message: CometChat.BaseMessage): boolean; /** * * * @returns {string} * @description Returns the unique ID for this extension. */ getId(): string; /** * * * @param {CometChat.Conversation} conversation - The conversation object. * @param {CometChatTheme} [theme] - The current theme. * @returns {string | JSX.Element} * @description Returns the preview text or element for the last conversation message. */ getLastConversationMessage(conversation: CometChat.Conversation, theme?: CometChatTheme): string | JSX.Element; /** * * * @returns {string[]} * @description Returns all message categories including custom types. */ getAllMessageCategories(): string[]; /** * * * @returns {string[]} * @description Returns all message types including the poll extension type. */ getAllMessageTypes(): string[]; /** * * * @param {CometChatTheme} theme - The current theme. * @param {any} [user] - The current user. * @param {any} [group] - The current group. * @param {any} [composerId] - The composer identifier. * @returns {CometChatMessageComposerAction[]} * @description Returns the attachment options for the message composer including polls. */ getAttachmentOptions(theme: CometChatTheme, user?: any, group?: any, composerId?: any, additionalAttachmentOptionsParams?: AdditionalAttachmentOptionsParams): CometChatMessageComposerAction[]; /** * * * @param {CometChatTheme} theme - The current theme. * @param {AdditionalParams} [additionalParams] - Additional parameters. * @returns {CometChatMessageTemplate[]} * @description Returns all message templates including the poll template. */ getAllMessageTemplates(theme: CometChatTheme, additionalParams?: AdditionalParams): CometChatMessageTemplate[]; /** * * * @param {CometChat.BaseMessage} message - The poll message. * @param {MessageBubbleAlignmentType} _alignment - The alignment for the message bubble. * @param {CometChatTheme} theme - The current theme. * @returns {JSX.Element} * @description Returns the poll bubble element for a given poll message. */ getPollBubble(message: CometChat.BaseMessage, _alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element; }