@telnyx/webrtc
Version:
Telnyx WebRTC Client
59 lines (58 loc) • 2.13 kB
TypeScript
import * as log from 'loglevel';
import BaseMessage from './messages/BaseMessage';
import Connection from './services/Connection';
import { BroadcastParams, IVertoOptions } from './util/interfaces';
export default abstract class BaseSession {
options: IVertoOptions;
uuid: string;
sessionid: string;
subscriptions: {
[channel: string]: any;
};
nodeid: string;
master_nodeid: string;
signature: string;
relayProtocol: string;
contexts: string[];
timeoutErrorCode: number;
connection: Connection;
protected _jwtAuth: boolean;
protected _doKeepAlive: boolean;
protected _keepAliveTimeout: any;
protected _reconnectTimeout: any;
protected _autoReconnect: boolean;
protected _idle: boolean;
private _executeQueue;
private _pong;
private registerAgent;
constructor(options: IVertoOptions);
get __logger(): log.Logger;
get connected(): boolean;
get reconnectDelay(): number;
execute(msg: BaseMessage): any;
executeRaw(text: string): void;
validateOptions(): boolean;
broadcast(params: BroadcastParams): void;
disconnect(): Promise<void>;
on(eventName: string, callback: Function): this;
off(eventName: string, callback?: Function): this;
connect(): Promise<void>;
protected _handleLoginError(error: any): void;
protected _onSocketOpen(): Promise<void>;
onNetworkClose(): void;
protected _onSocketMessage(response: any): void;
protected _removeSubscription(protocol: string, channel?: string): void;
protected _addSubscription(protocol: string, handler: Function, channel: string): void;
_existsSubscription(protocol: string, channel?: string): boolean;
private _attachListeners;
private _detachListeners;
private _emptyExecuteQueues;
_closeConnection(): void;
private _keepAlive;
static on(eventName: string, callback: any): void;
static off(eventName: string): void;
static uuid(): string;
clearConnection(): void;
hasAutoReconnect(): boolean;
private getIsRegistered;
}