
#import "RCTNativeSdkModule.h"
#import "react_native_prestoplay-Swift.h"

@interface RCTNativeSdkModule ()
@property (nonatomic, strong) RCTNativeSdkModuleSwift *instance;
@end

@implementation RCTNativeSdkModule

@synthesize moduleRegistry = _moduleRegistry;

+ (NSString *)moduleName {
    return @"NativeSdkModule";
}

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params {
    return std::make_shared<facebook::react::NativeSdkModuleSpecJSI>(params);
}

- (void)initialize {
    self.instance = [[RCTNativeSdkModuleSwift alloc] initWithModuleRegistry:self.moduleRegistry];
}

- (void)initialize:(nonnull NSDictionary *)config companionSdkInfo:(nonnull NSDictionary *)companionSdkInfo resolve:(nonnull RCTPromiseResolveBlock)resolve reject:(nonnull RCTPromiseRejectBlock)reject {
    [self.instance initialize:config companionSdkInfo:companionSdkInfo resolve:^(){ resolve(nil); } reject:^(NSString* prestoPlayErrorJson){ reject(nil, prestoPlayErrorJson, nil);}];
}

@end
