export = ClusterPublisher; declare class ClusterPublisher { /** * @constructor * @param {ClusterNode} node */ constructor(node: ClusterNode); node: ClusterNode; lastMessageId: Long; socket: Publisher; protoroot: protobuf.Root; state: 1; buffer: any[]; init(): Promise; /** * Publishes an event telling them that this node has created a new room * * @param {NormalizedFilter} normalized - Obtained with Koncorde.normalize() * @return {Long} ID of the message sent to other nodes */ sendNewRealtimeRoom(normalized: NormalizedFilter): Long; /** * Publishes an event telling telling them that this node * no longer has subscribers on the provided realtime room. * * @param {string} roomId * @return {Long} ID of the message sent to other nodes */ sendRemoveRealtimeRoom(roomId: string): Long; /** * Publishes an event telling that a room has one less subscriber * @param {string} roomId * @return {Long} ID of the message sent to other nodes */ sendUnsubscription(roomId: string): Long; /** * Publishes an event telling that a new subscription has been made * made to an existing room * * @param {string} roomId * @return {Long} Id of the message sent to other nodes */ sendSubscription(roomId: string): Long; /** * Publishes an event telling that a document notification must be * propagated * * @param {Array.} rooms - Koncorde rooms * @param {DocumentNotification} notification * @return {Long} Id of the message sent to other nodes */ sendDocumentNotification(rooms: Array, notification: DocumentNotification): Long; /** * Publishes an event telling that a user notification must be * propagated * * @param {string} room - Koncorde room * @param {UserNotification} notification * @return {Long} Id of the message sent to other nodes */ sendUserNotification(room: string, notification: UserNotification): Long; /** * Publishes an event telling that a new authentication strategy has been * dynamically added * * @param {string} strategyName * @param {string} pluginName * @param {Object} strategy * @return {Long} Id of the message sent to other nodes */ sendNewAuthStrategy(strategyName: string, pluginName: string, strategy: any): Long; /** * Publishes an event telling that a new authentication strategy has been * dynamically added * * @param {string} strategyName * @param {string} pluginName * @param {Object} strategyObject * @return {Long} Id of the message sent to other nodes */ sendRemoveAuthStrategy(strategyName: string, pluginName: string): Long; /** * Publishes an event telling other nodes to create an info dump * * @param {string} suffix - dump directory suffix name * @returns {Long} ID of the message sent */ sendDumpRequest(suffix: string): Long; /** * Publishes an event about a new index being added * * @param {storeScopeEnum} scope * @param {string} index * @returns {Long} ID of the message sent */ sendAddIndex(scope: storeScopeEnum, index: string): Long; /** * Publishes an event about a new collection being added * * @param {storeScopeEnum} scope * @param {string} index * @param {string} collection * @returns {Long} ID of the message sent */ sendAddCollection(scope: storeScopeEnum, index: string, collection: string): Long; /** * Publishes an event about indexes been removed * * @param {storeScopeEnum} scope * @param {Array.} indexes * @returns {Long} ID of the message sent */ sendRemoveIndexes(scope: storeScopeEnum, indexes: Array): Long; /** * Publishes an event about a collection been removed * * @param {storeScopeEnum} scope * @param {string} index * @param {string} collection * @returns {Long} ID of the message sent */ sendRemoveCollection(scope: storeScopeEnum, index: string, collection: string): Long; /** * Publishes an event about a cluster-wide event emission * * @param {string} event name * @param {Object} payload - event payload * @returns {Long} ID of the message sent */ sendClusterWideEvent(event: string, payload: any): Long; /** * Publishes an event about shutdown * * @param {Object} nodeId - node ID * * @returns {Long} ID of the message sent */ sendNodeShutdown(nodeId: any): Long; /** * Publishes an event about the node being in debug mode * @param {bool} evictionPrevented * * @returns {Long} ID of the message sent */ sendNodePreventEviction(evictionPrevented: bool): Long; /** * Publishes an event about a node being evicted * * @param {string} evictor node ID of the evictor * @param {Object} nodeId - node ID of the node being evicted * @param {Object} reason - reason of the eviction * * @returns {Long} ID of the message sent */ sendNodeEvicted(evictor: string, nodeId: any, reason: any): Long; /** * Publishes an event about heartbeat * * @param {string} address node sync address * * @returns {Long} ID of the message sent */ sendHeartbeat(address: string): Long; /** * Broadcasts a sync message. Topic must match a protobuf type name. * Returns immediately, but the message to be sent migh be bufferized and send * later. * * @param {String} topic name * @param {Object} data * @returns {Long} ID of the message sent * @throws If the topic's protobuf type cannot be found */ send(topic: string, data: any): Long; /** * Sends the provided message, and then sends all pending ones waiting in * the buffer, in order * * @param {string} topic * @param {Buffer} data * @return {void} */ bufferSend(topic: string, data: Buffer): void; dispose(): Promise; } import Long = require("long/umd/types"); import { Publisher } from "zeromq"; import protobuf = require("protobufjs");