package com.contentsquare.rn.csq import com.facebook.react.bridge.Dynamic import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReadableMap /** * Interface for Heap autocapture functionality. * Provides an abstraction layer between React Native bridge modules and the actual Heap implementation. * This allows for different implementations based on whether CSQ SDK is enabled or disabled. */ interface HeapAutocaptureWrapper { /** * Handles method invocations from JavaScript to native. * @param method The name of the method to invoke * @param arguments The arguments passed from JavaScript * @param promise Promise to resolve/reject with the result */ fun handleInvocation(method: String, arguments: ReadableMap, promise: Promise) /** * Handles callback results from JavaScript to native (Dynamic variant). * @param callbackId The unique identifier for the callback * @param data The data returned from JavaScript * @param error Any error message from JavaScript */ fun handleResult(callbackId: String, data: Dynamic?, error: String?) /** * Handles callback results from JavaScript to native (ReadableMap variant for new arch). * @param callbackId The unique identifier for the callback * @param data The data returned from JavaScript as ReadableMap * @param error Any error message from JavaScript */ fun handleResult(callbackId: String, data: ReadableMap?, error: String?) /** * Called when listeners are added (for old architecture). */ fun onListenerAdded() /** * Called when listeners are removed (for old architecture). * @param count Number of listeners removed */ fun onListenersRemoved(count: Int) }