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

import NitroModules

/// See ``HybridOneContactsSpec``
public protocol HybridOneContactsSpec_protocol: HybridObject {
  // Properties


  // Methods
  func getPermissionStatus() throws -> ContactsPermissionStatus
  func requestPermission() throws -> Promise<ContactsPermissionStatus>
  func pickContact() throws -> Promise<ContactInfo?>
  func search(name: String, limit: Double) throws -> Promise<[ContactInfo]>
  func create(input: ContactInput) throws -> Promise<String>
  func update(identifier: String, changes: ContactChanges) throws -> Promise<ContactInfo>
  func remove(identifier: String) throws -> Promise<Void>
}

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

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

/**
 * A Swift base-protocol representing the OneContacts HybridObject.
 * Implement this protocol to create Swift-based instances of OneContacts.
 * ```swift
 * class HybridOneContacts : HybridOneContactsSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridOneContactsSpec = HybridOneContactsSpec_protocol & HybridOneContactsSpec_base
