//
//  callview-bridge.m
//  adamo-sample
//
//  Created by Trần Tý on 8/13/19.
//  Copyright © 2019 Trần Tý. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "React/RCTViewManager.h"
#import "React/RCTEventEmitter.h"

@interface RCT_EXTERN_MODULE(CallViewManager, RCTViewManager)

//Mark: properties
RCT_EXPORT_VIEW_PROPERTY(shareVideo, BOOL)

RCT_EXPORT_VIEW_PROPERTY(shareAudio, BOOL)

//MARK: EVENT

RCT_EXPORT_VIEW_PROPERTY(onDidConnect, RCTBubblingEventBlock)

RCT_EXPORT_VIEW_PROPERTY(onFailedToConnect, RCTDirectEventBlock)

RCT_EXPORT_VIEW_PROPERTY(onDisConnected, RCTDirectEventBlock)

RCT_EXPORT_VIEW_PROPERTY(onReConnecting, RCTDirectEventBlock)

RCT_EXPORT_VIEW_PROPERTY(onFailedReConnect, RCTDirectEventBlock)

RCT_EXPORT_VIEW_PROPERTY(onDidReConnect, RCTDirectEventBlock)

RCT_EXPORT_VIEW_PROPERTY(onParticipantConnected, RCTDirectEventBlock)

RCT_EXPORT_VIEW_PROPERTY(onParticipantDisConnected, RCTDirectEventBlock)


//MARK: function
RCT_EXTERN_METHOD(
                  connectWithOptions:(nonnull NSNumber *)node
                  token: (nonnull NSString *)token
                  room:(nonnull NSString *)room
                  )

RCT_EXTERN_METHOD(flipCamera:(nonnull NSNumber *)node)

RCT_EXTERN_METHOD(
                  muteAudio:(nonnull NSNumber *)node
                  isMuted:(nonnull BOOL*) isMuted
                  )

RCT_EXTERN_METHOD(disconnect:(nonnull NSNumber *)node)

@end
