///
/// HybridMunimBluetoothSpec.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

import Foundation
import NitroModules

/// See ``HybridMunimBluetoothSpec``
public protocol HybridMunimBluetoothSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func startAdvertising(options: AdvertisingOptions) throws -> Void
  func updateAdvertisingData(advertisingData: AdvertisingDataTypes) throws -> Void
  func getAdvertisingData() throws -> Promise<AdvertisingDataTypes>
  func stopAdvertising() throws -> Void
  func setServices(services: [GATTService]) throws -> Void
  func isBluetoothEnabled() throws -> Promise<Bool>
  func requestBluetoothPermission() throws -> Promise<Bool>
  func startScan(options: ScanOptions?) throws -> Void
  func stopScan() throws -> Void
  func connect(deviceId: String) throws -> Promise<Void>
  func disconnect(deviceId: String) throws -> Void
  func discoverServices(deviceId: String) throws -> Promise<[GATTService]>
  func readCharacteristic(deviceId: String, serviceUUID: String, characteristicUUID: String) throws -> Promise<CharacteristicValue>
  func writeCharacteristic(deviceId: String, serviceUUID: String, characteristicUUID: String, value: String, writeType: WriteType?) throws -> Promise<Void>
  func subscribeToCharacteristic(deviceId: String, serviceUUID: String, characteristicUUID: String) throws -> Void
  func unsubscribeFromCharacteristic(deviceId: String, serviceUUID: String, characteristicUUID: String) throws -> Void
  func getConnectedDevices() throws -> Promise<[String]>
  func readRSSI(deviceId: String) throws -> Promise<Double>
  func addListener(eventName: String) throws -> Void
  func removeListeners(count: Double) throws -> Void
}

public extension HybridMunimBluetoothSpec_protocol {
  /// Default implementation of ``HybridObject.toString``
  func toString() -> String {
    return "[HybridObject MunimBluetooth]"
  }
}

/// See ``HybridMunimBluetoothSpec``
open class HybridMunimBluetoothSpec_base: NSObject {
  private weak var cxxWrapper: HybridMunimBluetoothSpec_cxx? = nil
  public override init() {
    super.init()
  }
  public func getCxxWrapper() -> HybridMunimBluetoothSpec_cxx {
  #if DEBUG
    guard self is any HybridMunimBluetoothSpec else {
      fatalError("`self` is not a `HybridMunimBluetoothSpec`! Did you accidentally inherit from `HybridMunimBluetoothSpec_base` instead of `HybridMunimBluetoothSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridMunimBluetoothSpec_cxx(self as! any HybridMunimBluetoothSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
}

/**
 * A Swift base-protocol representing the MunimBluetooth HybridObject.
 * Implement this protocol to create Swift-based instances of MunimBluetooth.
 * ```swift
 * class HybridMunimBluetooth : HybridMunimBluetoothSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridMunimBluetoothSpec = HybridMunimBluetoothSpec_protocol & HybridMunimBluetoothSpec_base
