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

import NitroModules

/// See ``HybridRiveFileSpec``
public protocol HybridRiveFileSpec_protocol: HybridObject {
  // Properties
  var viewModelCount: Double? { get }
  var artboardCount: Double { get }
  var artboardNames: [String] { get }

  // Methods
  func viewModelByIndex(index: Double) throws -> (any HybridViewModelSpec)?
  func viewModelByName(name: String) throws -> (any HybridViewModelSpec)?
  func defaultArtboardViewModel(artboardBy: ArtboardBy?) throws -> (any HybridViewModelSpec)?
  func updateReferencedAssets(referencedAssets: ReferencedAssetsType) throws -> Void
  func getViewModelNamesAsync() throws -> Promise<[String]>
  func viewModelByNameAsync(name: String, validate: Bool?) throws -> Promise<(any HybridViewModelSpec)?>
  func defaultArtboardViewModelAsync(artboardBy: ArtboardBy?) throws -> Promise<(any HybridViewModelSpec)?>
  func getArtboardCountAsync() throws -> Promise<Double>
  func getArtboardNamesAsync() throws -> Promise<[String]>
  func getBindableArtboard(name: String) throws -> (any HybridBindableArtboardSpec)
}

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

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

/**
 * A Swift base-protocol representing the RiveFile HybridObject.
 * Implement this protocol to create Swift-based instances of RiveFile.
 * ```swift
 * class HybridRiveFile : HybridRiveFileSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridRiveFileSpec = HybridRiveFileSpec_protocol & HybridRiveFileSpec_base
