import type { ChatBskyConvoDefs } from "@atcute/bluesky"; import type { Bot, BotSendMessageOptions } from "../../bot/Bot.js"; import { Profile } from "../Profile.js"; import { type ChatMessage, type ChatMessagePayload } from "./ChatMessage.js"; import { type DeletedChatMessage } from "./DeletedChatMessage.js"; /** * Data used to construct a Conversation class. * @see Conversation */ export interface ConversationData { id: string; muted: boolean; unreadCount: number; members: Array; } /** * Represents a DM conversation on Bluesky. */ export declare class Conversation { protected bot: Bot; /** The conversation's ID. */ id: string; /** Whether the bot account has this conversation muted. */ muted: boolean; /** The number of unread messages in the conversation. */ unreadCount: number; /** The users that are members in this conversation. */ members: Array; /** * @param data Data used to construct the conversation. * @param bot The active Bot instance. */ constructor({ id, muted, unreadCount, members }: ConversationData, bot: Bot); /** * Fetch a list of messages in this conversation. * This method returns 100 messages at a time, beginning from the latest message, alongside a cursor to fetch the next 100. * @param cursor The cursor to begin fetching from. * @returns An array of messages and a cursor for pagination. */ getMessages(cursor?: string): Promise<{ cursor?: string; messages: Array; }>; /** * Iterate over the messages in this conversation. * @param cursor The cursor to begin fetching from. */ iterateMessages(cursor?: string): AsyncIterableIterator; /** * Send a message in the conversation. * @param payload The message to send. * @param options Additional options for sending the message. * @returns The sent message. */ sendMessage(payload: Omit, options?: BotSendMessageOptions): Promise; /** * Leave the conversation. */ leave(): Promise; /** * Constructs an instance from a ConvoView. */ static fromView(view: ChatBskyConvoDefs.ConvoView, bot: Bot): Conversation; }