import { type FilenSDK } from ".."; import { type ChatConversation } from "../api/v3/chat/conversations"; import { type Contact } from "../api/v3/contacts"; import { ChatTypingType } from "../api/v3/chat/typing"; import { type ChatMessage } from "../api/v3/chat/messages"; import { type ChatConversationsOnlineUser } from "../api/v3/chat/conversations/online"; import { type ChatLastFocusValues } from "../api/v3/chat/lastFocusUpdate"; /** * Chats * @date 2/1/2024 - 2:44:47 AM * * @export * @class Chats * @typedef {Chats} */ export declare class Chats { private readonly _chatKeyCache; private readonly sdk; constructor(sdk: FilenSDK); /** * Get the encryption key of a chat. * @date 2/20/2024 - 6:05:30 AM * * @public * @async * @param {{ conversation: string }} param0 * @param {string} param0.conversation * @returns {Promise} */ chatKey({ conversation }: { conversation: string; }): Promise; /** * Fetch all chat conversations. * @date 2/20/2024 - 5:35:54 AM * * @public * @async * @returns {Promise} */ conversations(): Promise; /** * Fetch all recent chat conversations. * @date 2/20/2024 - 5:37:59 AM * * @public * @async * @returns {Promise} */ conversationsRecents(): Promise; /** * Fetch a chat conversation. * @date 2/20/2024 - 5:39:11 AM * * @public * @async * @param {{conversation: string}} param0 * @param {string} param0.conversation * @returns {Promise} */ get({ conversation }: { conversation: string; }): Promise; /** * Create a chat conversation. Optionally add participants to it. * @date 2/20/2024 - 5:48:07 AM * * @public * @async * @param {{ uuid?: string; contacts?: Contact[] }} param0 * @param {string} param0.uuid * @param {{}} param0.contacts * @returns {Promise} */ create({ uuid, contacts }: { uuid?: string; contacts?: Contact[]; }): Promise; /** * Delete a chat message. * @date 2/20/2024 - 5:52:09 AM * * @public * @async * @param {{ uuid: string }} param0 * @param {string} param0.uuid * @returns {Promise} */ deleteMessage({ uuid }: { uuid: string; }): Promise; /** * Delete a chat conversation. * @date 2/20/2024 - 6:15:57 AM * * @public * @async * @param {{conversation: string}} param0 * @param {string} param0.conversation * @returns {Promise} */ delete({ conversation }: { conversation: string; }): Promise; /** * Edit a conversation name. * @date 2/20/2024 - 6:03:14 AM * * @public * @async * @param {{conversation: string, name: string}} param0 * @param {string} param0.conversation * @param {string} param0.name * @returns {Promise} */ editConversationName({ conversation, name }: { conversation: string; name: string; }): Promise; /** * Edit a chat message. * @date 2/20/2024 - 5:52:16 AM * * @public * @async * @param {{ uuid: string; conversation: string; message: string }} param0 * @param {string} param0.uuid * @param {string} param0.conversation * @param {string} param0.message * @returns {Promise} */ editMessage({ uuid, conversation, message }: { uuid: string; conversation: string; message: string; }): Promise; /** * Send a message. * @date 2/20/2024 - 5:54:24 AM * * @public * @async * @param {{ uuid?: string; conversation: string; message: string, replyTo: string }} param0 * @param {string} param0.uuid * @param {string} param0.conversation * @param {string} param0.message * @param {string} param0.replyTo * @returns {Promise} */ sendMessage({ uuid, conversation, message, replyTo }: { uuid?: string; conversation: string; message: string; replyTo: string; }): Promise; /** * Send a typing event. * @date 2/20/2024 - 5:55:20 AM * * @public * @async * @param {{conversation: string, type: ChatTypingType}} param0 * @param {string} param0.conversation * @param {ChatTypingType} param0.type * @returns {Promise} */ sendTyping({ conversation, type }: { conversation: string; type: ChatTypingType; }): Promise; /** * Fetch chat messages from the given timestamp ordered DESC. Can be used for pagination. * @date 2/20/2024 - 6:00:37 AM * * @public * @async * @param {{ conversation: string; timestamp?: number }} param0 * @param {string} param0.conversation * @param {number} param0.timestamp * @returns {Promise} */ messages({ conversation, timestamp }: { conversation: string; timestamp?: number; }): Promise; /** * Add a participant to a chat. * @date 2/20/2024 - 5:46:46 AM * * @public * @async * @param {{ conversation: string; contact: Contact }} param0 * @param {string} param0.conversation * @param {Contact} param0.contact * @returns {Promise} */ addParticipant({ conversation, contact }: { conversation: string; contact: Contact; }): Promise; /** * Remove a participant from a chat. * @date 2/20/2024 - 5:49:45 AM * * @public * @async * @param {{conversation: string, userId: number}} param0 * @param {string} param0.conversation * @param {number} param0.userId * @returns {Promise} */ removeParticipant({ conversation, userId }: { conversation: string; userId: number; }): Promise; /** * Mark a conversation as read. * @date 2/20/2024 - 6:06:21 AM * * @public * @async * @param {{conversation: string}} param0 * @param {string} param0.conversation * @returns {Promise} */ markConversationAsRead({ conversation }: { conversation: string; }): Promise; /** * Get the notification count for a conversation. * @date 2/20/2024 - 6:07:24 AM * * @public * @async * @param {{conversation: string}} param0 * @param {string} param0.conversation * @returns {Promise} */ conversationUnreadCount({ conversation }: { conversation: string; }): Promise; /** * Get the unread notification count (includes all conversations). * @date 2/20/2024 - 6:08:07 AM * * @public * @async * @returns {Promise} */ unread(): Promise; /** * Get the online status of each participant in a conversation. * @date 2/20/2024 - 6:09:47 AM * * @public * @async * @param {{ conversation: string }} param0 * @param {string} param0.conversation * @returns {Promise} */ conversationOnline({ conversation }: { conversation: string; }): Promise; /** * Disable a message embed. * @date 2/20/2024 - 6:10:38 AM * * @public * @async * @param {{uuid: string}} param0 * @param {string} param0.uuid * @returns {Promise} */ disableMessageEmbed({ uuid }: { uuid: string; }): Promise; /** * Leave a conversation. Only works if you are not the owner. * @date 2/20/2024 - 6:14:36 AM * * @public * @async * @param {{conversation: string}} param0 * @param {string} param0.conversation * @returns {Promise} */ leave({ conversation }: { conversation: string; }): Promise; /** * Fetch last focus. * @date 2/20/2024 - 6:22:46 AM * * @public * @async * @returns {Promise} */ lastFocus(): Promise; /** * Update last focus. * @date 2/20/2024 - 6:22:37 AM * * @public * @async * @param {{values: ChatLastFocusValues[]}} param0 * @param {{}} param0.values * @returns {Promise} */ updateLastFocus({ values }: { values: ChatLastFocusValues[]; }): Promise; mute({ uuid, mute }: { uuid: string; mute: boolean; }): Promise; } export default Chats;