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

import Foundation
import NitroModules

/**
 * Represents an instance of `TTSGenerateOptions`, backed by a C++ struct.
 */
public typealias TTSGenerateOptions = margelo.nitro.mlxreactnative.TTSGenerateOptions

public extension TTSGenerateOptions {
  private typealias bridge = margelo.nitro.mlxreactnative.bridge.swift

  /**
   * Create a new instance of `TTSGenerateOptions`.
   */
  init(voice: String?, speed: Double?) {
    self.init({ () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = voice {
        return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = speed {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }())
  }

  var voice: String? {
    @inline(__always)
    get {
      return { () -> String? in
        if bridge.has_value_std__optional_std__string_(self.__voice) {
          let __unwrapped = bridge.get_std__optional_std__string_(self.__voice)
          return String(__unwrapped)
        } else {
          return nil
        }
      }()
    }
    @inline(__always)
    set {
      self.__voice = { () -> bridge.std__optional_std__string_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
        } else {
          return .init()
        }
      }()
    }
  }
  
  var speed: Double? {
    @inline(__always)
    get {
      return self.__speed.value
    }
    @inline(__always)
    set {
      self.__speed = { () -> bridge.std__optional_double_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_double_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    }
  }
}
