#import "ARModule.h"
#import <React/RCTBridge.h>
#import <React/RCTEventDispatcher.h>

@implementation ARModule

RCT_EXPORT_MODULE()

// Export methods to be called from JavaScript
RCT_EXTERN_METHOD(startSession:(NSDictionary *)options 
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(pauseSession:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(resetSession:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(isSupported:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(addObject:(NSDictionary *)model
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(removeObject:(NSString *)id
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(moveObject:(NSString *)id
                  position:(NSDictionary *)position
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(rotateObject:(NSString *)id
                  rotation:(NSDictionary *)rotation
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(scaleObject:(NSString *)id
                  scale:(double)scale
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

// Constants that can be accessed from JavaScript
- (NSDictionary *)constantsToExport {
  return @{
    @"VERSION": @"0.1.0"
  };
}

@end
