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

import Foundation
import NitroModules

/// See ``HybridInputStreamSpec``
public protocol HybridInputStreamSpec_protocol: AnyObject {
  // Properties
  

  // Methods
  func read() throws -> Promise<ArrayBufferHolder>
  func open() throws -> Void
  func close() throws -> Void
}

/// See ``HybridInputStreamSpec``
public class HybridInputStreamSpec_base: HybridObjectSpec {
  private weak var cxxWrapper: HybridInputStreamSpec_cxx? = nil
  public func getCxxWrapper() -> HybridInputStreamSpec_cxx {
  #if DEBUG
    guard self is HybridInputStreamSpec else {
      fatalError("`self` is not a `HybridInputStreamSpec`! Did you accidentally inherit from `HybridInputStreamSpec_base` instead of `HybridInputStreamSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridInputStreamSpec_cxx(self as! HybridInputStreamSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
  public var memorySize: Int { return 0 }
}

/**
 * A Swift base-protocol representing the InputStream HybridObject.
 * Implement this protocol to create Swift-based instances of InputStream.
 * ```swift
 * class HybridInputStream : HybridInputStreamSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridInputStreamSpec = HybridInputStreamSpec_protocol & HybridInputStreamSpec_base
