import { NativeModulesProxy, EventEmitter, Subscription } from 'expo-modules-core'; // Import the native module. On web, it will be resolved to ExpoWifiRtt.web.ts // and on native platforms to ExpoWifiRtt.ts import ExpoWifiRttModule from './ExpoWifiRttModule'; import ExpoWifiRttView from './ExpoWifiRttView'; import { ChangeEventPayload, ExpoWifiRttViewProps } from './ExpoWifiRtt.types'; // Get the native constant value. export const PI = ExpoWifiRttModule.PI; export function hello(): string { return ExpoWifiRttModule.hello(); } export async function setValueAsync(value: string) { return await ExpoWifiRttModule.setValueAsync(value); } const emitter = new EventEmitter(ExpoWifiRttModule ?? NativeModulesProxy.ExpoWifiRtt); export function addChangeListener(listener: (event: ChangeEventPayload) => void): Subscription { return emitter.addListener('onChange', listener); } export { ExpoWifiRttView, ExpoWifiRttViewProps, ChangeEventPayload };