/*
 * Copyright © Dynamsoft Corporation. All rights reserved.
 */

#import <React/RCTViewManager.h>

@interface RCT_EXTERN_REMAP_MODULE(DynamsoftCameraView, RNDynamsoftCameraViewManager, RCTViewManager)

RCT_EXPORT_VIEW_PROPERTY(visibleLayerIds, NSArray)
RCT_EXPORT_VIEW_PROPERTY(scanRegionMaskVisible, BOOL)
RCT_EXPORT_VIEW_PROPERTY(scanLaserVisible, BOOL)
RCT_EXPORT_VIEW_PROPERTY(torchButton, NSDictionary)
RCT_EXPORT_VIEW_PROPERTY(torchButtonVisible, BOOL)
RCT_EXPORT_VIEW_PROPERTY(cameraToggleButton, NSDictionary)
RCT_EXPORT_VIEW_PROPERTY(cameraToggleButtonVisible, BOOL)

RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(createInstance)

RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(destroyInstance:(NSString *)key)

RCT_EXTERN_METHOD(open)

RCT_EXTERN_METHOD(close)

RCT_EXTERN_METHOD(setCameraView:(nonnull NSNumber *)tag)

RCT_EXTERN_METHOD(selectCamera:(NSInteger)position)

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

RCT_EXTERN_METHOD(setFocus:(CGFloat)x y:(CGFloat)y mode:(NSInteger)mode)

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

RCT_EXTERN_METHOD(setZoomFactor:(CGFloat)factor)

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

RCT_EXTERN_METHOD(enableEnhancedFeatures:(NSInteger)features)

RCT_EXTERN_METHOD(disableEnhancedFeatures:(NSInteger)features)

RCT_EXTERN_METHOD(setScanRegion:(NSDictionary *)region)

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

RCT_EXTERN_METHOD(turnOnTorch)

RCT_EXTERN_METHOD(turnOffTorch)

RCT_EXTERN_METHOD(beep)

RCT_EXTERN_METHOD(vibrate)

RCT_EXTERN_METHOD(setResolution:(NSInteger)resolution)

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

RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(convertRectToViewCoordinates:(NSDictionary *)rectDict)

RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(convertPointToViewCoordinates:(NSDictionary *)pointDict)

@end
