react-native-headphone-detect-v2
Version:
This library is ported from the legacy react-native-headphone-detection library with support for the latest version of Android/iOS SDK, and Typescript intellisense.
18 lines (13 loc) • 562 B
text/typescript
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
import type { ConnectedResult } from 'react-native-headphone-detect-v2';
export interface Spec extends TurboModule {
// Methods
isAudioDeviceConnected(): Promise<ConnectedResult>;
// Event Emitter Methods
addListener(eventName: string): void;
removeListeners(count: number): void;
}
export default TurboModuleRegistry.getEnforcing<Spec>('HeadphoneDetectV2');
export const AUDIO_DEVICE_CHANGED_NOTIFICATION =
'AUDIO_DEVICE_CHANGED_NOTIFICATION';