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

import NitroModules

/// See ``HybridViewModelInstanceSpec``
public protocol HybridViewModelInstanceSpec_protocol: HybridObject {
  // Properties
  var instanceName: String { get }

  // Methods
  func numberProperty(path: String) throws -> (any HybridViewModelNumberPropertySpec)?
  func stringProperty(path: String) throws -> (any HybridViewModelStringPropertySpec)?
  func booleanProperty(path: String) throws -> (any HybridViewModelBooleanPropertySpec)?
  func colorProperty(path: String) throws -> (any HybridViewModelColorPropertySpec)?
  func enumProperty(path: String) throws -> (any HybridViewModelEnumPropertySpec)?
  func triggerProperty(path: String) throws -> (any HybridViewModelTriggerPropertySpec)?
  func imageProperty(path: String) throws -> (any HybridViewModelImagePropertySpec)?
  func listProperty(path: String) throws -> (any HybridViewModelListPropertySpec)?
  func artboardProperty(path: String) throws -> (any HybridViewModelArtboardPropertySpec)?
  func viewModel(path: String) throws -> (any HybridViewModelInstanceSpec)?
  func viewModelAsync(path: String) throws -> Promise<(any HybridViewModelInstanceSpec)?>
  func replaceViewModel(path: String, instance: (any HybridViewModelInstanceSpec)) throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the ViewModelInstance HybridObject.
 * Implement this protocol to create Swift-based instances of ViewModelInstance.
 * ```swift
 * class HybridViewModelInstance : HybridViewModelInstanceSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridViewModelInstanceSpec = HybridViewModelInstanceSpec_protocol & HybridViewModelInstanceSpec_base
