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

import NitroModules

/// See ``HybridOneContactUISpec``
public protocol HybridOneContactUISpec_protocol: HybridObject {
  // Properties
  var contact: (any HybridNativeCNContactSpec) { get }
  var displayedPropertyKeys: [String]? { get set }
  var alternateName: String? { get set }
  var message: String? { get set }
  var allowsEditing: Bool { get set }
  var allowsActions: Bool { get set }
  var shouldShowLinkedContacts: Bool { get set }

  // Methods
  func descriptorForRequiredKeys() throws -> (any HybridNativeCNKeyDescriptorSpec)
  func configure(mode: ContactUIMode, contact: (any HybridNativeCNContactSpec)?) throws -> Void
  func getContactStore() throws -> (any HybridNativeCNContactStoreSpec)?
  func setContactStore(store: (any HybridNativeCNContactStoreSpec)?) throws -> Void
  func highlightProperty(withKey: String, identifier: String?) throws -> Void
  func present(animated: Bool, didComplete: @escaping (_ contact: (any HybridNativeCNContactSpec)?) -> Void) throws -> Promise<Void>
  func dismiss(animated: Bool) throws -> Promise<Void>
}

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

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

/**
 * A Swift base-protocol representing the OneContactUI HybridObject.
 * Implement this protocol to create Swift-based instances of OneContactUI.
 * ```swift
 * class HybridOneContactUI : HybridOneContactUISpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneContactUISpec = HybridOneContactUISpec_protocol & HybridOneContactUISpec_base
