import { EventEmitter } from "node:events"; import { GossipProtocol, PeerState } from "./gossip_protocol.js"; import { Cluster } from "./cluster.js"; import { HealthCheckable, ComponentHealth } from "./health.js"; /** * A wrapper around the GossipProtocol that provides a cluster interface * compatible with the ActorSystem. */ export declare class DistributedCluster extends EventEmitter implements Cluster, HealthCheckable { readonly nodeId: string; private gossipProtocol; constructor(gossipProtocol: GossipProtocol); start(): Promise; stop(): Promise; /** * Gracefully leaves the cluster by notifying peers before stopping. * Prefer this over stop() for graceful shutdown. * @param broadcastCount Number of times to broadcast leave message. Default: 3 * @param intervalMs Interval between broadcasts in ms. Default: 100 */ leave(broadcastCount?: number, intervalMs?: number): Promise; /** * Returns true if this node is in the process of leaving the cluster. */ isLeaving(): boolean; getMembers(): string[]; getLivePeers(): PeerState[]; getPeerState(nodeId: string): PeerState | undefined; getMembersByRole(role: string): string[]; /** * Sets custom metadata for this node, propagated via gossip. */ setMetadata(key: string, value: string): void; /** * Gets a metadata value for a specific node. */ getMetadata(nodeId: string, key: string): string | undefined; /** * Returns health status of the cluster. */ getHealth(): ComponentHealth; } //# sourceMappingURL=distributed_cluster.d.ts.map