import { NativeModules } from 'react-native'; import autoTrack from './autotrack'; import configGlobal from './autotrack/config'; import { currentPageInfo } from './autotrack/global'; type RangersApplogReactnativePluginType = { multiply(a: number, b: number): Promise; }; export { autoTrack }; const { RangersAppLogModule, RangersApplogReactnativePlugin } = NativeModules; RangersAppLogModule.onEventV3 = new Proxy(RangersAppLogModule.onEventV3, { apply: (target, thisArgument, argumentsList) => { const params = argumentsList[1] ?? {}; if (configGlobal.getConfig().bindEvent) { currentPageInfo.appendPageInfo(params); } argumentsList[1] = params; // console.info(argumentsList) return Reflect.apply(target, thisArgument, argumentsList); }, }); export default RangersApplogReactnativePlugin as RangersApplogReactnativePluginType;