
#import <React/RCTBridgeModule.h>
#import <React/RCTConvert.h>
#import <Foundation/Foundation.h>


typedef NS_ENUM(NSInteger, RNPermission) {
  RNPermissionUnknown = 0,
  RNPermissionCamera = 3,
  RNPermissionBluetoothPeripheral = 1,
  RNPermissionMicrophone = 9,
  RNPermissionPhotoLibrary = 11,
};

@interface RCTConvert (RNPermission)
@end

typedef enum {
  RNPermissionStatusNotAvailable = 0,
  RNPermissionStatusNotDetermined = 1,
  RNPermissionStatusRestricted = 2,
  RNPermissionStatusDenied = 3,
  RNPermissionStatusAuthorized = 4,
  RNPermissionStatusLimited = 5,
} RNPermissionStatus;

@protocol RNPermissionHandler <NSObject>

@required

+ (NSArray<NSString *> * _Nonnull)usageDescriptionKeys;

+ (NSString * _Nonnull)handlerUniqueId;

- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus status))resolve
                 rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject;

- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus status))resolve
                   rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject;

@end

@interface DyteRNPermissions :  NSObject <RCTBridgeModule>

+ (bool)isFlaggedAsRequested:(NSString * _Nonnull)handlerId;

+ (void)flagAsRequested:(NSString * _Nonnull)handlerId;

@end

