import { StateRegistry, DeepstreamPlugin, StateRegistryCallback } from '@deepstream/types'; /** * This class provides a generic mechanism that allows to maintain * a distributed state amongst the nodes of a cluster. */ export declare class SingleStateRegistry extends DeepstreamPlugin implements StateRegistry { description: string; private readonly data; private emitter; /** * Checks if a given entry exists within the registry */ has(name: string): boolean; onAdd(callback: StateRegistryCallback): void; onRemove(callback: StateRegistryCallback): void; /** * Add a name/entry to the registry. If the entry doesn't exist yet, * this will notify the other nodes within the cluster */ add(name: string): void; /** * Removes a name/entry from the registry. If the entry doesn't exist, * this will exit silently */ remove(name: string): void; /** * Returns all currently registered entries */ getAll(): string[]; /** * Returns all the servers that hold a given state */ getAllServers(subscriptionName: string): string[]; /** * Removes all entries for a given serverName. This is intended to be called * whenever a node leaves the cluster */ removeAll(serverName: string): void; }