import { Channel } from "./channel"; /** * A room represents a subscription scope made on a combination of: * - index * - collection * - filters * * A room may contain differents channels that describe which notifications should * be sent. (e.g. only document leaving the scope, users joining the room) * * The rooms also contains the list of connections who subscribed to it. * * @property id * @property index * @property collection * @property connections * @property channels */ export declare class Room { /** * Room unique identifier. * * Koncorde hash for the desired scope (index + collection + filters) */ id: string; index: string; collection: string; /** * List of connections subscribing to this room. */ private connections; /** * Map of channels configuration for this room. * * Map * * @example * * channels: { * '': { * * // request scope filter, default: 'all' * scope: 'all|in|out|none', * * // filter users notifications, default: 'none' * users: 'all|in|out|none', * * // should propagate notification to the cluster * // (used for plugin subscriptions) * cluster: true|false * } * }, */ channels: Map; constructor(id: string, index: string, collection: string, channels?: Map, connections?: Set); /** * Number of connections subscribing to the room */ get size(): number; /** * Creates a new configuration channel on the room if it doesn't already exists */ createChannel(channel: Channel): void; addConnection(connectionId: string): void; removeConnection(connectionId: string): void; }