import EventEmitter from 'events'; import Line from '../Line'; import CallSession from '../CallSession'; import type WebRTCClient from '../../web-rtc-client'; import { IEmitter } from '../../utils/Emitter'; import IndirectTransfer from '../IndirectTransfer'; export type PhoneEventCallbacks = { onCallIncoming?: (number: string) => void; onCallOutgoing?: (number: string) => void; onCallRinging?: () => void; onCallAccepted?: () => void; onCallHeld?: () => void; onCallResumed?: () => void; onCallMuted?: () => void; onCallUnmuted?: () => void; onCallEnded?: () => void; onCallFailed?: (message: string) => void; onMediaConnected?: (callSession: CallSession) => void; }; type PhoneVoid = Promise | void; export type AvailablePhoneOptions = { accept: boolean; addParticipant: boolean; decline: boolean; hold: boolean; merge: boolean; mute: boolean; record: boolean; sendKey: boolean; transfer: boolean; }; export interface Phone extends IEmitter { accept(callSession: CallSession, enableVideo?: boolean): Promise; changeAudioDevice(id: string): Promise; changeRingDevice(id: string): PhoneVoid; changeAudioVolume(volume: number): PhoneVoid; changeRingVolume(volume: number): PhoneVoid; changeAudioInputDevice(id: string): Promise | null | undefined; changeVideoInputDevice(id: string): Promise | null | undefined; onConnectionMade(): PhoneVoid; close(): Promise; disableRinging(): PhoneVoid; enableRinging(): PhoneVoid; endCurrentCall(CallSession: CallSession): PhoneVoid; getLocalStreamForCall(callSession: CallSession): MediaStream | null | undefined; getLocalVideoStream(callSession: CallSession): MediaStream | null | undefined; getOptions(): AvailablePhoneOptions; getRemoteStreamForCall(callSession: CallSession): MediaStream | null | undefined; ignore(callSession: CallSession): PhoneVoid; hangup(callSession?: CallSession): Promise; hasAnActiveCall(): boolean; hold(callSession: CallSession): Promise | null | undefined; indirectTransfer(source: CallSession, destination: CallSession): Promise; initiateCTIIndirectTransfer(callSession: CallSession, number: string): Promise; cancelCTIIndirectTransfer(transferId: string): PhoneVoid; confirmCTIIndirectTransfer(transferId: string): PhoneVoid; hasVideo(callSession: CallSession): boolean; hasAVideoTrack(callSession: CallSession): boolean; isWebRTC(): boolean; getUserAgent(): string; makeCall(number: string, line: Line, enableVideo?: boolean, audioOnly?: boolean): Promise; mute(callSession: CallSession): PhoneVoid; reject(callSession: CallSession): PhoneVoid; resume(callSession: CallSession): Promise | null | undefined; sendKey(callSession: CallSession, tone: string): PhoneVoid; transfer(callSession: CallSession, target: string): PhoneVoid; turnCameraOff(callSession: CallSession): PhoneVoid; turnCameraOn(callSession: CallSession): PhoneVoid; unmute(callSession: CallSession): PhoneVoid; setActiveSipSession(callSession: CallSession): PhoneVoid; isRegistered(): boolean; hasIncomingCallSession(): boolean; setMediaConstraints(media: MediaStreamConstraints): PhoneVoid; getCurrentCallSession(): CallSession | null | undefined; getRemoteVideoStream(callSession: CallSession): MediaStream | null | undefined; hasLocalVideo(callSession: CallSession): boolean; eventEmitter: EventEmitter; client: WebRTCClient | null; register(): Promise; onConnect(): Promise; } export {}; //# sourceMappingURL=Phone.d.ts.map