@river-build/sdk
Version:
For more details, visit the following resources:
59 lines • 2.31 kB
TypeScript
import { PersistedObservable } from '../../../observable/persistedObservable';
import { Identifiable, Store } from '../../../store/store';
import { RiverConnection } from '../../river-connection/riverConnection';
import { Members } from '../../members/members';
import type { ChannelMessage_Post_Attachment, ChannelMessage_Post_Mention, ChannelProperties, PlainMessage } from '@river-build/proto';
import { MessageTimeline } from '../../timeline/timeline';
export interface DmModel extends Identifiable {
/** The id of the DM. */
id: string;
/** Whether the SyncAgent has loaded this data. */
initialized: boolean;
/** Whether the current user has joined the DM. */
isJoined: boolean;
/** The metadata of the DM. @see {@link ChannelProperties} */
metadata?: ChannelProperties;
}
export declare class Dm extends PersistedObservable<DmModel> {
private riverConnection;
timeline: MessageTimeline;
members: Members;
constructor(id: string, riverConnection: RiverConnection, store: Store);
protected onLoaded(): void;
sendMessage(message: string, options?: {
threadId?: string;
replyId?: string;
mentions?: PlainMessage<ChannelMessage_Post_Mention>[];
attachments?: PlainMessage<ChannelMessage_Post_Attachment>[];
}): Promise<{
eventId: string;
}>;
pin(eventId: string): Promise<{
eventId: string;
error?: import("@river-build/proto").AddEventResponse_Error | undefined;
}>;
unpin(eventId: string): Promise<{
eventId: string;
error?: import("@river-build/proto").AddEventResponse_Error | undefined;
}>;
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;
}>;
private onStreamInitialized;
private onStreamUserJoined;
private onStreamUserLeft;
}
//# sourceMappingURL=dm.d.ts.map