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

import NitroModules

/// See ``HybridOneAppleAuthSpec``
public protocol HybridOneAppleAuthSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func isAvailable() throws -> Bool
  func signIn(options: AppleAuthSignInOptions) throws -> Promise<AppleAuthResult>
  func getCredentialState(user: String) throws -> Promise<AppleCredentialState>
}

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

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

/**
 * A Swift base-protocol representing the OneAppleAuth HybridObject.
 * Implement this protocol to create Swift-based instances of OneAppleAuth.
 * ```swift
 * class HybridOneAppleAuth : HybridOneAppleAuthSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneAppleAuthSpec = HybridOneAppleAuthSpec_protocol & HybridOneAppleAuthSpec_base
