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

import Foundation
import NitroModules

/// See ``HybridAlarmKitSpec``
public protocol HybridAlarmKitSpec_protocol: HybridObject {
  // Properties
  var isSupported: Bool { get }

  // Methods
  func getAuthorizationState() throws -> Promise<String>
  func requestAuthorization() throws -> Promise<Bool>
  func schedule(id: String, configJson: String) throws -> Promise<String>
  func cancel(id: String) throws -> Promise<Void>
  func stop(id: String) throws -> Promise<Void>
  func pause(id: String) throws -> Promise<Void>
  func resume(id: String) throws -> Promise<Void>
  func countdown(id: String) throws -> Promise<Void>
  func getAlarms() throws -> Promise<String>
  func addAlarmsListener(callback: @escaping (_ alarmsJson: String) -> Void) throws -> String
  func removeAlarmsListener(subscriptionId: String) throws -> Void
  func addAuthorizationListener(callback: @escaping (_ state: String) -> Void) throws -> String
  func removeAuthorizationListener(subscriptionId: String) throws -> Void
}

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

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

/**
 * A Swift base-protocol representing the AlarmKit HybridObject.
 * Implement this protocol to create Swift-based instances of AlarmKit.
 * ```swift
 * class HybridAlarmKit : HybridAlarmKitSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridAlarmKitSpec = HybridAlarmKitSpec_protocol & HybridAlarmKitSpec_base
