//
//  RNUsercentricsModule.m
//  RNUsercentricsModule
//
//  Copyright © 2021 Usercentrics. All rights reserved.
//

#import <React/RCTBridgeModule.h>

@interface RCT_EXTERN_MODULE(RNUsercentricsModule, NSObject)
RCT_EXTERN_METHOD(configure:(NSDictionary *)dict)

RCT_EXTERN_METHOD(showFirstLayer:(NSDictionary *)dict
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(showSecondLayer:(NSDictionary *)dict
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(restoreUserSession:(NSString *)controllerId
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(isReady:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getControllerId:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getABTestingVariant:(RCTPromiseResolveBlock)resolve
                reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getConsents:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getCMPData:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getUserSessionData:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getUSPData:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getGPPData:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getGPPString:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getTCFData:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getAdditionalConsentModeData:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(changeLanguage:(NSString *)language
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(acceptAllForTCF:(double)fromLayer
                  consentType:(double)consentType
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(acceptAll:(double)consentType
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(denyAllForTCF:(double)fromLayer
                  consentType:(double)consentType
                  unsavedPurposeLIDecisions:(NSArray)unsavedPurposeLIDecisions
                  unsavedVendorLIDecisions:(NSArray)unsavedVendorLIDecisions
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(denyAll:(double)consentType
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(saveDecisionsForTCF:(NSDictionary *)tcfDecisions
                  fromLayer:(double)fromLayer
                  serviceDecisions:(NSArray)serviceDecisions
                  consentType:(double)consentType
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(saveDecisions:(NSArray)serviceDecisions
                  consentType:(double)consentType
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(saveOptOutForCCPA:(BOOL *)isOptedOut
                  consentType:(double)consentType
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(setCMPId:(double)id)

RCT_EXTERN_METHOD(setABTestingVariant:(NSString *)variant)

RCT_EXTERN_METHOD(setGPPConsent:(NSString *)sectionName
                  fieldName:(NSString *)fieldName
                  value:(NSDictionary *)value)

RCT_EXTERN_METHOD(track:(double)event)

RCT_EXTERN_METHOD(clearUserSession:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)
@end
