// SPDX-License-Identifier: MIT

/**
 * React Native bridge module for thermal printer (iOS)
 * Objective-C bridge interface for Swift implementation
 */

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

@interface RCT_EXTERN_MODULE (RNThermalPrinter, RCTEventEmitter)

// ===== Discovery Flow =====
RCT_EXTERN_METHOD(scanBluetoothDevices
                  : (RCTPromiseResolveBlock)resolve rejecter
                  : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(stopScanDevices
                  : (RCTPromiseResolveBlock)resolve rejecter
                  : (RCTPromiseRejectBlock)reject)

// ===== Connection Flow =====
RCT_EXTERN_METHOD(testConnection
                  : (NSString *)address resolver
                  : (RCTPromiseResolveBlock)resolve rejecter
                  : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(connect
                  : (NSString *)address withOptions
                  : (NSDictionary *)options resolver
                  : (RCTPromiseResolveBlock)resolve rejecter
                  : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(disconnect
                  : (NSString *)address resolver
                  : (RCTPromiseResolveBlock)resolve rejecter
                  : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(isConnected
                  : (NSString *)address resolver
                  : (RCTPromiseResolveBlock)resolve rejecter
                  : (RCTPromiseRejectBlock)reject)

// ===== Printing Flow =====
RCT_EXTERN_METHOD(printRaw
                  : (NSString *)address data
                  : (NSArray *)data options
                  : (NSDictionary *)options resolver
                  : (RCTPromiseResolveBlock)resolve rejecter
                  : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(printImage
                  : (NSString *)address imagePath
                  : (NSString *)imagePath options
                  : (NSDictionary *)options resolver
                  : (RCTPromiseResolveBlock)resolve rejecter
                  : (RCTPromiseRejectBlock)reject)

@end