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

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

// Include C++ implementation defined types
#include "HybridLunarDatePickerSpecSwift.hpp"
#include "LunarDatePicker-Swift-Cxx-Umbrella.hpp"
#include <NitroModules/NitroDefines.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* NON_NULL swiftClosureWrapper) noexcept {
    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::shared_ptr<HybridLunarDatePickerSpec>
  std::shared_ptr<HybridLunarDatePickerSpec> create_std__shared_ptr_HybridLunarDatePickerSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    LunarDatePicker::HybridLunarDatePickerSpec_cxx swiftPart = LunarDatePicker::HybridLunarDatePickerSpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::lunardatepicker::HybridLunarDatePickerSpecSwift>(swiftPart);
  }
  void* NON_NULL get_std__shared_ptr_HybridLunarDatePickerSpec_(std__shared_ptr_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
