/**
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by codegen project: GenerateModuleObjCpp
 *
 * We create an umbrella header (and corresponding implementation) here since
 * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
 * must have a single output. More files => more genrule()s => slower builds.
 */

#import "ScanditReactNativeDatacaptureCoreSpec.h"


@implementation NativeScanditDataCaptureCoreSpecBase
- (void)emitOnScanditEvent:(NSDictionary *)value
{
  _eventEmitterCallback("onScanditEvent", value);
}

- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
{
  _eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
}
@end


namespace facebook::react {
  
    static facebook::jsi::Value __hostFunction_NativeScanditDataCaptureCoreSpecJSI_createDataCaptureView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "createDataCaptureView", @selector(createDataCaptureView:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeScanditDataCaptureCoreSpecJSI_removeDataCaptureView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "removeDataCaptureView", @selector(removeDataCaptureView:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeScanditDataCaptureCoreSpecJSI_executeCore(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "executeCore", @selector(executeCore:resolve:reject:), args, count);
    }

    static facebook::jsi::Value __hostFunction_NativeScanditDataCaptureCoreSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
      return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count);
    }

  NativeScanditDataCaptureCoreSpecJSI::NativeScanditDataCaptureCoreSpecJSI(const ObjCTurboModule::InitParams &params)
    : ObjCTurboModule(params) {
      
        methodMap_["createDataCaptureView"] = MethodMetadata {1, __hostFunction_NativeScanditDataCaptureCoreSpecJSI_createDataCaptureView};
        
        
        methodMap_["removeDataCaptureView"] = MethodMetadata {1, __hostFunction_NativeScanditDataCaptureCoreSpecJSI_removeDataCaptureView};
        
        
        methodMap_["executeCore"] = MethodMetadata {1, __hostFunction_NativeScanditDataCaptureCoreSpecJSI_executeCore};
        
        
        methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeScanditDataCaptureCoreSpecJSI_getConstants};
        
        eventEmitterMap_["onScanditEvent"] = std::make_shared<AsyncEventEmitter<id>>();
        setEventEmitterCallback([&](const std::string &name, id value) {
          static_cast<AsyncEventEmitter<id> &>(*eventEmitterMap_[name]).emit(value);
        });
  }
} // namespace facebook::react
