//
//  RPRReproReactBridgeImpl.h
//  RPRReproReactBridgeImpl
//
//  Created by Koki Oshima on 2025/07/16.
//  Copyright © 2025 Repro Inc. All rights reserved.
//


#import <Foundation/Foundation.h>
#import <Repro/Repro.h>

// ReactNative Version >= 0.41
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>

// ReactNative Version < 0.41
#elif __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"

// if ReactNative is a cocoapod and the project has swift enabled
#elif __has_include("React/RCTBridgeModule.h")
#import "React/RCTBridgeModule.h"

#else
#error "Can't find RCTBridgeModule.h anywhere."
#endif

NS_ASSUME_NONNULL_BEGIN

@interface RPRReproReactBridgeImpl : NSObject

// RemoteConfig
- (NSDictionary *)toDictionary:(NSDictionary<NSString *, RPRRemoteConfigValue *> *)values;
- (void)fetch:(double)timeout completionHandler:(RCTResponseSenderBlock)callback;
- (void)activateFetched;
- (void)setDefaultsFromDictionary:(NSDictionary<NSString *, id> *)json;
- (void)setDefaultsFromJsonString:(NSString *)string;
- (void)getValue:(NSString*)key callback:(RCTResponseSenderBlock)callback;
- (void)getAllValues:(RCTResponseSenderBlock)callback;
- (void)getAllValuesWithPrefix:(NSString*)key callback:(RCTResponseSenderBlock)callback;
- (void)getLocalDefaultValue:(NSString*)key callback:(RCTResponseSenderBlock)callback;
- (void)forceReset;

// Repro
- (void)optIn:(BOOL)endUserOptedIn;
- (void)setUserID:(NSString *)userID;
- (void)getUserID:(RCTResponseSenderBlock)callback;
- (void)getDeviceID:(RCTResponseSenderBlock)callback;
- (void)setStringUserProfile:(NSString *)key value:(NSString *)value;
- (void)setIntUserProfile:(NSString *)key value:(NSInteger)value;
- (void)setDoubleUserProfile:(NSString *)key value:(double)value;
- (void)setDateUserProfile:(NSString *)key value:(NSDate *)value;
- (void)setUserGender:(RPRUserProfileGender)value;
- (void)setUserEmailAddress:(NSString *)value;
- (void)setUserResidencePrefecture:(RPRUserProfilePrefecture)value;
- (void)setUserDateOfBirth:(NSDate *)value;
- (void)setUserAge:(NSInteger)value;
- (void)onlySetIfAbsentStringUserProfile:(NSString *)key value:(NSString *)value;
- (void)onlySetIfAbsentIntUserProfile:(NSString *)key value:(NSInteger)value;
- (void)onlySetIfAbsentDoubleUserProfile:(NSString *)key value:(double)value;
- (void)onlySetIfAbsentDateUserProfile:(NSString *)key value:(NSDate *)value;
- (void)incrementIntUserProfileBy:(NSString *)key value:(NSInteger)value;
- (void)decrementIntUserProfileBy:(NSString *)key value:(NSInteger)value;
- (void)incrementDoubleUserProfileBy:(NSString *)key value:(double)value;
- (void)decrementDoubleUserProfileBy:(NSString *)key value:(double)value;
- (void)onlySetIfAbsentUserGender:(RPRUserProfileGender)value;
- (void)onlySetIfAbsentUserEmailAddress:(NSString *)value;
- (void)onlySetIfAbsentUserResidencePrefecture:(RPRUserProfilePrefecture)value;
- (void)onlySetIfAbsentUserDateOfBirth:(NSDate *)value;
- (void)onlySetIfAbsentUserAge:(NSInteger)value;
- (void)incrementUserAgeBy:(NSInteger)value;
- (void)decrementUserAgeBy:(NSInteger)value;
- (void)deleteUserProfile:(NSString *)key;
- (void)deleteUserGender;
- (void)deleteUserEmailAddress;
- (void)deleteUserResidencePrefecture;
- (void)deleteUserDateOfBirth;
- (void)deleteUserAge;
- (void)track:(NSString *)name properties:(NSDictionary *)properties;
- (void)trackViewContent:(NSString *)contentID properties:(NSDictionary *)props;
- (void)trackSearch:(NSDictionary *)props;
- (void)trackAddToCart:(NSString *)contentID properties:(NSDictionary *)props;
- (void)trackAddToWishlist:(NSDictionary *)props;
- (void)trackInitiateCheckout:(NSDictionary *)props;
- (void)trackAddPaymentInfo:(NSDictionary *)props;
- (void)trackPurchase:(NSString *)contentID value:(double)value currency:(NSString *)currency properties:(NSDictionary *)props;
- (void)trackShare:(NSDictionary *)props;
- (void)trackLead:(NSDictionary *)props;
- (void)trackCompleteRegistration:(NSDictionary *)props;
- (void)trackNotificationOpened:(NSString *)notificationId;
- (void)setLogLevel:(RPRLogLevel)level;
- (void)setPushDeviceTokenString:(NSString *)deviceTokenHexString;
- (void)setPushRegistrationID:(NSString *)pushRegId;
- (void)setPushToken:(NSString *)token;
- (void)enablePushNotification;
- (void)setup:(NSString *)token;
- (void)enableInAppMessagesOnForegroundTransition;
- (void)disableInAppMessagesOnForegroundTransition;
- (void)getNewsFeeds:(double)limit campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback;
- (void)getNewsFeedsFor:(double)limit offsetID:(double)offsetID campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback;
- (void)updateNewsFeeds:(NSArray<NSDictionary *> *)entryJsons callback:(RCTResponseSenderBlock)callback;
- (void)setSilverEggProdKey:(NSString *)silverEggProdKey;
- (void)setSilverEggCookie:(NSString *)silverEggCookie;
- (void)linkLineID:(NSString *)lineUserId lineChannelID:(NSString *)lineChannelId;
- (void)unlinkLineID:(NSString *)lineUserId lineChannelID:(NSString *)lineChannelId;
- (void)_webviewJavaScriptOpenUrlHandler:(NSString *)webViewRequestUrl;

@end

NS_ASSUME_NONNULL_END