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

import NitroModules

/// See ``HybridAssetLoaderSpec``
public protocol HybridAssetLoaderSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func loadAsset(path: String) throws -> Promise<ArrayBuffer>
}

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

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

/**
 * A Swift base-protocol representing the AssetLoader HybridObject.
 * Implement this protocol to create Swift-based instances of AssetLoader.
 * ```swift
 * class HybridAssetLoader : HybridAssetLoaderSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridAssetLoaderSpec = HybridAssetLoaderSpec_protocol & HybridAssetLoaderSpec_base
