import { IConversation } from '../../types/data/Conversation'; import { IConversationTimelineResponse } from '../../types/raw/dm/Conversation'; import { IInboxInitialResponse, Conversation as RawConversation } from '../../types/raw/dm/InboxInitial'; import { IInboxTimelineResponse } from '../../types/raw/dm/InboxTimeline'; import { DirectMessage } from './DirectMessage'; /** * The details of a single conversation. * * @public */ export declare class Conversation implements IConversation { /** The raw conversation details. */ private readonly _raw; avatarUrl?: string; hasMore: boolean; id: string; lastActivityAt: string; lastMessageId?: string; messages: DirectMessage[]; muted: boolean; name?: string; notificationsDisabled: boolean; participants: string[]; trusted: boolean; type: 'ONE_TO_ONE' | 'GROUP_DM'; /** * @param conversation - The raw conversation details from the API response. * @param messages - Array of messages in this conversation. */ constructor(conversation: unknown, messages?: DirectMessage[]); /** The raw conversation details. */ get raw(): RawConversation; /** * Parse avatar URL from conversation data */ private _parseAvatarUrl; /** * Parse conversation type with proper fallback */ private _parseConversationType; /** * Parse participants array with type safety */ private _parseParticipants; /** * Parse timestamp with proper fallback */ private _parseTimestamp; /** * Extracts a single conversation from conversation timeline response. * * @param response - The raw response data. * * @returns The deserialized conversation with full message history. */ static fromConversationTimeline(response: IConversationTimelineResponse): Conversation | undefined; /** * Extracts conversations from inbox initial state response. * * @param response - The raw response data. * * @returns The deserialized list of conversations with their preview messages. */ static listFromInboxInitial(response: IInboxInitialResponse): Conversation[]; /** * Extracts conversations from inbox timeline response. * * @param response - The raw response data. * * @returns The deserialized list of conversations with their messages. */ static listFromInboxTimeline(response: IInboxTimelineResponse): Conversation[]; /** * Generic method to extract conversations from any supported response type */ static listFromResponse(response: IConversationTimelineResponse | IInboxInitialResponse | IInboxTimelineResponse): Conversation[]; /** * Get the other participant's ID (only for one-to-one conversations) */ getOtherParticipant(currentUserId: string): string | undefined; /** * Check if this conversation is a group DM */ isGroupDM(): boolean; /** * Check if this conversation is one-to-one */ isOneToOne(): boolean; /** * @returns A serializable JSON representation of `this` object. */ toJSON(): IConversation; }