import { PersistedObservable } from '../../../observable/persistedObservable'; import { Identifiable, Store } from '../../../store/store'; import { RiverConnection } from '../../river-connection/riverConnection'; import { ChannelMessage_Post_Attachment, ChannelMessage_Post_Mention, PlainMessage } from '@towns-protocol/proto'; import { MessageTimeline } from '../../timeline/timeline'; import { ChannelDetails, SpaceDapp, type Address } from '@towns-protocol/web3'; import { Members } from '../../members/members'; import type { ethers } from 'ethers'; type ChannelSendTipParams = { type: 'member'; receiver: Address; tokenId: string; currency: Address; amount: bigint; chainId: number; } | { type: 'bot'; botId: string; appId: string; appAddress: Address; currency: Address; amount: bigint; chainId: number; }; export interface ChannelModel extends Identifiable { /** The River `channelId` of the channel. */ id: string; /** The River `spaceId` which this channel belongs. */ spaceId: string; /** Whether the SyncAgent has joined this channel. */ isJoined: boolean; /** The channel metadata {@link ChannelDetails}. */ metadata?: ChannelDetails; } export declare class Channel extends PersistedObservable { private riverConnection; private spaceDapp; timeline: MessageTimeline; members: Members; constructor(id: string, spaceId: string, riverConnection: RiverConnection, spaceDapp: SpaceDapp, store: Store); protected onLoaded(): void; /** Joins the channel. */ join(): Promise; /** Sends a message to the channel. * @param message - The message to send. * @param options - Additional options for the message. * @returns The event id of the message. */ sendMessage(message: string, options?: { /** If set, this message will be linked to a thread with the specified message. */ threadId?: string; /** If set, this message will be linked as a reply to the specified message. */ replyId?: string; /** The users that are mentioned in the message */ mentions?: PlainMessage[]; /** The attachments in the message. You can attach images, videos, links, files, or even other messages. */ attachments?: PlainMessage[]; /** The app client address that should receive the slash command. */ appClientAddress?: string; }): Promise<{ eventId: string; }>; /** Edits a message in the channel. * @param eventId - The event id of the message to edit. * @param message - The new message content. * @returns The event id of the edited message. */ editMessage(eventId: string, message: string, options?: { /** If set, this message will be linked to a thread with the specified message. */ threadId?: string; /** If set, this message will be linked as a reply to the specified message. */ replyId?: string; /** The users that are mentioned in the message */ mentions?: PlainMessage[]; /** The attachments in the message. You can attach images, videos, links, files, or even other messages. */ attachments?: PlainMessage[]; }): Promise<{ eventId: string; }>; /** Pins a message to the top of the channel. * @param eventId - The event id of the message to pin. * @returns The event id of the pin action. */ pin(eventId: string): Promise<{ eventId: string; newEvents: import("@towns-protocol/proto").EventRef[]; }>; /** Unpins a message from the channel. * @param eventId - The event id of the message to unpin. * @returns The event id of the unpin action. */ unpin(eventId: string): Promise<{ eventId: string; newEvents: import("@towns-protocol/proto").EventRef[]; }>; /** Sends a reaction to a message. * @param refEventId - The event id of the message to react to. * @param reaction - The reaction to send. Can be any string, including emoji, unicode characters. */ sendReaction(refEventId: string, reaction: string): Promise<{ eventId: string; }>; /** Redacts your own event. * @param eventId - The event id of the message to redact * @param reason - The reason for the redaction */ redact(eventId: string, reason?: string): Promise<{ eventId: string; }>; /** Redacts any message as an admin. * @param eventId - The event id of the message to redact */ adminRedact(eventId: string): Promise<{ eventId: string; }>; sendTip(messageId: string, tip: ChannelSendTipParams, signer: ethers.Signer): Promise<{ eventId: string; }>; private onStreamInitialized; private onStreamUserJoined; private onStreamUserLeft; } export {}; //# sourceMappingURL=channel.d.ts.map