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

import NitroModules

/// See ``HybridQuantityTypeModuleSpec``
public protocol HybridQuantityTypeModuleSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func isQuantityCompatibleWithUnit(identifier: QuantityTypeIdentifier, unit: String) throws -> Bool
  func aggregationStyle(identifier: QuantityTypeIdentifier) throws -> AggregationStyle
  func saveQuantitySample(identifier: QuantityTypeIdentifierWriteable, unit: String, value: Double, start: Date, end: Date, metadata: AnyMap?) throws -> Promise<QuantitySample?>
  func queryQuantitySamples(identifier: QuantityTypeIdentifier, options: QueryOptionsWithSortOrderAndStringUnit) throws -> Promise<[QuantitySample]>
  func queryStatisticsForQuantity(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], options: StatisticsQueryOptionsWithStringUnit?) throws -> Promise<QueryStatisticsResponse>
  func queryStatisticsCollectionForQuantity(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], anchorDate: Date, intervalComponents: IntervalComponents, options: StatisticsQueryOptionsWithStringUnit?) throws -> Promise<[QueryStatisticsResponse]>
  func queryStatisticsForQuantitySeparateBySource(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], options: StatisticsQueryOptionsWithStringUnit?) throws -> Promise<[QueryStatisticsResponseFromSingleSource]>
  func queryStatisticsCollectionForQuantitySeparateBySource(identifier: QuantityTypeIdentifier, statistics: [StatisticsOptions], anchorDate: Date, intervalComponents: IntervalComponents, options: StatisticsQueryOptionsWithStringUnit?) throws -> Promise<[QueryStatisticsResponseFromSingleSource]>
  func queryQuantitySamplesWithAnchor(identifier: QuantityTypeIdentifier, options: QueryOptionsWithAnchorAndStringUnit) throws -> Promise<QuantitySamplesWithAnchorResponse>
}

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

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

/**
 * A Swift base-protocol representing the QuantityTypeModule HybridObject.
 * Implement this protocol to create Swift-based instances of QuantityTypeModule.
 * ```swift
 * class HybridQuantityTypeModule : HybridQuantityTypeModuleSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridQuantityTypeModuleSpec = HybridQuantityTypeModuleSpec_protocol & HybridQuantityTypeModuleSpec_base
