import { NativeModules } from 'react-native'; import type { Errors } from '../native/ZoomVideoSdk'; const { RNZoomVideoSdkTestAudioDeviceHelper } = NativeModules; /** * Test audio device interface. */ export type ZoomVideoSdkTestAudioDeviceHelperType = { /** * Start the microphone test. This will start recording the input from the microphone. Once the recording is complete, call stopMicTest to finish the recording. */ startMicTest: () => Promise; /** * Stop the microphone test. Before calling this, you must have successfully started the microphone test by calling startMicTest. Otherwise this returns an error. */ stopMicTest: () => Promise; /** * Play the microphone recorded sound. You must complete a microphone test by successfully executing startMicTest and stopMicTest before calling this. Otherwise this returns an error. */ playMicTest: () => Promise; /** * Start the speaker test. */ startSpeakerTest: () => Promise; /** * Stop the speaker test. Before calling this, you must have successfully started the speaker test by calling startSpeakerTest. Otherwise this returns an error. */ stopSpeakerTest: () => Promise; }; export class ZoomVideoSdkTestAudioDeviceHelper implements ZoomVideoSdkTestAudioDeviceHelperType { async startMicTest() { return await RNZoomVideoSdkTestAudioDeviceHelper.startMicTest(); } async playMicTest() { return await RNZoomVideoSdkTestAudioDeviceHelper.playMicTest(); } async startSpeakerTest() { return await RNZoomVideoSdkTestAudioDeviceHelper.startSpeakerTest(); } async stopMicTest() { return await RNZoomVideoSdkTestAudioDeviceHelper.stopMicTest(); } async stopSpeakerTest() { return await RNZoomVideoSdkTestAudioDeviceHelper.stopSpeakerTest(); } }