///
/// HybridNitroKeyEventSpec.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 ``HybridNitroKeyEventSpec``
public protocol HybridNitroKeyEventSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func onKeyDownListener(callback: @escaping (_ keyEvent: KeyEventData) -> Void) throws -> Void
  func onKeyUpListener(callback: @escaping (_ keyEvent: KeyEventData) -> Void) throws -> Void
}

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

/**
 * A Swift base-protocol representing the NitroKeyEvent HybridObject.
 * Implement this protocol to create Swift-based instances of NitroKeyEvent.
 * ```swift
 * class HybridNitroKeyEvent : HybridNitroKeyEventSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridNitroKeyEventSpec = HybridNitroKeyEventSpec_protocol & HybridNitroKeyEventSpec_base
