import { Channel, ChannelHub } from '@mlytics/core-ts/core/util/future'; import { AbstractDaemon, SpecDaemon } from '../../../base/daemon/daemon'; import { AbstractProcessAgent } from '../../../base/daemon/process/flow/agent'; import { AbstractProcessPipe, ProcessPipeContent, ProcessPipeOutcome } from '../../../base/daemon/process/flow/pipe'; import { PeerBroker, SpecConstraintPeerBroker } from '../../broker/broker'; interface SpecPeerDaemon extends SpecDaemon { broker: SpecConstraintPeerBroker; command(command: PeerDaemonCommandOptions): Promise>; } declare abstract class AbstractPeerDaemon extends AbstractDaemon implements SpecPeerDaemon { protected _agent: AbstractProcessAgent; protected _broker: PeerBroker; protected _commands: Channel>; protected _submissions: ChannelHub; get broker(): PeerBroker; command(command: PeerDaemonCommandOptions): Promise>; protected _buildWaitToStartTask(): Promise; protected _execWaitToStartTaskCallee(): Promise; protected abstract _buildConnectPeerTask(): Promise; protected _buildListenIceNegotiationEventTask(): Promise; protected _execListenIceNegotiationEventTaskCallee(): Promise; protected _buildListenIceCandidateEventTask(): Promise; protected _execListenIceCandidateEventTaskCallee(): Promise; protected _buildListenIceSignalingEventTask(): Promise; protected _execListenIceSignalingEventTaskCallee(): Promise; protected _buildListenIceGatheringEventTask(): Promise; protected _execListenIceGatheringEventTaskCallee(): Promise; protected _buildListenIceConnectionEventTask(): Promise; protected _execListenIceConnectionEventTaskCallee(): Promise; protected _buildListenDataChannelOpenEventTask(): Promise; protected _execListenDataChannelOpenEventTaskCallee(): Promise; protected _buildListenDataChannelDataEventTask(): Promise; protected _execListenDataChannelDataEventTaskCallee(): Promise; protected _buildListenDataChannelErrorEventTask(): Promise; protected _execListenDataChannelErrorEventTaskCallee(): Promise; protected _buildListenDataChannelCloseEventTask(): Promise; protected _execListenDataChannelCloseEventTaskCallee(): Promise; protected _buildListenConnectionClosedEventTask(): Promise; protected _execListenConnectionClosedEventTaskCallee(): Promise; protected _buildDeliverMessageTask(): Promise; protected _execDeliverMessageTaskCallee(): Promise; protected _buildReceiveMessageTask(): Promise; protected _execReceiveMessageTaskCallee(): Promise; protected _buildProcessMessageTask(): Promise; protected _execProcessMessageTaskCallee(): Promise; protected _buildProcessCommandTask(): Promise; protected _execProcessCommandTaskCallee(): Promise; protected _buildExitProcessTask(): Promise; protected _execExitProcessTaskOnClose(): Promise; } declare class PeerDaemonEvent { static readonly CONNECTED = "connected"; static readonly DISCONNECTED = "disconnected"; } declare class PeerDaemonTaskName { static readonly WAIT_TO_START = "peer daemon: wait to start"; static readonly CONNECT_PEER = "peer daemon: connect peer"; static readonly LISTEN_ICE_NEGOTIATION_EVENT = "peer daemon: listen ice negotiation event"; static readonly LISTEN_ICE_CANDIDATE_EVENT = "peer daemon: listen ice candidate event"; static readonly LISTEN_ICE_SIGNALING_EVENT = "peer daemon: listen ice signaling event"; static readonly LISTEN_ICE_GATHERING_EVENT = "peer daemon: listen ice gathering event"; static readonly LISTEN_ICE_CONNECTION_EVENT = "peer daemon: listen ice connection event"; static readonly LISTEN_DATACHANNEL_OPEN_EVENT = "peer daemon: listen datachannel open event"; static readonly LISTEN_DATACHANNEL_DATA_EVENT = "peer daemon: listen datachannel data event"; static readonly LISTEN_DATACHANNEL_ERROR_EVENT = "peer daemon: listen datachannel error event"; static readonly LISTEN_DATACHANNEL_CLOSE_EVENT = "peer daemon: listen datachannel close event"; static readonly LISTEN_CONNECTION_CLOSED_EVENT = "peer daemon: listen connection closed event"; static readonly DELIVER_MESSAGE = "peer daemon: deliver message"; static readonly RECEIVE_MESSAGE = "peer daemon: receive message"; static readonly PROCESS_MESSAGE = "peer daemon: process message"; static readonly PROCESS_COMMAND = "peer daemon: process command"; static readonly EXIT_PROCESS = "peer daemon: exit process"; } type PeerDaemonCommandOptions = { id: string; name: string; content?: ProcessPipeContent; }; export { SpecPeerDaemon, AbstractPeerDaemon, PeerDaemonEvent, PeerDaemonTaskName, PeerDaemonCommandOptions };