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

import Foundation
import NitroModules

/// See ``HybridReactNativeBundleUpdateSpec``
public protocol HybridReactNativeBundleUpdateSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func downloadBundle(params: BundleDownloadParams) throws -> Promise<BundleDownloadResult>
  func verifyBundle(params: BundleVerifyParams) throws -> Promise<Void>
  func verifyBundleASC(params: BundleVerifyASCParams) throws -> Promise<Void>
  func downloadBundleASC(params: BundleDownloadASCParams) throws -> Promise<Void>
  func installBundle(params: BundleInstallParams) throws -> Promise<Void>
  func clearDownload() throws -> Promise<Void>
  func clearBundle() throws -> Promise<Void>
  func clearAllJSBundleData() throws -> Promise<TestResult>
  func resetToBuiltInBundle() throws -> Promise<Void>
  func getFallbackUpdateBundleData() throws -> Promise<[FallbackBundleInfo]>
  func setCurrentUpdateBundleData(params: BundleSwitchParams) throws -> Promise<Void>
  func getWebEmbedPath() throws -> String
  func getWebEmbedPathAsync() throws -> Promise<String>
  func getJsBundlePath() throws -> String
  func getJsBundlePathAsync() throws -> Promise<String>
  func getBackgroundJsBundlePath() throws -> String
  func getBackgroundJsBundlePathAsync() throws -> Promise<String>
  func getNativeAppVersion() throws -> Promise<String>
  func getNativeBuildNumber() throws -> Promise<String>
  func getBuiltinBundleVersion() throws -> Promise<String>
  func testVerification() throws -> Promise<Bool>
  func testSkipVerification() throws -> Promise<Bool>
  func isSkipGpgVerificationAllowed() throws -> Bool
  func isBundleExists(appVersion: String, bundleVersion: String) throws -> Promise<Bool>
  func verifyExtractedBundle(appVersion: String, bundleVersion: String) throws -> Promise<Void>
  func listLocalBundles() throws -> Promise<[LocalBundleInfo]>
  func listAscFiles() throws -> Promise<[AscFileInfo]>
  func getSha256FromFilePath(filePath: String) throws -> Promise<String>
  func testDeleteJsBundle(appVersion: String, bundleVersion: String) throws -> Promise<TestResult>
  func testDeleteJsRuntimeDir(appVersion: String, bundleVersion: String) throws -> Promise<TestResult>
  func testDeleteMetadataJson(appVersion: String, bundleVersion: String) throws -> Promise<TestResult>
  func testWriteEmptyMetadataJson(appVersion: String, bundleVersion: String) throws -> Promise<TestResult>
  func addDownloadListener(callback: @escaping (_ event: BundleDownloadEvent) -> Void) throws -> Double
  func removeDownloadListener(id: Double) throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the ReactNativeBundleUpdate HybridObject.
 * Implement this protocol to create Swift-based instances of ReactNativeBundleUpdate.
 * ```swift
 * class HybridReactNativeBundleUpdate : HybridReactNativeBundleUpdateSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridReactNativeBundleUpdateSpec = HybridReactNativeBundleUpdateSpec_protocol & HybridReactNativeBundleUpdateSpec_base
