import type { NativeModulesStatic } from 'react-native'; import type { CallInvite } from '../CallInvite'; import type { PreflightTest } from '../PreflightTest'; import type { NativeAudioDevicesInfo } from './AudioDevice'; import type { NativeCallInfo, NativeCallFeedbackIssue, NativeCallFeedbackScore } from './Call'; import type { NativeCallInviteInfo } from './CallInvite'; import type { Uuid } from './common'; import type { RTCStats } from './RTCStats'; export interface TwilioVoiceReactNative extends NativeModulesStatic { /** * Native types. * * The following event related functions are required by the React Native * bindings. */ addListener: (eventType: string) => void; removeListeners: (count: number) => void; /** * Call bindings. */ call_disconnect(callUuid: Uuid): Promise; call_getStats(callUuid: Uuid): Promise; call_hold(callUuid: Uuid, hold: boolean): Promise; call_isOnHold(callUuid: Uuid): Promise; call_isMuted(callUuid: Uuid): Promise; call_mute(callUuid: Uuid, mute: boolean): Promise; call_postFeedback(callUuid: Uuid, score: NativeCallFeedbackScore, issue: NativeCallFeedbackIssue): Promise; call_sendDigits(callUuid: Uuid, digits: string): Promise; call_sendMessage(callUuid: Uuid, content: string, contentType: string, messageType: string): Promise; /** * Call Invite bindings. */ callInvite_accept(callInviteUuid: Uuid, acceptOptions: CallInvite.AcceptOptions): Promise; callInvite_isValid(callInviteUuid: Uuid): Promise; callInvite_reject(callInviteUuid: Uuid): Promise; callInvite_updateCallerHandle(callInviteUuid: Uuid, handle: string): Promise; /** * Voice bindings. */ voice_connect_android(token: string, twimlParams: Record, notificationDisplayName: string | undefined): Promise; voice_connect_ios(token: string, twimlParams: Record, contactHandle: string): Promise; voice_initializePushRegistry(): Promise; voice_setCallKitConfiguration(configuration: Record): Promise; voice_setIncomingCallContactHandleTemplate(template?: string): Promise; voice_getAudioDevices(): Promise; voice_getCalls(): Promise; voice_getCallInvites(): Promise; voice_getDeviceToken(): Promise; voice_getVersion(): Promise; voice_handleEvent(remoteMessage: Record): Promise; voice_register(accessToken: string): Promise; voice_selectAudioDevice(audioDeviceUuid: Uuid): Promise; voice_showNativeAvRoutePicker(): Promise; voice_unregister(accessToken: string): Promise; /** * Preflight related bindings. */ voice_runPreflight(accessToken: string, options: PreflightTest.Options): Promise; preflightTest_getCallSid(preflightTestUuid: Uuid): Promise; preflightTest_getEndTime(preflightTestUuid: Uuid): Promise; preflightTest_getLatestSample(preflightTestUuid: Uuid): Promise; preflightTest_getReport(preflightTestUuid: Uuid): Promise; preflightTest_getStartTime(preflightTestUuid: Uuid): Promise; preflightTest_getState(preflightTestUuid: Uuid): Promise; preflightTest_stop(preflightTestUuid: Uuid): Promise; preflightTest_flushEvents(): Promise; }