UNPKG

@twilio/flex-ui

Version:

Twilio Flex UI

76 lines (75 loc) 2.74 kB
import { Call, Device } from "@twilio/voice-sdk"; import { Action } from "redux"; /** * Voice connection state * @deprecated * @deprecatedSince 2.0.0 * @altRecommendation Use `getCurrentPhoneCallState` to access source connection (call) object * @altRecommendationExample * import { Flex } from "@twilio/flex-ui"; * const activeCallState = Flex.StateHelper.getCurrentPhoneCallState; * @altRecommendationLink https://assets.flex.twilio.com/docs/releases/flex-ui/latest/advanced/state-management/StateHelper/#getcurrentphonecallstate-call * @ignore * @typedef PhoneCallState * @property {Call} source Source call object. [See](https://www.twilio.com/docs/voice/sdks/javascript/twiliocall) * @memberof PhoneState */ export interface PhoneCallState { source: any; } /** * Voice call state * @interface PhoneState * @property {DeviceListener} [listener] device listener * @property {Call} [activeCall] Source call object. [See](https://www.twilio.com/docs/voice/sdks/javascript/twiliocall) * @category State */ export interface PhoneState { listener?: DeviceListener; activeCall?: Call; lastCallSid?: string; connection?: PhoneCallState; } export interface InitPhonePayload { token: string; listener: DeviceListener; } export interface PhoneAction extends Action { payload?: any; } export declare function reduce(state: PhoneState, action: PhoneAction): PhoneState; export declare function onWindowLeaveDuringCall(e: BeforeUnloadEvent): string; export declare class Actions { private static listener; static dispatchPhoneAction(type: string, payload: any): void; static init(accessToken: string, deviceOptions?: Device.Options, audioConstraints?: MediaTrackConstraints): void; static getDeviceListener(): DeviceListener; static shutdown(): void; } export declare class DeviceListener { private _listening; private microphoneID?; private hasPerformedInitialDeviceCheck; private hasEmittedSyntheticDeviceChange; private remoteAudio; private isUnloading; constructor(accessToken: string, deviceOptions?: Device.Options, audioConstraints?: MediaTrackConstraints); get isMicrophoneSet(): boolean; stop(): void; private isCitrixVDIEnabled; private handleDeviceChange; private setDeviceAudioConstraints; private handleDeviceRegistered; private handleDeviceAudio; private handleDeviceError; private handleDeviceIncoming; private multiTabFallbackAcceptanceTimer; private handleFlexMobileCall; private handleCallAccept; private handleCallDisconnect; private handleCallCancel; private handleCallMute; isListening(): boolean; tryInitialDeviceCheck(): void; private onWindowUnload; }