import { Platform } from 'react-native'; import { FreeraspReactNative } from '../nativeModules'; import type { TalsecConfig } from '../../types/types'; export const talsecStart = async (options: TalsecConfig): Promise => { return FreeraspReactNative.talsecStart(options); }; export const addToWhitelist = async (packageName: string): Promise => { if (Platform.OS === 'ios') { return Promise.reject('Malware detection not available on iOS'); } return FreeraspReactNative.addToWhitelist(packageName); }; export const blockScreenCapture = (enable: boolean): Promise => { return FreeraspReactNative.blockScreenCapture(enable); }; export const isScreenCaptureBlocked = (): Promise => { return FreeraspReactNative.isScreenCaptureBlocked(); }; export const storeExternalId = (data: string): Promise => { return FreeraspReactNative.storeExternalId(data); }; export const removeExternalId = (): Promise => { return FreeraspReactNative.removeExternalId(); }; export const getAppIcon = (packageName: string): Promise => { if (Platform.OS === 'ios') { return Promise.reject( 'App icon retrieval for Malware detection not available on iOS' ); } return FreeraspReactNative.getAppIcon(packageName); }; export const onInvalidCallback = (): void => { FreeraspReactNative.onInvalidCallback(); }; export const removeListenerForEvent = (channel: string): Promise => { return FreeraspReactNative.removeListenerForEvent(channel); };