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

import NitroModules

/// See ``HybridViewModelColorPropertySpec``
public protocol HybridViewModelColorPropertySpec_protocol: HybridObject, HybridViewModelPropertySpec_protocol {
  // Properties
  var value: Double { get set }

  // Methods
  func getValueAsync() throws -> Promise<Double>
  func set(value: Double) throws -> Void
  func addListener(onChanged: @escaping (_ value: Double) -> Void) throws -> () -> Void
  func removeListeners() throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the ViewModelColorProperty HybridObject.
 * Implement this protocol to create Swift-based instances of ViewModelColorProperty.
 * ```swift
 * class HybridViewModelColorProperty : HybridViewModelColorPropertySpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridViewModelColorPropertySpec = HybridViewModelColorPropertySpec_protocol & HybridViewModelColorPropertySpec_base
