UNPKG

@waku/core

Version:

TypeScript implementation of the Waku v2 protocol

36 lines (35 loc) 947 B
import type { IRelay, Libp2p } from "@waku/interfaces"; type KeepAliveOptions = { pingKeepAlive: number; relayKeepAlive: number; }; type CreateKeepAliveManagerOptions = { options: KeepAliveOptions; libp2p: Libp2p; relay?: IRelay; }; interface IKeepAliveManager { start(): void; stop(): void; } export declare class KeepAliveManager implements IKeepAliveManager { private readonly relay?; private readonly libp2p; private readonly options; private pingKeepAliveTimers; private relayKeepAliveTimers; constructor({ options, relay, libp2p }: CreateKeepAliveManagerOptions); start(): void; stop(): void; private onPeerConnect; private onPeerDisconnect; private startPingForPeer; private stopPingForPeer; private startLibp2pPing; private stopLibp2pPing; private startRelayPing; private stopRelayPing; private pingRelay; private pingLibp2p; } export {};