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

import NitroModules

/// See ``HybridRiveFileFactorySpec``
public protocol HybridRiveFileFactorySpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func fromURL(url: String, loadCdn: Bool, referencedAssets: ReferencedAssetsType?) throws -> Promise<(any HybridRiveFileSpec)>
  func fromFileURL(fileURL: String, loadCdn: Bool, referencedAssets: ReferencedAssetsType?) throws -> Promise<(any HybridRiveFileSpec)>
  func fromResource(resource: String, loadCdn: Bool, referencedAssets: ReferencedAssetsType?) throws -> Promise<(any HybridRiveFileSpec)>
  func fromBytes(bytes: ArrayBuffer, loadCdn: Bool, referencedAssets: ReferencedAssetsType?) throws -> Promise<(any HybridRiveFileSpec)>
}

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

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

/**
 * A Swift base-protocol representing the RiveFileFactory HybridObject.
 * Implement this protocol to create Swift-based instances of RiveFileFactory.
 * ```swift
 * class HybridRiveFileFactory : HybridRiveFileFactorySpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridRiveFileFactorySpec = HybridRiveFileFactorySpec_protocol & HybridRiveFileFactorySpec_base
