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

import NitroModules

/// See ``HybridRiveImageFactorySpec``
public protocol HybridRiveImageFactorySpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func loadFromURLAsync(url: String) throws -> Promise<(any HybridRiveImageSpec)>
  func loadFromResourceAsync(resource: String) throws -> Promise<(any HybridRiveImageSpec)>
  func loadFromBytesAsync(bytes: ArrayBuffer) throws -> Promise<(any HybridRiveImageSpec)>
}

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

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

/**
 * A Swift base-protocol representing the RiveImageFactory HybridObject.
 * Implement this protocol to create Swift-based instances of RiveImageFactory.
 * ```swift
 * class HybridRiveImageFactory : HybridRiveImageFactorySpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridRiveImageFactorySpec = HybridRiveImageFactorySpec_protocol & HybridRiveImageFactorySpec_base
