import { RealtimeScope, RealtimeUsers } from "../../types"; /** * A channel define how notifications should be send for a particular realtime * room. * * Channel names are sent back to users who subscribe to realtime notification, * then each notification sent to them contains the associated channel. * * It allows to makes two subscriptions on index + collection + filters but one * for documents entering the scope and the other for documents exiting the scope * for example. * * Channels define with more granularity if a room notification should be sent: * - is the document entering or leaving the scope * - should I notify when users join or leave the room * - should I propagate the notification to other cluster nodes * * @property name * @property scope * @property users * @property cluster */ export declare class Channel { /** * Dummy hash function since we only need to keep the channel configuration. * * This is 10x faster than murmur. */ static hash(channel: Channel): string; static USERS_ALLOWED_VALUES: string[]; static SCOPE_ALLOWED_VALUES: string[]; /** * Identifier of the channel. * * Result of roomId + hash(channel) */ name: string; /** * Define if notification should be send when documents are entering or leaving * the subscription scope. * * @default "all" */ scope: RealtimeScope; /** * Define if notification should be send when users join or leave the channel. * * @default "none" */ users: RealtimeUsers; /** * Define if the notification should be propagated on other cluster nodes or * only to connection subscribing on this node. * * This is used by the EmbeddedSDK realtime subscription to propagate or not * callback execution among other nodes. */ cluster: boolean; constructor(roomId: string, { scope, users, propagate, }?: { scope?: RealtimeScope; users?: RealtimeUsers; propagate?: boolean; }); }