2020-04-23 21:17:50 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is auto-generated from a NativeModule spec file in js.
|
|
|
|
*
|
|
|
|
* This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules
|
|
|
|
* in a way that also verifies at compile time that the native module matches the interface required
|
|
|
|
* by the TurboModule JS spec.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2023-08-07 22:58:14 +03:00
|
|
|
#include <NativeModules.h>
|
2020-04-23 21:17:50 +03:00
|
|
|
#include <tuple>
|
|
|
|
|
|
|
|
namespace Microsoft::ReactNativeSpecs {
|
|
|
|
|
2023-10-06 00:38:33 +03:00
|
|
|
struct AppStateSpec_AppState {
|
|
|
|
std::string app_state;
|
2021-09-29 04:31:40 +03:00
|
|
|
};
|
|
|
|
|
2024-05-29 20:58:28 +03:00
|
|
|
struct AppStateSpec_AppStateConstants {
|
|
|
|
std::string initialAppState;
|
|
|
|
};
|
2023-08-07 22:58:14 +03:00
|
|
|
|
2024-05-29 20:58:28 +03:00
|
|
|
|
|
|
|
inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AppStateSpec_AppState*) noexcept {
|
2023-08-07 22:58:14 +03:00
|
|
|
winrt::Microsoft::ReactNative::FieldMap fieldMap {
|
2024-05-29 20:58:28 +03:00
|
|
|
{L"app_state", &AppStateSpec_AppState::app_state},
|
2023-08-07 22:58:14 +03:00
|
|
|
};
|
|
|
|
return fieldMap;
|
|
|
|
}
|
|
|
|
|
2024-05-29 20:58:28 +03:00
|
|
|
inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AppStateSpec_AppStateConstants*) noexcept {
|
2023-08-07 22:58:14 +03:00
|
|
|
winrt::Microsoft::ReactNative::FieldMap fieldMap {
|
2024-05-29 20:58:28 +03:00
|
|
|
{L"initialAppState", &AppStateSpec_AppStateConstants::initialAppState},
|
2023-08-07 22:58:14 +03:00
|
|
|
};
|
|
|
|
return fieldMap;
|
|
|
|
}
|
|
|
|
|
2020-04-23 21:17:50 +03:00
|
|
|
struct AppStateSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
|
|
|
|
static constexpr auto methods = std::tuple{
|
2023-10-06 00:38:33 +03:00
|
|
|
Method<void(Callback<AppStateSpec_AppState>, Callback<::React::JSValue>) noexcept>{0, L"getCurrentAppState"},
|
2020-04-23 21:17:50 +03:00
|
|
|
Method<void(std::string) noexcept>{1, L"addListener"},
|
|
|
|
Method<void(double) noexcept>{2, L"removeListeners"},
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class TModule>
|
|
|
|
static constexpr void ValidateModule() noexcept {
|
|
|
|
constexpr auto methodCheckResults = CheckMethods<TModule, AppStateSpec>();
|
|
|
|
|
|
|
|
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
|
|
0,
|
|
|
|
"getCurrentAppState",
|
2023-10-06 00:38:33 +03:00
|
|
|
" REACT_METHOD(getCurrentAppState) void getCurrentAppState(std::function<void(AppStateSpec_AppState const &)> const & success, std::function<void(::React::JSValue const &)> const & error) noexcept { /* implementation */ }\n"
|
|
|
|
" REACT_METHOD(getCurrentAppState) static void getCurrentAppState(std::function<void(AppStateSpec_AppState const &)> const & success, std::function<void(::React::JSValue const &)> const & error) noexcept { /* implementation */ }\n");
|
2020-04-23 21:17:50 +03:00
|
|
|
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
|
|
1,
|
|
|
|
"addListener",
|
2022-10-07 04:28:42 +03:00
|
|
|
" REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n"
|
|
|
|
" REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n");
|
2020-04-23 21:17:50 +03:00
|
|
|
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
|
|
2,
|
|
|
|
"removeListeners",
|
2022-10-07 04:28:42 +03:00
|
|
|
" REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n"
|
|
|
|
" REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n");
|
2020-04-23 21:17:50 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Microsoft::ReactNativeSpecs
|