react-native-twilio-voice-sdk
Version:
React Native wrapper for Twilio Programmable Voice SDK
45 lines (44 loc) • 1.72 kB
TypeScript
import Call from './call';
import CallError from "./callError";
declare type voiceStatus = "READY" | "OFFLINE" | "BUSY";
declare type callEventHandler = (call: Call) => void;
declare type callEventWithErrorHandler = (call: Call, err?: CallError) => void;
declare type removeHandlerFn = () => void;
declare class TwilioVoice {
private _currentCall;
private _nativeAppEventEmitter;
private _internalEventHandlers;
private _eventHandlers;
private _isSetup;
private _nativeVersion;
constructor();
readonly version: string;
readonly nativeVersion: string | undefined;
readonly status: voiceStatus;
connect: (accessToken: string, params?: {}) => Promise<Call>;
destroy: () => void;
on(event: "connect", handler: callEventHandler): removeHandlerFn;
on(event: "reconnect", handler: callEventHandler): removeHandlerFn;
on(event: "ringing", handler: callEventHandler): removeHandlerFn;
on(event: "connectFailure", handler: callEventWithErrorHandler): removeHandlerFn;
on(event: "reconnecting", handler: callEventWithErrorHandler): removeHandlerFn;
on(event: "disconnect", handler: callEventWithErrorHandler): removeHandlerFn;
private removeListener;
private getNativeVersion;
private setup;
private addInternalCallEventHandlers;
private removeInternalCallEventHandlers;
private handleEvent;
private createOrUpdateCall;
private createCallError;
private parseNativeCallObject;
private onConnect;
private onDisconnect;
private onConnectFailure;
private onReconnect;
private onReconnecting;
private onRinging;
private disconnectAll;
}
declare const _default: TwilioVoice;
export default _default;