#import <Apptics/Apptics.h>
#ifdef RCT_NEW_ARCH_ENABLED
#import <AppticsReactNativeSpec/AppticsReactNativeSpec.h>
@interface AppticsReactModule : NSObject <NativeAppticsReactModuleSpec, UINavigationControllerDelegate>
#else
#import <React/RCTBridgeModule.h>
@interface AppticsReactModule : NSObject <RCTBridgeModule, UINavigationControllerDelegate>
#endif

void uncaughtExceptionHandler(NSException *exception);

@property (strong, nonatomic) NSMutableDictionary *uniqErrors;

+(AppticsReactModule*) shared;
- (void) sendPendingNonFatalsReports;
- (void) checkForNonFatalAndSendToServer;
- (void) uploadCrashSuccessNotification : (NSNotification*) notification;
@end

@interface Analytics (RCTExtension)
- (void) saveRCTNonFatalsUniqueId : (NSString*) uniqueId issueName : (NSString *)issueName message : (NSString *)message stackTrace : (NSString*)stackTrace crashProperties : (NSMutableDictionary*) crashProperties;
- (void) saveRCTFatals : (NSString *)issueName message : (NSString *)message stackTrace : (NSString*)stackTrace crashProperties : (NSMutableDictionary*) crashProperties;
@end

@interface ZAFileManager (RCTExtension)
+ (NSArray*) getRCTCrashes;
+ (void) deleteAllRCTCrashes;
+ (NSArray*) getRCTNonFatals;
+ (void) deleteAllRCTNonFatals;
+ (NSArray*) getRCTNonFatalsMeta;
+ (void) deleteAllRCTNonFatalsMeta;
+ (void) archiveRCTCrashReport:(NSDictionary*)crashReport withFileName : (NSString*) filePath;
    + (id) unarchiveRCTCrashReportForFileName : (NSString*) filePath;
@end
