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

import NitroModules
import NitroImage

/// See ``HybridPhotoSpec``
public protocol HybridPhotoSpec_protocol: HybridObject {
  // Properties
  var isMirrored: Bool { get }
  var orientation: CameraOrientation { get }
  var timestamp: Double { get }
  var isRawPhoto: Bool { get }
  var width: Double { get }
  var height: Double { get }
  var containerFormat: PhotoContainerFormat { get }
  var hasPixelBuffer: Bool { get }
  var depth: (any HybridDepthSpec)? { get }
  var calibrationData: (any HybridCameraCalibrationDataSpec)? { get }

  // Methods
  func getPixelBuffer() throws -> ArrayBuffer
  func saveToFileAsync(path: String) throws -> Promise<Void>
  func saveToTemporaryFileAsync() throws -> Promise<String>
  func getFileData() throws -> ArrayBuffer
  func getFileDataAsync() throws -> Promise<ArrayBuffer>
  func toImage() throws -> (any HybridImageSpec)
  func toImageAsync() throws -> Promise<(any HybridImageSpec)>
}

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

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

/**
 * A Swift base-protocol representing the Photo HybridObject.
 * Implement this protocol to create Swift-based instances of Photo.
 * ```swift
 * class HybridPhoto : HybridPhotoSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridPhotoSpec = HybridPhotoSpec_protocol & HybridPhotoSpec_base
