UNPKG

netflux

Version:

Peer to peer isomorphic transport API based on WebRTC and WebSocket. Allows to create/join full mesh network

24 lines (23 loc) 877 B
import { Observable } from 'rxjs'; import { Channel } from '../../Channel'; import '../../misc/env'; import { dataChannelBuilder as proto } from '../../proto/index'; import { WebChannel } from '../../WebChannel'; import { Service } from '../Service'; export declare const CONNECT_TIMEOUT = 9000; export declare class DataChannelBuilder extends Service<proto.IMessage, proto.Message> { static readonly SERVICE_ID: number; private readonly remotes; private readonly channelsSubject; private rtcConfiguration; private allStreams; private wc; constructor(wc: WebChannel, rtcConfiguration: RTCConfiguration); readonly channels: Observable<{ id: number; channel: Channel; }>; connect(targetId: number, myId: number, type: number): Promise<void>; clean(id?: number): void; private createRemote; }