sendingnetwork-bot-sdk
Version:
TypeScript/JavaScript SDK for SDN bots
42 lines (41 loc) • 1.46 kB
TypeScript
import { SDNClient } from "../SDNClient";
import { ICryptoRoomInformation } from "./ICryptoRoomInformation";
/**
* Tracks room encryption status for a SDNClient.
* @category Encryption
*/
export declare class RoomTracker {
private client;
constructor(client: SDNClient);
/**
* Handles a room join
* @internal
* @param roomId The room ID.
*/
onRoomJoin(roomId: string): Promise<void>;
/**
* Handles a room event.
* @internal
* @param roomId The room ID.
* @param event The event.
*/
onRoomEvent(roomId: string, event: any): Promise<void>;
/**
* Prepares the room tracker to track the given rooms.
* @param {string[]} roomIds The room IDs to track. This should be the joined rooms set.
*/
prepare(roomIds: string[]): Promise<void>;
/**
* Queues a room check for the tracker. If the room needs an update to the store, an
* update will be made.
* @param {string} roomId The room ID to check.
*/
queueRoomCheck(roomId: string): Promise<void>;
/**
* Gets the room's crypto configuration, as known by the underlying store. If the room is
* not encrypted then this will return an empty object.
* @param {string} roomId The room ID to get the config for.
* @returns {Promise<ICryptoRoomInformation>} Resolves to the encryption config.
*/
getRoomCryptoConfig(roomId: string): Promise<ICryptoRoomInformation>;
}