mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-02-04 14:03:17 +00:00
* implement HealthIndicator * up libp2p interface version * up lock * remove unused tests * expose HealthIndicator from Waku * update test, add start and stop * fix error handling
25 lines
574 B
TypeScript
25 lines
574 B
TypeScript
import { TypedEventEmitter } from "@libp2p/interface";
|
|
|
|
import { Libp2p } from "./libp2p.js";
|
|
|
|
export enum HealthStatusChangeEvents {
|
|
StatusChange = "health:change"
|
|
}
|
|
|
|
export enum HealthStatus {
|
|
Unhealthy = "Unhealthy",
|
|
MinimallyHealthy = "MinimallyHealthy",
|
|
SufficientlyHealthy = "SufficientlyHealthy"
|
|
}
|
|
|
|
export type HealthIndicatorEvents = {
|
|
[HealthStatusChangeEvents.StatusChange]: CustomEvent<HealthStatus>;
|
|
};
|
|
|
|
export interface IHealthIndicator
|
|
extends TypedEventEmitter<HealthIndicatorEvents> {}
|
|
|
|
export type HealthIndicatorParams = {
|
|
libp2p: Libp2p;
|
|
};
|