@actyx/sdk
Version:
Actyx SDK
47 lines (46 loc) • 1.44 kB
TypeScript
import { NodeInfo as NodeInfoIo } from './internal_common';
import { ActyxOpts, NodeStatus } from '.';
export declare const getInfo: (config: ActyxOpts) => (token: string, maxAgeMillis: number) => Promise<NodeInfo>;
/**
* Information about the Actyx node this SDK is connected to.
*
* Instances are returned by `Pond.nodeInfo()`.
* @public
*/
export declare class NodeInfo {
private io;
private semver;
constructor(io: NodeInfoIo);
/**
*
* @returns the full version string including git hash and CPU architecture
*/
longVersion(): string;
/**
*
* @returns the semantic version part of the full version string, e.g. `2.6.1`
*/
semVer(): string;
/**
*
* @param version - The version to compare with, in semantic version format `<major>.<minor>.<patch>`
* @returns `true` if the reported Actyx version is greater than or equal to the supplied version
*/
isAtLeastVersion(version: string): boolean;
/**
*
* @returns the uptime of the Actyx node in milliseconds
*/
uptimeMillis(): number;
/**
*
* @returns the number of other nodes the Actyx node is currently connected to
*/
connectedNodes(): number;
/**
*
* @returns information about the perceived connectivity of other nodes
*/
peersStatus(): Record<string, NodeStatus> | undefined;
}
export declare const invalidNodeInfo: NodeInfo;