import { type SpawnedProc } from "./process_runtime"; import { type ConnectionOptions, type NatsConnection } from "@nats-io/nats-core/internal"; export declare const ServerSignals: { readonly QUIT: "SIGQUIT"; readonly STOP: "SIGSTOP"; readonly REOPEN: "SIGUSR1"; readonly RELOAD: "SIGHUP"; readonly LDM: "SIGUSR2"; readonly KILL: "SIGKILL"; }; export interface PortInfo { clusterName?: string; hostname: string; port: number; cluster?: number; monitoring?: number; websocket?: number; } export interface Ports { nats: string[]; cluster?: string[]; monitoring?: string[]; websocket?: string[]; } export interface VarZ { "connect_urls": string[]; } export interface JSZ { "server_id": string; now: string; config: { "max_memory": number; "max_storage": number; "store_dir": string; }; memory: number; storage: number; api: { total: number; errors: number; }; "current_api_calls": number; "meta_cluster": { name: string; leader: string; replicas: [{ name: string; current: boolean; active: number; }]; }; } export interface SubDetails { subject: string; sid: string; msgs: number; cid: number; } export interface Conn { cid: number; kind: string; type: string; ip: string; port: number; start: string; "last_activity": string; "rtt": string; uptime: string; idle: string; "pending_bytes": number; "in_msgs": number; "out_msgs": number; "in_bytes": number; "out_bytes": number; subscriptions: number; name: string; lang: string; version: string; subscriptions_list?: string[]; subscriptions_list_detail?: SubDetails[]; } export interface ConnZ { "server_id": string; now: string; "num_connections": number; "total": number; "offset": number; "limit": number; "connections": Conn[]; } export declare class NatsServer implements PortInfo { hostname: string; clusterName?: string; port: number; cluster?: number; monitoring?: number; websocket?: number; process: SpawnedProc; logBuffer: string[]; logBytes: number; stopped: boolean; debug: boolean; config: any; configFile: string; certsDir?: string; rgb: { r: number; g: number; b: number; }; constructor(opts: { info: PortInfo; process: SpawnedProc; debug?: boolean; config: any; configFile: string; }); updatePorts(): Promise; restart(): Promise; pid(): number; getLog(): string; static stopAll(cluster: NatsServer[], cleanup?: boolean): Promise; rmPortsFile(): Promise; rmConfigFile(): Promise; rmDataDir(): Promise; rmCertsDir(): Promise; stop(cleanup?: boolean): Promise; [Symbol.asyncDispose](): Promise; signal(signal: string): Promise; varz(): Promise; jsz(): Promise; leafz(): Promise<{ leafs: unknown[]; leafnodes: number; }>; connz(cid?: number, subs?: boolean | "detail"): Promise; dataDir(): Promise; /** * Setup a cluster that has N nodes with the first node being just a connection * server - rest are JetStream. * @param count * @param debug */ static setupDataConnCluster(count?: number, debug?: boolean): Promise; static jetstreamCluster(count?: number, serverConf?: Record, debug?: boolean): Promise; static dataClusterFormed(proms: Promise[], debug?: boolean): Promise; static cluster(count?: number, conf?: any, debug?: boolean): Promise; static localClusterFormed(servers: NatsServer[]): Promise; static addClusterMember(ns: NatsServer, conf?: any, debug?: boolean): Promise; static confDefaults(conf?: any): any; /** * this is only expecting authentication type changes * @param conf */ reload(conf?: any): Promise; static tlsConfig(): Promise<{ tls: { cert_file: string; key_file: string; ca_file: string; }; certsDir: string; }>; connect(opts?: ConnectionOptions): Promise; static start(conf?: any, debug?: boolean): Promise; } export declare function toConf(o: any, indent?: string): string;