UNPKG

moleculer

Version:

Fast & powerful microservices framework for Node.JS

36 lines (27 loc) 789 B
import type { NodeRawInfo } from "./registry"; declare class Node { id: string; instanceID: string | null; available: boolean; local: boolean; lastHeartbeatTime: number; config: Record<string, any>; client: Record<string, any>; metadata: Record<string, any> | null; ipList: string[] | null; port: number | null; hostname: string | null; udpAddress: string | null; rawInfo: NodeRawInfo | null; services: Record<string, any>[]; cpu: number | null; cpuSeq: number | null; seq: number; offlineSince: number | null; constructor(id: string); update(payload: NodeRawInfo, isReconnected: boolean): boolean; updateLocalInfo(cpuUsage: Function): Promise<any>; heartbeat(payload: Record<string, any>): void; disconnected(isUnexpected?: boolean): void; } export = Node;