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

import NitroModules

/// See ``HybridOneLightSensorSpec``
public protocol HybridOneLightSensorSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func isAvailable() throws -> Bool
  func setUpdateInterval(intervalMs: Double) throws -> Void
  func addListener(listener: @escaping (_ event: LightSensorMeasurement) -> Void) throws -> () -> Void
}

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

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

/**
 * A Swift base-protocol representing the OneLightSensor HybridObject.
 * Implement this protocol to create Swift-based instances of OneLightSensor.
 * ```swift
 * class HybridOneLightSensor : HybridOneLightSensorSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneLightSensorSpec = HybridOneLightSensorSpec_protocol & HybridOneLightSensorSpec_base
