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

import NitroModules

/// See ``HybridNitroBackgroundTimerSpec``
public protocol HybridNitroBackgroundTimerSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func schedule(id: Double, delayMs: Double, kind: String, intervalMs: Double, group: String, driftPolicy: String, maxRuns: Double, correlationToken: Double, retryMaxAttempts: Double, retryInitialBackoffMs: Double, cancellationToken: String, tagMask: Double, policyProfile: String, callback: @escaping (_ id: Double) -> Void) throws -> Double
  func cancel(id: Double) throws -> Void
  func pauseGroup(group: String) throws -> Double
  func resumeGroup(group: String) throws -> Double
  func cancelGroup(group: String) throws -> Double
  func listActiveTimerIds() throws -> [Double]
  func getStatsJson() throws -> String
  func getPersistWireJson() throws -> String
  func restorePersistWireJson(wireJson: String) throws -> Void
  func setTimeout(id: Double, duration: Double, callback: @escaping (_ id: Double) -> Void) throws -> Double
  func clearTimeout(id: Double) throws -> Void
  func setInterval(id: Double, interval: Double, callback: @escaping (_ id: Double) -> Void) throws -> Double
  func clearInterval(id: Double) throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the NitroBackgroundTimer HybridObject.
 * Implement this protocol to create Swift-based instances of NitroBackgroundTimer.
 * ```swift
 * class HybridNitroBackgroundTimer : HybridNitroBackgroundTimerSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridNitroBackgroundTimerSpec = HybridNitroBackgroundTimerSpec_protocol & HybridNitroBackgroundTimerSpec_base
