import { MatrixClient } from "../MatrixClient"; import { ICryptoRoomInformation } from "./ICryptoRoomInformation"; /** * Tracks room encryption status for a MatrixClient. * @category Encryption */ export declare class RoomTracker { private client; constructor(client: MatrixClient); /** * Handles a room join * @internal * @param roomId The room ID. */ onRoomJoin(roomId: string): Promise; /** * Handles a room event. * @internal * @param roomId The room ID. * @param event The event. */ onRoomEvent(roomId: string, event: any): Promise; /** * Prepares the room tracker to track the given rooms. * * Only rooms already known to be encrypted are skipped — encryption cannot * be disabled once enabled. Unencrypted rooms are deliberately not cached: * every consumer asks the server on use, so a room that enables encryption * at any point is always seen. This scan is therefore purely a cache * warm-up for encrypted rooms; correctness never depends on it running. * @param {string[]} roomIds The room IDs to track. This should be the joined rooms set. */ prepare(roomIds: string[]): Promise; /** * 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. * @param {boolean} force When true, any cached result is ignored and the room's * state is re-fetched from the server. Used when an event indicates the cached * result is stale (encryption enabled, history visibility changed, room joined). */ queueRoomCheck(roomId: string, force?: boolean): Promise; /** * Fetches a room's encryption configuration from the server. * @returns The encryption event content (plus history visibility) for * encrypted rooms, or null when the room definitively has no encryption * state event. "Not encrypted" is deliberately never cached: consumers ask * the server on use, so a room that enables encryption is always seen. * @throws When the server's answer is non-definitive (network error, rate * limiting, …) — callers must never treat that as "not encrypted". */ private checkRoom; /** * 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} Resolves to the encryption config. */ getRoomCryptoConfig(roomId: string, failClosed?: boolean): Promise; }