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

#pragma once

// Forward declarations of C++ defined types
// Forward declaration of `AppleAuthCredential` to properly resolve imports.
namespace margelo::nitro::appleauth { struct AppleAuthCredential; }
// Forward declaration of `AppleAuthOperation` to properly resolve imports.
namespace margelo::nitro::appleauth { enum class AppleAuthOperation; }
// Forward declaration of `AppleAuthScopes` to properly resolve imports.
namespace margelo::nitro::appleauth { enum class AppleAuthScopes; }
// Forward declaration of `HybridAppleAuthSpec` to properly resolve imports.
namespace margelo::nitro::appleauth { class HybridAppleAuthSpec; }

// Forward declarations of Swift defined types
// Forward declaration of `HybridAppleAuthSpec_cxx` to properly resolve imports.
namespace AppleAuth { class HybridAppleAuthSpec_cxx; }

// Include C++ defined types
#include "AppleAuthCredential.hpp"
#include "AppleAuthOperation.hpp"
#include "AppleAuthScopes.hpp"
#include "HybridAppleAuthSpec.hpp"
#include <NitroModules/Promise.hpp>
#include <NitroModules/PromiseHolder.hpp>
#include <NitroModules/Result.hpp>
#include <exception>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <vector>

/**
 * Contains specialized versions of C++ templated types so they can be accessed from Swift,
 * as well as helper functions to interact with those C++ types from Swift.
 */
namespace margelo::nitro::appleauth::bridge::swift {

