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

import NitroModules

/// See ``HybridOneBrightnessSpec``
public protocol HybridOneBrightnessSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func get() throws -> Promise<Double>
  func set(value: Double) throws -> Promise<Void>
  func getSystem() throws -> Promise<Double>
  func setSystem(value: Double) throws -> Promise<Void>
  func getSystemMode() throws -> Promise<BrightnessMode>
  func setSystemMode(mode: BrightnessMode) throws -> Promise<Void>
  func isUsingSystem() throws -> Promise<Bool>
  func restoreSystem() throws -> Promise<Void>
  func getPermissions() throws -> Promise<BrightnessPermissionResponse>
  func requestPermissions() throws -> Promise<BrightnessPermissionResponse>
  func isAvailable() throws -> Bool
  func addListener(listener: @escaping (_ event: BrightnessEvent) -> Void) throws -> () -> Void
}

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

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

/**
 * A Swift base-protocol representing the OneBrightness HybridObject.
 * Implement this protocol to create Swift-based instances of OneBrightness.
 * ```swift
 * class HybridOneBrightness : HybridOneBrightnessSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneBrightnessSpec = HybridOneBrightnessSpec_protocol & HybridOneBrightnessSpec_base
