///
/// LunarDatePicker-Swift-Cxx-Bridge.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

#include "LunarDatePicker-Swift-Cxx-Bridge.hpp"

// Include C++ implementation defined types
#include "HybridLunarDatePickerSpecSwift.hpp"
#include "LunarDatePicker-Swift-Cxx-Umbrella.hpp"

namespace margelo::nitro::lunardatepicker::bridge::swift {

  // pragma MARK: std::function<void(const LDP_Range& /* result */)>
  Func_void_LDP_Range create_Func_void_LDP_Range(void* _Nonnull swiftClosureWrapper) {
    auto swiftClosure = LunarDatePicker::Func_void_LDP_Range::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const LDP_Range& result) mutable -> void {
      swiftClosure.call(result);
    };
  }
  
  // pragma MARK: std::function<void(const std::string& /* month */)>
  Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper) {
    auto swiftClosure = LunarDatePicker::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const std::string& month) mutable -> void {
      swiftClosure.call(month);
    };
  }
  
  // pragma MARK: std::function<void(const std::string& /* date */, const std::vector<std::string>& /* currentlyVisibleMonths */)>
  Func_void_std__string_std__vector_std__string_ create_Func_void_std__string_std__vector_std__string_(void* _Nonnull swiftClosureWrapper) {
    auto swiftClosure = LunarDatePicker::Func_void_std__string_std__vector_std__string_::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const std::string& date, const std::vector<std::string>& currentlyVisibleMonths) mutable -> void {
      swiftClosure.call(date, currentlyVisibleMonths);
    };
  }
  
  // pragma MARK: std::shared_ptr<margelo::nitro::lunardatepicker::HybridLunarDatePickerSpec>
  std::shared_ptr<margelo::nitro::lunardatepicker::HybridLunarDatePickerSpec> create_std__shared_ptr_margelo__nitro__lunardatepicker__HybridLunarDatePickerSpec_(void* _Nonnull swiftUnsafePointer) {
    LunarDatePicker::HybridLunarDatePickerSpec_cxx swiftPart = LunarDatePicker::HybridLunarDatePickerSpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::lunardatepicker::HybridLunarDatePickerSpecSwift>(swiftPart);
  }
  void* _Nonnull get_std__shared_ptr_margelo__nitro__lunardatepicker__HybridLunarDatePickerSpec_(std__shared_ptr_margelo__nitro__lunardatepicker__HybridLunarDatePickerSpec_ cppType) {
    std::shared_ptr<margelo::nitro::lunardatepicker::HybridLunarDatePickerSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::lunardatepicker::HybridLunarDatePickerSpecSwift>(cppType);
  #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridLunarDatePickerSpec\" is not implemented in Swift!");
    }
  #endif
    LunarDatePicker::HybridLunarDatePickerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }

} // namespace margelo::nitro::lunardatepicker::bridge::swift
