import type { ChannelMemberResponse, ChannelMembership, DefaultGenerics, Event, ExtendableGenerics, FormatMessageResponse, MessageResponse, MessageSetType, UserResponse } from './models'; export declare type ChannelReadStatus = Record; }>; /** * ChannelState - A container class for the channel state. */ export interface ChannelState { /** * addMessageSorted - Add a message to the state * * @param {MessageResponse} newMessage A new message * @param {boolean} timestampChanged Whether updating a message with changed created_at value. * @param {boolean} addIfDoesNotExist Add message if it is not in the list, used to prevent out of order updated messages from being added. * @param {MessageSetType} messageSetToAddToIfDoesNotExist Which message set to add to if message is not in the list (only used if addIfDoesNotExist is true) */ addMessageSorted: (newMessage: MessageResponse, timestampChanged?: boolean, addIfDoesNotExist?: boolean, messageSetToAddToIfDoesNotExist?: MessageSetType) => void; filterErrorMessages: () => void; /** * formatMessage - Takes the message object. Parses the dates, sets __html * and sets the status to received if missing. Returns a message object * * @param {MessageResponse} message a message object * */ formatMessage: (message: MessageResponse) => FormatMessageResponse; lastMessageAt: Date | null; latestMessages: Array['formatMessage']>>; /** * loadMessageIntoState - Loads a given message (and messages around it) into the state * * @param {string} messageId The id of the message, or 'latest' to indicate switching to the latest messages * @param {string} parentMessageId The id of the parent message, if we want load a thread reply */ loadMessageIntoState: (messageId: string | 'latest', parentMessageId?: string, limit?: number) => void; members: Record>; membership: ChannelMembership; messages: Array['formatMessage']>>; pinnedMessages: Array['formatMessage']>>; read: ChannelReadStatus; /** * removeMessage - Description * * @param {{ id: string; parent_id?: string }} messageToRemove Object of the message to remove. Needs to have at id specified. * * @return {boolean} Returns if the message was removed */ removeMessage: (messageToRemove: { id: string; messageSetIndex?: number; parent_id?: string; }) => boolean; threads: Record['formatMessage']>>>; typing: Record>; /** * Updates all instances of given message in channel state * @param message * @param updateFunc */ updateMessage: (message: { id?: string; parent_id?: string; pinned?: boolean; show_in_channel?: boolean; }, updateFunc: (msg: ReturnType['formatMessage']>) => ReturnType['formatMessage']>) => void; watcher_count: number; unreadCount: number; watchers: Record>; } //# sourceMappingURL=channel_state.d.ts.map