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

import Foundation
import NitroModules

/// See ``HybridNitroScreenRecorderSpec``
public protocol HybridNitroScreenRecorderSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func getCameraPermissionStatus() throws -> PermissionStatus
  func getMicrophonePermissionStatus() throws -> PermissionStatus
  func requestCameraPermission() throws -> Promise<PermissionResponse>
  func requestMicrophonePermission() throws -> Promise<PermissionResponse>
  func addScreenRecordingListener(callback: @escaping (_ event: ScreenRecordingEvent) -> Void) throws -> Double
  func removeScreenRecordingListener(id: Double) throws -> Void
  func startInAppRecording(enableMic: Bool, enableCamera: Bool, cameraPreviewStyle: RecorderCameraStyle, cameraDevice: CameraDevice, onRecordingFinished: @escaping (_ file: ScreenRecordingFile) -> Void) throws -> Void
  func stopInAppRecording() throws -> Promise<ScreenRecordingFile?>
  func cancelInAppRecording() throws -> Promise<Void>
  func startGlobalRecording(enableMic: Bool, onRecordingError: @escaping (_ error: RecordingError) -> Void) throws -> Void
  func stopGlobalRecording(settledTimeMs: Double) throws -> Promise<ScreenRecordingFile?>
  func retrieveLastGlobalRecording() throws -> ScreenRecordingFile?
  func addBroadcastPickerListener(callback: @escaping (_ event: BroadcastPickerPresentationEvent) -> Void) throws -> Double
  func removeBroadcastPickerListener(id: Double) throws -> Void
  func clearRecordingCache() throws -> Void
}

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

/**
 * A Swift base-protocol representing the NitroScreenRecorder HybridObject.
 * Implement this protocol to create Swift-based instances of NitroScreenRecorder.
 * ```swift
 * class HybridNitroScreenRecorder : HybridNitroScreenRecorderSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridNitroScreenRecorderSpec = HybridNitroScreenRecorderSpec_protocol & HybridNitroScreenRecorderSpec_base