  // pragma MARK: std::optional<std::string>
  /**
   * Specialized version of `std::optional<std::string>`.
   */
  using std__optional_std__string_ = std::optional<std::string>;
  inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) {
    return std::optional<std::string>(value);
  }
  
  // pragma MARK: std::optional<AppleAuthCredential>
  /**
   * Specialized version of `std::optional<AppleAuthCredential>`.
   */
  using std__optional_AppleAuthCredential_ = std::optional<AppleAuthCredential>;
  inline std::optional<AppleAuthCredential> create_std__optional_AppleAuthCredential_(const AppleAuthCredential& value) {
    return std::optional<AppleAuthCredential>(value);
  }
  
  // pragma MARK: std::shared_ptr<Promise<std::optional<AppleAuthCredential>>>
  /**
   * Specialized version of `std::shared_ptr<Promise<std::optional<AppleAuthCredential>>>`.
   */
  using std__shared_ptr_Promise_std__optional_AppleAuthCredential___ = std::shared_ptr<Promise<std::optional<AppleAuthCredential>>>;
  inline std::shared_ptr<Promise<std::optional<AppleAuthCredential>>> create_std__shared_ptr_Promise_std__optional_AppleAuthCredential___() {
    return Promise<std::optional<AppleAuthCredential>>::create();
  }
  inline PromiseHolder<std::optional<AppleAuthCredential>> wrap_std__shared_ptr_Promise_std__optional_AppleAuthCredential___(std::shared_ptr<Promise<std::optional<AppleAuthCredential>>> promise) {
    return PromiseHolder<std::optional<AppleAuthCredential>>(std::move(promise));
  }
  
  // pragma MARK: std::function<void(const std::optional<AppleAuthCredential>& /* result */)>
  /**
   * Specialized version of `std::function<void(const std::optional<AppleAuthCredential>&)>`.
   */
  using Func_void_std__optional_AppleAuthCredential_ = std::function<void(const std::optional<AppleAuthCredential>& /* result */)>;
  /**
   * Wrapper class for a `std::function<void(const std::optional<AppleAuthCredential>& / * result * /)>`, this can be used from Swift.
   */
  class Func_void_std__optional_AppleAuthCredential__Wrapper final {
  public:
    explicit Func_void_std__optional_AppleAuthCredential__Wrapper(std::function<void(const std::optional<AppleAuthCredential>& /* result */)>&& func): _function(std::make_shared<std::function<void(const std::optional<AppleAuthCredential>& /* result */)>>(std::move(func))) {}
    inline void call(std::optional<AppleAuthCredential> result) const {
      _function->operator()(result);
    }
  private:
    std::shared_ptr<std::function<void(const std::optional<AppleAuthCredential>& /* result */)>> _function;
  };
  Func_void_std__optional_AppleAuthCredential_ create_Func_void_std__optional_AppleAuthCredential_(void* _Nonnull swiftClosureWrapper);
  inline Func_void_std__optional_AppleAuthCredential__Wrapper wrap_Func_void_std__optional_AppleAuthCredential_(Func_void_std__optional_AppleAuthCredential_ value) {
    return Func_void_std__optional_AppleAuthCredential__Wrapper(std::move(value));
  }
  
  // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
  /**
   * Specialized version of `std::function<void(const std::exception_ptr&)>`.
   */
  using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
  /**
   * Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
   */
  class Func_void_std__exception_ptr_Wrapper final {
  public:
    explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_shared<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
    inline void call(std::exception_ptr error) const {
      _function->operator()(error);
    }
  private:
    std::shared_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
  };
  Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper);
  inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) {
    return Func_void_std__exception_ptr_Wrapper(std::move(value));
  }
  
  // pragma MARK: std::optional<AppleAuthOperation>
  /**
   * Specialized version of `std::optional<AppleAuthOperation>`.
   */
  using std__optional_AppleAuthOperation_ = std::optional<AppleAuthOperation>;
  inline std::optional<AppleAuthOperation> create_std__optional_AppleAuthOperation_(const AppleAuthOperation& value) {
    return std::optional<AppleAuthOperation>(value);
  }
  
  // pragma MARK: std::vector<AppleAuthScopes>
  /**
   * Specialized version of `std::vector<AppleAuthScopes>`.
   */
  using std__vector_AppleAuthScopes_ = std::vector<AppleAuthScopes>;
  inline std::vector<AppleAuthScopes> create_std__vector_AppleAuthScopes_(size_t size) {
    std::vector<AppleAuthScopes> vector;
    vector.reserve(size);
    return vector;
  }
  
  // pragma MARK: std::shared_ptr<margelo::nitro::appleauth::HybridAppleAuthSpec>
  /**
   * Specialized version of `std::shared_ptr<margelo::nitro::appleauth::HybridAppleAuthSpec>`.
   */
  using std__shared_ptr_margelo__nitro__appleauth__HybridAppleAuthSpec_ = std::shared_ptr<margelo::nitro::appleauth::HybridAppleAuthSpec>;
  std::shared_ptr<margelo::nitro::appleauth::HybridAppleAuthSpec> create_std__shared_ptr_margelo__nitro__appleauth__HybridAppleAuthSpec_(void* _Nonnull swiftUnsafePointer);
  void* _Nonnull get_std__shared_ptr_margelo__nitro__appleauth__HybridAppleAuthSpec_(std__shared_ptr_margelo__nitro__appleauth__HybridAppleAuthSpec_ cppType);
  
  // pragma MARK: std::weak_ptr<margelo::nitro::appleauth::HybridAppleAuthSpec>
  using std__weak_ptr_margelo__nitro__appleauth__HybridAppleAuthSpec_ = std::weak_ptr<margelo::nitro::appleauth::HybridAppleAuthSpec>;
  inline std__weak_ptr_margelo__nitro__appleauth__HybridAppleAuthSpec_ weakify_std__shared_ptr_margelo__nitro__appleauth__HybridAppleAuthSpec_(const std::shared_ptr<margelo::nitro::appleauth::HybridAppleAuthSpec>& strong) { return strong; }
  
  // pragma MARK: Result<std::shared_ptr<Promise<std::optional<AppleAuthCredential>>>>
  using Result_std__shared_ptr_Promise_std__optional_AppleAuthCredential____ = Result<std::shared_ptr<Promise<std::optional<AppleAuthCredential>>>>;
  inline Result_std__shared_ptr_Promise_std__optional_AppleAuthCredential____ create_Result_std__shared_ptr_Promise_std__optional_AppleAuthCredential____(const std::shared_ptr<Promise<std::optional<AppleAuthCredential>>>& value) {
    return Result<std::shared_ptr<Promise<std::optional<AppleAuthCredential>>>>::withValue(value);
  }
  inline Result_std__shared_ptr_Promise_std__optional_AppleAuthCredential____ create_Result_std__shared_ptr_Promise_std__optional_AppleAuthCredential____(const std::exception_ptr& error) {
    return Result<std::shared_ptr<Promise<std::optional<AppleAuthCredential>>>>::withError(error);
  }

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