text: #import <AVFoundation/AVFoundation.h>
  #import <UIKit/UIKit.h>
  #import <EXCamera/EXCameraManager.h>
  #import <UMCore/UMModuleRegistry.h>
  #import <UMCore/UMAppLifecycleListener.h>
  #import <UMCameraInterface/UMCameraInterface.h>
  
  @class EXCameraManager;
  
  static const int EXFlashModeTorch = 3;
  
  typedef NS_ENUM(NSInteger, EXCameraType) {
    EXCameraTypeFront = AVCaptureDevicePositionFront,
    EXCameraTypeBack = AVCaptureDevicePositionBack
  };
  
  typedef NS_ENUM(NSInteger, EXCameraFlashMode) {
    EXCameraFlashModeOff = AVCaptureFlashModeOff,
    EXCameraFlashModeOn = AVCaptureFlashModeOn,
    EXCameraFlashModeTorch = EXFlashModeTorch,
    EXCameraFlashModeAuto = AVCaptureFlashModeAuto
  };
  
  typedef NS_ENUM(NSInteger, EXCameraVideoStabilizationMode) {
    EXCameraVideoStabilizationModeOff = AVCaptureVideoStabilizationModeOff,
    EXCameraVideoStabilizationModeStandard = AVCaptureVideoStabilizationModeStandard,
    EXCameraVideoStabilizationModeCinematic = AVCaptureVideoStabilizationModeCinematic,
    EXCameraAVCaptureVideoStabilizationModeAuto = AVCaptureVideoStabilizationModeAuto
  };
  
  typedef NS_ENUM(NSInteger, EXCameraAutoFocus) {
    EXCameraAutoFocusOff = AVCaptureFocusModeLocked,
    EXCameraAutoFocusOn = AVCaptureFocusModeContinuousAutoFocus,
  };
  
  typedef NS_ENUM(NSInteger, EXCameraWhiteBalance) {
    EXCameraWhiteBalanceAuto = 0,
    EXCameraWhiteBalanceSunny = 1,
    EXCameraWhiteBalanceCloudy = 2,
    EXCameraWhiteBalanceFlash = 3,
    EXCameraWhiteBalanceShadow = 4,
    EXCameraWhiteBalanceIncandescent = 5,
    EXCameraWhiteBalanceFluorescent = 6,
  };
  
  typedef NS_ENUM(NSInteger, EXCameraExposureMode) {
    EXCameraExposureLocked = AVCaptureExposureModeLocked,
    EXCameraExposureAuto = AVCaptureExposureModeContinuousAutoExposure,
    EXCameraExposureCustom = AVCaptureExposureModeCustom,
  };
  
  typedef NS_ENUM(NSInteger, EXCameraVideoResolution) {
    EXCameraVideo2160p = 0,
    EXCameraVideo1080p = 1,
    EXCameraVideo720p = 2,
    EXCameraVideo4x3 = 3,
  };
  
  @interface EXCamera : UIView <AVCaptureMetadataOutputObjectsDelegate, AVCaptureFileOutputRecordingDelegate, UMAppLifecycleListener, UMCameraInterface, AVCapturePhotoCaptureDelegate>
  
  @property (nonatomic, strong) dispatch_queue_t sessionQueue;
  @property (nonatomic, strong) AVCaptureSession *session;
  @property (nonatomic, strong) AVCaptureDeviceInput *videoCaptureDeviceInput;
  @property (nonatomic, strong) AVCapturePhotoOutput *photoOutput;
  @property (nonatomic, strong) AVCaptureMovieFileOutput *movieFileOutput;
  @property (nonatomic, strong) id runtimeErrorHandlingObserver;
  @property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
  
  @property (nonatomic, assign) NSInteger presetCamera;
  @property (nonatomic, assign) EXCameraFlashMode flashMode;
  @property (nonatomic, assign) CGFloat zoom;
  @property (nonatomic, assign) NSInteger autoFocus;
  @property (nonatomic, assign) float focusDepth;
  @property (nonatomic, assign) NSInteger whiteBalance;
  @property (assign, nonatomic) AVCaptureSessionPreset pictureSize;
  @property (nonatomic, assign) AVCaptureVideoStabilizationMode videoStabilizationMode;
  
  @property (nonatomic, assign) BOOL isScanningBarCodes;
  @property (nonatomic, assign) BOOL isDetectingFaces;
  
  - (id)initWithModuleRegistry:(UMModuleRegistry *)moduleRegistry;
  - (void)updateType;
  - (void)updateFlashMode;
  - (void)updateFocusMode;
  - (void)updateFocusDepth;
  - (void)updateZoom;
  - (void)updateWhiteBalance;
  - (void)updatePictureSize;
  - (void)updateFaceDetectorSettings:(NSDictionary *)settings;
  - (void)setBarCodeScannerSettings:(NSDictionary *)settings;
  - (void)takePicture:(NSDictionary *)options resolve:(UMPromiseResolveBlock)resolve reject:(UMPromiseRejectBlock)reject;
  - (void)record:(NSDictionary *)options resolve:(UMPromiseResolveBlock)resolve reject:(UMPromiseRejectBlock)reject;
  - (void)stopRecording;
  - (void)resumePreview;
  - (void)pausePreview;
  - (void)onReady:(NSDictionary *)event;
  - (void)onMountingError:(NSDictionary *)event;
  - (void)onPictureSaved:(NSDictionary *)event;
  
  @end
  
  
  