// PulseUpdates Objective-C Bridge
// Exposes Swift module to React Native

#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>

@interface RCT_EXTERN_MODULE(PulseUpdates, RCTEventEmitter)

RCT_EXTERN_METHOD(configure:(BOOL)enabled
                  updateUrl:(NSString *)updateUrl
                  runtimeVersion:(NSString *)runtimeVersion
                  checkOnLaunch:(NSString *)checkOnLaunch
                  launchWaitMs:(int)launchWaitMs
                  channel:(NSString *)channel
                  signingKeyId:(NSString *)signingKeyId
                  signingPublicKey:(NSString *)signingPublicKey)

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

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

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

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

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

RCT_EXTERN_METHOD(reportLaunchFailure:(NSString *)reason
                  resolve:(RCTPromiseResolveBlock)resolve
                  reject:(RCTPromiseRejectBlock)reject)

@end
