import { requireNativeModule, EventEmitter, EventSubscription } from 'expo-modules-core'; // Reexport the native module. On web, it will be resolved to ExpoOtpAutofillConsentModule.web.ts // and on native platforms to ExpoOtpAutofillConsentModule.ts const ExpoOtpAutofillConsentModule = requireNativeModule('ExpoOtpAutofillConsent'); export { default } from './ExpoOtpAutofillConsentModule'; export * from './ExpoOtpAutofillConsent.types'; type SmsRetrieverEvents = { onSmsReceived: (event: { message: string }) => void; onSmsTimeout: (event: { message: string }) => void; }; const emitter = new EventEmitter(ExpoOtpAutofillConsentModule); export function addSmsListener(listener: (event: { message: string }) => void): EventSubscription { return emitter.addListener('onSmsReceived', listener); } export function addSmsTimeoutListener(listener: (event: { message: string }) => void): EventSubscription { return emitter.addListener('onSmsTimeout', listener); } export async function startSmsUserConsent(senderPhoneNumber?: string): Promise { return await ExpoOtpAutofillConsentModule.startSmsUserConsent(senderPhoneNumber); } export function removeSmsListener(): void { return ExpoOtpAutofillConsentModule.removeSmsListener(); }