UNPKG

data-channel-router

Version:
29 lines (28 loc) 1.28 kB
import { DataChannelEvents } from "../enums"; import { IDataChannel, IDataChannelOptions } from "../interfaces"; import { Id } from "../types"; import { EventEmitter } from "../utils"; import { DataChannelExecutor } from "./DataChannelExecutor"; type ChannelEvents = typeof DataChannelEvents.IDLE | typeof DataChannelEvents.CONNECTED | typeof DataChannelEvents.UNAVAILABLE; type OnIdleListener = (channel: IDataChannel) => void; type OnConnectedListener = (channel: IDataChannel) => void; type OnUnavailableListener = (channel: IDataChannel) => void; type DataChanelListeners = OnIdleListener | OnConnectedListener | OnUnavailableListener; /** * Data channel * @link https://github.com/DjonnyX/data-channel-router/blob/main/library/src/components/DataChannel.ts * @author Evgenii Grebennikov * @email djonnyx@gmail.com */ export declare class DataChannel extends EventEmitter<ChannelEvents, DataChanelListeners> { private _options; get id(): Id; get status(): import("../enums").DataChannelStatuses; get signal(): import("../enums").DataChannelSignalQuality; get options(): IDataChannelOptions<any>; get router(): any; protected _channel: DataChannelExecutor; constructor(_options: IDataChannelOptions, id?: Id); dispose(): void; } export {};