From 037d5fcdb55d28f746be18105fa773119e85fbfa Mon Sep 17 00:00:00 2001 From: vineethkuttan Date: Tue, 14 Oct 2025 10:16:44 +0530 Subject: [PATCH 1/4] Removing Codegen files --- .ado/templates/prep-and-pack-nuget.yml | 2 +- vnext/.gitignore | 1 + vnext/codegen/.clang-format | 2 - vnext/codegen/NativeAccessibilityInfoSpec.g.h | 83 - .../NativeAccessibilityManagerSpec.g.h | 145 - .../codegen/NativeActionSheetManagerSpec.g.h | 122 - vnext/codegen/NativeAlertManagerSpec.g.h | 64 - vnext/codegen/NativeAnimatedModuleSpec.g.h | 201 - .../codegen/NativeAnimatedTurboModuleSpec.g.h | 201 - vnext/codegen/NativeAppStateSpec.g.h | 69 - vnext/codegen/NativeAppThemeSpec.g.h | 69 - vnext/codegen/NativeAppearanceSpec.g.h | 53 - vnext/codegen/NativeBlobModuleSpec.g.h | 78 - vnext/codegen/NativeBugReportingSpec.g.h | 41 - vnext/codegen/NativeClipboardSpec.g.h | 41 - vnext/codegen/NativeDOMSpec.g.h | 149 - vnext/codegen/NativeDevLoadingViewSpec.g.h | 41 - vnext/codegen/NativeDevMenuSpec.g.h | 53 - vnext/codegen/NativeDevSettingsSpec.g.h | 95 - .../codegen/NativeDeviceEventManagerSpec.g.h | 35 - vnext/codegen/NativeDeviceInfoSpec.g.h | 99 - .../NativeDialogManagerAndroidSpec.g.h | 87 - .../NativeDialogManagerWindowsSpec.g.h | 91 - vnext/codegen/NativeExceptionsManagerSpec.g.h | 97 - vnext/codegen/NativeFileReaderModuleSpec.g.h | 41 - vnext/codegen/NativeFrameRateLoggerSpec.g.h | 64 - .../NativeHeadlessJsTaskSupportSpec.g.h | 41 - vnext/codegen/NativeI18nManagerSpec.g.h | 62 - vnext/codegen/NativeIdleCallbacksSpec.g.h | 65 - vnext/codegen/NativeImageEditorSpec.g.h | 93 - .../codegen/NativeImageLoaderAndroidSpec.g.h | 72 - vnext/codegen/NativeImageLoaderIOSSpec.g.h | 72 - vnext/codegen/NativeImageStoreAndroidSpec.g.h | 35 - vnext/codegen/NativeImageStoreIOSSpec.g.h | 75 - vnext/codegen/NativeIntentAndroidSpec.g.h | 59 - .../NativeIntersectionObserverSpec.g.h | 113 - vnext/codegen/NativeJSCHeapCaptureSpec.g.h | 35 - vnext/codegen/NativeKeyboardObserverSpec.g.h | 41 - vnext/codegen/NativeLinkingManagerSpec.g.h | 65 - vnext/codegen/NativeLogBoxSpec.g.h | 41 - vnext/codegen/NativeMicrotasksSpec.g.h | 35 - vnext/codegen/NativeModalManagerSpec.g.h | 41 - vnext/codegen/NativeMutationObserverSpec.g.h | 91 - vnext/codegen/NativeNetworkingAndroidSpec.g.h | 59 - vnext/codegen/NativeNetworkingIOSSpec.g.h | 84 - vnext/codegen/NativePerformanceSpec.g.h | 207 - .../codegen/NativePermissionsAndroidSpec.g.h | 53 - .../NativePlatformConstantsAndroidSpec.g.h | 85 - .../NativePlatformConstantsIOSSpec.g.h | 73 - .../NativePlatformConstantsWindowsSpec.g.h | 82 - .../NativePushNotificationManagerIOSSpec.g.h | 194 - ...ReactDevToolsRuntimeSettingsModuleSpec.g.h | 67 - ...NativeReactDevToolsSettingsManagerSpec.g.h | 41 - .../NativeReactNativeFeatureFlagsSpec.g.h | 371 - vnext/codegen/NativeRedBoxSpec.g.h | 41 - vnext/codegen/NativeSampleTurboModuleSpec.g.h | 203 - vnext/codegen/NativeSegmentFetcherSpec.g.h | 41 - vnext/codegen/NativeSettingsManagerSpec.g.h | 62 - vnext/codegen/NativeShareModuleSpec.g.h | 59 - vnext/codegen/NativeSoundManagerSpec.g.h | 35 - vnext/codegen/NativeSourceCodeSpec.g.h | 42 - .../NativeStatusBarManagerAndroidSpec.g.h | 76 - .../codegen/NativeStatusBarManagerIOSSpec.g.h | 99 - vnext/codegen/NativeTimingSpec.g.h | 47 - vnext/codegen/NativeToastAndroidSpec.g.h | 76 - vnext/codegen/NativeUIManagerSpec.g.h | 155 - vnext/codegen/NativeVibrationSpec.g.h | 47 - vnext/codegen/NativeWebSocketModuleSpec.g.h | 82 - .../rnwcore/ActivityIndicatorView.g.h | 212 - .../rnwcore/AndroidDrawerLayout.g.h | 295 - .../AndroidHorizontalScrollContentView.g.h | 200 - .../components/rnwcore/AndroidProgressBar.g.h | 224 - .../rnwcore/AndroidSwipeRefreshLayout.g.h | 250 - .../components/rnwcore/AndroidSwitch.g.h | 267 - .../components/rnwcore/ComponentDescriptors.h | 30 - .../components/rnwcore/DebuggingOverlay.g.h | 234 - .../components/rnwcore/EventEmitters.cpp | 157 - .../react/components/rnwcore/EventEmitters.h | 194 - .../components/rnwcore/InputAccessory.g.h | 200 - .../components/rnwcore/ModalHostView.g.h | 291 - .../react/components/rnwcore/Props.cpp | 668 -- .../codegen/react/components/rnwcore/Props.h | 536 - .../components/rnwcore/PullToRefreshView.g.h | 246 - .../react/components/rnwcore/SafeAreaView.g.h | 197 - .../react/components/rnwcore/ShadowNodes.cpp | 23 - .../react/components/rnwcore/ShadowNodes.h | 98 - .../react/components/rnwcore/States.cpp | 16 - .../codegen/react/components/rnwcore/States.h | 32 - .../react/components/rnwcore/Switch.g.h | 263 - .../rnwcore/UnimplementedNativeView.g.h | 200 - .../react/components/rnwcore/VirtualView.g.h | 226 - vnext/codegen/rnwcoreJSI-generated.cpp | 3393 ------ vnext/codegen/rnwcoreJSI.h | 9414 ----------------- 93 files changed, 2 insertions(+), 23305 deletions(-) delete mode 100644 vnext/codegen/.clang-format delete mode 100644 vnext/codegen/NativeAccessibilityInfoSpec.g.h delete mode 100644 vnext/codegen/NativeAccessibilityManagerSpec.g.h delete mode 100644 vnext/codegen/NativeActionSheetManagerSpec.g.h delete mode 100644 vnext/codegen/NativeAlertManagerSpec.g.h delete mode 100644 vnext/codegen/NativeAnimatedModuleSpec.g.h delete mode 100644 vnext/codegen/NativeAnimatedTurboModuleSpec.g.h delete mode 100644 vnext/codegen/NativeAppStateSpec.g.h delete mode 100644 vnext/codegen/NativeAppThemeSpec.g.h delete mode 100644 vnext/codegen/NativeAppearanceSpec.g.h delete mode 100644 vnext/codegen/NativeBlobModuleSpec.g.h delete mode 100644 vnext/codegen/NativeBugReportingSpec.g.h delete mode 100644 vnext/codegen/NativeClipboardSpec.g.h delete mode 100644 vnext/codegen/NativeDOMSpec.g.h delete mode 100644 vnext/codegen/NativeDevLoadingViewSpec.g.h delete mode 100644 vnext/codegen/NativeDevMenuSpec.g.h delete mode 100644 vnext/codegen/NativeDevSettingsSpec.g.h delete mode 100644 vnext/codegen/NativeDeviceEventManagerSpec.g.h delete mode 100644 vnext/codegen/NativeDeviceInfoSpec.g.h delete mode 100644 vnext/codegen/NativeDialogManagerAndroidSpec.g.h delete mode 100644 vnext/codegen/NativeDialogManagerWindowsSpec.g.h delete mode 100644 vnext/codegen/NativeExceptionsManagerSpec.g.h delete mode 100644 vnext/codegen/NativeFileReaderModuleSpec.g.h delete mode 100644 vnext/codegen/NativeFrameRateLoggerSpec.g.h delete mode 100644 vnext/codegen/NativeHeadlessJsTaskSupportSpec.g.h delete mode 100644 vnext/codegen/NativeI18nManagerSpec.g.h delete mode 100644 vnext/codegen/NativeIdleCallbacksSpec.g.h delete mode 100644 vnext/codegen/NativeImageEditorSpec.g.h delete mode 100644 vnext/codegen/NativeImageLoaderAndroidSpec.g.h delete mode 100644 vnext/codegen/NativeImageLoaderIOSSpec.g.h delete mode 100644 vnext/codegen/NativeImageStoreAndroidSpec.g.h delete mode 100644 vnext/codegen/NativeImageStoreIOSSpec.g.h delete mode 100644 vnext/codegen/NativeIntentAndroidSpec.g.h delete mode 100644 vnext/codegen/NativeIntersectionObserverSpec.g.h delete mode 100644 vnext/codegen/NativeJSCHeapCaptureSpec.g.h delete mode 100644 vnext/codegen/NativeKeyboardObserverSpec.g.h delete mode 100644 vnext/codegen/NativeLinkingManagerSpec.g.h delete mode 100644 vnext/codegen/NativeLogBoxSpec.g.h delete mode 100644 vnext/codegen/NativeMicrotasksSpec.g.h delete mode 100644 vnext/codegen/NativeModalManagerSpec.g.h delete mode 100644 vnext/codegen/NativeMutationObserverSpec.g.h delete mode 100644 vnext/codegen/NativeNetworkingAndroidSpec.g.h delete mode 100644 vnext/codegen/NativeNetworkingIOSSpec.g.h delete mode 100644 vnext/codegen/NativePerformanceSpec.g.h delete mode 100644 vnext/codegen/NativePermissionsAndroidSpec.g.h delete mode 100644 vnext/codegen/NativePlatformConstantsAndroidSpec.g.h delete mode 100644 vnext/codegen/NativePlatformConstantsIOSSpec.g.h delete mode 100644 vnext/codegen/NativePlatformConstantsWindowsSpec.g.h delete mode 100644 vnext/codegen/NativePushNotificationManagerIOSSpec.g.h delete mode 100644 vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h delete mode 100644 vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h delete mode 100644 vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h delete mode 100644 vnext/codegen/NativeRedBoxSpec.g.h delete mode 100644 vnext/codegen/NativeSampleTurboModuleSpec.g.h delete mode 100644 vnext/codegen/NativeSegmentFetcherSpec.g.h delete mode 100644 vnext/codegen/NativeSettingsManagerSpec.g.h delete mode 100644 vnext/codegen/NativeShareModuleSpec.g.h delete mode 100644 vnext/codegen/NativeSoundManagerSpec.g.h delete mode 100644 vnext/codegen/NativeSourceCodeSpec.g.h delete mode 100644 vnext/codegen/NativeStatusBarManagerAndroidSpec.g.h delete mode 100644 vnext/codegen/NativeStatusBarManagerIOSSpec.g.h delete mode 100644 vnext/codegen/NativeTimingSpec.g.h delete mode 100644 vnext/codegen/NativeToastAndroidSpec.g.h delete mode 100644 vnext/codegen/NativeUIManagerSpec.g.h delete mode 100644 vnext/codegen/NativeVibrationSpec.g.h delete mode 100644 vnext/codegen/NativeWebSocketModuleSpec.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/ActivityIndicatorView.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/AndroidProgressBar.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/AndroidSwitch.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/ComponentDescriptors.h delete mode 100644 vnext/codegen/react/components/rnwcore/DebuggingOverlay.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/EventEmitters.cpp delete mode 100644 vnext/codegen/react/components/rnwcore/EventEmitters.h delete mode 100644 vnext/codegen/react/components/rnwcore/InputAccessory.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/ModalHostView.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/Props.cpp delete mode 100644 vnext/codegen/react/components/rnwcore/Props.h delete mode 100644 vnext/codegen/react/components/rnwcore/PullToRefreshView.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/SafeAreaView.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/ShadowNodes.cpp delete mode 100644 vnext/codegen/react/components/rnwcore/ShadowNodes.h delete mode 100644 vnext/codegen/react/components/rnwcore/States.cpp delete mode 100644 vnext/codegen/react/components/rnwcore/States.h delete mode 100644 vnext/codegen/react/components/rnwcore/Switch.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/UnimplementedNativeView.g.h delete mode 100644 vnext/codegen/react/components/rnwcore/VirtualView.g.h delete mode 100644 vnext/codegen/rnwcoreJSI-generated.cpp delete mode 100644 vnext/codegen/rnwcoreJSI.h diff --git a/.ado/templates/prep-and-pack-nuget.yml b/.ado/templates/prep-and-pack-nuget.yml index ddf38181084..45caf5b79d3 100644 --- a/.ado/templates/prep-and-pack-nuget.yml +++ b/.ado/templates/prep-and-pack-nuget.yml @@ -157,4 +157,4 @@ steps: packageVersion: ${{parameters.npmVersion}} buildProperties: CommitId=${{parameters.publishCommitId}};nugetroot=${{parameters.nugetroot}};baseconfiguration=$(baseConfiguration);baseplatform=$(basePlatform) codesignBinaries: ${{ parameters.signMicrosoft }} - codesignNuget: ${{ parameters.signMicrosoft }} + codesignNuget: ${{ parameters.signMicrosoft }} \ No newline at end of file diff --git a/vnext/.gitignore b/vnext/.gitignore index 0d24c1eb3f7..4f9a62a3029 100644 --- a/vnext/.gitignore +++ b/vnext/.gitignore @@ -74,6 +74,7 @@ Generated Files/ /WindowsSampleCSharpApp/obj/ /target/ /x64/ +/codegen/ Examples/WindowsSampleApp/Generated Files/ Examples/WindowsSampleApp/build Examples/TypeScript/Generated Files/ diff --git a/vnext/codegen/.clang-format b/vnext/codegen/.clang-format deleted file mode 100644 index a43d914ec38..00000000000 --- a/vnext/codegen/.clang-format +++ /dev/null @@ -1,2 +0,0 @@ -DisableFormat: true -SortIncludes: false \ No newline at end of file diff --git a/vnext/codegen/NativeAccessibilityInfoSpec.g.h b/vnext/codegen/NativeAccessibilityInfoSpec.g.h deleted file mode 100644 index d3988673998..00000000000 --- a/vnext/codegen/NativeAccessibilityInfoSpec.g.h +++ /dev/null @@ -1,83 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct AccessibilityInfoSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"isReduceMotionEnabled"}, - Method) noexcept>{1, L"isInvertColorsEnabled"}, - Method) noexcept>{2, L"isHighTextContrastEnabled"}, - Method) noexcept>{3, L"isTouchExplorationEnabled"}, - Method) noexcept>{4, L"isAccessibilityServiceEnabled"}, - Method{5, L"setAccessibilityFocus"}, - Method{6, L"announceForAccessibility"}, - Method) noexcept>{7, L"getRecommendedTimeoutMillis"}, - Method) noexcept>{8, L"isGrayscaleEnabled"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "isReduceMotionEnabled", - " REACT_METHOD(isReduceMotionEnabled) void isReduceMotionEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n" - " REACT_METHOD(isReduceMotionEnabled) static void isReduceMotionEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "isInvertColorsEnabled", - " REACT_METHOD(isInvertColorsEnabled) void isInvertColorsEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n" - " REACT_METHOD(isInvertColorsEnabled) static void isInvertColorsEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "isHighTextContrastEnabled", - " REACT_METHOD(isHighTextContrastEnabled) void isHighTextContrastEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n" - " REACT_METHOD(isHighTextContrastEnabled) static void isHighTextContrastEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "isTouchExplorationEnabled", - " REACT_METHOD(isTouchExplorationEnabled) void isTouchExplorationEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n" - " REACT_METHOD(isTouchExplorationEnabled) static void isTouchExplorationEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "isAccessibilityServiceEnabled", - " REACT_METHOD(isAccessibilityServiceEnabled) void isAccessibilityServiceEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n" - " REACT_METHOD(isAccessibilityServiceEnabled) static void isAccessibilityServiceEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "setAccessibilityFocus", - " REACT_METHOD(setAccessibilityFocus) void setAccessibilityFocus(double reactTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(setAccessibilityFocus) static void setAccessibilityFocus(double reactTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "announceForAccessibility", - " REACT_METHOD(announceForAccessibility) void announceForAccessibility(std::string announcement) noexcept { /* implementation */ }\n" - " REACT_METHOD(announceForAccessibility) static void announceForAccessibility(std::string announcement) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "getRecommendedTimeoutMillis", - " REACT_METHOD(getRecommendedTimeoutMillis) void getRecommendedTimeoutMillis(double mSec, std::function const & onSuccess) noexcept { /* implementation */ }\n" - " REACT_METHOD(getRecommendedTimeoutMillis) static void getRecommendedTimeoutMillis(double mSec, std::function const & onSuccess) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "isGrayscaleEnabled", - " REACT_METHOD(isGrayscaleEnabled) void isGrayscaleEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n" - " REACT_METHOD(isGrayscaleEnabled) static void isGrayscaleEnabled(std::function const & onSuccess) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeAccessibilityManagerSpec.g.h b/vnext/codegen/NativeAccessibilityManagerSpec.g.h deleted file mode 100644 index 3d8d9d73bb2..00000000000 --- a/vnext/codegen/NativeAccessibilityManagerSpec.g.h +++ /dev/null @@ -1,145 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers { - std::optional extraSmall; - std::optional small; - std::optional medium; - std::optional large; - std::optional extraLarge; - std::optional extraExtraLarge; - std::optional extraExtraExtraLarge; - std::optional accessibilityMedium; - std::optional accessibilityLarge; - std::optional accessibilityExtraLarge; - std::optional accessibilityExtraExtraLarge; - std::optional accessibilityExtraExtraExtraLarge; -}; - -struct AccessibilityManagerSpec_announceForAccessibilityWithOptions_options { - std::optional queue; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"extraSmall", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::extraSmall}, - {L"small", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::small}, - {L"medium", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::medium}, - {L"large", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::large}, - {L"extraLarge", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::extraLarge}, - {L"extraExtraLarge", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::extraExtraLarge}, - {L"extraExtraExtraLarge", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::extraExtraExtraLarge}, - {L"accessibilityMedium", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::accessibilityMedium}, - {L"accessibilityLarge", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::accessibilityLarge}, - {L"accessibilityExtraLarge", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::accessibilityExtraLarge}, - {L"accessibilityExtraExtraLarge", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::accessibilityExtraExtraLarge}, - {L"accessibilityExtraExtraExtraLarge", &AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers::accessibilityExtraExtraExtraLarge}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AccessibilityManagerSpec_announceForAccessibilityWithOptions_options*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"queue", &AccessibilityManagerSpec_announceForAccessibilityWithOptions_options::queue}, - }; - return fieldMap; -} - -struct AccessibilityManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method, Callback<::React::JSValue>) noexcept>{0, L"getCurrentBoldTextState"}, - Method, Callback<::React::JSValue>) noexcept>{1, L"getCurrentGrayscaleState"}, - Method, Callback<::React::JSValue>) noexcept>{2, L"getCurrentInvertColorsState"}, - Method, Callback<::React::JSValue>) noexcept>{3, L"getCurrentReduceMotionState"}, - Method, Callback<::React::JSValue>) noexcept>{4, L"getCurrentDarkerSystemColorsState"}, - Method, Callback<::React::JSValue>) noexcept>{5, L"getCurrentPrefersCrossFadeTransitionsState"}, - Method, Callback<::React::JSValue>) noexcept>{6, L"getCurrentReduceTransparencyState"}, - Method, Callback<::React::JSValue>) noexcept>{7, L"getCurrentVoiceOverState"}, - Method{8, L"setAccessibilityContentSizeMultipliers"}, - Method{9, L"setAccessibilityFocus"}, - Method{10, L"announceForAccessibility"}, - Method{11, L"announceForAccessibilityWithOptions"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getCurrentBoldTextState", - " REACT_METHOD(getCurrentBoldTextState) void getCurrentBoldTextState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentBoldTextState) static void getCurrentBoldTextState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getCurrentGrayscaleState", - " REACT_METHOD(getCurrentGrayscaleState) void getCurrentGrayscaleState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentGrayscaleState) static void getCurrentGrayscaleState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "getCurrentInvertColorsState", - " REACT_METHOD(getCurrentInvertColorsState) void getCurrentInvertColorsState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentInvertColorsState) static void getCurrentInvertColorsState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "getCurrentReduceMotionState", - " REACT_METHOD(getCurrentReduceMotionState) void getCurrentReduceMotionState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentReduceMotionState) static void getCurrentReduceMotionState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "getCurrentDarkerSystemColorsState", - " REACT_METHOD(getCurrentDarkerSystemColorsState) void getCurrentDarkerSystemColorsState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentDarkerSystemColorsState) static void getCurrentDarkerSystemColorsState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "getCurrentPrefersCrossFadeTransitionsState", - " REACT_METHOD(getCurrentPrefersCrossFadeTransitionsState) void getCurrentPrefersCrossFadeTransitionsState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentPrefersCrossFadeTransitionsState) static void getCurrentPrefersCrossFadeTransitionsState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "getCurrentReduceTransparencyState", - " REACT_METHOD(getCurrentReduceTransparencyState) void getCurrentReduceTransparencyState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentReduceTransparencyState) static void getCurrentReduceTransparencyState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "getCurrentVoiceOverState", - " REACT_METHOD(getCurrentVoiceOverState) void getCurrentVoiceOverState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentVoiceOverState) static void getCurrentVoiceOverState(std::function const & onSuccess, std::function const & onError) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "setAccessibilityContentSizeMultipliers", - " REACT_METHOD(setAccessibilityContentSizeMultipliers) void setAccessibilityContentSizeMultipliers(AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers && JSMultipliers) noexcept { /* implementation */ }\n" - " REACT_METHOD(setAccessibilityContentSizeMultipliers) static void setAccessibilityContentSizeMultipliers(AccessibilityManagerSpec_setAccessibilityContentSizeMultipliers_JSMultipliers && JSMultipliers) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "setAccessibilityFocus", - " REACT_METHOD(setAccessibilityFocus) void setAccessibilityFocus(double reactTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(setAccessibilityFocus) static void setAccessibilityFocus(double reactTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "announceForAccessibility", - " REACT_METHOD(announceForAccessibility) void announceForAccessibility(std::string announcement) noexcept { /* implementation */ }\n" - " REACT_METHOD(announceForAccessibility) static void announceForAccessibility(std::string announcement) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "announceForAccessibilityWithOptions", - " REACT_METHOD(announceForAccessibilityWithOptions) void announceForAccessibilityWithOptions(std::string announcement, AccessibilityManagerSpec_announceForAccessibilityWithOptions_options && options) noexcept { /* implementation */ }\n" - " REACT_METHOD(announceForAccessibilityWithOptions) static void announceForAccessibilityWithOptions(std::string announcement, AccessibilityManagerSpec_announceForAccessibilityWithOptions_options && options) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeActionSheetManagerSpec.g.h b/vnext/codegen/NativeActionSheetManagerSpec.g.h deleted file mode 100644 index 09fb149c492..00000000000 --- a/vnext/codegen/NativeActionSheetManagerSpec.g.h +++ /dev/null @@ -1,122 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ActionSheetManagerSpec_showActionSheetWithOptions_options { - std::optional title; - std::optional message; - std::optional> options; - std::optional> destructiveButtonIndices; - std::optional cancelButtonIndex; - std::optional anchor; - std::optional tintColor; - std::optional cancelButtonTintColor; - std::optional disabledButtonTintColor; - std::optional userInterfaceStyle; - std::optional> disabledButtonIndices; -}; - -struct ActionSheetManagerSpec_showShareActionSheetWithOptions_options { - std::optional message; - std::optional url; - std::optional subject; - std::optional anchor; - std::optional tintColor; - std::optional cancelButtonTintColor; - std::optional disabledButtonTintColor; - std::optional> excludedActivityTypes; - std::optional userInterfaceStyle; -}; - -struct ActionSheetManagerSpec_showShareActionSheetWithOptions_failureCallback_error { - std::string domain; - std::string code; - std::optional<::React::JSValue> userInfo; - std::string message; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ActionSheetManagerSpec_showActionSheetWithOptions_options*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"title", &ActionSheetManagerSpec_showActionSheetWithOptions_options::title}, - {L"message", &ActionSheetManagerSpec_showActionSheetWithOptions_options::message}, - {L"options", &ActionSheetManagerSpec_showActionSheetWithOptions_options::options}, - {L"destructiveButtonIndices", &ActionSheetManagerSpec_showActionSheetWithOptions_options::destructiveButtonIndices}, - {L"cancelButtonIndex", &ActionSheetManagerSpec_showActionSheetWithOptions_options::cancelButtonIndex}, - {L"anchor", &ActionSheetManagerSpec_showActionSheetWithOptions_options::anchor}, - {L"tintColor", &ActionSheetManagerSpec_showActionSheetWithOptions_options::tintColor}, - {L"cancelButtonTintColor", &ActionSheetManagerSpec_showActionSheetWithOptions_options::cancelButtonTintColor}, - {L"disabledButtonTintColor", &ActionSheetManagerSpec_showActionSheetWithOptions_options::disabledButtonTintColor}, - {L"userInterfaceStyle", &ActionSheetManagerSpec_showActionSheetWithOptions_options::userInterfaceStyle}, - {L"disabledButtonIndices", &ActionSheetManagerSpec_showActionSheetWithOptions_options::disabledButtonIndices}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ActionSheetManagerSpec_showShareActionSheetWithOptions_options*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"message", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::message}, - {L"url", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::url}, - {L"subject", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::subject}, - {L"anchor", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::anchor}, - {L"tintColor", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::tintColor}, - {L"cancelButtonTintColor", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::cancelButtonTintColor}, - {L"disabledButtonTintColor", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::disabledButtonTintColor}, - {L"excludedActivityTypes", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::excludedActivityTypes}, - {L"userInterfaceStyle", &ActionSheetManagerSpec_showShareActionSheetWithOptions_options::userInterfaceStyle}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ActionSheetManagerSpec_showShareActionSheetWithOptions_failureCallback_error*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"domain", &ActionSheetManagerSpec_showShareActionSheetWithOptions_failureCallback_error::domain}, - {L"code", &ActionSheetManagerSpec_showShareActionSheetWithOptions_failureCallback_error::code}, - {L"userInfo", &ActionSheetManagerSpec_showShareActionSheetWithOptions_failureCallback_error::userInfo}, - {L"message", &ActionSheetManagerSpec_showShareActionSheetWithOptions_failureCallback_error::message}, - }; - return fieldMap; -} - -struct ActionSheetManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"showActionSheetWithOptions"}, - Method, Callback>) noexcept>{1, L"showShareActionSheetWithOptions"}, - Method{2, L"dismissActionSheet"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "showActionSheetWithOptions", - " REACT_METHOD(showActionSheetWithOptions) void showActionSheetWithOptions(ActionSheetManagerSpec_showActionSheetWithOptions_options && options, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(showActionSheetWithOptions) static void showActionSheetWithOptions(ActionSheetManagerSpec_showActionSheetWithOptions_options && options, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "showShareActionSheetWithOptions", - " REACT_METHOD(showShareActionSheetWithOptions) void showShareActionSheetWithOptions(ActionSheetManagerSpec_showShareActionSheetWithOptions_options && options, std::function const & failureCallback, std::function)> const & successCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(showShareActionSheetWithOptions) static void showShareActionSheetWithOptions(ActionSheetManagerSpec_showShareActionSheetWithOptions_options && options, std::function const & failureCallback, std::function)> const & successCallback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "dismissActionSheet", - " REACT_METHOD(dismissActionSheet) void dismissActionSheet() noexcept { /* implementation */ }\n" - " REACT_METHOD(dismissActionSheet) static void dismissActionSheet() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeAlertManagerSpec.g.h b/vnext/codegen/NativeAlertManagerSpec.g.h deleted file mode 100644 index 507b416abb8..00000000000 --- a/vnext/codegen/NativeAlertManagerSpec.g.h +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct AlertManagerSpec_Args { - std::optional title; - std::optional message; - std::optional> buttons; - std::optional type; - std::optional defaultValue; - std::optional cancelButtonKey; - std::optional destructiveButtonKey; - std::optional preferredButtonKey; - std::optional keyboardType; - std::optional userInterfaceStyle; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AlertManagerSpec_Args*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"title", &AlertManagerSpec_Args::title}, - {L"message", &AlertManagerSpec_Args::message}, - {L"buttons", &AlertManagerSpec_Args::buttons}, - {L"type", &AlertManagerSpec_Args::type}, - {L"defaultValue", &AlertManagerSpec_Args::defaultValue}, - {L"cancelButtonKey", &AlertManagerSpec_Args::cancelButtonKey}, - {L"destructiveButtonKey", &AlertManagerSpec_Args::destructiveButtonKey}, - {L"preferredButtonKey", &AlertManagerSpec_Args::preferredButtonKey}, - {L"keyboardType", &AlertManagerSpec_Args::keyboardType}, - {L"userInterfaceStyle", &AlertManagerSpec_Args::userInterfaceStyle}, - }; - return fieldMap; -} - -struct AlertManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"alertWithArgs"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "alertWithArgs", - " REACT_METHOD(alertWithArgs) void alertWithArgs(AlertManagerSpec_Args && args, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(alertWithArgs) static void alertWithArgs(AlertManagerSpec_Args && args, std::function const & callback) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeAnimatedModuleSpec.g.h b/vnext/codegen/NativeAnimatedModuleSpec.g.h deleted file mode 100644 index ce1eea2a5ca..00000000000 --- a/vnext/codegen/NativeAnimatedModuleSpec.g.h +++ /dev/null @@ -1,201 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct AnimatedModuleSpec_EndResult { - bool finished; - std::optional value; - std::optional offset; -}; - -struct AnimatedModuleSpec_EventMapping { - std::vector nativeEventPath; - std::optional animatedValueTag; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AnimatedModuleSpec_EndResult*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"finished", &AnimatedModuleSpec_EndResult::finished}, - {L"value", &AnimatedModuleSpec_EndResult::value}, - {L"offset", &AnimatedModuleSpec_EndResult::offset}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AnimatedModuleSpec_EventMapping*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"nativeEventPath", &AnimatedModuleSpec_EventMapping::nativeEventPath}, - {L"animatedValueTag", &AnimatedModuleSpec_EventMapping::animatedValueTag}, - }; - return fieldMap; -} - -struct AnimatedModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"startOperationBatch"}, - Method{1, L"finishOperationBatch"}, - Method{2, L"createAnimatedNode"}, - Method{3, L"updateAnimatedNodeConfig"}, - Method) noexcept>{4, L"getValue"}, - Method{5, L"startListeningToAnimatedNodeValue"}, - Method{6, L"stopListeningToAnimatedNodeValue"}, - Method{7, L"connectAnimatedNodes"}, - Method{8, L"disconnectAnimatedNodes"}, - Method) noexcept>{9, L"startAnimatingNode"}, - Method{10, L"stopAnimation"}, - Method{11, L"setAnimatedNodeValue"}, - Method{12, L"setAnimatedNodeOffset"}, - Method{13, L"flattenAnimatedNodeOffset"}, - Method{14, L"extractAnimatedNodeOffset"}, - Method{15, L"connectAnimatedNodeToView"}, - Method{16, L"disconnectAnimatedNodeFromView"}, - Method{17, L"restoreDefaultValues"}, - Method{18, L"dropAnimatedNode"}, - Method{19, L"addAnimatedEventToView"}, - Method{20, L"removeAnimatedEventFromView"}, - Method{21, L"addListener"}, - Method{22, L"removeListeners"}, - Method{23, L"queueAndExecuteBatchedOperations"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "startOperationBatch", - " REACT_METHOD(startOperationBatch) void startOperationBatch() noexcept { /* implementation */ }\n" - " REACT_METHOD(startOperationBatch) static void startOperationBatch() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "finishOperationBatch", - " REACT_METHOD(finishOperationBatch) void finishOperationBatch() noexcept { /* implementation */ }\n" - " REACT_METHOD(finishOperationBatch) static void finishOperationBatch() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "createAnimatedNode", - " REACT_METHOD(createAnimatedNode) void createAnimatedNode(double tag, ::React::JSValue && config) noexcept { /* implementation */ }\n" - " REACT_METHOD(createAnimatedNode) static void createAnimatedNode(double tag, ::React::JSValue && config) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "updateAnimatedNodeConfig", - " REACT_METHOD(updateAnimatedNodeConfig) void updateAnimatedNodeConfig(double tag, ::React::JSValue && config) noexcept { /* implementation */ }\n" - " REACT_METHOD(updateAnimatedNodeConfig) static void updateAnimatedNodeConfig(double tag, ::React::JSValue && config) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "getValue", - " REACT_METHOD(getValue) void getValue(double tag, std::function const & saveValueCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getValue) static void getValue(double tag, std::function const & saveValueCallback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "startListeningToAnimatedNodeValue", - " REACT_METHOD(startListeningToAnimatedNodeValue) void startListeningToAnimatedNodeValue(double tag) noexcept { /* implementation */ }\n" - " REACT_METHOD(startListeningToAnimatedNodeValue) static void startListeningToAnimatedNodeValue(double tag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "stopListeningToAnimatedNodeValue", - " REACT_METHOD(stopListeningToAnimatedNodeValue) void stopListeningToAnimatedNodeValue(double tag) noexcept { /* implementation */ }\n" - " REACT_METHOD(stopListeningToAnimatedNodeValue) static void stopListeningToAnimatedNodeValue(double tag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "connectAnimatedNodes", - " REACT_METHOD(connectAnimatedNodes) void connectAnimatedNodes(double parentTag, double childTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(connectAnimatedNodes) static void connectAnimatedNodes(double parentTag, double childTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "disconnectAnimatedNodes", - " REACT_METHOD(disconnectAnimatedNodes) void disconnectAnimatedNodes(double parentTag, double childTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(disconnectAnimatedNodes) static void disconnectAnimatedNodes(double parentTag, double childTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "startAnimatingNode", - " REACT_METHOD(startAnimatingNode) void startAnimatingNode(double animationId, double nodeTag, ::React::JSValue && config, std::function const & endCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(startAnimatingNode) static void startAnimatingNode(double animationId, double nodeTag, ::React::JSValue && config, std::function const & endCallback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "stopAnimation", - " REACT_METHOD(stopAnimation) void stopAnimation(double animationId) noexcept { /* implementation */ }\n" - " REACT_METHOD(stopAnimation) static void stopAnimation(double animationId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "setAnimatedNodeValue", - " REACT_METHOD(setAnimatedNodeValue) void setAnimatedNodeValue(double nodeTag, double value) noexcept { /* implementation */ }\n" - " REACT_METHOD(setAnimatedNodeValue) static void setAnimatedNodeValue(double nodeTag, double value) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "setAnimatedNodeOffset", - " REACT_METHOD(setAnimatedNodeOffset) void setAnimatedNodeOffset(double nodeTag, double offset) noexcept { /* implementation */ }\n" - " REACT_METHOD(setAnimatedNodeOffset) static void setAnimatedNodeOffset(double nodeTag, double offset) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "flattenAnimatedNodeOffset", - " REACT_METHOD(flattenAnimatedNodeOffset) void flattenAnimatedNodeOffset(double nodeTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(flattenAnimatedNodeOffset) static void flattenAnimatedNodeOffset(double nodeTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "extractAnimatedNodeOffset", - " REACT_METHOD(extractAnimatedNodeOffset) void extractAnimatedNodeOffset(double nodeTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(extractAnimatedNodeOffset) static void extractAnimatedNodeOffset(double nodeTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "connectAnimatedNodeToView", - " REACT_METHOD(connectAnimatedNodeToView) void connectAnimatedNodeToView(double nodeTag, double viewTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(connectAnimatedNodeToView) static void connectAnimatedNodeToView(double nodeTag, double viewTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "disconnectAnimatedNodeFromView", - " REACT_METHOD(disconnectAnimatedNodeFromView) void disconnectAnimatedNodeFromView(double nodeTag, double viewTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(disconnectAnimatedNodeFromView) static void disconnectAnimatedNodeFromView(double nodeTag, double viewTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "restoreDefaultValues", - " REACT_METHOD(restoreDefaultValues) void restoreDefaultValues(double nodeTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(restoreDefaultValues) static void restoreDefaultValues(double nodeTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 18, - "dropAnimatedNode", - " REACT_METHOD(dropAnimatedNode) void dropAnimatedNode(double tag) noexcept { /* implementation */ }\n" - " REACT_METHOD(dropAnimatedNode) static void dropAnimatedNode(double tag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 19, - "addAnimatedEventToView", - " REACT_METHOD(addAnimatedEventToView) void addAnimatedEventToView(double viewTag, std::string eventName, AnimatedModuleSpec_EventMapping && eventMapping) noexcept { /* implementation */ }\n" - " REACT_METHOD(addAnimatedEventToView) static void addAnimatedEventToView(double viewTag, std::string eventName, AnimatedModuleSpec_EventMapping && eventMapping) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 20, - "removeAnimatedEventFromView", - " REACT_METHOD(removeAnimatedEventFromView) void removeAnimatedEventFromView(double viewTag, std::string eventName, double animatedNodeTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeAnimatedEventFromView) static void removeAnimatedEventFromView(double viewTag, std::string eventName, double animatedNodeTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 21, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 22, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 23, - "queueAndExecuteBatchedOperations", - " REACT_METHOD(queueAndExecuteBatchedOperations) void queueAndExecuteBatchedOperations(::React::JSValueArray && operationsAndArgs) noexcept { /* implementation */ }\n" - " REACT_METHOD(queueAndExecuteBatchedOperations) static void queueAndExecuteBatchedOperations(::React::JSValueArray && operationsAndArgs) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeAnimatedTurboModuleSpec.g.h b/vnext/codegen/NativeAnimatedTurboModuleSpec.g.h deleted file mode 100644 index 7bf019e7ab6..00000000000 --- a/vnext/codegen/NativeAnimatedTurboModuleSpec.g.h +++ /dev/null @@ -1,201 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct AnimatedTurboModuleSpec_EndResult { - bool finished; - std::optional value; - std::optional offset; -}; - -struct AnimatedTurboModuleSpec_EventMapping { - std::vector nativeEventPath; - std::optional animatedValueTag; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AnimatedTurboModuleSpec_EndResult*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"finished", &AnimatedTurboModuleSpec_EndResult::finished}, - {L"value", &AnimatedTurboModuleSpec_EndResult::value}, - {L"offset", &AnimatedTurboModuleSpec_EndResult::offset}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AnimatedTurboModuleSpec_EventMapping*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"nativeEventPath", &AnimatedTurboModuleSpec_EventMapping::nativeEventPath}, - {L"animatedValueTag", &AnimatedTurboModuleSpec_EventMapping::animatedValueTag}, - }; - return fieldMap; -} - -struct AnimatedTurboModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"startOperationBatch"}, - Method{1, L"finishOperationBatch"}, - Method{2, L"createAnimatedNode"}, - Method{3, L"updateAnimatedNodeConfig"}, - Method) noexcept>{4, L"getValue"}, - Method{5, L"startListeningToAnimatedNodeValue"}, - Method{6, L"stopListeningToAnimatedNodeValue"}, - Method{7, L"connectAnimatedNodes"}, - Method{8, L"disconnectAnimatedNodes"}, - Method) noexcept>{9, L"startAnimatingNode"}, - Method{10, L"stopAnimation"}, - Method{11, L"setAnimatedNodeValue"}, - Method{12, L"setAnimatedNodeOffset"}, - Method{13, L"flattenAnimatedNodeOffset"}, - Method{14, L"extractAnimatedNodeOffset"}, - Method{15, L"connectAnimatedNodeToView"}, - Method{16, L"disconnectAnimatedNodeFromView"}, - Method{17, L"restoreDefaultValues"}, - Method{18, L"dropAnimatedNode"}, - Method{19, L"addAnimatedEventToView"}, - Method{20, L"removeAnimatedEventFromView"}, - Method{21, L"addListener"}, - Method{22, L"removeListeners"}, - Method{23, L"queueAndExecuteBatchedOperations"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "startOperationBatch", - " REACT_METHOD(startOperationBatch) void startOperationBatch() noexcept { /* implementation */ }\n" - " REACT_METHOD(startOperationBatch) static void startOperationBatch() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "finishOperationBatch", - " REACT_METHOD(finishOperationBatch) void finishOperationBatch() noexcept { /* implementation */ }\n" - " REACT_METHOD(finishOperationBatch) static void finishOperationBatch() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "createAnimatedNode", - " REACT_METHOD(createAnimatedNode) void createAnimatedNode(double tag, ::React::JSValue && config) noexcept { /* implementation */ }\n" - " REACT_METHOD(createAnimatedNode) static void createAnimatedNode(double tag, ::React::JSValue && config) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "updateAnimatedNodeConfig", - " REACT_METHOD(updateAnimatedNodeConfig) void updateAnimatedNodeConfig(double tag, ::React::JSValue && config) noexcept { /* implementation */ }\n" - " REACT_METHOD(updateAnimatedNodeConfig) static void updateAnimatedNodeConfig(double tag, ::React::JSValue && config) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "getValue", - " REACT_METHOD(getValue) void getValue(double tag, std::function const & saveValueCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getValue) static void getValue(double tag, std::function const & saveValueCallback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "startListeningToAnimatedNodeValue", - " REACT_METHOD(startListeningToAnimatedNodeValue) void startListeningToAnimatedNodeValue(double tag) noexcept { /* implementation */ }\n" - " REACT_METHOD(startListeningToAnimatedNodeValue) static void startListeningToAnimatedNodeValue(double tag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "stopListeningToAnimatedNodeValue", - " REACT_METHOD(stopListeningToAnimatedNodeValue) void stopListeningToAnimatedNodeValue(double tag) noexcept { /* implementation */ }\n" - " REACT_METHOD(stopListeningToAnimatedNodeValue) static void stopListeningToAnimatedNodeValue(double tag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "connectAnimatedNodes", - " REACT_METHOD(connectAnimatedNodes) void connectAnimatedNodes(double parentTag, double childTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(connectAnimatedNodes) static void connectAnimatedNodes(double parentTag, double childTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "disconnectAnimatedNodes", - " REACT_METHOD(disconnectAnimatedNodes) void disconnectAnimatedNodes(double parentTag, double childTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(disconnectAnimatedNodes) static void disconnectAnimatedNodes(double parentTag, double childTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "startAnimatingNode", - " REACT_METHOD(startAnimatingNode) void startAnimatingNode(double animationId, double nodeTag, ::React::JSValue && config, std::function const & endCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(startAnimatingNode) static void startAnimatingNode(double animationId, double nodeTag, ::React::JSValue && config, std::function const & endCallback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "stopAnimation", - " REACT_METHOD(stopAnimation) void stopAnimation(double animationId) noexcept { /* implementation */ }\n" - " REACT_METHOD(stopAnimation) static void stopAnimation(double animationId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "setAnimatedNodeValue", - " REACT_METHOD(setAnimatedNodeValue) void setAnimatedNodeValue(double nodeTag, double value) noexcept { /* implementation */ }\n" - " REACT_METHOD(setAnimatedNodeValue) static void setAnimatedNodeValue(double nodeTag, double value) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "setAnimatedNodeOffset", - " REACT_METHOD(setAnimatedNodeOffset) void setAnimatedNodeOffset(double nodeTag, double offset) noexcept { /* implementation */ }\n" - " REACT_METHOD(setAnimatedNodeOffset) static void setAnimatedNodeOffset(double nodeTag, double offset) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "flattenAnimatedNodeOffset", - " REACT_METHOD(flattenAnimatedNodeOffset) void flattenAnimatedNodeOffset(double nodeTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(flattenAnimatedNodeOffset) static void flattenAnimatedNodeOffset(double nodeTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "extractAnimatedNodeOffset", - " REACT_METHOD(extractAnimatedNodeOffset) void extractAnimatedNodeOffset(double nodeTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(extractAnimatedNodeOffset) static void extractAnimatedNodeOffset(double nodeTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "connectAnimatedNodeToView", - " REACT_METHOD(connectAnimatedNodeToView) void connectAnimatedNodeToView(double nodeTag, double viewTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(connectAnimatedNodeToView) static void connectAnimatedNodeToView(double nodeTag, double viewTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "disconnectAnimatedNodeFromView", - " REACT_METHOD(disconnectAnimatedNodeFromView) void disconnectAnimatedNodeFromView(double nodeTag, double viewTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(disconnectAnimatedNodeFromView) static void disconnectAnimatedNodeFromView(double nodeTag, double viewTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "restoreDefaultValues", - " REACT_METHOD(restoreDefaultValues) void restoreDefaultValues(double nodeTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(restoreDefaultValues) static void restoreDefaultValues(double nodeTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 18, - "dropAnimatedNode", - " REACT_METHOD(dropAnimatedNode) void dropAnimatedNode(double tag) noexcept { /* implementation */ }\n" - " REACT_METHOD(dropAnimatedNode) static void dropAnimatedNode(double tag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 19, - "addAnimatedEventToView", - " REACT_METHOD(addAnimatedEventToView) void addAnimatedEventToView(double viewTag, std::string eventName, AnimatedTurboModuleSpec_EventMapping && eventMapping) noexcept { /* implementation */ }\n" - " REACT_METHOD(addAnimatedEventToView) static void addAnimatedEventToView(double viewTag, std::string eventName, AnimatedTurboModuleSpec_EventMapping && eventMapping) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 20, - "removeAnimatedEventFromView", - " REACT_METHOD(removeAnimatedEventFromView) void removeAnimatedEventFromView(double viewTag, std::string eventName, double animatedNodeTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeAnimatedEventFromView) static void removeAnimatedEventFromView(double viewTag, std::string eventName, double animatedNodeTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 21, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 22, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 23, - "queueAndExecuteBatchedOperations", - " REACT_METHOD(queueAndExecuteBatchedOperations) void queueAndExecuteBatchedOperations(::React::JSValueArray && operationsAndArgs) noexcept { /* implementation */ }\n" - " REACT_METHOD(queueAndExecuteBatchedOperations) static void queueAndExecuteBatchedOperations(::React::JSValueArray && operationsAndArgs) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeAppStateSpec.g.h b/vnext/codegen/NativeAppStateSpec.g.h deleted file mode 100644 index b9586d91db3..00000000000 --- a/vnext/codegen/NativeAppStateSpec.g.h +++ /dev/null @@ -1,69 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct AppStateSpec_AppState { - std::string app_state; -}; - -struct AppStateSpec_AppStateConstants { - std::string initialAppState; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AppStateSpec_AppState*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"app_state", &AppStateSpec_AppState::app_state}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AppStateSpec_AppStateConstants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"initialAppState", &AppStateSpec_AppStateConstants::initialAppState}, - }; - return fieldMap; -} - -struct AppStateSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method, Callback<::React::JSValue>) noexcept>{0, L"getCurrentAppState"}, - Method{1, L"addListener"}, - Method{2, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getCurrentAppState", - " REACT_METHOD(getCurrentAppState) void getCurrentAppState(std::function const & success, std::function const & error) noexcept { /* implementation */ }\n" - " REACT_METHOD(getCurrentAppState) static void getCurrentAppState(std::function const & success, std::function const & error) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeAppThemeSpec.g.h b/vnext/codegen/NativeAppThemeSpec.g.h deleted file mode 100644 index cdf9bfc7afd..00000000000 --- a/vnext/codegen/NativeAppThemeSpec.g.h +++ /dev/null @@ -1,69 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct AppThemeSpec_HighContrastColors { - std::string ButtonFaceColor; - std::string ButtonTextColor; - std::string GrayTextColor; - std::string HighlightColor; - std::string HighlightTextColor; - std::string HotlightColor; - std::string WindowColor; - std::string WindowTextColor; -}; - -struct AppThemeSpec_AppThemeData { - bool isHighContrast; - AppThemeSpec_HighContrastColors highContrastColors; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AppThemeSpec_HighContrastColors*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"ButtonFaceColor", &AppThemeSpec_HighContrastColors::ButtonFaceColor}, - {L"ButtonTextColor", &AppThemeSpec_HighContrastColors::ButtonTextColor}, - {L"GrayTextColor", &AppThemeSpec_HighContrastColors::GrayTextColor}, - {L"HighlightColor", &AppThemeSpec_HighContrastColors::HighlightColor}, - {L"HighlightTextColor", &AppThemeSpec_HighContrastColors::HighlightTextColor}, - {L"HotlightColor", &AppThemeSpec_HighContrastColors::HotlightColor}, - {L"WindowColor", &AppThemeSpec_HighContrastColors::WindowColor}, - {L"WindowTextColor", &AppThemeSpec_HighContrastColors::WindowTextColor}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(AppThemeSpec_AppThemeData*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"isHighContrast", &AppThemeSpec_AppThemeData::isHighContrast}, - {L"highContrastColors", &AppThemeSpec_AppThemeData::highContrastColors}, - }; - return fieldMap; -} - -struct AppThemeSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeAppearanceSpec.g.h b/vnext/codegen/NativeAppearanceSpec.g.h deleted file mode 100644 index af2d1120ff0..00000000000 --- a/vnext/codegen/NativeAppearanceSpec.g.h +++ /dev/null @@ -1,53 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct AppearanceSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - SyncMethod() noexcept>{0, L"getColorScheme"}, - Method{1, L"setColorScheme"}, - Method{2, L"addListener"}, - Method{3, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getColorScheme", - " REACT_SYNC_METHOD(getColorScheme) std::optional getColorScheme() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getColorScheme) static std::optional getColorScheme() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "setColorScheme", - " REACT_METHOD(setColorScheme) void setColorScheme(std::string colorScheme) noexcept { /* implementation */ }\n" - " REACT_METHOD(setColorScheme) static void setColorScheme(std::string colorScheme) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeBlobModuleSpec.g.h b/vnext/codegen/NativeBlobModuleSpec.g.h deleted file mode 100644 index 218565360b0..00000000000 --- a/vnext/codegen/NativeBlobModuleSpec.g.h +++ /dev/null @@ -1,78 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct BlobModuleSpec_Constants { - std::optional BLOB_URI_SCHEME; - std::optional BLOB_URI_HOST; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(BlobModuleSpec_Constants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"BLOB_URI_SCHEME", &BlobModuleSpec_Constants::BLOB_URI_SCHEME}, - {L"BLOB_URI_HOST", &BlobModuleSpec_Constants::BLOB_URI_HOST}, - }; - return fieldMap; -} - -struct BlobModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"addNetworkingHandler"}, - Method{1, L"addWebSocketHandler"}, - Method{2, L"removeWebSocketHandler"}, - Method{3, L"sendOverSocket"}, - Method, std::string) noexcept>{4, L"createFromParts"}, - Method{5, L"release"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "addNetworkingHandler", - " REACT_METHOD(addNetworkingHandler) void addNetworkingHandler() noexcept { /* implementation */ }\n" - " REACT_METHOD(addNetworkingHandler) static void addNetworkingHandler() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "addWebSocketHandler", - " REACT_METHOD(addWebSocketHandler) void addWebSocketHandler(double id) noexcept { /* implementation */ }\n" - " REACT_METHOD(addWebSocketHandler) static void addWebSocketHandler(double id) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "removeWebSocketHandler", - " REACT_METHOD(removeWebSocketHandler) void removeWebSocketHandler(double id) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeWebSocketHandler) static void removeWebSocketHandler(double id) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "sendOverSocket", - " REACT_METHOD(sendOverSocket) void sendOverSocket(::React::JSValue && blob, double socketID) noexcept { /* implementation */ }\n" - " REACT_METHOD(sendOverSocket) static void sendOverSocket(::React::JSValue && blob, double socketID) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "createFromParts", - " REACT_METHOD(createFromParts) void createFromParts(std::vector<::React::JSValue> const & parts, std::string withId) noexcept { /* implementation */ }\n" - " REACT_METHOD(createFromParts) static void createFromParts(std::vector<::React::JSValue> const & parts, std::string withId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "release", - " REACT_METHOD(release) void release(std::string blobId) noexcept { /* implementation */ }\n" - " REACT_METHOD(release) static void release(std::string blobId) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeBugReportingSpec.g.h b/vnext/codegen/NativeBugReportingSpec.g.h deleted file mode 100644 index b8d8be6bd91..00000000000 --- a/vnext/codegen/NativeBugReportingSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct BugReportingSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"startReportAProblemFlow"}, - Method{1, L"setExtraData"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "startReportAProblemFlow", - " REACT_METHOD(startReportAProblemFlow) void startReportAProblemFlow() noexcept { /* implementation */ }\n" - " REACT_METHOD(startReportAProblemFlow) static void startReportAProblemFlow() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "setExtraData", - " REACT_METHOD(setExtraData) void setExtraData(::React::JSValue && extraData, ::React::JSValue && extraFiles) noexcept { /* implementation */ }\n" - " REACT_METHOD(setExtraData) static void setExtraData(::React::JSValue && extraData, ::React::JSValue && extraFiles) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeClipboardSpec.g.h b/vnext/codegen/NativeClipboardSpec.g.h deleted file mode 100644 index 1908c625795..00000000000 --- a/vnext/codegen/NativeClipboardSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct ClipboardSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"getString"}, - Method{1, L"setString"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getString", - " REACT_METHOD(getString) void getString(::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getString) static void getString(::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "setString", - " REACT_METHOD(setString) void setString(std::string content) noexcept { /* implementation */ }\n" - " REACT_METHOD(setString) static void setString(std::string content) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeDOMSpec.g.h b/vnext/codegen/NativeDOMSpec.g.h deleted file mode 100644 index 1ae9a7b3f34..00000000000 --- a/vnext/codegen/NativeDOMSpec.g.h +++ /dev/null @@ -1,149 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct DOMSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - SyncMethod{0, L"compareDocumentPosition"}, - SyncMethod() noexcept>{1, L"getChildNodes"}, - SyncMethod<() noexcept>{2, L"getParentNode"}, - SyncMethod{3, L"isConnected"}, - SyncMethod() noexcept>{4, L"getBorderWidth"}, - SyncMethod(, bool) noexcept>{5, L"getBoundingClientRect"}, - SyncMethod() noexcept>{6, L"getInnerSize"}, - SyncMethod() noexcept>{7, L"getScrollPosition"}, - SyncMethod() noexcept>{8, L"getScrollSize"}, - SyncMethod{9, L"getTagName"}, - SyncMethod{10, L"getTextContent"}, - SyncMethod{11, L"hasPointerCapture"}, - Method{12, L"releasePointerCapture"}, - Method{13, L"setPointerCapture"}, - SyncMethod() noexcept>{14, L"getOffset"}, - SyncMethod<(double, ) noexcept>{15, L"linkRootNode"}, - Method) noexcept>{16, L"measure"}, - Method) noexcept>{17, L"measureInWindow"}, - Method, Callback) noexcept>{18, L"measureLayout"}, - Method{19, L"setNativeProps"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "compareDocumentPosition", - " REACT_SYNC_METHOD(compareDocumentPosition) double compareDocumentPosition( nativeNodeReference, otherNativeNodeReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(compareDocumentPosition) static double compareDocumentPosition( nativeNodeReference, otherNativeNodeReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getChildNodes", - " REACT_SYNC_METHOD(getChildNodes) std::vector<> getChildNodes( nativeNodeReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getChildNodes) static std::vector<> getChildNodes( nativeNodeReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "getParentNode", - " REACT_SYNC_METHOD(getParentNode) getParentNode( nativeNodeReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getParentNode) static getParentNode( nativeNodeReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "isConnected", - " REACT_SYNC_METHOD(isConnected) bool isConnected( nativeNodeReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(isConnected) static bool isConnected( nativeNodeReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "getBorderWidth", - " REACT_SYNC_METHOD(getBorderWidth) std::vector getBorderWidth( nativeElementReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getBorderWidth) static std::vector getBorderWidth( nativeElementReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "getBoundingClientRect", - " REACT_SYNC_METHOD(getBoundingClientRect) std::vector getBoundingClientRect( nativeElementReference, bool includeTransform) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getBoundingClientRect) static std::vector getBoundingClientRect( nativeElementReference, bool includeTransform) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "getInnerSize", - " REACT_SYNC_METHOD(getInnerSize) std::vector getInnerSize( nativeElementReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getInnerSize) static std::vector getInnerSize( nativeElementReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "getScrollPosition", - " REACT_SYNC_METHOD(getScrollPosition) std::vector getScrollPosition( nativeElementReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getScrollPosition) static std::vector getScrollPosition( nativeElementReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "getScrollSize", - " REACT_SYNC_METHOD(getScrollSize) std::vector getScrollSize( nativeElementReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getScrollSize) static std::vector getScrollSize( nativeElementReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "getTagName", - " REACT_SYNC_METHOD(getTagName) std::string getTagName( nativeElementReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getTagName) static std::string getTagName( nativeElementReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "getTextContent", - " REACT_SYNC_METHOD(getTextContent) std::string getTextContent( nativeElementReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getTextContent) static std::string getTextContent( nativeElementReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "hasPointerCapture", - " REACT_SYNC_METHOD(hasPointerCapture) bool hasPointerCapture( nativeElementReference, double pointerId) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(hasPointerCapture) static bool hasPointerCapture( nativeElementReference, double pointerId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "releasePointerCapture", - " REACT_METHOD(releasePointerCapture) void releasePointerCapture( nativeElementReference, double pointerId) noexcept { /* implementation */ }\n" - " REACT_METHOD(releasePointerCapture) static void releasePointerCapture( nativeElementReference, double pointerId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "setPointerCapture", - " REACT_METHOD(setPointerCapture) void setPointerCapture( nativeElementReference, double pointerId) noexcept { /* implementation */ }\n" - " REACT_METHOD(setPointerCapture) static void setPointerCapture( nativeElementReference, double pointerId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "getOffset", - " REACT_SYNC_METHOD(getOffset) std::vector<> getOffset( nativeElementReference) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getOffset) static std::vector<> getOffset( nativeElementReference) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "linkRootNode", - " REACT_SYNC_METHOD(linkRootNode) linkRootNode(double rootTag, instanceHandle) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(linkRootNode) static linkRootNode(double rootTag, instanceHandle) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "measure", - " REACT_METHOD(measure) void measure( nativeElementReference, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(measure) static void measure( nativeElementReference, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "measureInWindow", - " REACT_METHOD(measureInWindow) void measureInWindow( nativeElementReference, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(measureInWindow) static void measureInWindow( nativeElementReference, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 18, - "measureLayout", - " REACT_METHOD(measureLayout) void measureLayout( nativeElementReference, relativeNode, std::function const & onFail, std::function const & onSuccess) noexcept { /* implementation */ }\n" - " REACT_METHOD(measureLayout) static void measureLayout( nativeElementReference, relativeNode, std::function const & onFail, std::function const & onSuccess) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 19, - "setNativeProps", - " REACT_METHOD(setNativeProps) void setNativeProps( nativeElementReference, updatePayload) noexcept { /* implementation */ }\n" - " REACT_METHOD(setNativeProps) static void setNativeProps( nativeElementReference, updatePayload) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeDevLoadingViewSpec.g.h b/vnext/codegen/NativeDevLoadingViewSpec.g.h deleted file mode 100644 index 8df12e28295..00000000000 --- a/vnext/codegen/NativeDevLoadingViewSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct DevLoadingViewSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method, std::optional) noexcept>{0, L"showMessage"}, - Method{1, L"hide"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "showMessage", - " REACT_METHOD(showMessage) void showMessage(std::string message, std::optional withColor, std::optional withBackgroundColor) noexcept { /* implementation */ }\n" - " REACT_METHOD(showMessage) static void showMessage(std::string message, std::optional withColor, std::optional withBackgroundColor) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "hide", - " REACT_METHOD(hide) void hide() noexcept { /* implementation */ }\n" - " REACT_METHOD(hide) static void hide() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeDevMenuSpec.g.h b/vnext/codegen/NativeDevMenuSpec.g.h deleted file mode 100644 index db5e1edf413..00000000000 --- a/vnext/codegen/NativeDevMenuSpec.g.h +++ /dev/null @@ -1,53 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct DevMenuSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"show"}, - Method{1, L"reload"}, - Method{2, L"setProfilingEnabled"}, - Method{3, L"setHotLoadingEnabled"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "show", - " REACT_METHOD(show) void show() noexcept { /* implementation */ }\n" - " REACT_METHOD(show) static void show() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "reload", - " REACT_METHOD(reload) void reload() noexcept { /* implementation */ }\n" - " REACT_METHOD(reload) static void reload() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "setProfilingEnabled", - " REACT_METHOD(setProfilingEnabled) void setProfilingEnabled(bool enabled) noexcept { /* implementation */ }\n" - " REACT_METHOD(setProfilingEnabled) static void setProfilingEnabled(bool enabled) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "setHotLoadingEnabled", - " REACT_METHOD(setHotLoadingEnabled) void setHotLoadingEnabled(bool enabled) noexcept { /* implementation */ }\n" - " REACT_METHOD(setHotLoadingEnabled) static void setHotLoadingEnabled(bool enabled) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeDevSettingsSpec.g.h b/vnext/codegen/NativeDevSettingsSpec.g.h deleted file mode 100644 index faea2113e9b..00000000000 --- a/vnext/codegen/NativeDevSettingsSpec.g.h +++ /dev/null @@ -1,95 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct DevSettingsSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"reload"}, - Method{1, L"reloadWithReason"}, - Method{2, L"onFastRefresh"}, - Method{3, L"setHotLoadingEnabled"}, - Method{4, L"setProfilingEnabled"}, - Method{5, L"toggleElementInspector"}, - Method{6, L"addMenuItem"}, - Method{7, L"openDebugger"}, - Method{8, L"addListener"}, - Method{9, L"removeListeners"}, - Method{10, L"setIsShakeToShowDevMenuEnabled"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "reload", - " REACT_METHOD(reload) void reload() noexcept { /* implementation */ }\n" - " REACT_METHOD(reload) static void reload() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "reloadWithReason", - " REACT_METHOD(reloadWithReason) void reloadWithReason(std::string reason) noexcept { /* implementation */ }\n" - " REACT_METHOD(reloadWithReason) static void reloadWithReason(std::string reason) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "onFastRefresh", - " REACT_METHOD(onFastRefresh) void onFastRefresh() noexcept { /* implementation */ }\n" - " REACT_METHOD(onFastRefresh) static void onFastRefresh() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "setHotLoadingEnabled", - " REACT_METHOD(setHotLoadingEnabled) void setHotLoadingEnabled(bool isHotLoadingEnabled) noexcept { /* implementation */ }\n" - " REACT_METHOD(setHotLoadingEnabled) static void setHotLoadingEnabled(bool isHotLoadingEnabled) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "setProfilingEnabled", - " REACT_METHOD(setProfilingEnabled) void setProfilingEnabled(bool isProfilingEnabled) noexcept { /* implementation */ }\n" - " REACT_METHOD(setProfilingEnabled) static void setProfilingEnabled(bool isProfilingEnabled) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "toggleElementInspector", - " REACT_METHOD(toggleElementInspector) void toggleElementInspector() noexcept { /* implementation */ }\n" - " REACT_METHOD(toggleElementInspector) static void toggleElementInspector() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "addMenuItem", - " REACT_METHOD(addMenuItem) void addMenuItem(std::string title) noexcept { /* implementation */ }\n" - " REACT_METHOD(addMenuItem) static void addMenuItem(std::string title) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "openDebugger", - " REACT_METHOD(openDebugger) void openDebugger() noexcept { /* implementation */ }\n" - " REACT_METHOD(openDebugger) static void openDebugger() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "setIsShakeToShowDevMenuEnabled", - " REACT_METHOD(setIsShakeToShowDevMenuEnabled) void setIsShakeToShowDevMenuEnabled(bool enabled) noexcept { /* implementation */ }\n" - " REACT_METHOD(setIsShakeToShowDevMenuEnabled) static void setIsShakeToShowDevMenuEnabled(bool enabled) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeDeviceEventManagerSpec.g.h b/vnext/codegen/NativeDeviceEventManagerSpec.g.h deleted file mode 100644 index 84c12436a76..00000000000 --- a/vnext/codegen/NativeDeviceEventManagerSpec.g.h +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct DeviceEventManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"invokeDefaultBackPressHandler"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "invokeDefaultBackPressHandler", - " REACT_METHOD(invokeDefaultBackPressHandler) void invokeDefaultBackPressHandler() noexcept { /* implementation */ }\n" - " REACT_METHOD(invokeDefaultBackPressHandler) static void invokeDefaultBackPressHandler() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeDeviceInfoSpec.g.h b/vnext/codegen/NativeDeviceInfoSpec.g.h deleted file mode 100644 index f243ab774a4..00000000000 --- a/vnext/codegen/NativeDeviceInfoSpec.g.h +++ /dev/null @@ -1,99 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct DeviceInfoSpec_DisplayMetrics { - double width; - double height; - double scale; - double fontScale; -}; - -struct DeviceInfoSpec_DisplayMetricsAndroid { - double width; - double height; - double scale; - double fontScale; - double densityDpi; -}; - -struct DeviceInfoSpec_DimensionsPayload { - std::optional window; - std::optional screen; - std::optional windowPhysicalPixels; - std::optional screenPhysicalPixels; -}; - -struct DeviceInfoSpec_DeviceInfoConstants { - DeviceInfoSpec_DimensionsPayload Dimensions; - std::optional isEdgeToEdge; - std::optional isIPhoneX_deprecated; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DeviceInfoSpec_DisplayMetrics*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"width", &DeviceInfoSpec_DisplayMetrics::width}, - {L"height", &DeviceInfoSpec_DisplayMetrics::height}, - {L"scale", &DeviceInfoSpec_DisplayMetrics::scale}, - {L"fontScale", &DeviceInfoSpec_DisplayMetrics::fontScale}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DeviceInfoSpec_DisplayMetricsAndroid*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"width", &DeviceInfoSpec_DisplayMetricsAndroid::width}, - {L"height", &DeviceInfoSpec_DisplayMetricsAndroid::height}, - {L"scale", &DeviceInfoSpec_DisplayMetricsAndroid::scale}, - {L"fontScale", &DeviceInfoSpec_DisplayMetricsAndroid::fontScale}, - {L"densityDpi", &DeviceInfoSpec_DisplayMetricsAndroid::densityDpi}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DeviceInfoSpec_DimensionsPayload*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"window", &DeviceInfoSpec_DimensionsPayload::window}, - {L"screen", &DeviceInfoSpec_DimensionsPayload::screen}, - {L"windowPhysicalPixels", &DeviceInfoSpec_DimensionsPayload::windowPhysicalPixels}, - {L"screenPhysicalPixels", &DeviceInfoSpec_DimensionsPayload::screenPhysicalPixels}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DeviceInfoSpec_DeviceInfoConstants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"Dimensions", &DeviceInfoSpec_DeviceInfoConstants::Dimensions}, - {L"isEdgeToEdge", &DeviceInfoSpec_DeviceInfoConstants::isEdgeToEdge}, - {L"isIPhoneX_deprecated", &DeviceInfoSpec_DeviceInfoConstants::isIPhoneX_deprecated}, - }; - return fieldMap; -} - -struct DeviceInfoSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeDialogManagerAndroidSpec.g.h b/vnext/codegen/NativeDialogManagerAndroidSpec.g.h deleted file mode 100644 index 711c593784d..00000000000 --- a/vnext/codegen/NativeDialogManagerAndroidSpec.g.h +++ /dev/null @@ -1,87 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct DialogManagerAndroidSpec_DialogOptions { - std::optional title; - std::optional message; - std::optional buttonPositive; - std::optional buttonNegative; - std::optional buttonNeutral; - std::optional> items; - std::optional cancelable; -}; - -struct DialogManagerAndroidSpec_Constants { - std::string buttonClicked; - std::string dismissed; - double buttonPositive; - double buttonNegative; - double buttonNeutral; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DialogManagerAndroidSpec_DialogOptions*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"title", &DialogManagerAndroidSpec_DialogOptions::title}, - {L"message", &DialogManagerAndroidSpec_DialogOptions::message}, - {L"buttonPositive", &DialogManagerAndroidSpec_DialogOptions::buttonPositive}, - {L"buttonNegative", &DialogManagerAndroidSpec_DialogOptions::buttonNegative}, - {L"buttonNeutral", &DialogManagerAndroidSpec_DialogOptions::buttonNeutral}, - {L"items", &DialogManagerAndroidSpec_DialogOptions::items}, - {L"cancelable", &DialogManagerAndroidSpec_DialogOptions::cancelable}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DialogManagerAndroidSpec_Constants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"buttonClicked", &DialogManagerAndroidSpec_Constants::buttonClicked}, - {L"dismissed", &DialogManagerAndroidSpec_Constants::dismissed}, - {L"buttonPositive", &DialogManagerAndroidSpec_Constants::buttonPositive}, - {L"buttonNegative", &DialogManagerAndroidSpec_Constants::buttonNegative}, - {L"buttonNeutral", &DialogManagerAndroidSpec_Constants::buttonNeutral}, - }; - return fieldMap; -} - -struct DialogManagerAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto constants = std::tuple{ - TypedConstant{0}, - }; - static constexpr auto methods = std::tuple{ - Method, Callback) noexcept>{0, L"showAlert"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto constantCheckResults = CheckConstants(); - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_CONSTANT_SPEC_ERRORS( - 0, - "DialogManagerAndroidSpec_Constants", - " REACT_GET_CONSTANTS(GetConstants) DialogManagerAndroidSpec_Constants GetConstants() noexcept {/*implementation*/}\n" - " REACT_GET_CONSTANTS(GetConstants) static DialogManagerAndroidSpec_Constants GetConstants() noexcept {/*implementation*/}\n"); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "showAlert", - " REACT_METHOD(showAlert) void showAlert(DialogManagerAndroidSpec_DialogOptions && config, std::function const & onError, std::function const & onAction) noexcept { /* implementation */ }\n" - " REACT_METHOD(showAlert) static void showAlert(DialogManagerAndroidSpec_DialogOptions && config, std::function const & onError, std::function const & onAction) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeDialogManagerWindowsSpec.g.h b/vnext/codegen/NativeDialogManagerWindowsSpec.g.h deleted file mode 100644 index 9c5fe21a26e..00000000000 --- a/vnext/codegen/NativeDialogManagerWindowsSpec.g.h +++ /dev/null @@ -1,91 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct DialogManagerWindowsSpec_DialogOptions { - std::optional title; - std::optional message; - std::optional buttonPositive; - std::optional buttonNegative; - std::optional buttonNeutral; - std::optional> items; - std::optional cancelable; - std::optional defaultButton; - std::optional rootTag; -}; - -struct DialogManagerWindowsSpec_Constants { - std::string buttonClicked; - std::string dismissed; - int buttonPositive; - int buttonNegative; - int buttonNeutral; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DialogManagerWindowsSpec_DialogOptions*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"title", &DialogManagerWindowsSpec_DialogOptions::title}, - {L"message", &DialogManagerWindowsSpec_DialogOptions::message}, - {L"buttonPositive", &DialogManagerWindowsSpec_DialogOptions::buttonPositive}, - {L"buttonNegative", &DialogManagerWindowsSpec_DialogOptions::buttonNegative}, - {L"buttonNeutral", &DialogManagerWindowsSpec_DialogOptions::buttonNeutral}, - {L"items", &DialogManagerWindowsSpec_DialogOptions::items}, - {L"cancelable", &DialogManagerWindowsSpec_DialogOptions::cancelable}, - {L"defaultButton", &DialogManagerWindowsSpec_DialogOptions::defaultButton}, - {L"rootTag", &DialogManagerWindowsSpec_DialogOptions::rootTag}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(DialogManagerWindowsSpec_Constants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"buttonClicked", &DialogManagerWindowsSpec_Constants::buttonClicked}, - {L"dismissed", &DialogManagerWindowsSpec_Constants::dismissed}, - {L"buttonPositive", &DialogManagerWindowsSpec_Constants::buttonPositive}, - {L"buttonNegative", &DialogManagerWindowsSpec_Constants::buttonNegative}, - {L"buttonNeutral", &DialogManagerWindowsSpec_Constants::buttonNeutral}, - }; - return fieldMap; -} - -struct DialogManagerWindowsSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto constants = std::tuple{ - TypedConstant{0}, - }; - static constexpr auto methods = std::tuple{ - Method, Callback) noexcept>{0, L"showAlert"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto constantCheckResults = CheckConstants(); - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_CONSTANT_SPEC_ERRORS( - 0, - "DialogManagerWindowsSpec_Constants", - " REACT_GET_CONSTANTS(GetConstants) DialogManagerWindowsSpec_Constants GetConstants() noexcept {/*implementation*/}\n" - " REACT_GET_CONSTANTS(GetConstants) static DialogManagerWindowsSpec_Constants GetConstants() noexcept {/*implementation*/}\n"); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "showAlert", - " REACT_METHOD(showAlert) void showAlert(DialogManagerWindowsSpec_DialogOptions && config, std::function const & onError, std::function const & onAction) noexcept { /* implementation */ }\n" - " REACT_METHOD(showAlert) static void showAlert(DialogManagerWindowsSpec_DialogOptions && config, std::function const & onError, std::function const & onAction) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeExceptionsManagerSpec.g.h b/vnext/codegen/NativeExceptionsManagerSpec.g.h deleted file mode 100644 index a2a97893f34..00000000000 --- a/vnext/codegen/NativeExceptionsManagerSpec.g.h +++ /dev/null @@ -1,97 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ExceptionsManagerSpec_StackFrame { - std::optional column; - std::optional file; - std::optional lineNumber; - std::string methodName; - std::optional collapse; -}; - -struct ExceptionsManagerSpec_ExceptionData { - std::string message; - std::optional originalMessage; - std::optional name; - std::optional componentStack; - std::vector stack; - double id; - bool isFatal; - std::optional<::React::JSValue> extraData; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ExceptionsManagerSpec_StackFrame*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"column", &ExceptionsManagerSpec_StackFrame::column}, - {L"file", &ExceptionsManagerSpec_StackFrame::file}, - {L"lineNumber", &ExceptionsManagerSpec_StackFrame::lineNumber}, - {L"methodName", &ExceptionsManagerSpec_StackFrame::methodName}, - {L"collapse", &ExceptionsManagerSpec_StackFrame::collapse}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ExceptionsManagerSpec_ExceptionData*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"message", &ExceptionsManagerSpec_ExceptionData::message}, - {L"originalMessage", &ExceptionsManagerSpec_ExceptionData::originalMessage}, - {L"name", &ExceptionsManagerSpec_ExceptionData::name}, - {L"componentStack", &ExceptionsManagerSpec_ExceptionData::componentStack}, - {L"stack", &ExceptionsManagerSpec_ExceptionData::stack}, - {L"id", &ExceptionsManagerSpec_ExceptionData::id}, - {L"isFatal", &ExceptionsManagerSpec_ExceptionData::isFatal}, - {L"extraData", &ExceptionsManagerSpec_ExceptionData::extraData}, - }; - return fieldMap; -} - -struct ExceptionsManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method, double) noexcept>{0, L"reportFatalException"}, - Method, double) noexcept>{1, L"reportSoftException"}, - Method{2, L"reportException"}, - Method{3, L"dismissRedbox"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "reportFatalException", - " REACT_METHOD(reportFatalException) void reportFatalException(std::string message, std::vector const & stack, double exceptionId) noexcept { /* implementation */ }\n" - " REACT_METHOD(reportFatalException) static void reportFatalException(std::string message, std::vector const & stack, double exceptionId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "reportSoftException", - " REACT_METHOD(reportSoftException) void reportSoftException(std::string message, std::vector const & stack, double exceptionId) noexcept { /* implementation */ }\n" - " REACT_METHOD(reportSoftException) static void reportSoftException(std::string message, std::vector const & stack, double exceptionId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "reportException", - " REACT_METHOD(reportException) void reportException(ExceptionsManagerSpec_ExceptionData && data) noexcept { /* implementation */ }\n" - " REACT_METHOD(reportException) static void reportException(ExceptionsManagerSpec_ExceptionData && data) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "dismissRedbox", - " REACT_METHOD(dismissRedbox) void dismissRedbox() noexcept { /* implementation */ }\n" - " REACT_METHOD(dismissRedbox) static void dismissRedbox() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeFileReaderModuleSpec.g.h b/vnext/codegen/NativeFileReaderModuleSpec.g.h deleted file mode 100644 index e8cd720496d..00000000000 --- a/vnext/codegen/NativeFileReaderModuleSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct FileReaderModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"readAsDataURL"}, - Method) noexcept>{1, L"readAsText"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "readAsDataURL", - " REACT_METHOD(readAsDataURL) void readAsDataURL(::React::JSValue && data, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(readAsDataURL) static void readAsDataURL(::React::JSValue && data, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "readAsText", - " REACT_METHOD(readAsText) void readAsText(::React::JSValue && data, std::string encoding, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(readAsText) static void readAsText(::React::JSValue && data, std::string encoding, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeFrameRateLoggerSpec.g.h b/vnext/codegen/NativeFrameRateLoggerSpec.g.h deleted file mode 100644 index ee0fa9b373f..00000000000 --- a/vnext/codegen/NativeFrameRateLoggerSpec.g.h +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct FrameRateLoggerSpec_setGlobalOptions_options { - std::optional debug; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(FrameRateLoggerSpec_setGlobalOptions_options*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"debug", &FrameRateLoggerSpec_setGlobalOptions_options::debug}, - }; - return fieldMap; -} - -struct FrameRateLoggerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"setGlobalOptions"}, - Method{1, L"setContext"}, - Method{2, L"beginScroll"}, - Method{3, L"endScroll"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "setGlobalOptions", - " REACT_METHOD(setGlobalOptions) void setGlobalOptions(FrameRateLoggerSpec_setGlobalOptions_options && options) noexcept { /* implementation */ }\n" - " REACT_METHOD(setGlobalOptions) static void setGlobalOptions(FrameRateLoggerSpec_setGlobalOptions_options && options) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "setContext", - " REACT_METHOD(setContext) void setContext(std::string context) noexcept { /* implementation */ }\n" - " REACT_METHOD(setContext) static void setContext(std::string context) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "beginScroll", - " REACT_METHOD(beginScroll) void beginScroll() noexcept { /* implementation */ }\n" - " REACT_METHOD(beginScroll) static void beginScroll() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "endScroll", - " REACT_METHOD(endScroll) void endScroll() noexcept { /* implementation */ }\n" - " REACT_METHOD(endScroll) static void endScroll() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeHeadlessJsTaskSupportSpec.g.h b/vnext/codegen/NativeHeadlessJsTaskSupportSpec.g.h deleted file mode 100644 index 4ba71d2e7ae..00000000000 --- a/vnext/codegen/NativeHeadlessJsTaskSupportSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct HeadlessJsTaskSupportSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"notifyTaskFinished"}, - Method) noexcept>{1, L"notifyTaskRetry"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "notifyTaskFinished", - " REACT_METHOD(notifyTaskFinished) void notifyTaskFinished(double taskId) noexcept { /* implementation */ }\n" - " REACT_METHOD(notifyTaskFinished) static void notifyTaskFinished(double taskId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "notifyTaskRetry", - " REACT_METHOD(notifyTaskRetry) void notifyTaskRetry(double taskId, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(notifyTaskRetry) static void notifyTaskRetry(double taskId, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeI18nManagerSpec.g.h b/vnext/codegen/NativeI18nManagerSpec.g.h deleted file mode 100644 index 2e9eab293a0..00000000000 --- a/vnext/codegen/NativeI18nManagerSpec.g.h +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct I18nManagerSpec_I18nManagerConstants { - bool doLeftAndRightSwapInRTL; - bool isRTL; - std::optional localeIdentifier; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(I18nManagerSpec_I18nManagerConstants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"doLeftAndRightSwapInRTL", &I18nManagerSpec_I18nManagerConstants::doLeftAndRightSwapInRTL}, - {L"isRTL", &I18nManagerSpec_I18nManagerConstants::isRTL}, - {L"localeIdentifier", &I18nManagerSpec_I18nManagerConstants::localeIdentifier}, - }; - return fieldMap; -} - -struct I18nManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"allowRTL"}, - Method{1, L"forceRTL"}, - Method{2, L"swapLeftAndRightInRTL"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "allowRTL", - " REACT_METHOD(allowRTL) void allowRTL(bool allowRTL) noexcept { /* implementation */ }\n" - " REACT_METHOD(allowRTL) static void allowRTL(bool allowRTL) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "forceRTL", - " REACT_METHOD(forceRTL) void forceRTL(bool forceRTL) noexcept { /* implementation */ }\n" - " REACT_METHOD(forceRTL) static void forceRTL(bool forceRTL) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "swapLeftAndRightInRTL", - " REACT_METHOD(swapLeftAndRightInRTL) void swapLeftAndRightInRTL(bool flipStyles) noexcept { /* implementation */ }\n" - " REACT_METHOD(swapLeftAndRightInRTL) static void swapLeftAndRightInRTL(bool flipStyles) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeIdleCallbacksSpec.g.h b/vnext/codegen/NativeIdleCallbacksSpec.g.h deleted file mode 100644 index 4dbcb376940..00000000000 --- a/vnext/codegen/NativeIdleCallbacksSpec.g.h +++ /dev/null @@ -1,65 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct IdleCallbacksSpec_IdleDeadline { - bool didTimeout; - timeRemaining; -}; - -struct IdleCallbacksSpec_RequestIdleCallbackOptions { - std::optional timeout; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(IdleCallbacksSpec_IdleDeadline*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"didTimeout", &IdleCallbacksSpec_IdleDeadline::didTimeout}, - {L"timeRemaining", &IdleCallbacksSpec_IdleDeadline::timeRemaining}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(IdleCallbacksSpec_RequestIdleCallbackOptions*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"timeout", &IdleCallbacksSpec_RequestIdleCallbackOptions::timeout}, - }; - return fieldMap; -} - -struct IdleCallbacksSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - SyncMethod<(Callback, IdleCallbacksSpec_RequestIdleCallbackOptions) noexcept>{0, L"requestIdleCallback"}, - Method{1, L"cancelIdleCallback"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "requestIdleCallback", - " REACT_SYNC_METHOD(requestIdleCallback) requestIdleCallback(std::function const & callback, IdleCallbacksSpec_RequestIdleCallbackOptions && options) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(requestIdleCallback) static requestIdleCallback(std::function const & callback, IdleCallbacksSpec_RequestIdleCallbackOptions && options) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "cancelIdleCallback", - " REACT_METHOD(cancelIdleCallback) void cancelIdleCallback( handle) noexcept { /* implementation */ }\n" - " REACT_METHOD(cancelIdleCallback) static void cancelIdleCallback( handle) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeImageEditorSpec.g.h b/vnext/codegen/NativeImageEditorSpec.g.h deleted file mode 100644 index f308bd08654..00000000000 --- a/vnext/codegen/NativeImageEditorSpec.g.h +++ /dev/null @@ -1,93 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ImageEditorSpec_Options_offset { - double x; - double y; -}; - -struct ImageEditorSpec_Options_size { - double width; - double height; -}; - -struct ImageEditorSpec_Options_displaySize { - double width; - double height; -}; - -struct ImageEditorSpec_Options { - ImageEditorSpec_Options_offset offset; - ImageEditorSpec_Options_size size; - std::optional displaySize; - std::optional resizeMode; - std::optional allowExternalStorage; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageEditorSpec_Options_offset*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"x", &ImageEditorSpec_Options_offset::x}, - {L"y", &ImageEditorSpec_Options_offset::y}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageEditorSpec_Options_size*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"width", &ImageEditorSpec_Options_size::width}, - {L"height", &ImageEditorSpec_Options_size::height}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageEditorSpec_Options_displaySize*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"width", &ImageEditorSpec_Options_displaySize::width}, - {L"height", &ImageEditorSpec_Options_displaySize::height}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageEditorSpec_Options*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"offset", &ImageEditorSpec_Options::offset}, - {L"size", &ImageEditorSpec_Options::size}, - {L"displaySize", &ImageEditorSpec_Options::displaySize}, - {L"resizeMode", &ImageEditorSpec_Options::resizeMode}, - {L"allowExternalStorage", &ImageEditorSpec_Options::allowExternalStorage}, - }; - return fieldMap; -} - -struct ImageEditorSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method, Callback) noexcept>{0, L"cropImage"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "cropImage", - " REACT_METHOD(cropImage) void cropImage(std::string uri, ImageEditorSpec_Options && cropData, std::function const & successCallback, std::function const & errorCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(cropImage) static void cropImage(std::string uri, ImageEditorSpec_Options && cropData, std::function const & successCallback, std::function const & errorCallback) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeImageLoaderAndroidSpec.g.h b/vnext/codegen/NativeImageLoaderAndroidSpec.g.h deleted file mode 100644 index ac972d61345..00000000000 --- a/vnext/codegen/NativeImageLoaderAndroidSpec.g.h +++ /dev/null @@ -1,72 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ImageLoaderAndroidSpec_ImageSize { - double width; - double height; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageLoaderAndroidSpec_ImageSize*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"width", &ImageLoaderAndroidSpec_ImageSize::width}, - {L"height", &ImageLoaderAndroidSpec_ImageSize::height}, - }; - return fieldMap; -} - -struct ImageLoaderAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"abortRequest"}, - Method) noexcept>{1, L"getSize"}, - Method) noexcept>{2, L"getSizeWithHeaders"}, - Method) noexcept>{3, L"prefetchImage"}, - Method, Promise<::React::JSValue>) noexcept>{4, L"queryCache"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "abortRequest", - " REACT_METHOD(abortRequest) void abortRequest(double requestId) noexcept { /* implementation */ }\n" - " REACT_METHOD(abortRequest) static void abortRequest(double requestId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getSize", - " REACT_METHOD(getSize) void getSize(std::string uri, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getSize) static void getSize(std::string uri, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "getSizeWithHeaders", - " REACT_METHOD(getSizeWithHeaders) void getSizeWithHeaders(std::string uri, ::React::JSValue && headers, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getSizeWithHeaders) static void getSizeWithHeaders(std::string uri, ::React::JSValue && headers, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "prefetchImage", - " REACT_METHOD(prefetchImage) void prefetchImage(std::string uri, double requestId, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(prefetchImage) static void prefetchImage(std::string uri, double requestId, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "queryCache", - " REACT_METHOD(queryCache) void queryCache(std::vector const & uris, ::React::ReactPromise<::React::JSValue> &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(queryCache) static void queryCache(std::vector const & uris, ::React::ReactPromise<::React::JSValue> &&result) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeImageLoaderIOSSpec.g.h b/vnext/codegen/NativeImageLoaderIOSSpec.g.h deleted file mode 100644 index 4b69e50442a..00000000000 --- a/vnext/codegen/NativeImageLoaderIOSSpec.g.h +++ /dev/null @@ -1,72 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ImageLoaderIOSSpec_getSizeWithHeaders_returnType { - double width; - double height; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageLoaderIOSSpec_getSizeWithHeaders_returnType*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"width", &ImageLoaderIOSSpec_getSizeWithHeaders_returnType::width}, - {L"height", &ImageLoaderIOSSpec_getSizeWithHeaders_returnType::height}, - }; - return fieldMap; -} - -struct ImageLoaderIOSSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method>) noexcept>{0, L"getSize"}, - Method) noexcept>{1, L"getSizeWithHeaders"}, - Method) noexcept>{2, L"prefetchImage"}, - Method) noexcept>{3, L"prefetchImageWithMetadata"}, - Method, Promise<::React::JSValue>) noexcept>{4, L"queryCache"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getSize", - " REACT_METHOD(getSize) void getSize(std::string uri, ::React::ReactPromise> &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getSize) static void getSize(std::string uri, ::React::ReactPromise> &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getSizeWithHeaders", - " REACT_METHOD(getSizeWithHeaders) void getSizeWithHeaders(std::string uri, ::React::JSValue && headers, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getSizeWithHeaders) static void getSizeWithHeaders(std::string uri, ::React::JSValue && headers, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "prefetchImage", - " REACT_METHOD(prefetchImage) void prefetchImage(std::string uri, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(prefetchImage) static void prefetchImage(std::string uri, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "prefetchImageWithMetadata", - " REACT_METHOD(prefetchImageWithMetadata) void prefetchImageWithMetadata(std::string uri, std::string queryRootName, double rootTag, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(prefetchImageWithMetadata) static void prefetchImageWithMetadata(std::string uri, std::string queryRootName, double rootTag, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "queryCache", - " REACT_METHOD(queryCache) void queryCache(std::vector const & uris, ::React::ReactPromise<::React::JSValue> &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(queryCache) static void queryCache(std::vector const & uris, ::React::ReactPromise<::React::JSValue> &&result) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeImageStoreAndroidSpec.g.h b/vnext/codegen/NativeImageStoreAndroidSpec.g.h deleted file mode 100644 index 66fccbe9a63..00000000000 --- a/vnext/codegen/NativeImageStoreAndroidSpec.g.h +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct ImageStoreAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method, Callback) noexcept>{0, L"getBase64ForTag"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getBase64ForTag", - " REACT_METHOD(getBase64ForTag) void getBase64ForTag(std::string uri, std::function const & successCallback, std::function const & errorCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getBase64ForTag) static void getBase64ForTag(std::string uri, std::function const & successCallback, std::function const & errorCallback) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeImageStoreIOSSpec.g.h b/vnext/codegen/NativeImageStoreIOSSpec.g.h deleted file mode 100644 index 887fa9af152..00000000000 --- a/vnext/codegen/NativeImageStoreIOSSpec.g.h +++ /dev/null @@ -1,75 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ImageStoreIOSSpec_getBase64ForTag_errorCallback_error { - std::string message; -}; - -struct ImageStoreIOSSpec_addImageFromBase64_errorCallback_error { - std::string message; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageStoreIOSSpec_getBase64ForTag_errorCallback_error*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"message", &ImageStoreIOSSpec_getBase64ForTag_errorCallback_error::message}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageStoreIOSSpec_addImageFromBase64_errorCallback_error*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"message", &ImageStoreIOSSpec_addImageFromBase64_errorCallback_error::message}, - }; - return fieldMap; -} - -struct ImageStoreIOSSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method, Callback) noexcept>{0, L"getBase64ForTag"}, - Method) noexcept>{1, L"hasImageForTag"}, - Method{2, L"removeImageForTag"}, - Method, Callback) noexcept>{3, L"addImageFromBase64"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getBase64ForTag", - " REACT_METHOD(getBase64ForTag) void getBase64ForTag(std::string uri, std::function const & successCallback, std::function const & errorCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getBase64ForTag) static void getBase64ForTag(std::string uri, std::function const & successCallback, std::function const & errorCallback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "hasImageForTag", - " REACT_METHOD(hasImageForTag) void hasImageForTag(std::string uri, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(hasImageForTag) static void hasImageForTag(std::string uri, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "removeImageForTag", - " REACT_METHOD(removeImageForTag) void removeImageForTag(std::string uri) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeImageForTag) static void removeImageForTag(std::string uri) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "addImageFromBase64", - " REACT_METHOD(addImageFromBase64) void addImageFromBase64(std::string base64ImageData, std::function const & successCallback, std::function const & errorCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(addImageFromBase64) static void addImageFromBase64(std::string base64ImageData, std::function const & successCallback, std::function const & errorCallback) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeIntentAndroidSpec.g.h b/vnext/codegen/NativeIntentAndroidSpec.g.h deleted file mode 100644 index 861ecc0267e..00000000000 --- a/vnext/codegen/NativeIntentAndroidSpec.g.h +++ /dev/null @@ -1,59 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct IntentAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"getInitialURL"}, - Method) noexcept>{1, L"canOpenURL"}, - Method) noexcept>{2, L"openURL"}, - Method) noexcept>{3, L"openSettings"}, - Method, Promise) noexcept>{4, L"sendIntent"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getInitialURL", - " REACT_METHOD(getInitialURL) void getInitialURL(::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getInitialURL) static void getInitialURL(::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "canOpenURL", - " REACT_METHOD(canOpenURL) void canOpenURL(std::string url, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(canOpenURL) static void canOpenURL(std::string url, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "openURL", - " REACT_METHOD(openURL) void openURL(std::string url, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(openURL) static void openURL(std::string url, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "openSettings", - " REACT_METHOD(openSettings) void openSettings(::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(openSettings) static void openSettings(::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "sendIntent", - " REACT_METHOD(sendIntent) void sendIntent(std::string action, std::optional<::React::JSValueArray> extras, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(sendIntent) static void sendIntent(std::string action, std::optional<::React::JSValueArray> extras, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeIntersectionObserverSpec.g.h b/vnext/codegen/NativeIntersectionObserverSpec.g.h deleted file mode 100644 index d5478418b9c..00000000000 --- a/vnext/codegen/NativeIntersectionObserverSpec.g.h +++ /dev/null @@ -1,113 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct IntersectionObserverSpec_NativeIntersectionObserverEntry { - double intersectionObserverId; - targetInstanceHandle; - std::vector targetRect; - std::vector rootRect; - std::optional> intersectionRect; - bool isIntersectingAboveThresholds; - double time; -}; - -struct IntersectionObserverSpec_NativeIntersectionObserverObserveOptions { - double intersectionObserverId; - std::optional<> rootShadowNode; - targetShadowNode; - std::vector thresholds; - std::optional> rootThresholds; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(IntersectionObserverSpec_NativeIntersectionObserverEntry*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"intersectionObserverId", &IntersectionObserverSpec_NativeIntersectionObserverEntry::intersectionObserverId}, - {L"targetInstanceHandle", &IntersectionObserverSpec_NativeIntersectionObserverEntry::targetInstanceHandle}, - {L"targetRect", &IntersectionObserverSpec_NativeIntersectionObserverEntry::targetRect}, - {L"rootRect", &IntersectionObserverSpec_NativeIntersectionObserverEntry::rootRect}, - {L"intersectionRect", &IntersectionObserverSpec_NativeIntersectionObserverEntry::intersectionRect}, - {L"isIntersectingAboveThresholds", &IntersectionObserverSpec_NativeIntersectionObserverEntry::isIntersectingAboveThresholds}, - {L"time", &IntersectionObserverSpec_NativeIntersectionObserverEntry::time}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(IntersectionObserverSpec_NativeIntersectionObserverObserveOptions*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"intersectionObserverId", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::intersectionObserverId}, - {L"rootShadowNode", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::rootShadowNode}, - {L"targetShadowNode", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::targetShadowNode}, - {L"thresholds", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::thresholds}, - {L"rootThresholds", &IntersectionObserverSpec_NativeIntersectionObserverObserveOptions::rootThresholds}, - }; - return fieldMap; -} - -struct IntersectionObserverSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"observe"}, - Method{1, L"unobserve"}, - SyncMethod<(IntersectionObserverSpec_NativeIntersectionObserverObserveOptions) noexcept>{2, L"observeV2"}, - Method{3, L"unobserveV2"}, - Method) noexcept>{4, L"connect"}, - Method{5, L"disconnect"}, - SyncMethod() noexcept>{6, L"takeRecords"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "observe", - " REACT_METHOD(observe) void observe(IntersectionObserverSpec_NativeIntersectionObserverObserveOptions && options) noexcept { /* implementation */ }\n" - " REACT_METHOD(observe) static void observe(IntersectionObserverSpec_NativeIntersectionObserverObserveOptions && options) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "unobserve", - " REACT_METHOD(unobserve) void unobserve(double intersectionObserverId, targetShadowNode) noexcept { /* implementation */ }\n" - " REACT_METHOD(unobserve) static void unobserve(double intersectionObserverId, targetShadowNode) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "observeV2", - " REACT_SYNC_METHOD(observeV2) observeV2(IntersectionObserverSpec_NativeIntersectionObserverObserveOptions && options) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(observeV2) static observeV2(IntersectionObserverSpec_NativeIntersectionObserverObserveOptions && options) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "unobserveV2", - " REACT_METHOD(unobserveV2) void unobserveV2(double intersectionObserverId, token) noexcept { /* implementation */ }\n" - " REACT_METHOD(unobserveV2) static void unobserveV2(double intersectionObserverId, token) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "connect", - " REACT_METHOD(connect) void connect(std::function const & notifyIntersectionObserversCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(connect) static void connect(std::function const & notifyIntersectionObserversCallback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "disconnect", - " REACT_METHOD(disconnect) void disconnect() noexcept { /* implementation */ }\n" - " REACT_METHOD(disconnect) static void disconnect() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "takeRecords", - " REACT_SYNC_METHOD(takeRecords) std::vector takeRecords() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(takeRecords) static std::vector takeRecords() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeJSCHeapCaptureSpec.g.h b/vnext/codegen/NativeJSCHeapCaptureSpec.g.h deleted file mode 100644 index aa9adddd0f1..00000000000 --- a/vnext/codegen/NativeJSCHeapCaptureSpec.g.h +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct JSCHeapCaptureSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"captureComplete"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "captureComplete", - " REACT_METHOD(captureComplete) void captureComplete(std::string path, std::optional error) noexcept { /* implementation */ }\n" - " REACT_METHOD(captureComplete) static void captureComplete(std::string path, std::optional error) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeKeyboardObserverSpec.g.h b/vnext/codegen/NativeKeyboardObserverSpec.g.h deleted file mode 100644 index 3c888dc5023..00000000000 --- a/vnext/codegen/NativeKeyboardObserverSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct KeyboardObserverSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"addListener"}, - Method{1, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeLinkingManagerSpec.g.h b/vnext/codegen/NativeLinkingManagerSpec.g.h deleted file mode 100644 index c8e5d92a83f..00000000000 --- a/vnext/codegen/NativeLinkingManagerSpec.g.h +++ /dev/null @@ -1,65 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct LinkingManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method>) noexcept>{0, L"getInitialURL"}, - Method) noexcept>{1, L"canOpenURL"}, - Method) noexcept>{2, L"openURL"}, - Method) noexcept>{3, L"openSettings"}, - Method{4, L"addListener"}, - Method{5, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getInitialURL", - " REACT_METHOD(getInitialURL) void getInitialURL(::React::ReactPromise> &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getInitialURL) static void getInitialURL(::React::ReactPromise> &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "canOpenURL", - " REACT_METHOD(canOpenURL) void canOpenURL(std::string url, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(canOpenURL) static void canOpenURL(std::string url, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "openURL", - " REACT_METHOD(openURL) void openURL(std::string url, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(openURL) static void openURL(std::string url, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "openSettings", - " REACT_METHOD(openSettings) void openSettings(::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(openSettings) static void openSettings(::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeLogBoxSpec.g.h b/vnext/codegen/NativeLogBoxSpec.g.h deleted file mode 100644 index 0e510c75996..00000000000 --- a/vnext/codegen/NativeLogBoxSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct LogBoxSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"show"}, - Method{1, L"hide"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "show", - " REACT_METHOD(show) void show() noexcept { /* implementation */ }\n" - " REACT_METHOD(show) static void show() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "hide", - " REACT_METHOD(hide) void hide() noexcept { /* implementation */ }\n" - " REACT_METHOD(hide) static void hide() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeMicrotasksSpec.g.h b/vnext/codegen/NativeMicrotasksSpec.g.h deleted file mode 100644 index bd351cd7fe1..00000000000 --- a/vnext/codegen/NativeMicrotasksSpec.g.h +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct MicrotasksSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"queueMicrotask"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "queueMicrotask", - " REACT_METHOD(queueMicrotask) void queueMicrotask(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(queueMicrotask) static void queueMicrotask(std::function const & callback) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeModalManagerSpec.g.h b/vnext/codegen/NativeModalManagerSpec.g.h deleted file mode 100644 index 9cb67c0b03b..00000000000 --- a/vnext/codegen/NativeModalManagerSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct ModalManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"addListener"}, - Method{1, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeMutationObserverSpec.g.h b/vnext/codegen/NativeMutationObserverSpec.g.h deleted file mode 100644 index d37fbeb72a3..00000000000 --- a/vnext/codegen/NativeMutationObserverSpec.g.h +++ /dev/null @@ -1,91 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct MutationObserverSpec_NativeMutationObserverObserveOptions { - double mutationObserverId; - targetShadowNode; - bool subtree; -}; - -struct MutationObserverSpec_NativeMutationRecord { - double mutationObserverId; - target; - std::vector<> addedNodes; - std::vector<> removedNodes; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(MutationObserverSpec_NativeMutationObserverObserveOptions*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"mutationObserverId", &MutationObserverSpec_NativeMutationObserverObserveOptions::mutationObserverId}, - {L"targetShadowNode", &MutationObserverSpec_NativeMutationObserverObserveOptions::targetShadowNode}, - {L"subtree", &MutationObserverSpec_NativeMutationObserverObserveOptions::subtree}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(MutationObserverSpec_NativeMutationRecord*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"mutationObserverId", &MutationObserverSpec_NativeMutationRecord::mutationObserverId}, - {L"target", &MutationObserverSpec_NativeMutationRecord::target}, - {L"addedNodes", &MutationObserverSpec_NativeMutationRecord::addedNodes}, - {L"removedNodes", &MutationObserverSpec_NativeMutationRecord::removedNodes}, - }; - return fieldMap; -} - -struct MutationObserverSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"observe"}, - Method{1, L"unobserveAll"}, - Method, Callback<>) noexcept>{2, L"connect"}, - Method{3, L"disconnect"}, - SyncMethod() noexcept>{4, L"takeRecords"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "observe", - " REACT_METHOD(observe) void observe(MutationObserverSpec_NativeMutationObserverObserveOptions && options) noexcept { /* implementation */ }\n" - " REACT_METHOD(observe) static void observe(MutationObserverSpec_NativeMutationObserverObserveOptions && options) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "unobserveAll", - " REACT_METHOD(unobserveAll) void unobserveAll(double mutationObserverId) noexcept { /* implementation */ }\n" - " REACT_METHOD(unobserveAll) static void unobserveAll(double mutationObserverId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "connect", - " REACT_METHOD(connect) void connect(std::function const & notifyMutationObservers, std::function const & getPublicInstanceFromInstanceHandle) noexcept { /* implementation */ }\n" - " REACT_METHOD(connect) static void connect(std::function const & notifyMutationObservers, std::function const & getPublicInstanceFromInstanceHandle) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "disconnect", - " REACT_METHOD(disconnect) void disconnect() noexcept { /* implementation */ }\n" - " REACT_METHOD(disconnect) static void disconnect() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "takeRecords", - " REACT_SYNC_METHOD(takeRecords) std::vector takeRecords() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(takeRecords) static std::vector takeRecords() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeNetworkingAndroidSpec.g.h b/vnext/codegen/NativeNetworkingAndroidSpec.g.h deleted file mode 100644 index 3f6a0276878..00000000000 --- a/vnext/codegen/NativeNetworkingAndroidSpec.g.h +++ /dev/null @@ -1,59 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct NetworkingAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"sendRequest"}, - Method{1, L"abortRequest"}, - Method) noexcept>{2, L"clearCookies"}, - Method{3, L"addListener"}, - Method{4, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "sendRequest", - " REACT_METHOD(sendRequest) void sendRequest(std::string method, std::string url, double requestId, ::React::JSValueArray && headers, ::React::JSValue && data, std::string responseType, bool useIncrementalUpdates, double timeout, bool withCredentials) noexcept { /* implementation */ }\n" - " REACT_METHOD(sendRequest) static void sendRequest(std::string method, std::string url, double requestId, ::React::JSValueArray && headers, ::React::JSValue && data, std::string responseType, bool useIncrementalUpdates, double timeout, bool withCredentials) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "abortRequest", - " REACT_METHOD(abortRequest) void abortRequest(double requestId) noexcept { /* implementation */ }\n" - " REACT_METHOD(abortRequest) static void abortRequest(double requestId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "clearCookies", - " REACT_METHOD(clearCookies) void clearCookies(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(clearCookies) static void clearCookies(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeNetworkingIOSSpec.g.h b/vnext/codegen/NativeNetworkingIOSSpec.g.h deleted file mode 100644 index 42d2eb7093c..00000000000 --- a/vnext/codegen/NativeNetworkingIOSSpec.g.h +++ /dev/null @@ -1,84 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct NetworkingIOSSpec_sendRequest_query { - std::string method; - std::string url; - ::React::JSValue data; - ::React::JSValue headers; - std::string responseType; - bool incrementalUpdates; - double timeout; - bool withCredentials; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(NetworkingIOSSpec_sendRequest_query*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"method", &NetworkingIOSSpec_sendRequest_query::method}, - {L"url", &NetworkingIOSSpec_sendRequest_query::url}, - {L"data", &NetworkingIOSSpec_sendRequest_query::data}, - {L"headers", &NetworkingIOSSpec_sendRequest_query::headers}, - {L"responseType", &NetworkingIOSSpec_sendRequest_query::responseType}, - {L"incrementalUpdates", &NetworkingIOSSpec_sendRequest_query::incrementalUpdates}, - {L"timeout", &NetworkingIOSSpec_sendRequest_query::timeout}, - {L"withCredentials", &NetworkingIOSSpec_sendRequest_query::withCredentials}, - }; - return fieldMap; -} - -struct NetworkingIOSSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"sendRequest"}, - Method{1, L"abortRequest"}, - Method) noexcept>{2, L"clearCookies"}, - Method{3, L"addListener"}, - Method{4, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "sendRequest", - " REACT_METHOD(sendRequest) void sendRequest(NetworkingIOSSpec_sendRequest_query && query, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(sendRequest) static void sendRequest(NetworkingIOSSpec_sendRequest_query && query, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "abortRequest", - " REACT_METHOD(abortRequest) void abortRequest(double requestId) noexcept { /* implementation */ }\n" - " REACT_METHOD(abortRequest) static void abortRequest(double requestId) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "clearCookies", - " REACT_METHOD(clearCookies) void clearCookies(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(clearCookies) static void clearCookies(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativePerformanceSpec.g.h b/vnext/codegen/NativePerformanceSpec.g.h deleted file mode 100644 index 399f6e0f0d9..00000000000 --- a/vnext/codegen/NativePerformanceSpec.g.h +++ /dev/null @@ -1,207 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct PerformanceSpec_NativeMemoryInfo { - -}; - -struct PerformanceSpec_PerformanceObserverInit { - std::optional> entryTypes; - std::optional type; - std::optional buffered; - std::optional durationThreshold; -}; - -struct PerformanceSpec_RawPerformanceEntry { - std::string name; - double entryType; - double startTime; - double duration; - std::optional processingStart; - std::optional processingEnd; - std::optional interactionId; - std::optional fetchStart; - std::optional requestStart; - std::optional connectStart; - std::optional connectEnd; - std::optional responseStart; - std::optional responseEnd; - std::optional responseStatus; -}; - -struct PerformanceSpec_ReactNativeStartupTiming { - -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PerformanceSpec_NativeMemoryInfo*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PerformanceSpec_PerformanceObserverInit*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"entryTypes", &PerformanceSpec_PerformanceObserverInit::entryTypes}, - {L"type", &PerformanceSpec_PerformanceObserverInit::type}, - {L"buffered", &PerformanceSpec_PerformanceObserverInit::buffered}, - {L"durationThreshold", &PerformanceSpec_PerformanceObserverInit::durationThreshold}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PerformanceSpec_RawPerformanceEntry*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"name", &PerformanceSpec_RawPerformanceEntry::name}, - {L"entryType", &PerformanceSpec_RawPerformanceEntry::entryType}, - {L"startTime", &PerformanceSpec_RawPerformanceEntry::startTime}, - {L"duration", &PerformanceSpec_RawPerformanceEntry::duration}, - {L"processingStart", &PerformanceSpec_RawPerformanceEntry::processingStart}, - {L"processingEnd", &PerformanceSpec_RawPerformanceEntry::processingEnd}, - {L"interactionId", &PerformanceSpec_RawPerformanceEntry::interactionId}, - {L"fetchStart", &PerformanceSpec_RawPerformanceEntry::fetchStart}, - {L"requestStart", &PerformanceSpec_RawPerformanceEntry::requestStart}, - {L"connectStart", &PerformanceSpec_RawPerformanceEntry::connectStart}, - {L"connectEnd", &PerformanceSpec_RawPerformanceEntry::connectEnd}, - {L"responseStart", &PerformanceSpec_RawPerformanceEntry::responseStart}, - {L"responseEnd", &PerformanceSpec_RawPerformanceEntry::responseEnd}, - {L"responseStatus", &PerformanceSpec_RawPerformanceEntry::responseStatus}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PerformanceSpec_ReactNativeStartupTiming*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - - }; - return fieldMap; -} - -struct PerformanceSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - SyncMethod{0, L"now"}, - SyncMethod{1, L"markWithResult"}, - SyncMethod(std::string, double, double, double, std::string, std::string) noexcept>{2, L"measureWithResult"}, - Method{3, L"clearMarks"}, - Method{4, L"clearMeasures"}, - SyncMethod() noexcept>{5, L"getEntries"}, - SyncMethod(std::string, std::optional) noexcept>{6, L"getEntriesByName"}, - SyncMethod(double) noexcept>{7, L"getEntriesByType"}, - SyncMethod<::React::JSValueArray() noexcept>{8, L"getEventCounts"}, - SyncMethod<::React::JSValue() noexcept>{9, L"getSimpleMemoryInfo"}, - SyncMethod<::React::JSValue() noexcept>{10, L"getReactNativeStartupTiming"}, - SyncMethod<(Callback<>) noexcept>{11, L"createObserver"}, - SyncMethod{12, L"getDroppedEntriesCount"}, - Method{13, L"observe"}, - Method{14, L"disconnect"}, - SyncMethod(, bool) noexcept>{15, L"takeRecords"}, - SyncMethod() noexcept>{16, L"getSupportedPerformanceEntryTypes"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "now", - " REACT_SYNC_METHOD(now) double now() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(now) static double now() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "markWithResult", - " REACT_SYNC_METHOD(markWithResult) double markWithResult(std::string name, double startTime) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(markWithResult) static double markWithResult(std::string name, double startTime) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "measureWithResult", - " REACT_SYNC_METHOD(measureWithResult) std::vector measureWithResult(std::string name, double startTime, double endTime, double duration, std::string startMark, std::string endMark) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(measureWithResult) static std::vector measureWithResult(std::string name, double startTime, double endTime, double duration, std::string startMark, std::string endMark) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "clearMarks", - " REACT_METHOD(clearMarks) void clearMarks(std::string entryName) noexcept { /* implementation */ }\n" - " REACT_METHOD(clearMarks) static void clearMarks(std::string entryName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "clearMeasures", - " REACT_METHOD(clearMeasures) void clearMeasures(std::string entryName) noexcept { /* implementation */ }\n" - " REACT_METHOD(clearMeasures) static void clearMeasures(std::string entryName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "getEntries", - " REACT_SYNC_METHOD(getEntries) std::vector getEntries() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEntries) static std::vector getEntries() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "getEntriesByName", - " REACT_SYNC_METHOD(getEntriesByName) std::vector getEntriesByName(std::string entryName, std::optional entryType) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEntriesByName) static std::vector getEntriesByName(std::string entryName, std::optional entryType) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "getEntriesByType", - " REACT_SYNC_METHOD(getEntriesByType) std::vector getEntriesByType(double entryType) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEntriesByType) static std::vector getEntriesByType(double entryType) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "getEventCounts", - " REACT_SYNC_METHOD(getEventCounts) ::React::JSValueArray getEventCounts() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEventCounts) static ::React::JSValueArray getEventCounts() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "getSimpleMemoryInfo", - " REACT_SYNC_METHOD(getSimpleMemoryInfo) ::React::JSValue getSimpleMemoryInfo() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getSimpleMemoryInfo) static ::React::JSValue getSimpleMemoryInfo() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "getReactNativeStartupTiming", - " REACT_SYNC_METHOD(getReactNativeStartupTiming) ::React::JSValue getReactNativeStartupTiming() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getReactNativeStartupTiming) static ::React::JSValue getReactNativeStartupTiming() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "createObserver", - " REACT_SYNC_METHOD(createObserver) createObserver(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(createObserver) static createObserver(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "getDroppedEntriesCount", - " REACT_SYNC_METHOD(getDroppedEntriesCount) double getDroppedEntriesCount( observer) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getDroppedEntriesCount) static double getDroppedEntriesCount( observer) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "observe", - " REACT_METHOD(observe) void observe( observer, PerformanceSpec_PerformanceObserverInit && options) noexcept { /* implementation */ }\n" - " REACT_METHOD(observe) static void observe( observer, PerformanceSpec_PerformanceObserverInit && options) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "disconnect", - " REACT_METHOD(disconnect) void disconnect( observer) noexcept { /* implementation */ }\n" - " REACT_METHOD(disconnect) static void disconnect( observer) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "takeRecords", - " REACT_SYNC_METHOD(takeRecords) std::vector takeRecords( observer, bool sort) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(takeRecords) static std::vector takeRecords( observer, bool sort) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "getSupportedPerformanceEntryTypes", - " REACT_SYNC_METHOD(getSupportedPerformanceEntryTypes) std::vector getSupportedPerformanceEntryTypes() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getSupportedPerformanceEntryTypes) static std::vector getSupportedPerformanceEntryTypes() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativePermissionsAndroidSpec.g.h b/vnext/codegen/NativePermissionsAndroidSpec.g.h deleted file mode 100644 index 4bde8da8dae..00000000000 --- a/vnext/codegen/NativePermissionsAndroidSpec.g.h +++ /dev/null @@ -1,53 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct PermissionsAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"checkPermission"}, - Method) noexcept>{1, L"requestPermission"}, - Method) noexcept>{2, L"shouldShowRequestPermissionRationale"}, - Method, Promise<::React::JSValue>) noexcept>{3, L"requestMultiplePermissions"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "checkPermission", - " REACT_METHOD(checkPermission) void checkPermission(std::string permission, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(checkPermission) static void checkPermission(std::string permission, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "requestPermission", - " REACT_METHOD(requestPermission) void requestPermission(std::string permission, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(requestPermission) static void requestPermission(std::string permission, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "shouldShowRequestPermissionRationale", - " REACT_METHOD(shouldShowRequestPermissionRationale) void shouldShowRequestPermissionRationale(std::string permission, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(shouldShowRequestPermissionRationale) static void shouldShowRequestPermissionRationale(std::string permission, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "requestMultiplePermissions", - " REACT_METHOD(requestMultiplePermissions) void requestMultiplePermissions(std::vector const & permissions, ::React::ReactPromise<::React::JSValue> &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(requestMultiplePermissions) static void requestMultiplePermissions(std::vector const & permissions, ::React::ReactPromise<::React::JSValue> &&result) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativePlatformConstantsAndroidSpec.g.h b/vnext/codegen/NativePlatformConstantsAndroidSpec.g.h deleted file mode 100644 index 7cba243dd24..00000000000 --- a/vnext/codegen/NativePlatformConstantsAndroidSpec.g.h +++ /dev/null @@ -1,85 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct PlatformConstantsAndroidSpec_ReactNativeVersionAndroid { - double major; - double minor; - double patch; - std::optional prerelease; -}; - -struct PlatformConstantsAndroidSpec_PlatformConstantsAndroid { - bool isTesting; - std::optional isDisableAnimations; - PlatformConstantsAndroidSpec_ReactNativeVersionAndroid reactNativeVersion; - double Version; - std::string Release; - std::string Serial; - std::string Fingerprint; - std::string Model; - std::optional ServerHost; - std::string uiMode; - std::string Brand; - std::string Manufacturer; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsAndroidSpec_ReactNativeVersionAndroid*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"major", &PlatformConstantsAndroidSpec_ReactNativeVersionAndroid::major}, - {L"minor", &PlatformConstantsAndroidSpec_ReactNativeVersionAndroid::minor}, - {L"patch", &PlatformConstantsAndroidSpec_ReactNativeVersionAndroid::patch}, - {L"prerelease", &PlatformConstantsAndroidSpec_ReactNativeVersionAndroid::prerelease}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsAndroidSpec_PlatformConstantsAndroid*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"isTesting", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::isTesting}, - {L"isDisableAnimations", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::isDisableAnimations}, - {L"reactNativeVersion", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::reactNativeVersion}, - {L"Version", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::Version}, - {L"Release", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::Release}, - {L"Serial", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::Serial}, - {L"Fingerprint", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::Fingerprint}, - {L"Model", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::Model}, - {L"ServerHost", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::ServerHost}, - {L"uiMode", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::uiMode}, - {L"Brand", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::Brand}, - {L"Manufacturer", &PlatformConstantsAndroidSpec_PlatformConstantsAndroid::Manufacturer}, - }; - return fieldMap; -} - -struct PlatformConstantsAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - SyncMethod{0, L"getAndroidID"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getAndroidID", - " REACT_SYNC_METHOD(getAndroidID) std::string getAndroidID() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getAndroidID) static std::string getAndroidID() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativePlatformConstantsIOSSpec.g.h b/vnext/codegen/NativePlatformConstantsIOSSpec.g.h deleted file mode 100644 index c9c4ca1c224..00000000000 --- a/vnext/codegen/NativePlatformConstantsIOSSpec.g.h +++ /dev/null @@ -1,73 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct PlatformConstantsIOSSpec_PlatformConstantsIOS_reactNativeVersion { - double major; - double minor; - double patch; - std::optional prerelease; -}; - -struct PlatformConstantsIOSSpec_PlatformConstantsIOS { - bool isTesting; - std::optional isDisableAnimations; - PlatformConstantsIOSSpec_PlatformConstantsIOS_reactNativeVersion reactNativeVersion; - bool forceTouchAvailable; - std::string osVersion; - std::string systemName; - std::string interfaceIdiom; - std::optional isMacCatalyst; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsIOSSpec_PlatformConstantsIOS_reactNativeVersion*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"major", &PlatformConstantsIOSSpec_PlatformConstantsIOS_reactNativeVersion::major}, - {L"minor", &PlatformConstantsIOSSpec_PlatformConstantsIOS_reactNativeVersion::minor}, - {L"patch", &PlatformConstantsIOSSpec_PlatformConstantsIOS_reactNativeVersion::patch}, - {L"prerelease", &PlatformConstantsIOSSpec_PlatformConstantsIOS_reactNativeVersion::prerelease}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsIOSSpec_PlatformConstantsIOS*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"isTesting", &PlatformConstantsIOSSpec_PlatformConstantsIOS::isTesting}, - {L"isDisableAnimations", &PlatformConstantsIOSSpec_PlatformConstantsIOS::isDisableAnimations}, - {L"reactNativeVersion", &PlatformConstantsIOSSpec_PlatformConstantsIOS::reactNativeVersion}, - {L"forceTouchAvailable", &PlatformConstantsIOSSpec_PlatformConstantsIOS::forceTouchAvailable}, - {L"osVersion", &PlatformConstantsIOSSpec_PlatformConstantsIOS::osVersion}, - {L"systemName", &PlatformConstantsIOSSpec_PlatformConstantsIOS::systemName}, - {L"interfaceIdiom", &PlatformConstantsIOSSpec_PlatformConstantsIOS::interfaceIdiom}, - {L"isMacCatalyst", &PlatformConstantsIOSSpec_PlatformConstantsIOS::isMacCatalyst}, - }; - return fieldMap; -} - -struct PlatformConstantsIOSSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h b/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h deleted file mode 100644 index d6a274cbf5f..00000000000 --- a/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h +++ /dev/null @@ -1,82 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct PlatformConstantsWindowsSpec_ReactNativeVersionAndroid { - double major; - double minor; - double patch; - std::optional prerelease; -}; - -struct PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion { - double major; - double minor; - double patch; -}; - -struct PlatformConstantsWindowsSpec_PlatformConstantsWindows { - bool isTesting; - std::optional isDisableAnimations; - PlatformConstantsWindowsSpec_ReactNativeVersionAndroid reactNativeVersion; - PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion reactNativeWindowsVersion; - double osVersion; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_ReactNativeVersionAndroid*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"major", &PlatformConstantsWindowsSpec_ReactNativeVersionAndroid::major}, - {L"minor", &PlatformConstantsWindowsSpec_ReactNativeVersionAndroid::minor}, - {L"patch", &PlatformConstantsWindowsSpec_ReactNativeVersionAndroid::patch}, - {L"prerelease", &PlatformConstantsWindowsSpec_ReactNativeVersionAndroid::prerelease}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"major", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::major}, - {L"minor", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::minor}, - {L"patch", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::patch}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_PlatformConstantsWindows*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"isTesting", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::isTesting}, - {L"isDisableAnimations", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::isDisableAnimations}, - {L"reactNativeVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::reactNativeVersion}, - {L"reactNativeWindowsVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::reactNativeWindowsVersion}, - {L"osVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::osVersion}, - }; - return fieldMap; -} - -struct PlatformConstantsWindowsSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativePushNotificationManagerIOSSpec.g.h b/vnext/codegen/NativePushNotificationManagerIOSSpec.g.h deleted file mode 100644 index 7ebec3d5d30..00000000000 --- a/vnext/codegen/NativePushNotificationManagerIOSSpec.g.h +++ /dev/null @@ -1,194 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct PushNotificationManagerIOSSpec_Notification { - std::optional alertTitle; - std::optional alertBody; - std::optional<::React::JSValue> userInfo; - std::optional category; - std::optional fireDate; - std::optional fireIntervalSeconds; - std::optional applicationIconBadgeNumber; - std::optional isSilent; - std::optional soundName; -}; - -struct PushNotificationManagerIOSSpec_Permissions { - bool alert; - bool badge; - bool sound; -}; - -struct PushNotificationManagerIOSSpec_requestPermissions_permission { - bool alert; - bool badge; - bool sound; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PushNotificationManagerIOSSpec_Notification*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"alertTitle", &PushNotificationManagerIOSSpec_Notification::alertTitle}, - {L"alertBody", &PushNotificationManagerIOSSpec_Notification::alertBody}, - {L"userInfo", &PushNotificationManagerIOSSpec_Notification::userInfo}, - {L"category", &PushNotificationManagerIOSSpec_Notification::category}, - {L"fireDate", &PushNotificationManagerIOSSpec_Notification::fireDate}, - {L"fireIntervalSeconds", &PushNotificationManagerIOSSpec_Notification::fireIntervalSeconds}, - {L"applicationIconBadgeNumber", &PushNotificationManagerIOSSpec_Notification::applicationIconBadgeNumber}, - {L"isSilent", &PushNotificationManagerIOSSpec_Notification::isSilent}, - {L"soundName", &PushNotificationManagerIOSSpec_Notification::soundName}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PushNotificationManagerIOSSpec_Permissions*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"alert", &PushNotificationManagerIOSSpec_Permissions::alert}, - {L"badge", &PushNotificationManagerIOSSpec_Permissions::badge}, - {L"sound", &PushNotificationManagerIOSSpec_Permissions::sound}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PushNotificationManagerIOSSpec_requestPermissions_permission*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"alert", &PushNotificationManagerIOSSpec_requestPermissions_permission::alert}, - {L"badge", &PushNotificationManagerIOSSpec_requestPermissions_permission::badge}, - {L"sound", &PushNotificationManagerIOSSpec_requestPermissions_permission::sound}, - }; - return fieldMap; -} - -struct PushNotificationManagerIOSSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"onFinishRemoteNotification"}, - Method{1, L"setApplicationIconBadgeNumber"}, - Method) noexcept>{2, L"getApplicationIconBadgeNumber"}, - Method) noexcept>{3, L"requestPermissions"}, - Method{4, L"abandonPermissions"}, - Method) noexcept>{5, L"checkPermissions"}, - Method{6, L"presentLocalNotification"}, - Method{7, L"scheduleLocalNotification"}, - Method{8, L"cancelAllLocalNotifications"}, - Method{9, L"cancelLocalNotifications"}, - Method>) noexcept>{10, L"getInitialNotification"}, - Method) noexcept>{11, L"getScheduledLocalNotifications"}, - Method{12, L"removeAllDeliveredNotifications"}, - Method) noexcept>{13, L"removeDeliveredNotifications"}, - Method>) noexcept>{14, L"getDeliveredNotifications"}, - Method) noexcept>{15, L"getAuthorizationStatus"}, - Method{16, L"addListener"}, - Method{17, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "onFinishRemoteNotification", - " REACT_METHOD(onFinishRemoteNotification) void onFinishRemoteNotification(std::string notificationId, std::string fetchResult) noexcept { /* implementation */ }\n" - " REACT_METHOD(onFinishRemoteNotification) static void onFinishRemoteNotification(std::string notificationId, std::string fetchResult) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "setApplicationIconBadgeNumber", - " REACT_METHOD(setApplicationIconBadgeNumber) void setApplicationIconBadgeNumber(double num) noexcept { /* implementation */ }\n" - " REACT_METHOD(setApplicationIconBadgeNumber) static void setApplicationIconBadgeNumber(double num) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "getApplicationIconBadgeNumber", - " REACT_METHOD(getApplicationIconBadgeNumber) void getApplicationIconBadgeNumber(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getApplicationIconBadgeNumber) static void getApplicationIconBadgeNumber(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "requestPermissions", - " REACT_METHOD(requestPermissions) void requestPermissions(PushNotificationManagerIOSSpec_requestPermissions_permission && permission, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(requestPermissions) static void requestPermissions(PushNotificationManagerIOSSpec_requestPermissions_permission && permission, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "abandonPermissions", - " REACT_METHOD(abandonPermissions) void abandonPermissions() noexcept { /* implementation */ }\n" - " REACT_METHOD(abandonPermissions) static void abandonPermissions() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "checkPermissions", - " REACT_METHOD(checkPermissions) void checkPermissions(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(checkPermissions) static void checkPermissions(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "presentLocalNotification", - " REACT_METHOD(presentLocalNotification) void presentLocalNotification(PushNotificationManagerIOSSpec_Notification && notification) noexcept { /* implementation */ }\n" - " REACT_METHOD(presentLocalNotification) static void presentLocalNotification(PushNotificationManagerIOSSpec_Notification && notification) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "scheduleLocalNotification", - " REACT_METHOD(scheduleLocalNotification) void scheduleLocalNotification(PushNotificationManagerIOSSpec_Notification && notification) noexcept { /* implementation */ }\n" - " REACT_METHOD(scheduleLocalNotification) static void scheduleLocalNotification(PushNotificationManagerIOSSpec_Notification && notification) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "cancelAllLocalNotifications", - " REACT_METHOD(cancelAllLocalNotifications) void cancelAllLocalNotifications() noexcept { /* implementation */ }\n" - " REACT_METHOD(cancelAllLocalNotifications) static void cancelAllLocalNotifications() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "cancelLocalNotifications", - " REACT_METHOD(cancelLocalNotifications) void cancelLocalNotifications(::React::JSValue && userInfo) noexcept { /* implementation */ }\n" - " REACT_METHOD(cancelLocalNotifications) static void cancelLocalNotifications(::React::JSValue && userInfo) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "getInitialNotification", - " REACT_METHOD(getInitialNotification) void getInitialNotification(::React::ReactPromise> &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getInitialNotification) static void getInitialNotification(::React::ReactPromise> &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "getScheduledLocalNotifications", - " REACT_METHOD(getScheduledLocalNotifications) void getScheduledLocalNotifications(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getScheduledLocalNotifications) static void getScheduledLocalNotifications(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "removeAllDeliveredNotifications", - " REACT_METHOD(removeAllDeliveredNotifications) void removeAllDeliveredNotifications() noexcept { /* implementation */ }\n" - " REACT_METHOD(removeAllDeliveredNotifications) static void removeAllDeliveredNotifications() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "removeDeliveredNotifications", - " REACT_METHOD(removeDeliveredNotifications) void removeDeliveredNotifications(std::vector const & identifiers) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeDeliveredNotifications) static void removeDeliveredNotifications(std::vector const & identifiers) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "getDeliveredNotifications", - " REACT_METHOD(getDeliveredNotifications) void getDeliveredNotifications(std::function const &)> const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getDeliveredNotifications) static void getDeliveredNotifications(std::function const &)> const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "getAuthorizationStatus", - " REACT_METHOD(getAuthorizationStatus) void getAuthorizationStatus(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getAuthorizationStatus) static void getAuthorizationStatus(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventType) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventType) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h b/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h deleted file mode 100644 index c9275869659..00000000000 --- a/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h +++ /dev/null @@ -1,67 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig { - std::optional shouldReloadAndProfile; - std::optional recordChangeDescriptions; -}; - -struct ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig { - bool shouldReloadAndProfile; - bool recordChangeDescriptions; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"shouldReloadAndProfile", &ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig::shouldReloadAndProfile}, - {L"recordChangeDescriptions", &ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig::recordChangeDescriptions}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"shouldReloadAndProfile", &ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig::shouldReloadAndProfile}, - {L"recordChangeDescriptions", &ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig::recordChangeDescriptions}, - }; - return fieldMap; -} - -struct ReactDevToolsRuntimeSettingsModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"setReloadAndProfileConfig"}, - SyncMethod{1, L"getReloadAndProfileConfig"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "setReloadAndProfileConfig", - " REACT_METHOD(setReloadAndProfileConfig) void setReloadAndProfileConfig(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig && config) noexcept { /* implementation */ }\n" - " REACT_METHOD(setReloadAndProfileConfig) static void setReloadAndProfileConfig(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig && config) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getReloadAndProfileConfig", - " REACT_SYNC_METHOD(getReloadAndProfileConfig) ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig getReloadAndProfileConfig() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getReloadAndProfileConfig) static ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig getReloadAndProfileConfig() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h b/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h deleted file mode 100644 index 3aa4d89dc57..00000000000 --- a/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct ReactDevToolsSettingsManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"setGlobalHookSettings"}, - SyncMethod() noexcept>{1, L"getGlobalHookSettings"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "setGlobalHookSettings", - " REACT_METHOD(setGlobalHookSettings) void setGlobalHookSettings(std::string settings) noexcept { /* implementation */ }\n" - " REACT_METHOD(setGlobalHookSettings) static void setGlobalHookSettings(std::string settings) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getGlobalHookSettings", - " REACT_SYNC_METHOD(getGlobalHookSettings) std::optional getGlobalHookSettings() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getGlobalHookSettings) static std::optional getGlobalHookSettings() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h b/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h deleted file mode 100644 index 0a5494359e7..00000000000 --- a/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h +++ /dev/null @@ -1,371 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct ReactNativeFeatureFlagsSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - SyncMethod{0, L"commonTestFlag"}, - SyncMethod{1, L"commonTestFlagWithoutNativeImplementation"}, - SyncMethod{2, L"animatedShouldSignalBatch"}, - SyncMethod{3, L"cxxNativeAnimatedEnabled"}, - SyncMethod{4, L"cxxNativeAnimatedRemoveJsSync"}, - SyncMethod{5, L"disableMainQueueSyncDispatchIOS"}, - SyncMethod{6, L"disableMountItemReorderingAndroid"}, - SyncMethod{7, L"disableTextLayoutManagerCacheAndroid"}, - SyncMethod{8, L"enableAccessibilityOrder"}, - SyncMethod{9, L"enableAccumulatedUpdatesInRawPropsAndroid"}, - SyncMethod{10, L"enableBridgelessArchitecture"}, - SyncMethod{11, L"enableCppPropsIteratorSetter"}, - SyncMethod{12, L"enableCustomFocusSearchOnClippedElementsAndroid"}, - SyncMethod{13, L"enableDestroyShadowTreeRevisionAsync"}, - SyncMethod{14, L"enableDoubleMeasurementFixAndroid"}, - SyncMethod{15, L"enableEagerRootViewAttachment"}, - SyncMethod{16, L"enableFabricLogs"}, - SyncMethod{17, L"enableFabricRenderer"}, - SyncMethod{18, L"enableFixForParentTagDuringReparenting"}, - SyncMethod{19, L"enableFontScaleChangesUpdatingLayout"}, - SyncMethod{20, L"enableIOSTextBaselineOffsetPerLine"}, - SyncMethod{21, L"enableIOSViewClipToPaddingBox"}, - SyncMethod{22, L"enableInteropViewManagerClassLookUpOptimizationIOS"}, - SyncMethod{23, L"enableLayoutAnimationsOnAndroid"}, - SyncMethod{24, L"enableLayoutAnimationsOnIOS"}, - SyncMethod{25, L"enableMainQueueCoordinatorOnIOS"}, - SyncMethod{26, L"enableMainQueueModulesOnIOS"}, - SyncMethod{27, L"enableModuleArgumentNSNullConversionIOS"}, - SyncMethod{28, L"enableNativeCSSParsing"}, - SyncMethod{29, L"enableNetworkEventReporting"}, - SyncMethod{30, L"enableNewBackgroundAndBorderDrawables"}, - SyncMethod{31, L"enablePreparedTextLayout"}, - SyncMethod{32, L"enablePropsUpdateReconciliationAndroid"}, - SyncMethod{33, L"enableResourceTimingAPI"}, - SyncMethod{34, L"enableSynchronousStateUpdates"}, - SyncMethod{35, L"enableViewCulling"}, - SyncMethod{36, L"enableViewRecycling"}, - SyncMethod{37, L"enableViewRecyclingForText"}, - SyncMethod{38, L"enableViewRecyclingForView"}, - SyncMethod{39, L"enableVirtualViewDebugFeatures"}, - SyncMethod{40, L"enableVirtualViewRenderState"}, - SyncMethod{41, L"enableVirtualViewWindowFocusDetection"}, - SyncMethod{42, L"fixMappingOfEventPrioritiesBetweenFabricAndReact"}, - SyncMethod{43, L"fuseboxEnabledRelease"}, - SyncMethod{44, L"fuseboxNetworkInspectionEnabled"}, - SyncMethod{45, L"preparedTextCacheSize"}, - SyncMethod{46, L"traceTurboModulePromiseRejectionsOnAndroid"}, - SyncMethod{47, L"updateRuntimeShadowNodeReferencesOnCommit"}, - SyncMethod{48, L"useAlwaysAvailableJSErrorHandling"}, - SyncMethod{49, L"useFabricInterop"}, - SyncMethod{50, L"useNativeViewConfigsInBridgelessMode"}, - SyncMethod{51, L"useOptimizedEventBatchingOnAndroid"}, - SyncMethod{52, L"useRawPropsJsiValue"}, - SyncMethod{53, L"useShadowNodeStateOnClone"}, - SyncMethod{54, L"useTurboModuleInterop"}, - SyncMethod{55, L"useTurboModules"}, - SyncMethod{56, L"virtualViewPrerenderRatio"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "commonTestFlag", - " REACT_SYNC_METHOD(commonTestFlag) bool commonTestFlag() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(commonTestFlag) static bool commonTestFlag() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "commonTestFlagWithoutNativeImplementation", - " REACT_SYNC_METHOD(commonTestFlagWithoutNativeImplementation) bool commonTestFlagWithoutNativeImplementation() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(commonTestFlagWithoutNativeImplementation) static bool commonTestFlagWithoutNativeImplementation() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "animatedShouldSignalBatch", - " REACT_SYNC_METHOD(animatedShouldSignalBatch) bool animatedShouldSignalBatch() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(animatedShouldSignalBatch) static bool animatedShouldSignalBatch() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "cxxNativeAnimatedEnabled", - " REACT_SYNC_METHOD(cxxNativeAnimatedEnabled) bool cxxNativeAnimatedEnabled() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(cxxNativeAnimatedEnabled) static bool cxxNativeAnimatedEnabled() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "cxxNativeAnimatedRemoveJsSync", - " REACT_SYNC_METHOD(cxxNativeAnimatedRemoveJsSync) bool cxxNativeAnimatedRemoveJsSync() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(cxxNativeAnimatedRemoveJsSync) static bool cxxNativeAnimatedRemoveJsSync() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "disableMainQueueSyncDispatchIOS", - " REACT_SYNC_METHOD(disableMainQueueSyncDispatchIOS) bool disableMainQueueSyncDispatchIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(disableMainQueueSyncDispatchIOS) static bool disableMainQueueSyncDispatchIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "disableMountItemReorderingAndroid", - " REACT_SYNC_METHOD(disableMountItemReorderingAndroid) bool disableMountItemReorderingAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(disableMountItemReorderingAndroid) static bool disableMountItemReorderingAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "disableTextLayoutManagerCacheAndroid", - " REACT_SYNC_METHOD(disableTextLayoutManagerCacheAndroid) bool disableTextLayoutManagerCacheAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(disableTextLayoutManagerCacheAndroid) static bool disableTextLayoutManagerCacheAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "enableAccessibilityOrder", - " REACT_SYNC_METHOD(enableAccessibilityOrder) bool enableAccessibilityOrder() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableAccessibilityOrder) static bool enableAccessibilityOrder() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "enableAccumulatedUpdatesInRawPropsAndroid", - " REACT_SYNC_METHOD(enableAccumulatedUpdatesInRawPropsAndroid) bool enableAccumulatedUpdatesInRawPropsAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableAccumulatedUpdatesInRawPropsAndroid) static bool enableAccumulatedUpdatesInRawPropsAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "enableBridgelessArchitecture", - " REACT_SYNC_METHOD(enableBridgelessArchitecture) bool enableBridgelessArchitecture() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableBridgelessArchitecture) static bool enableBridgelessArchitecture() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "enableCppPropsIteratorSetter", - " REACT_SYNC_METHOD(enableCppPropsIteratorSetter) bool enableCppPropsIteratorSetter() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableCppPropsIteratorSetter) static bool enableCppPropsIteratorSetter() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "enableCustomFocusSearchOnClippedElementsAndroid", - " REACT_SYNC_METHOD(enableCustomFocusSearchOnClippedElementsAndroid) bool enableCustomFocusSearchOnClippedElementsAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableCustomFocusSearchOnClippedElementsAndroid) static bool enableCustomFocusSearchOnClippedElementsAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "enableDestroyShadowTreeRevisionAsync", - " REACT_SYNC_METHOD(enableDestroyShadowTreeRevisionAsync) bool enableDestroyShadowTreeRevisionAsync() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableDestroyShadowTreeRevisionAsync) static bool enableDestroyShadowTreeRevisionAsync() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "enableDoubleMeasurementFixAndroid", - " REACT_SYNC_METHOD(enableDoubleMeasurementFixAndroid) bool enableDoubleMeasurementFixAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableDoubleMeasurementFixAndroid) static bool enableDoubleMeasurementFixAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "enableEagerRootViewAttachment", - " REACT_SYNC_METHOD(enableEagerRootViewAttachment) bool enableEagerRootViewAttachment() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableEagerRootViewAttachment) static bool enableEagerRootViewAttachment() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "enableFabricLogs", - " REACT_SYNC_METHOD(enableFabricLogs) bool enableFabricLogs() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableFabricLogs) static bool enableFabricLogs() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "enableFabricRenderer", - " REACT_SYNC_METHOD(enableFabricRenderer) bool enableFabricRenderer() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableFabricRenderer) static bool enableFabricRenderer() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 18, - "enableFixForParentTagDuringReparenting", - " REACT_SYNC_METHOD(enableFixForParentTagDuringReparenting) bool enableFixForParentTagDuringReparenting() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableFixForParentTagDuringReparenting) static bool enableFixForParentTagDuringReparenting() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 19, - "enableFontScaleChangesUpdatingLayout", - " REACT_SYNC_METHOD(enableFontScaleChangesUpdatingLayout) bool enableFontScaleChangesUpdatingLayout() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableFontScaleChangesUpdatingLayout) static bool enableFontScaleChangesUpdatingLayout() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 20, - "enableIOSTextBaselineOffsetPerLine", - " REACT_SYNC_METHOD(enableIOSTextBaselineOffsetPerLine) bool enableIOSTextBaselineOffsetPerLine() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableIOSTextBaselineOffsetPerLine) static bool enableIOSTextBaselineOffsetPerLine() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 21, - "enableIOSViewClipToPaddingBox", - " REACT_SYNC_METHOD(enableIOSViewClipToPaddingBox) bool enableIOSViewClipToPaddingBox() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableIOSViewClipToPaddingBox) static bool enableIOSViewClipToPaddingBox() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 22, - "enableInteropViewManagerClassLookUpOptimizationIOS", - " REACT_SYNC_METHOD(enableInteropViewManagerClassLookUpOptimizationIOS) bool enableInteropViewManagerClassLookUpOptimizationIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableInteropViewManagerClassLookUpOptimizationIOS) static bool enableInteropViewManagerClassLookUpOptimizationIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 23, - "enableLayoutAnimationsOnAndroid", - " REACT_SYNC_METHOD(enableLayoutAnimationsOnAndroid) bool enableLayoutAnimationsOnAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableLayoutAnimationsOnAndroid) static bool enableLayoutAnimationsOnAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 24, - "enableLayoutAnimationsOnIOS", - " REACT_SYNC_METHOD(enableLayoutAnimationsOnIOS) bool enableLayoutAnimationsOnIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableLayoutAnimationsOnIOS) static bool enableLayoutAnimationsOnIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 25, - "enableMainQueueCoordinatorOnIOS", - " REACT_SYNC_METHOD(enableMainQueueCoordinatorOnIOS) bool enableMainQueueCoordinatorOnIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableMainQueueCoordinatorOnIOS) static bool enableMainQueueCoordinatorOnIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 26, - "enableMainQueueModulesOnIOS", - " REACT_SYNC_METHOD(enableMainQueueModulesOnIOS) bool enableMainQueueModulesOnIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableMainQueueModulesOnIOS) static bool enableMainQueueModulesOnIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 27, - "enableModuleArgumentNSNullConversionIOS", - " REACT_SYNC_METHOD(enableModuleArgumentNSNullConversionIOS) bool enableModuleArgumentNSNullConversionIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableModuleArgumentNSNullConversionIOS) static bool enableModuleArgumentNSNullConversionIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 28, - "enableNativeCSSParsing", - " REACT_SYNC_METHOD(enableNativeCSSParsing) bool enableNativeCSSParsing() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableNativeCSSParsing) static bool enableNativeCSSParsing() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 29, - "enableNetworkEventReporting", - " REACT_SYNC_METHOD(enableNetworkEventReporting) bool enableNetworkEventReporting() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableNetworkEventReporting) static bool enableNetworkEventReporting() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 30, - "enableNewBackgroundAndBorderDrawables", - " REACT_SYNC_METHOD(enableNewBackgroundAndBorderDrawables) bool enableNewBackgroundAndBorderDrawables() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableNewBackgroundAndBorderDrawables) static bool enableNewBackgroundAndBorderDrawables() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 31, - "enablePreparedTextLayout", - " REACT_SYNC_METHOD(enablePreparedTextLayout) bool enablePreparedTextLayout() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enablePreparedTextLayout) static bool enablePreparedTextLayout() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 32, - "enablePropsUpdateReconciliationAndroid", - " REACT_SYNC_METHOD(enablePropsUpdateReconciliationAndroid) bool enablePropsUpdateReconciliationAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enablePropsUpdateReconciliationAndroid) static bool enablePropsUpdateReconciliationAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 33, - "enableResourceTimingAPI", - " REACT_SYNC_METHOD(enableResourceTimingAPI) bool enableResourceTimingAPI() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableResourceTimingAPI) static bool enableResourceTimingAPI() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 34, - "enableSynchronousStateUpdates", - " REACT_SYNC_METHOD(enableSynchronousStateUpdates) bool enableSynchronousStateUpdates() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableSynchronousStateUpdates) static bool enableSynchronousStateUpdates() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 35, - "enableViewCulling", - " REACT_SYNC_METHOD(enableViewCulling) bool enableViewCulling() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableViewCulling) static bool enableViewCulling() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 36, - "enableViewRecycling", - " REACT_SYNC_METHOD(enableViewRecycling) bool enableViewRecycling() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableViewRecycling) static bool enableViewRecycling() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 37, - "enableViewRecyclingForText", - " REACT_SYNC_METHOD(enableViewRecyclingForText) bool enableViewRecyclingForText() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableViewRecyclingForText) static bool enableViewRecyclingForText() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 38, - "enableViewRecyclingForView", - " REACT_SYNC_METHOD(enableViewRecyclingForView) bool enableViewRecyclingForView() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableViewRecyclingForView) static bool enableViewRecyclingForView() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 39, - "enableVirtualViewDebugFeatures", - " REACT_SYNC_METHOD(enableVirtualViewDebugFeatures) bool enableVirtualViewDebugFeatures() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableVirtualViewDebugFeatures) static bool enableVirtualViewDebugFeatures() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 40, - "enableVirtualViewRenderState", - " REACT_SYNC_METHOD(enableVirtualViewRenderState) bool enableVirtualViewRenderState() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableVirtualViewRenderState) static bool enableVirtualViewRenderState() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 41, - "enableVirtualViewWindowFocusDetection", - " REACT_SYNC_METHOD(enableVirtualViewWindowFocusDetection) bool enableVirtualViewWindowFocusDetection() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableVirtualViewWindowFocusDetection) static bool enableVirtualViewWindowFocusDetection() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 42, - "fixMappingOfEventPrioritiesBetweenFabricAndReact", - " REACT_SYNC_METHOD(fixMappingOfEventPrioritiesBetweenFabricAndReact) bool fixMappingOfEventPrioritiesBetweenFabricAndReact() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(fixMappingOfEventPrioritiesBetweenFabricAndReact) static bool fixMappingOfEventPrioritiesBetweenFabricAndReact() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 43, - "fuseboxEnabledRelease", - " REACT_SYNC_METHOD(fuseboxEnabledRelease) bool fuseboxEnabledRelease() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(fuseboxEnabledRelease) static bool fuseboxEnabledRelease() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 44, - "fuseboxNetworkInspectionEnabled", - " REACT_SYNC_METHOD(fuseboxNetworkInspectionEnabled) bool fuseboxNetworkInspectionEnabled() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(fuseboxNetworkInspectionEnabled) static bool fuseboxNetworkInspectionEnabled() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 45, - "preparedTextCacheSize", - " REACT_SYNC_METHOD(preparedTextCacheSize) double preparedTextCacheSize() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(preparedTextCacheSize) static double preparedTextCacheSize() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 46, - "traceTurboModulePromiseRejectionsOnAndroid", - " REACT_SYNC_METHOD(traceTurboModulePromiseRejectionsOnAndroid) bool traceTurboModulePromiseRejectionsOnAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(traceTurboModulePromiseRejectionsOnAndroid) static bool traceTurboModulePromiseRejectionsOnAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 47, - "updateRuntimeShadowNodeReferencesOnCommit", - " REACT_SYNC_METHOD(updateRuntimeShadowNodeReferencesOnCommit) bool updateRuntimeShadowNodeReferencesOnCommit() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(updateRuntimeShadowNodeReferencesOnCommit) static bool updateRuntimeShadowNodeReferencesOnCommit() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 48, - "useAlwaysAvailableJSErrorHandling", - " REACT_SYNC_METHOD(useAlwaysAvailableJSErrorHandling) bool useAlwaysAvailableJSErrorHandling() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useAlwaysAvailableJSErrorHandling) static bool useAlwaysAvailableJSErrorHandling() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 49, - "useFabricInterop", - " REACT_SYNC_METHOD(useFabricInterop) bool useFabricInterop() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useFabricInterop) static bool useFabricInterop() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 50, - "useNativeViewConfigsInBridgelessMode", - " REACT_SYNC_METHOD(useNativeViewConfigsInBridgelessMode) bool useNativeViewConfigsInBridgelessMode() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useNativeViewConfigsInBridgelessMode) static bool useNativeViewConfigsInBridgelessMode() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 51, - "useOptimizedEventBatchingOnAndroid", - " REACT_SYNC_METHOD(useOptimizedEventBatchingOnAndroid) bool useOptimizedEventBatchingOnAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useOptimizedEventBatchingOnAndroid) static bool useOptimizedEventBatchingOnAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 52, - "useRawPropsJsiValue", - " REACT_SYNC_METHOD(useRawPropsJsiValue) bool useRawPropsJsiValue() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useRawPropsJsiValue) static bool useRawPropsJsiValue() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 53, - "useShadowNodeStateOnClone", - " REACT_SYNC_METHOD(useShadowNodeStateOnClone) bool useShadowNodeStateOnClone() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useShadowNodeStateOnClone) static bool useShadowNodeStateOnClone() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 54, - "useTurboModuleInterop", - " REACT_SYNC_METHOD(useTurboModuleInterop) bool useTurboModuleInterop() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useTurboModuleInterop) static bool useTurboModuleInterop() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 55, - "useTurboModules", - " REACT_SYNC_METHOD(useTurboModules) bool useTurboModules() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useTurboModules) static bool useTurboModules() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 56, - "virtualViewPrerenderRatio", - " REACT_SYNC_METHOD(virtualViewPrerenderRatio) double virtualViewPrerenderRatio() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(virtualViewPrerenderRatio) static double virtualViewPrerenderRatio() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeRedBoxSpec.g.h b/vnext/codegen/NativeRedBoxSpec.g.h deleted file mode 100644 index df5920f44d0..00000000000 --- a/vnext/codegen/NativeRedBoxSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct RedBoxSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"setExtraData"}, - Method{1, L"dismiss"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "setExtraData", - " REACT_METHOD(setExtraData) void setExtraData(::React::JSValue && extraData, std::string forIdentifier) noexcept { /* implementation */ }\n" - " REACT_METHOD(setExtraData) static void setExtraData(::React::JSValue && extraData, std::string forIdentifier) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "dismiss", - " REACT_METHOD(dismiss) void dismiss() noexcept { /* implementation */ }\n" - " REACT_METHOD(dismiss) static void dismiss() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeSampleTurboModuleSpec.g.h b/vnext/codegen/NativeSampleTurboModuleSpec.g.h deleted file mode 100644 index 3aef0ad9002..00000000000 --- a/vnext/codegen/NativeSampleTurboModuleSpec.g.h +++ /dev/null @@ -1,203 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct SampleTurboModuleSpec_ObjectStruct { - double a; - std::string b; - std::optional c; -}; - -struct SampleTurboModuleSpec_Constants { - bool const1; - double const2; - std::string const3; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(SampleTurboModuleSpec_ObjectStruct*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"a", &SampleTurboModuleSpec_ObjectStruct::a}, - {L"b", &SampleTurboModuleSpec_ObjectStruct::b}, - {L"c", &SampleTurboModuleSpec_ObjectStruct::c}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(SampleTurboModuleSpec_Constants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"const1", &SampleTurboModuleSpec_Constants::const1}, - {L"const2", &SampleTurboModuleSpec_Constants::const2}, - {L"const3", &SampleTurboModuleSpec_Constants::const3}, - }; - return fieldMap; -} - -struct SampleTurboModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto constants = std::tuple{ - TypedConstant{0}, - }; - static constexpr auto methods = std::tuple{ - Method{0, L"voidFunc"}, - SyncMethod{1, L"getBool"}, - SyncMethod{2, L"getEnum"}, - SyncMethod{3, L"getNumber"}, - SyncMethod{4, L"getString"}, - SyncMethod<::React::JSValueArray(::React::JSValueArray) noexcept>{5, L"getArray"}, - SyncMethod<::React::JSValue(::React::JSValue) noexcept>{6, L"getObject"}, - SyncMethod<::React::JSValue(::React::JSValue) noexcept>{7, L"getUnsafeObject"}, - SyncMethod{8, L"getRootTag"}, - SyncMethod<::React::JSValue(double, std::string, ::React::JSValue) noexcept>{9, L"getValue"}, - Method) noexcept>{10, L"getValueWithCallback"}, - Method) noexcept>{11, L"getValueWithPromise"}, - Method{12, L"voidFuncThrows"}, - SyncMethod<::React::JSValue(::React::JSValue) noexcept>{13, L"getObjectThrows"}, - Method) noexcept>{14, L"promiseThrows"}, - Method{15, L"voidFuncAssert"}, - SyncMethod<::React::JSValue(::React::JSValue) noexcept>{16, L"getObjectAssert"}, - Method) noexcept>{17, L"promiseAssert"}, - Method) noexcept>{18, L"getImageUrl"}, - EventEmitter{19, L"onPress"}, - EventEmitter{20, L"onClick"}, - EventEmitter{21, L"onChange"}, - EventEmitter)>{22, L"onSubmit"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto constantCheckResults = CheckConstants(); - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_CONSTANT_SPEC_ERRORS( - 0, - "SampleTurboModuleSpec_Constants", - " REACT_GET_CONSTANTS(GetConstants) SampleTurboModuleSpec_Constants GetConstants() noexcept {/*implementation*/}\n" - " REACT_GET_CONSTANTS(GetConstants) static SampleTurboModuleSpec_Constants GetConstants() noexcept {/*implementation*/}\n"); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "voidFunc", - " REACT_METHOD(voidFunc) void voidFunc() noexcept { /* implementation */ }\n" - " REACT_METHOD(voidFunc) static void voidFunc() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getBool", - " REACT_SYNC_METHOD(getBool) bool getBool(bool arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getBool) static bool getBool(bool arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "getEnum", - " REACT_SYNC_METHOD(getEnum) double getEnum(double arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEnum) static double getEnum(double arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "getNumber", - " REACT_SYNC_METHOD(getNumber) double getNumber(double arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getNumber) static double getNumber(double arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "getString", - " REACT_SYNC_METHOD(getString) std::string getString(std::string arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getString) static std::string getString(std::string arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "getArray", - " REACT_SYNC_METHOD(getArray) ::React::JSValueArray getArray(::React::JSValueArray && arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getArray) static ::React::JSValueArray getArray(::React::JSValueArray && arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "getObject", - " REACT_SYNC_METHOD(getObject) ::React::JSValue getObject(::React::JSValue && arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getObject) static ::React::JSValue getObject(::React::JSValue && arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "getUnsafeObject", - " REACT_SYNC_METHOD(getUnsafeObject) ::React::JSValue getUnsafeObject(::React::JSValue && arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getUnsafeObject) static ::React::JSValue getUnsafeObject(::React::JSValue && arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "getRootTag", - " REACT_SYNC_METHOD(getRootTag) double getRootTag(double arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getRootTag) static double getRootTag(double arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "getValue", - " REACT_SYNC_METHOD(getValue) ::React::JSValue getValue(double x, std::string y, ::React::JSValue && z) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getValue) static ::React::JSValue getValue(double x, std::string y, ::React::JSValue && z) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "getValueWithCallback", - " REACT_METHOD(getValueWithCallback) void getValueWithCallback(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getValueWithCallback) static void getValueWithCallback(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "getValueWithPromise", - " REACT_METHOD(getValueWithPromise) void getValueWithPromise(bool error, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getValueWithPromise) static void getValueWithPromise(bool error, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "voidFuncThrows", - " REACT_METHOD(voidFuncThrows) void voidFuncThrows() noexcept { /* implementation */ }\n" - " REACT_METHOD(voidFuncThrows) static void voidFuncThrows() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "getObjectThrows", - " REACT_SYNC_METHOD(getObjectThrows) ::React::JSValue getObjectThrows(::React::JSValue && arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getObjectThrows) static ::React::JSValue getObjectThrows(::React::JSValue && arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "promiseThrows", - " REACT_METHOD(promiseThrows) void promiseThrows(::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(promiseThrows) static void promiseThrows(::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "voidFuncAssert", - " REACT_METHOD(voidFuncAssert) void voidFuncAssert() noexcept { /* implementation */ }\n" - " REACT_METHOD(voidFuncAssert) static void voidFuncAssert() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "getObjectAssert", - " REACT_SYNC_METHOD(getObjectAssert) ::React::JSValue getObjectAssert(::React::JSValue && arg) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getObjectAssert) static ::React::JSValue getObjectAssert(::React::JSValue && arg) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "promiseAssert", - " REACT_METHOD(promiseAssert) void promiseAssert(::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(promiseAssert) static void promiseAssert(::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 18, - "getImageUrl", - " REACT_METHOD(getImageUrl) void getImageUrl(::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(getImageUrl) static void getImageUrl(::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - REACT_SHOW_EVENTEMITTER_SPEC_ERRORS( - 19, - "onPress", - " REACT_EVENT(onPress) std::function onPress;\n"); - REACT_SHOW_EVENTEMITTER_SPEC_ERRORS( - 20, - "onClick", - " REACT_EVENT(onClick) std::function onClick;\n"); - REACT_SHOW_EVENTEMITTER_SPEC_ERRORS( - 21, - "onChange", - " REACT_EVENT(onChange) std::function onChange;\n"); - REACT_SHOW_EVENTEMITTER_SPEC_ERRORS( - 22, - "onSubmit", - " REACT_EVENT(onSubmit) std::function)> onSubmit;\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeSegmentFetcherSpec.g.h b/vnext/codegen/NativeSegmentFetcherSpec.g.h deleted file mode 100644 index 437c2ec2733..00000000000 --- a/vnext/codegen/NativeSegmentFetcherSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct SegmentFetcherSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method>) noexcept>{0, L"fetchSegment"}, - Method, std::optional>) noexcept>{1, L"getSegment"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "fetchSegment", - " REACT_METHOD(fetchSegment) void fetchSegment(double segmentId, ::React::JSValue && options, std::function)> const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(fetchSegment) static void fetchSegment(double segmentId, ::React::JSValue && options, std::function)> const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getSegment", - " REACT_METHOD(getSegment) void getSegment(double segmentId, ::React::JSValue && options, std::function, std::optional)> const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getSegment) static void getSegment(double segmentId, ::React::JSValue && options, std::function, std::optional)> const & callback) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeSettingsManagerSpec.g.h b/vnext/codegen/NativeSettingsManagerSpec.g.h deleted file mode 100644 index e7c95185389..00000000000 --- a/vnext/codegen/NativeSettingsManagerSpec.g.h +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct SettingsManagerSpec_Constants { - ::React::JSValue settings; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(SettingsManagerSpec_Constants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"settings", &SettingsManagerSpec_Constants::settings}, - }; - return fieldMap; -} - -struct SettingsManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto constants = std::tuple{ - TypedConstant{0}, - }; - static constexpr auto methods = std::tuple{ - Method{0, L"setValues"}, - Method) noexcept>{1, L"deleteValues"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto constantCheckResults = CheckConstants(); - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_CONSTANT_SPEC_ERRORS( - 0, - "SettingsManagerSpec_Constants", - " REACT_GET_CONSTANTS(GetConstants) SettingsManagerSpec_Constants GetConstants() noexcept {/*implementation*/}\n" - " REACT_GET_CONSTANTS(GetConstants) static SettingsManagerSpec_Constants GetConstants() noexcept {/*implementation*/}\n"); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "setValues", - " REACT_METHOD(setValues) void setValues(::React::JSValue && values) noexcept { /* implementation */ }\n" - " REACT_METHOD(setValues) static void setValues(::React::JSValue && values) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "deleteValues", - " REACT_METHOD(deleteValues) void deleteValues(std::vector const & values) noexcept { /* implementation */ }\n" - " REACT_METHOD(deleteValues) static void deleteValues(std::vector const & values) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeShareModuleSpec.g.h b/vnext/codegen/NativeShareModuleSpec.g.h deleted file mode 100644 index 203924e6799..00000000000 --- a/vnext/codegen/NativeShareModuleSpec.g.h +++ /dev/null @@ -1,59 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ShareModuleSpec_share_content { - std::optional title; - std::optional message; -}; - -struct ShareModuleSpec_share_returnType { - std::string action; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ShareModuleSpec_share_content*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"title", &ShareModuleSpec_share_content::title}, - {L"message", &ShareModuleSpec_share_content::message}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ShareModuleSpec_share_returnType*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"action", &ShareModuleSpec_share_returnType::action}, - }; - return fieldMap; -} - -struct ShareModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"share"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "share", - " REACT_METHOD(share) void share(ShareModuleSpec_share_content && content, std::string dialogTitle, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n" - " REACT_METHOD(share) static void share(ShareModuleSpec_share_content && content, std::string dialogTitle, ::React::ReactPromise &&result) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeSoundManagerSpec.g.h b/vnext/codegen/NativeSoundManagerSpec.g.h deleted file mode 100644 index 0261a978d41..00000000000 --- a/vnext/codegen/NativeSoundManagerSpec.g.h +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct SoundManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"playTouchSound"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "playTouchSound", - " REACT_METHOD(playTouchSound) void playTouchSound() noexcept { /* implementation */ }\n" - " REACT_METHOD(playTouchSound) static void playTouchSound() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeSourceCodeSpec.g.h b/vnext/codegen/NativeSourceCodeSpec.g.h deleted file mode 100644 index 814ab87ba70..00000000000 --- a/vnext/codegen/NativeSourceCodeSpec.g.h +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct SourceCodeSpec_SourceCodeConstants { - std::string scriptURL; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(SourceCodeSpec_SourceCodeConstants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"scriptURL", &SourceCodeSpec_SourceCodeConstants::scriptURL}, - }; - return fieldMap; -} - -struct SourceCodeSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeStatusBarManagerAndroidSpec.g.h b/vnext/codegen/NativeStatusBarManagerAndroidSpec.g.h deleted file mode 100644 index 1bd4371f002..00000000000 --- a/vnext/codegen/NativeStatusBarManagerAndroidSpec.g.h +++ /dev/null @@ -1,76 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct StatusBarManagerAndroidSpec_Constants { - double HEIGHT; - double DEFAULT_BACKGROUND_COLOR; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(StatusBarManagerAndroidSpec_Constants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"HEIGHT", &StatusBarManagerAndroidSpec_Constants::HEIGHT}, - {L"DEFAULT_BACKGROUND_COLOR", &StatusBarManagerAndroidSpec_Constants::DEFAULT_BACKGROUND_COLOR}, - }; - return fieldMap; -} - -struct StatusBarManagerAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto constants = std::tuple{ - TypedConstant{0}, - }; - static constexpr auto methods = std::tuple{ - Method{0, L"setColor"}, - Method{1, L"setTranslucent"}, - Method) noexcept>{2, L"setStyle"}, - Method{3, L"setHidden"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto constantCheckResults = CheckConstants(); - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_CONSTANT_SPEC_ERRORS( - 0, - "StatusBarManagerAndroidSpec_Constants", - " REACT_GET_CONSTANTS(GetConstants) StatusBarManagerAndroidSpec_Constants GetConstants() noexcept {/*implementation*/}\n" - " REACT_GET_CONSTANTS(GetConstants) static StatusBarManagerAndroidSpec_Constants GetConstants() noexcept {/*implementation*/}\n"); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "setColor", - " REACT_METHOD(setColor) void setColor(double color, bool animated) noexcept { /* implementation */ }\n" - " REACT_METHOD(setColor) static void setColor(double color, bool animated) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "setTranslucent", - " REACT_METHOD(setTranslucent) void setTranslucent(bool translucent) noexcept { /* implementation */ }\n" - " REACT_METHOD(setTranslucent) static void setTranslucent(bool translucent) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "setStyle", - " REACT_METHOD(setStyle) void setStyle(std::optional statusBarStyle) noexcept { /* implementation */ }\n" - " REACT_METHOD(setStyle) static void setStyle(std::optional statusBarStyle) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "setHidden", - " REACT_METHOD(setHidden) void setHidden(bool hidden) noexcept { /* implementation */ }\n" - " REACT_METHOD(setHidden) static void setHidden(bool hidden) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeStatusBarManagerIOSSpec.g.h b/vnext/codegen/NativeStatusBarManagerIOSSpec.g.h deleted file mode 100644 index aa643aa9c06..00000000000 --- a/vnext/codegen/NativeStatusBarManagerIOSSpec.g.h +++ /dev/null @@ -1,99 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct StatusBarManagerIOSSpec_getHeight_callback_result { - double height; -}; - -struct StatusBarManagerIOSSpec_Constants { - double HEIGHT; - std::optional DEFAULT_BACKGROUND_COLOR; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(StatusBarManagerIOSSpec_getHeight_callback_result*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"height", &StatusBarManagerIOSSpec_getHeight_callback_result::height}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(StatusBarManagerIOSSpec_Constants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"HEIGHT", &StatusBarManagerIOSSpec_Constants::HEIGHT}, - {L"DEFAULT_BACKGROUND_COLOR", &StatusBarManagerIOSSpec_Constants::DEFAULT_BACKGROUND_COLOR}, - }; - return fieldMap; -} - -struct StatusBarManagerIOSSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto constants = std::tuple{ - TypedConstant{0}, - }; - static constexpr auto methods = std::tuple{ - Method) noexcept>{0, L"getHeight"}, - Method{1, L"setNetworkActivityIndicatorVisible"}, - Method{2, L"addListener"}, - Method{3, L"removeListeners"}, - Method, bool) noexcept>{4, L"setStyle"}, - Method{5, L"setHidden"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto constantCheckResults = CheckConstants(); - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_CONSTANT_SPEC_ERRORS( - 0, - "StatusBarManagerIOSSpec_Constants", - " REACT_GET_CONSTANTS(GetConstants) StatusBarManagerIOSSpec_Constants GetConstants() noexcept {/*implementation*/}\n" - " REACT_GET_CONSTANTS(GetConstants) static StatusBarManagerIOSSpec_Constants GetConstants() noexcept {/*implementation*/}\n"); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "getHeight", - " REACT_METHOD(getHeight) void getHeight(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(getHeight) static void getHeight(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "setNetworkActivityIndicatorVisible", - " REACT_METHOD(setNetworkActivityIndicatorVisible) void setNetworkActivityIndicatorVisible(bool visible) noexcept { /* implementation */ }\n" - " REACT_METHOD(setNetworkActivityIndicatorVisible) static void setNetworkActivityIndicatorVisible(bool visible) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventType) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventType) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "setStyle", - " REACT_METHOD(setStyle) void setStyle(std::optional statusBarStyle, bool animated) noexcept { /* implementation */ }\n" - " REACT_METHOD(setStyle) static void setStyle(std::optional statusBarStyle, bool animated) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "setHidden", - " REACT_METHOD(setHidden) void setHidden(bool hidden, std::string withAnimation) noexcept { /* implementation */ }\n" - " REACT_METHOD(setHidden) static void setHidden(bool hidden, std::string withAnimation) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeTimingSpec.g.h b/vnext/codegen/NativeTimingSpec.g.h deleted file mode 100644 index 8f06e1a7529..00000000000 --- a/vnext/codegen/NativeTimingSpec.g.h +++ /dev/null @@ -1,47 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct TimingSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"createTimer"}, - Method{1, L"deleteTimer"}, - Method{2, L"setSendIdleEvents"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "createTimer", - " REACT_METHOD(createTimer) void createTimer(double callbackID, double duration, double jsSchedulingTime, bool repeats) noexcept { /* implementation */ }\n" - " REACT_METHOD(createTimer) static void createTimer(double callbackID, double duration, double jsSchedulingTime, bool repeats) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "deleteTimer", - " REACT_METHOD(deleteTimer) void deleteTimer(double timerID) noexcept { /* implementation */ }\n" - " REACT_METHOD(deleteTimer) static void deleteTimer(double timerID) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "setSendIdleEvents", - " REACT_METHOD(setSendIdleEvents) void setSendIdleEvents(bool sendIdleEvents) noexcept { /* implementation */ }\n" - " REACT_METHOD(setSendIdleEvents) static void setSendIdleEvents(bool sendIdleEvents) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeToastAndroidSpec.g.h b/vnext/codegen/NativeToastAndroidSpec.g.h deleted file mode 100644 index 117aefda153..00000000000 --- a/vnext/codegen/NativeToastAndroidSpec.g.h +++ /dev/null @@ -1,76 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ToastAndroidSpec_Constants { - double SHORT; - double LONG; - double TOP; - double BOTTOM; - double CENTER; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ToastAndroidSpec_Constants*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"SHORT", &ToastAndroidSpec_Constants::SHORT}, - {L"LONG", &ToastAndroidSpec_Constants::LONG}, - {L"TOP", &ToastAndroidSpec_Constants::TOP}, - {L"BOTTOM", &ToastAndroidSpec_Constants::BOTTOM}, - {L"CENTER", &ToastAndroidSpec_Constants::CENTER}, - }; - return fieldMap; -} - -struct ToastAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto constants = std::tuple{ - TypedConstant{0}, - }; - static constexpr auto methods = std::tuple{ - Method{0, L"show"}, - Method{1, L"showWithGravity"}, - Method{2, L"showWithGravityAndOffset"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto constantCheckResults = CheckConstants(); - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_CONSTANT_SPEC_ERRORS( - 0, - "ToastAndroidSpec_Constants", - " REACT_GET_CONSTANTS(GetConstants) ToastAndroidSpec_Constants GetConstants() noexcept {/*implementation*/}\n" - " REACT_GET_CONSTANTS(GetConstants) static ToastAndroidSpec_Constants GetConstants() noexcept {/*implementation*/}\n"); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "show", - " REACT_METHOD(show) void show(std::string message, double duration) noexcept { /* implementation */ }\n" - " REACT_METHOD(show) static void show(std::string message, double duration) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "showWithGravity", - " REACT_METHOD(showWithGravity) void showWithGravity(std::string message, double duration, double gravity) noexcept { /* implementation */ }\n" - " REACT_METHOD(showWithGravity) static void showWithGravity(std::string message, double duration, double gravity) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "showWithGravityAndOffset", - " REACT_METHOD(showWithGravityAndOffset) void showWithGravityAndOffset(std::string message, double duration, double gravity, double xOffset, double yOffset) noexcept { /* implementation */ }\n" - " REACT_METHOD(showWithGravityAndOffset) static void showWithGravityAndOffset(std::string message, double duration, double gravity, double xOffset, double yOffset) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeUIManagerSpec.g.h b/vnext/codegen/NativeUIManagerSpec.g.h deleted file mode 100644 index fac3f0be693..00000000000 --- a/vnext/codegen/NativeUIManagerSpec.g.h +++ /dev/null @@ -1,155 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct UIManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"createView"}, - Method{1, L"updateView"}, - Method, Callback) noexcept>{2, L"findSubviewIn"}, - Method{3, L"dispatchViewManagerCommand"}, - Method) noexcept>{4, L"measure"}, - Method) noexcept>{5, L"measureInWindow"}, - Method>) noexcept>{6, L"viewIsDescendantOf"}, - Method, Callback) noexcept>{7, L"measureLayout"}, - Method, Callback) noexcept>{8, L"measureLayoutRelativeToParent"}, - Method{9, L"setJSResponder"}, - Method{10, L"clearJSResponder"}, - Method, Callback<::React::JSValue>) noexcept>{11, L"configureNextLayoutAnimation"}, - Method) noexcept>{12, L"setChildren"}, - Method, std::vector, std::vector, std::vector, std::vector) noexcept>{13, L"manageChildren"}, - SyncMethod(std::string) noexcept>{14, L"getConstantsForViewManager"}, - SyncMethod() noexcept>{15, L"getDefaultEventTypes"}, - Method{16, L"setLayoutAnimationEnabledExperimental"}, - Method{17, L"sendAccessibilityEvent"}, - SyncMethod<::React::JSValue(std::string) noexcept>{18, L"lazilyLoadView"}, - Method{19, L"focus"}, - Method{20, L"blur"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "createView", - " REACT_METHOD(createView) void createView(double reactTag, std::string viewName, double rootTag, ::React::JSValue && props) noexcept { /* implementation */ }\n" - " REACT_METHOD(createView) static void createView(double reactTag, std::string viewName, double rootTag, ::React::JSValue && props) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "updateView", - " REACT_METHOD(updateView) void updateView(double reactTag, std::string viewName, ::React::JSValue && props) noexcept { /* implementation */ }\n" - " REACT_METHOD(updateView) static void updateView(double reactTag, std::string viewName, ::React::JSValue && props) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "findSubviewIn", - " REACT_METHOD(findSubviewIn) void findSubviewIn(double reactTag, std::vector const & point, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(findSubviewIn) static void findSubviewIn(double reactTag, std::vector const & point, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "dispatchViewManagerCommand", - " REACT_METHOD(dispatchViewManagerCommand) void dispatchViewManagerCommand(double reactTag, double commandID, ::React::JSValueArray && commandArgs) noexcept { /* implementation */ }\n" - " REACT_METHOD(dispatchViewManagerCommand) static void dispatchViewManagerCommand(double reactTag, double commandID, ::React::JSValueArray && commandArgs) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "measure", - " REACT_METHOD(measure) void measure(double reactTag, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(measure) static void measure(double reactTag, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "measureInWindow", - " REACT_METHOD(measureInWindow) void measureInWindow(double reactTag, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(measureInWindow) static void measureInWindow(double reactTag, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "viewIsDescendantOf", - " REACT_METHOD(viewIsDescendantOf) void viewIsDescendantOf(double reactTag, double ancestorReactTag, std::function const &)> const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(viewIsDescendantOf) static void viewIsDescendantOf(double reactTag, double ancestorReactTag, std::function const &)> const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "measureLayout", - " REACT_METHOD(measureLayout) void measureLayout(double reactTag, double ancestorReactTag, std::function const & errorCallback, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(measureLayout) static void measureLayout(double reactTag, double ancestorReactTag, std::function const & errorCallback, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "measureLayoutRelativeToParent", - " REACT_METHOD(measureLayoutRelativeToParent) void measureLayoutRelativeToParent(double reactTag, std::function const & errorCallback, std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_METHOD(measureLayoutRelativeToParent) static void measureLayoutRelativeToParent(double reactTag, std::function const & errorCallback, std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "setJSResponder", - " REACT_METHOD(setJSResponder) void setJSResponder(double reactTag, bool blockNativeResponder) noexcept { /* implementation */ }\n" - " REACT_METHOD(setJSResponder) static void setJSResponder(double reactTag, bool blockNativeResponder) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "clearJSResponder", - " REACT_METHOD(clearJSResponder) void clearJSResponder() noexcept { /* implementation */ }\n" - " REACT_METHOD(clearJSResponder) static void clearJSResponder() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "configureNextLayoutAnimation", - " REACT_METHOD(configureNextLayoutAnimation) void configureNextLayoutAnimation(::React::JSValue && config, std::function const & callback, std::function const & errorCallback) noexcept { /* implementation */ }\n" - " REACT_METHOD(configureNextLayoutAnimation) static void configureNextLayoutAnimation(::React::JSValue && config, std::function const & callback, std::function const & errorCallback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "setChildren", - " REACT_METHOD(setChildren) void setChildren(double containerTag, std::vector const & reactTags) noexcept { /* implementation */ }\n" - " REACT_METHOD(setChildren) static void setChildren(double containerTag, std::vector const & reactTags) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "manageChildren", - " REACT_METHOD(manageChildren) void manageChildren(double containerTag, std::vector const & moveFromIndices, std::vector const & moveToIndices, std::vector const & addChildReactTags, std::vector const & addAtIndices, std::vector const & removeAtIndices) noexcept { /* implementation */ }\n" - " REACT_METHOD(manageChildren) static void manageChildren(double containerTag, std::vector const & moveFromIndices, std::vector const & moveToIndices, std::vector const & addChildReactTags, std::vector const & addAtIndices, std::vector const & removeAtIndices) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "getConstantsForViewManager", - " REACT_SYNC_METHOD(getConstantsForViewManager) std::optional<::React::JSValue> getConstantsForViewManager(std::string viewManagerName) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getConstantsForViewManager) static std::optional<::React::JSValue> getConstantsForViewManager(std::string viewManagerName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "getDefaultEventTypes", - " REACT_SYNC_METHOD(getDefaultEventTypes) std::vector getDefaultEventTypes() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getDefaultEventTypes) static std::vector getDefaultEventTypes() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "setLayoutAnimationEnabledExperimental", - " REACT_METHOD(setLayoutAnimationEnabledExperimental) void setLayoutAnimationEnabledExperimental(bool enabled) noexcept { /* implementation */ }\n" - " REACT_METHOD(setLayoutAnimationEnabledExperimental) static void setLayoutAnimationEnabledExperimental(bool enabled) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "sendAccessibilityEvent", - " REACT_METHOD(sendAccessibilityEvent) void sendAccessibilityEvent(double reactTag, double eventType) noexcept { /* implementation */ }\n" - " REACT_METHOD(sendAccessibilityEvent) static void sendAccessibilityEvent(double reactTag, double eventType) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 18, - "lazilyLoadView", - " REACT_SYNC_METHOD(lazilyLoadView) ::React::JSValue lazilyLoadView(std::string name) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(lazilyLoadView) static ::React::JSValue lazilyLoadView(std::string name) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 19, - "focus", - " REACT_METHOD(focus) void focus(double reactTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(focus) static void focus(double reactTag) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 20, - "blur", - " REACT_METHOD(blur) void blur(double reactTag) noexcept { /* implementation */ }\n" - " REACT_METHOD(blur) static void blur(double reactTag) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeVibrationSpec.g.h b/vnext/codegen/NativeVibrationSpec.g.h deleted file mode 100644 index 0f62498567b..00000000000 --- a/vnext/codegen/NativeVibrationSpec.g.h +++ /dev/null @@ -1,47 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct VibrationSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"vibrate"}, - Method, double) noexcept>{1, L"vibrateByPattern"}, - Method{2, L"cancel"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "vibrate", - " REACT_METHOD(vibrate) void vibrate(double pattern) noexcept { /* implementation */ }\n" - " REACT_METHOD(vibrate) static void vibrate(double pattern) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "vibrateByPattern", - " REACT_METHOD(vibrateByPattern) void vibrateByPattern(std::vector const & pattern, double repeat) noexcept { /* implementation */ }\n" - " REACT_METHOD(vibrateByPattern) static void vibrateByPattern(std::vector const & pattern, double repeat) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "cancel", - " REACT_METHOD(cancel) void cancel() noexcept { /* implementation */ }\n" - " REACT_METHOD(cancel) static void cancel() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeWebSocketModuleSpec.g.h b/vnext/codegen/NativeWebSocketModuleSpec.g.h deleted file mode 100644 index 1e037ea4d15..00000000000 --- a/vnext/codegen/NativeWebSocketModuleSpec.g.h +++ /dev/null @@ -1,82 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct WebSocketModuleSpec_connect_options { - std::optional<::React::JSValue> headers; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(WebSocketModuleSpec_connect_options*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"headers", &WebSocketModuleSpec_connect_options::headers}, - }; - return fieldMap; -} - -struct WebSocketModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method>, WebSocketModuleSpec_connect_options, double) noexcept>{0, L"connect"}, - Method{1, L"send"}, - Method{2, L"sendBinary"}, - Method{3, L"ping"}, - Method{4, L"close"}, - Method{5, L"addListener"}, - Method{6, L"removeListeners"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "connect", - " REACT_METHOD(connect) void connect(std::string url, std::optional> protocols, WebSocketModuleSpec_connect_options && options, double socketID) noexcept { /* implementation */ }\n" - " REACT_METHOD(connect) static void connect(std::string url, std::optional> protocols, WebSocketModuleSpec_connect_options && options, double socketID) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "send", - " REACT_METHOD(send) void send(std::string message, double forSocketID) noexcept { /* implementation */ }\n" - " REACT_METHOD(send) static void send(std::string message, double forSocketID) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "sendBinary", - " REACT_METHOD(sendBinary) void sendBinary(std::string base64String, double forSocketID) noexcept { /* implementation */ }\n" - " REACT_METHOD(sendBinary) static void sendBinary(std::string base64String, double forSocketID) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "ping", - " REACT_METHOD(ping) void ping(double socketID) noexcept { /* implementation */ }\n" - " REACT_METHOD(ping) static void ping(double socketID) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "close", - " REACT_METHOD(close) void close(double code, std::string reason, double socketID) noexcept { /* implementation */ }\n" - " REACT_METHOD(close) static void close(double code, std::string reason, double socketID) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "addListener", - " REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n" - " REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "removeListeners", - " REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n" - " REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/react/components/rnwcore/ActivityIndicatorView.g.h b/vnext/codegen/react/components/rnwcore/ActivityIndicatorView.g.h deleted file mode 100644 index 4f889b70cb1..00000000000 --- a/vnext/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +++ /dev/null @@ -1,212 +0,0 @@ - -/* - * This file is auto-generated from ActivityIndicatorViewNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(ActivityIndicatorViewProps) -struct ActivityIndicatorViewProps : winrt::implements { - ActivityIndicatorViewProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - hidesWhenStopped = cloneFromProps->hidesWhenStopped; - animating = cloneFromProps->animating; - color = cloneFromProps->color; - size = cloneFromProps->size; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(hidesWhenStopped) - bool hidesWhenStopped{true}; - - REACT_FIELD(animating) - bool animating{true}; - - REACT_FIELD(color) - winrt::Microsoft::ReactNative::Color color{nullptr}; - - REACT_FIELD(size) - std::optional size; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -struct ActivityIndicatorViewEventEmitter { - ActivityIndicatorViewEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseActivityIndicatorView { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterActivityIndicatorViewNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"ActivityIndicatorView", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseActivityIndicatorView::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseActivityIndicatorView::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseActivityIndicatorView::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseActivityIndicatorView::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseActivityIndicatorView::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseActivityIndicatorView::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h b/vnext/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h deleted file mode 100644 index 60f6327eaa7..00000000000 --- a/vnext/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +++ /dev/null @@ -1,295 +0,0 @@ - -/* - * This file is auto-generated from AndroidDrawerLayoutNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(AndroidDrawerLayoutProps) -struct AndroidDrawerLayoutProps : winrt::implements { - AndroidDrawerLayoutProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - keyboardDismissMode = cloneFromProps->keyboardDismissMode; - drawerBackgroundColor = cloneFromProps->drawerBackgroundColor; - drawerPosition = cloneFromProps->drawerPosition; - drawerWidth = cloneFromProps->drawerWidth; - drawerLockMode = cloneFromProps->drawerLockMode; - statusBarBackgroundColor = cloneFromProps->statusBarBackgroundColor; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(keyboardDismissMode) - std::optional keyboardDismissMode; - - REACT_FIELD(drawerBackgroundColor) - winrt::Microsoft::ReactNative::Color drawerBackgroundColor{nullptr}; - - REACT_FIELD(drawerPosition) - std::optional drawerPosition; - - REACT_FIELD(drawerWidth) - std::optional drawerWidth{}; - - REACT_FIELD(drawerLockMode) - std::optional drawerLockMode; - - REACT_FIELD(statusBarBackgroundColor) - winrt::Microsoft::ReactNative::Color statusBarBackgroundColor{nullptr}; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -REACT_STRUCT(AndroidDrawerLayout_OnDrawerSlide) -struct AndroidDrawerLayout_OnDrawerSlide { - REACT_FIELD(offset) - float offset{}; -}; - -REACT_STRUCT(AndroidDrawerLayout_OnDrawerStateChanged) -struct AndroidDrawerLayout_OnDrawerStateChanged { - REACT_FIELD(drawerState) - int32_t drawerState{}; -}; - -REACT_STRUCT(AndroidDrawerLayout_OnDrawerOpen) -struct AndroidDrawerLayout_OnDrawerOpen { -}; - -REACT_STRUCT(AndroidDrawerLayout_OnDrawerClose) -struct AndroidDrawerLayout_OnDrawerClose { -}; - -struct AndroidDrawerLayoutEventEmitter { - AndroidDrawerLayoutEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - using OnDrawerSlide = AndroidDrawerLayout_OnDrawerSlide; - using OnDrawerStateChanged = AndroidDrawerLayout_OnDrawerStateChanged; - using OnDrawerOpen = AndroidDrawerLayout_OnDrawerOpen; - using OnDrawerClose = AndroidDrawerLayout_OnDrawerClose; - - void onDrawerSlide(OnDrawerSlide &value) const { - m_eventEmitter.DispatchEvent(L"drawerSlide", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - void onDrawerStateChanged(OnDrawerStateChanged &value) const { - m_eventEmitter.DispatchEvent(L"drawerStateChanged", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - void onDrawerOpen(OnDrawerOpen &value) const { - m_eventEmitter.DispatchEvent(L"drawerOpen", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - void onDrawerClose(OnDrawerClose &value) const { - m_eventEmitter.DispatchEvent(L"drawerClose", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseAndroidDrawerLayout { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - // You must provide an implementation of this method to handle the "openDrawer" command - virtual void HandleOpenDrawerCommand() noexcept = 0; - - // You must provide an implementation of this method to handle the "closeDrawer" command - virtual void HandleCloseDrawerCommand() noexcept = 0; - - void HandleCommand(const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - auto commandName = args.CommandName(); - if (commandName == L"openDrawer") { - - userData->HandleOpenDrawerCommand(); - return; - } - - if (commandName == L"closeDrawer") { - - userData->HandleCloseDrawerCommand(); - return; - } - } - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterAndroidDrawerLayoutNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"AndroidDrawerLayout", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseAndroidDrawerLayout::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseAndroidDrawerLayout::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - builder.SetCustomCommandHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - userData->HandleCommand(view, args); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseAndroidDrawerLayout::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseAndroidDrawerLayout::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseAndroidDrawerLayout::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseAndroidDrawerLayout::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h b/vnext/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h deleted file mode 100644 index 2162299f622..00000000000 --- a/vnext/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +++ /dev/null @@ -1,200 +0,0 @@ - -/* - * This file is auto-generated from AndroidHorizontalScrollContentViewNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(AndroidHorizontalScrollContentViewProps) -struct AndroidHorizontalScrollContentViewProps : winrt::implements { - AndroidHorizontalScrollContentViewProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - removeClippedSubviews = cloneFromProps->removeClippedSubviews; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(removeClippedSubviews) - std::optional removeClippedSubviews{}; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -struct AndroidHorizontalScrollContentViewEventEmitter { - AndroidHorizontalScrollContentViewEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseAndroidHorizontalScrollContentView { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterAndroidHorizontalScrollContentViewNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"AndroidHorizontalScrollContentView", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseAndroidHorizontalScrollContentView::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseAndroidHorizontalScrollContentView::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseAndroidHorizontalScrollContentView::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseAndroidHorizontalScrollContentView::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseAndroidHorizontalScrollContentView::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseAndroidHorizontalScrollContentView::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/AndroidProgressBar.g.h b/vnext/codegen/react/components/rnwcore/AndroidProgressBar.g.h deleted file mode 100644 index 98c0b14197f..00000000000 --- a/vnext/codegen/react/components/rnwcore/AndroidProgressBar.g.h +++ /dev/null @@ -1,224 +0,0 @@ - -/* - * This file is auto-generated from AndroidProgressBarNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(AndroidProgressBarProps) -struct AndroidProgressBarProps : winrt::implements { - AndroidProgressBarProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - styleAttr = cloneFromProps->styleAttr; - typeAttr = cloneFromProps->typeAttr; - indeterminate = cloneFromProps->indeterminate; - progress = cloneFromProps->progress; - animating = cloneFromProps->animating; - color = cloneFromProps->color; - testID = cloneFromProps->testID; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(styleAttr) - std::optional styleAttr; - - REACT_FIELD(typeAttr) - std::optional typeAttr; - - REACT_FIELD(indeterminate) - bool indeterminate{}; - - REACT_FIELD(progress) - std::optional progress{}; - - REACT_FIELD(animating) - bool animating{true}; - - REACT_FIELD(color) - winrt::Microsoft::ReactNative::Color color{nullptr}; - - REACT_FIELD(testID) - std::optional testID; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -struct AndroidProgressBarEventEmitter { - AndroidProgressBarEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseAndroidProgressBar { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterAndroidProgressBarNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"AndroidProgressBar", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseAndroidProgressBar::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseAndroidProgressBar::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseAndroidProgressBar::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseAndroidProgressBar::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseAndroidProgressBar::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseAndroidProgressBar::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h b/vnext/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h deleted file mode 100644 index 6d149d8fd67..00000000000 --- a/vnext/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +++ /dev/null @@ -1,250 +0,0 @@ - -/* - * This file is auto-generated from AndroidSwipeRefreshLayoutNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(AndroidSwipeRefreshLayoutProps) -struct AndroidSwipeRefreshLayoutProps : winrt::implements { - AndroidSwipeRefreshLayoutProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - enabled = cloneFromProps->enabled; - colors = cloneFromProps->colors; - progressBackgroundColor = cloneFromProps->progressBackgroundColor; - size = cloneFromProps->size; - progressViewOffset = cloneFromProps->progressViewOffset; - refreshing = cloneFromProps->refreshing; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(enabled) - bool enabled{true}; - - REACT_FIELD(colors) - std::optional> colors; - - REACT_FIELD(progressBackgroundColor) - winrt::Microsoft::ReactNative::Color progressBackgroundColor{nullptr}; - - REACT_FIELD(size) - std::optional size; - - REACT_FIELD(progressViewOffset) - std::optional progressViewOffset{}; - - REACT_FIELD(refreshing) - bool refreshing{}; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -REACT_STRUCT(AndroidSwipeRefreshLayout_OnRefresh) -struct AndroidSwipeRefreshLayout_OnRefresh { -}; - -struct AndroidSwipeRefreshLayoutEventEmitter { - AndroidSwipeRefreshLayoutEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - using OnRefresh = AndroidSwipeRefreshLayout_OnRefresh; - - void onRefresh(OnRefresh &value) const { - m_eventEmitter.DispatchEvent(L"refresh", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseAndroidSwipeRefreshLayout { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - // You must provide an implementation of this method to handle the "setNativeRefreshing" command - virtual void HandleSetNativeRefreshingCommand(bool value) noexcept = 0; - - void HandleCommand(const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - auto commandName = args.CommandName(); - if (commandName == L"setNativeRefreshing") { - bool value; - winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), value); - userData->HandleSetNativeRefreshingCommand(value); - return; - } - } - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterAndroidSwipeRefreshLayoutNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"AndroidSwipeRefreshLayout", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseAndroidSwipeRefreshLayout::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseAndroidSwipeRefreshLayout::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - builder.SetCustomCommandHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - userData->HandleCommand(view, args); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseAndroidSwipeRefreshLayout::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseAndroidSwipeRefreshLayout::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseAndroidSwipeRefreshLayout::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseAndroidSwipeRefreshLayout::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/AndroidSwitch.g.h b/vnext/codegen/react/components/rnwcore/AndroidSwitch.g.h deleted file mode 100644 index 7aa785222ee..00000000000 --- a/vnext/codegen/react/components/rnwcore/AndroidSwitch.g.h +++ /dev/null @@ -1,267 +0,0 @@ - -/* - * This file is auto-generated from AndroidSwitchNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(AndroidSwitchProps) -struct AndroidSwitchProps : winrt::implements { - AndroidSwitchProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - disabled = cloneFromProps->disabled; - enabled = cloneFromProps->enabled; - thumbColor = cloneFromProps->thumbColor; - trackColorForFalse = cloneFromProps->trackColorForFalse; - trackColorForTrue = cloneFromProps->trackColorForTrue; - value = cloneFromProps->value; - on = cloneFromProps->on; - thumbTintColor = cloneFromProps->thumbTintColor; - trackTintColor = cloneFromProps->trackTintColor; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(disabled) - std::optional disabled{}; - - REACT_FIELD(enabled) - bool enabled{true}; - - REACT_FIELD(thumbColor) - winrt::Microsoft::ReactNative::Color thumbColor{nullptr}; - - REACT_FIELD(trackColorForFalse) - winrt::Microsoft::ReactNative::Color trackColorForFalse{nullptr}; - - REACT_FIELD(trackColorForTrue) - winrt::Microsoft::ReactNative::Color trackColorForTrue{nullptr}; - - REACT_FIELD(value) - std::optional value{}; - - REACT_FIELD(on) - std::optional on{}; - - REACT_FIELD(thumbTintColor) - winrt::Microsoft::ReactNative::Color thumbTintColor{nullptr}; - - REACT_FIELD(trackTintColor) - winrt::Microsoft::ReactNative::Color trackTintColor{nullptr}; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -REACT_STRUCT(AndroidSwitch_OnChange) -struct AndroidSwitch_OnChange { - REACT_FIELD(value) - bool value{}; - - REACT_FIELD(target) - int32_t target{}; -}; - -struct AndroidSwitchEventEmitter { - AndroidSwitchEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - using OnChange = AndroidSwitch_OnChange; - - void onChange(OnChange &value) const { - m_eventEmitter.DispatchEvent(L"change", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseAndroidSwitch { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - // You must provide an implementation of this method to handle the "setNativeValue" command - virtual void HandleSetNativeValueCommand(bool value) noexcept = 0; - - void HandleCommand(const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - auto commandName = args.CommandName(); - if (commandName == L"setNativeValue") { - bool value; - winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), value); - userData->HandleSetNativeValueCommand(value); - return; - } - } - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterAndroidSwitchNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"AndroidSwitch", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseAndroidSwitch::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseAndroidSwitch::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - builder.SetCustomCommandHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - userData->HandleCommand(view, args); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseAndroidSwitch::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseAndroidSwitch::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseAndroidSwitch::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseAndroidSwitch::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/ComponentDescriptors.h b/vnext/codegen/react/components/rnwcore/ComponentDescriptors.h deleted file mode 100644 index 45b7b5ea904..00000000000 --- a/vnext/codegen/react/components/rnwcore/ComponentDescriptors.h +++ /dev/null @@ -1,30 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateComponentDescriptorH.js - */ - -#pragma once - -#include "ShadowNodes.h" -#include -#include - -namespace facebook::react { - -using ActivityIndicatorViewComponentDescriptor = ConcreteComponentDescriptor; -using AndroidDrawerLayoutComponentDescriptor = ConcreteComponentDescriptor; -using AndroidSwipeRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor; -using DebuggingOverlayComponentDescriptor = ConcreteComponentDescriptor; -using PullToRefreshViewComponentDescriptor = ConcreteComponentDescriptor; -using SwitchComponentDescriptor = ConcreteComponentDescriptor; -using UnimplementedNativeViewComponentDescriptor = ConcreteComponentDescriptor; - -void rnwcore_registerComponentDescriptorsFromCodegen( - std::shared_ptr registry); - -} // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/DebuggingOverlay.g.h b/vnext/codegen/react/components/rnwcore/DebuggingOverlay.g.h deleted file mode 100644 index 23ece9b6f09..00000000000 --- a/vnext/codegen/react/components/rnwcore/DebuggingOverlay.g.h +++ /dev/null @@ -1,234 +0,0 @@ - -/* - * This file is auto-generated from DebuggingOverlayNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(DebuggingOverlayProps) -struct DebuggingOverlayProps : winrt::implements { - DebuggingOverlayProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -struct DebuggingOverlayEventEmitter { - DebuggingOverlayEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseDebuggingOverlay { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - // You must provide an implementation of this method to handle the "highlightTraceUpdates" command - virtual void HandleHighlightTraceUpdatesCommand(std::vector updates) noexcept = 0; - - // You must provide an implementation of this method to handle the "highlightElements" command - virtual void HandleHighlightElementsCommand(std::vector elements) noexcept = 0; - - // You must provide an implementation of this method to handle the "clearElementsHighlights" command - virtual void HandleClearElementsHighlightsCommand() noexcept = 0; - - void HandleCommand(const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - auto commandName = args.CommandName(); - if (commandName == L"highlightTraceUpdates") { - std::vector updates; - winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), updates); - userData->HandleHighlightTraceUpdatesCommand(updates); - return; - } - - if (commandName == L"highlightElements") { - std::vector elements; - winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), elements); - userData->HandleHighlightElementsCommand(elements); - return; - } - - if (commandName == L"clearElementsHighlights") { - - userData->HandleClearElementsHighlightsCommand(); - return; - } - } - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterDebuggingOverlayNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"DebuggingOverlay", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseDebuggingOverlay::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseDebuggingOverlay::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - builder.SetCustomCommandHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - userData->HandleCommand(view, args); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseDebuggingOverlay::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseDebuggingOverlay::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseDebuggingOverlay::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseDebuggingOverlay::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/EventEmitters.cpp b/vnext/codegen/react/components/rnwcore/EventEmitters.cpp deleted file mode 100644 index cb8c8986115..00000000000 --- a/vnext/codegen/react/components/rnwcore/EventEmitters.cpp +++ /dev/null @@ -1,157 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateEventEmitterCpp.js - */ - -#include "EventEmitters.h" - - -namespace facebook::react { - -void VirtualViewEventEmitter::onModeChange(OnModeChange event) const { - dispatchEvent("modeChange", [event=std::move(event)](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - payload.setProperty(runtime, "mode", event.mode); -{ - auto targetRect = jsi::Object(runtime); - targetRect.setProperty(runtime, "x", event.targetRect.x); - targetRect.setProperty(runtime, "y", event.targetRect.y); - targetRect.setProperty(runtime, "width", event.targetRect.width); - targetRect.setProperty(runtime, "height", event.targetRect.height); - payload.setProperty(runtime, "targetRect", targetRect); -} -{ - auto thresholdRect = jsi::Object(runtime); - thresholdRect.setProperty(runtime, "x", event.thresholdRect.x); - thresholdRect.setProperty(runtime, "y", event.thresholdRect.y); - thresholdRect.setProperty(runtime, "width", event.thresholdRect.width); - thresholdRect.setProperty(runtime, "height", event.thresholdRect.height); - payload.setProperty(runtime, "thresholdRect", thresholdRect); -} - return payload; - }); -} - - - -void AndroidDrawerLayoutEventEmitter::onDrawerSlide(OnDrawerSlide event) const { - dispatchEvent("drawerSlide", [event=std::move(event)](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - payload.setProperty(runtime, "offset", event.offset); - return payload; - }); -} - - -void AndroidDrawerLayoutEventEmitter::onDrawerStateChanged(OnDrawerStateChanged event) const { - dispatchEvent("drawerStateChanged", [event=std::move(event)](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - payload.setProperty(runtime, "drawerState", event.drawerState); - return payload; - }); -} - - -void AndroidDrawerLayoutEventEmitter::onDrawerOpen(OnDrawerOpen event) const { - dispatchEvent("drawerOpen", [](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - - return payload; - }); -} - - -void AndroidDrawerLayoutEventEmitter::onDrawerClose(OnDrawerClose event) const { - dispatchEvent("drawerClose", [](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - - return payload; - }); -} - - - -void AndroidSwipeRefreshLayoutEventEmitter::onRefresh(OnRefresh event) const { - dispatchEvent("refresh", [](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - - return payload; - }); -} - - -void AndroidSwitchEventEmitter::onChange(OnChange event) const { - dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - payload.setProperty(runtime, "value", event.value); -payload.setProperty(runtime, "target", event.target); - return payload; - }); -} - - - - -void PullToRefreshViewEventEmitter::onRefresh(OnRefresh event) const { - dispatchEvent("refresh", [](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - - return payload; - }); -} - - - -void ModalHostViewEventEmitter::onRequestClose(OnRequestClose event) const { - dispatchEvent("requestClose", [](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - - return payload; - }); -} - - -void ModalHostViewEventEmitter::onShow(OnShow event) const { - dispatchEvent("show", [](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - - return payload; - }); -} - - -void ModalHostViewEventEmitter::onDismiss(OnDismiss event) const { - dispatchEvent("dismiss", [](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - - return payload; - }); -} - - -void ModalHostViewEventEmitter::onOrientationChange(OnOrientationChange event) const { - dispatchEvent("orientationChange", [event=std::move(event)](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - payload.setProperty(runtime, "orientation", toString(event.orientation)); - return payload; - }); -} - - - -void SwitchEventEmitter::onChange(OnChange event) const { - dispatchEvent("change", [event=std::move(event)](jsi::Runtime &runtime) { - auto payload = jsi::Object(runtime); - payload.setProperty(runtime, "value", event.value); -payload.setProperty(runtime, "target", event.target); - return payload; - }); -} - - -} // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/EventEmitters.h b/vnext/codegen/react/components/rnwcore/EventEmitters.h deleted file mode 100644 index eeff0c9a2a9..00000000000 --- a/vnext/codegen/react/components/rnwcore/EventEmitters.h +++ /dev/null @@ -1,194 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateEventEmitterH.js - */ -#pragma once - -#include - - -namespace facebook::react { -class VirtualViewEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - struct OnModeChangeTargetRect { - double x; - double y; - double width; - double height; - }; - - struct OnModeChangeThresholdRect { - double x; - double y; - double width; - double height; - }; - - struct OnModeChange { - int mode; - OnModeChangeTargetRect targetRect; - OnModeChangeThresholdRect thresholdRect; - }; - void onModeChange(OnModeChange value) const; -}; -class ActivityIndicatorViewEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - - -}; -class AndroidDrawerLayoutEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - struct OnDrawerSlide { - Float offset; - }; - - struct OnDrawerStateChanged { - int drawerState; - }; - - struct OnDrawerOpen { - - }; - - struct OnDrawerClose { - - }; - void onDrawerSlide(OnDrawerSlide value) const; - - void onDrawerStateChanged(OnDrawerStateChanged value) const; - - void onDrawerOpen(OnDrawerOpen value) const; - - void onDrawerClose(OnDrawerClose value) const; -}; -class AndroidHorizontalScrollContentViewEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - - -}; -class AndroidSwipeRefreshLayoutEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - struct OnRefresh { - - }; - void onRefresh(OnRefresh value) const; -}; -class AndroidSwitchEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - struct OnChange { - bool value; - int target; - }; - void onChange(OnChange value) const; -}; -class DebuggingOverlayEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - - -}; -class AndroidProgressBarEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - - -}; -class PullToRefreshViewEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - struct OnRefresh { - - }; - void onRefresh(OnRefresh value) const; -}; -class InputAccessoryEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - - -}; -class ModalHostViewEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - struct OnRequestClose { - - }; - - struct OnShow { - - }; - - struct OnDismiss { - - }; - - enum class OnOrientationChangeOrientation { - Portrait, - Landscape - }; - - static char const *toString(const OnOrientationChangeOrientation value) { - switch (value) { - case OnOrientationChangeOrientation::Portrait: return "portrait"; - case OnOrientationChangeOrientation::Landscape: return "landscape"; - } - } - - struct OnOrientationChange { - OnOrientationChangeOrientation orientation; - }; - void onRequestClose(OnRequestClose value) const; - - void onShow(OnShow value) const; - - void onDismiss(OnDismiss value) const; - - void onOrientationChange(OnOrientationChange value) const; -}; -class SafeAreaViewEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - - -}; -class SwitchEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - struct OnChange { - bool value; - int target; - }; - void onChange(OnChange value) const; -}; -class UnimplementedNativeViewEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - - -}; -} // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/InputAccessory.g.h b/vnext/codegen/react/components/rnwcore/InputAccessory.g.h deleted file mode 100644 index 2b490f988ef..00000000000 --- a/vnext/codegen/react/components/rnwcore/InputAccessory.g.h +++ /dev/null @@ -1,200 +0,0 @@ - -/* - * This file is auto-generated from InputAccessoryNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(InputAccessoryProps) -struct InputAccessoryProps : winrt::implements { - InputAccessoryProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - backgroundColor = cloneFromProps->backgroundColor; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(backgroundColor) - winrt::Microsoft::ReactNative::Color backgroundColor{nullptr}; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -struct InputAccessoryEventEmitter { - InputAccessoryEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseInputAccessory { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterInputAccessoryNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"InputAccessory", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseInputAccessory::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseInputAccessory::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseInputAccessory::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseInputAccessory::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseInputAccessory::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseInputAccessory::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/ModalHostView.g.h b/vnext/codegen/react/components/rnwcore/ModalHostView.g.h deleted file mode 100644 index 1aa595d258c..00000000000 --- a/vnext/codegen/react/components/rnwcore/ModalHostView.g.h +++ /dev/null @@ -1,291 +0,0 @@ - -/* - * This file is auto-generated from ModalHostViewNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(ModalHostViewProps) -struct ModalHostViewProps : winrt::implements { - ModalHostViewProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - animationType = cloneFromProps->animationType; - presentationStyle = cloneFromProps->presentationStyle; - transparent = cloneFromProps->transparent; - statusBarTranslucent = cloneFromProps->statusBarTranslucent; - navigationBarTranslucent = cloneFromProps->navigationBarTranslucent; - hardwareAccelerated = cloneFromProps->hardwareAccelerated; - visible = cloneFromProps->visible; - animated = cloneFromProps->animated; - allowSwipeDismissal = cloneFromProps->allowSwipeDismissal; - supportedOrientations = cloneFromProps->supportedOrientations; - identifier = cloneFromProps->identifier; - title = cloneFromProps->title; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(animationType) - std::optional animationType; - - REACT_FIELD(presentationStyle) - std::optional presentationStyle; - - REACT_FIELD(transparent) - std::optional transparent{}; - - REACT_FIELD(statusBarTranslucent) - std::optional statusBarTranslucent{}; - - REACT_FIELD(navigationBarTranslucent) - std::optional navigationBarTranslucent{}; - - REACT_FIELD(hardwareAccelerated) - std::optional hardwareAccelerated{}; - - REACT_FIELD(visible) - std::optional visible{}; - - REACT_FIELD(animated) - std::optional animated{}; - - REACT_FIELD(allowSwipeDismissal) - std::optional allowSwipeDismissal{}; - - REACT_FIELD(supportedOrientations) - std::optional> supportedOrientations; - - REACT_FIELD(identifier) - std::optional identifier{}; - - REACT_FIELD(title) - std::optional title; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -REACT_STRUCT(ModalHostView_OnRequestClose) -struct ModalHostView_OnRequestClose { -}; - -REACT_STRUCT(ModalHostView_OnShow) -struct ModalHostView_OnShow { -}; - -REACT_STRUCT(ModalHostView_OnDismiss) -struct ModalHostView_OnDismiss { -}; - -REACT_STRUCT(ModalHostView_OnOrientationChange) -struct ModalHostView_OnOrientationChange { - REACT_FIELD(orientation) - std::string orientation; -}; - -struct ModalHostViewEventEmitter { - ModalHostViewEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - using OnRequestClose = ModalHostView_OnRequestClose; - using OnShow = ModalHostView_OnShow; - using OnDismiss = ModalHostView_OnDismiss; - using OnOrientationChange = ModalHostView_OnOrientationChange; - - void onRequestClose(OnRequestClose &value) const { - m_eventEmitter.DispatchEvent(L"requestClose", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - void onShow(OnShow &value) const { - m_eventEmitter.DispatchEvent(L"show", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - void onDismiss(OnDismiss &value) const { - m_eventEmitter.DispatchEvent(L"dismiss", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - void onOrientationChange(OnOrientationChange &value) const { - m_eventEmitter.DispatchEvent(L"orientationChange", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseModalHostView { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterModalHostViewNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"ModalHostView", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseModalHostView::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseModalHostView::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseModalHostView::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseModalHostView::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseModalHostView::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseModalHostView::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/Props.cpp b/vnext/codegen/react/components/rnwcore/Props.cpp deleted file mode 100644 index b5f355391cb..00000000000 --- a/vnext/codegen/react/components/rnwcore/Props.cpp +++ /dev/null @@ -1,668 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GeneratePropsCpp.js - */ - -#include "Props.h" -#include -#include - -namespace facebook::react { - -VirtualViewProps::VirtualViewProps( - const PropsParserContext &context, - const VirtualViewProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - initialHidden(convertRawProp(context, rawProps, "initialHidden", sourceProps.initialHidden, {false})), - renderState(convertRawProp(context, rawProps, "renderState", sourceProps.renderState, {0})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName VirtualViewProps::getDiffPropsImplementationTarget() const { - return "VirtualView"; -} - -folly::dynamic VirtualViewProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = VirtualViewProps(); - const VirtualViewProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (initialHidden != oldProps->initialHidden) { - result["initialHidden"] = initialHidden; - } - - if (renderState != oldProps->renderState) { - result["renderState"] = renderState; - } - return result; -} -#endif -ActivityIndicatorViewProps::ActivityIndicatorViewProps( - const PropsParserContext &context, - const ActivityIndicatorViewProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - hidesWhenStopped(convertRawProp(context, rawProps, "hidesWhenStopped", sourceProps.hidesWhenStopped, {true})), - animating(convertRawProp(context, rawProps, "animating", sourceProps.animating, {true})), - color(convertRawProp(context, rawProps, "color", sourceProps.color, {})), - size(convertRawProp(context, rawProps, "size", sourceProps.size, {ActivityIndicatorViewSize::Small})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName ActivityIndicatorViewProps::getDiffPropsImplementationTarget() const { - return "ActivityIndicatorView"; -} - -folly::dynamic ActivityIndicatorViewProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = ActivityIndicatorViewProps(); - const ActivityIndicatorViewProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (hidesWhenStopped != oldProps->hidesWhenStopped) { - result["hidesWhenStopped"] = hidesWhenStopped; - } - - if (animating != oldProps->animating) { - result["animating"] = animating; - } - - if (color != oldProps->color) { - result["color"] = *color; - } - - if (size != oldProps->size) { - result["size"] = toDynamic(size); - } - return result; -} -#endif -AndroidDrawerLayoutProps::AndroidDrawerLayoutProps( - const PropsParserContext &context, - const AndroidDrawerLayoutProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - keyboardDismissMode(convertRawProp(context, rawProps, "keyboardDismissMode", sourceProps.keyboardDismissMode, {AndroidDrawerLayoutKeyboardDismissMode::None})), - drawerBackgroundColor(convertRawProp(context, rawProps, "drawerBackgroundColor", sourceProps.drawerBackgroundColor, {})), - drawerPosition(convertRawProp(context, rawProps, "drawerPosition", sourceProps.drawerPosition, {AndroidDrawerLayoutDrawerPosition::Left})), - drawerWidth(convertRawProp(context, rawProps, "drawerWidth", sourceProps.drawerWidth, {})), - drawerLockMode(convertRawProp(context, rawProps, "drawerLockMode", sourceProps.drawerLockMode, {AndroidDrawerLayoutDrawerLockMode::Unlocked})), - statusBarBackgroundColor(convertRawProp(context, rawProps, "statusBarBackgroundColor", sourceProps.statusBarBackgroundColor, {})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName AndroidDrawerLayoutProps::getDiffPropsImplementationTarget() const { - return "AndroidDrawerLayout"; -} - -folly::dynamic AndroidDrawerLayoutProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = AndroidDrawerLayoutProps(); - const AndroidDrawerLayoutProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (keyboardDismissMode != oldProps->keyboardDismissMode) { - result["keyboardDismissMode"] = toDynamic(keyboardDismissMode); - } - - if (drawerBackgroundColor != oldProps->drawerBackgroundColor) { - result["drawerBackgroundColor"] = *drawerBackgroundColor; - } - - if (drawerPosition != oldProps->drawerPosition) { - result["drawerPosition"] = toDynamic(drawerPosition); - } - - if ((drawerWidth != oldProps->drawerWidth) && !(std::isnan(drawerWidth) && std::isnan(oldProps->drawerWidth))) { - result["drawerWidth"] = drawerWidth; - } - - if (drawerLockMode != oldProps->drawerLockMode) { - result["drawerLockMode"] = toDynamic(drawerLockMode); - } - - if (statusBarBackgroundColor != oldProps->statusBarBackgroundColor) { - result["statusBarBackgroundColor"] = *statusBarBackgroundColor; - } - return result; -} -#endif -AndroidHorizontalScrollContentViewProps::AndroidHorizontalScrollContentViewProps( - const PropsParserContext &context, - const AndroidHorizontalScrollContentViewProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - removeClippedSubviews(convertRawProp(context, rawProps, "removeClippedSubviews", sourceProps.removeClippedSubviews, {false})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName AndroidHorizontalScrollContentViewProps::getDiffPropsImplementationTarget() const { - return "AndroidHorizontalScrollContentView"; -} - -folly::dynamic AndroidHorizontalScrollContentViewProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = AndroidHorizontalScrollContentViewProps(); - const AndroidHorizontalScrollContentViewProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (removeClippedSubviews != oldProps->removeClippedSubviews) { - result["removeClippedSubviews"] = removeClippedSubviews; - } - return result; -} -#endif -AndroidSwipeRefreshLayoutProps::AndroidSwipeRefreshLayoutProps( - const PropsParserContext &context, - const AndroidSwipeRefreshLayoutProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - enabled(convertRawProp(context, rawProps, "enabled", sourceProps.enabled, {true})), - colors(convertRawProp(context, rawProps, "colors", sourceProps.colors, {})), - progressBackgroundColor(convertRawProp(context, rawProps, "progressBackgroundColor", sourceProps.progressBackgroundColor, {})), - size(convertRawProp(context, rawProps, "size", sourceProps.size, {AndroidSwipeRefreshLayoutSize::Default})), - progressViewOffset(convertRawProp(context, rawProps, "progressViewOffset", sourceProps.progressViewOffset, {0.0})), - refreshing(convertRawProp(context, rawProps, "refreshing", sourceProps.refreshing, {false})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName AndroidSwipeRefreshLayoutProps::getDiffPropsImplementationTarget() const { - return "AndroidSwipeRefreshLayout"; -} - -folly::dynamic AndroidSwipeRefreshLayoutProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = AndroidSwipeRefreshLayoutProps(); - const AndroidSwipeRefreshLayoutProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (enabled != oldProps->enabled) { - result["enabled"] = enabled; - } - - if (colors != oldProps->colors) { - result["colors"] = toDynamic(colors); - } - - if (progressBackgroundColor != oldProps->progressBackgroundColor) { - result["progressBackgroundColor"] = *progressBackgroundColor; - } - - if (size != oldProps->size) { - result["size"] = toDynamic(size); - } - - if ((progressViewOffset != oldProps->progressViewOffset) && !(std::isnan(progressViewOffset) && std::isnan(oldProps->progressViewOffset))) { - result["progressViewOffset"] = progressViewOffset; - } - - if (refreshing != oldProps->refreshing) { - result["refreshing"] = refreshing; - } - return result; -} -#endif -AndroidSwitchProps::AndroidSwitchProps( - const PropsParserContext &context, - const AndroidSwitchProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - disabled(convertRawProp(context, rawProps, "disabled", sourceProps.disabled, {false})), - enabled(convertRawProp(context, rawProps, "enabled", sourceProps.enabled, {true})), - thumbColor(convertRawProp(context, rawProps, "thumbColor", sourceProps.thumbColor, {})), - trackColorForFalse(convertRawProp(context, rawProps, "trackColorForFalse", sourceProps.trackColorForFalse, {})), - trackColorForTrue(convertRawProp(context, rawProps, "trackColorForTrue", sourceProps.trackColorForTrue, {})), - value(convertRawProp(context, rawProps, "value", sourceProps.value, {false})), - on(convertRawProp(context, rawProps, "on", sourceProps.on, {false})), - thumbTintColor(convertRawProp(context, rawProps, "thumbTintColor", sourceProps.thumbTintColor, {})), - trackTintColor(convertRawProp(context, rawProps, "trackTintColor", sourceProps.trackTintColor, {})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName AndroidSwitchProps::getDiffPropsImplementationTarget() const { - return "AndroidSwitch"; -} - -folly::dynamic AndroidSwitchProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = AndroidSwitchProps(); - const AndroidSwitchProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (disabled != oldProps->disabled) { - result["disabled"] = disabled; - } - - if (enabled != oldProps->enabled) { - result["enabled"] = enabled; - } - - if (thumbColor != oldProps->thumbColor) { - result["thumbColor"] = *thumbColor; - } - - if (trackColorForFalse != oldProps->trackColorForFalse) { - result["trackColorForFalse"] = *trackColorForFalse; - } - - if (trackColorForTrue != oldProps->trackColorForTrue) { - result["trackColorForTrue"] = *trackColorForTrue; - } - - if (value != oldProps->value) { - result["value"] = value; - } - - if (on != oldProps->on) { - result["on"] = on; - } - - if (thumbTintColor != oldProps->thumbTintColor) { - result["thumbTintColor"] = *thumbTintColor; - } - - if (trackTintColor != oldProps->trackTintColor) { - result["trackTintColor"] = *trackTintColor; - } - return result; -} -#endif -DebuggingOverlayProps::DebuggingOverlayProps( - const PropsParserContext &context, - const DebuggingOverlayProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) - - {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName DebuggingOverlayProps::getDiffPropsImplementationTarget() const { - return "DebuggingOverlay"; -} - -folly::dynamic DebuggingOverlayProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = DebuggingOverlayProps(); - const DebuggingOverlayProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - return result; -} -#endif -AndroidProgressBarProps::AndroidProgressBarProps( - const PropsParserContext &context, - const AndroidProgressBarProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - styleAttr(convertRawProp(context, rawProps, "styleAttr", sourceProps.styleAttr, {})), - typeAttr(convertRawProp(context, rawProps, "typeAttr", sourceProps.typeAttr, {})), - indeterminate(convertRawProp(context, rawProps, "indeterminate", sourceProps.indeterminate, {false})), - progress(convertRawProp(context, rawProps, "progress", sourceProps.progress, {0.0})), - animating(convertRawProp(context, rawProps, "animating", sourceProps.animating, {true})), - color(convertRawProp(context, rawProps, "color", sourceProps.color, {})), - testID(convertRawProp(context, rawProps, "testID", sourceProps.testID, {""})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName AndroidProgressBarProps::getDiffPropsImplementationTarget() const { - return "AndroidProgressBar"; -} - -folly::dynamic AndroidProgressBarProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = AndroidProgressBarProps(); - const AndroidProgressBarProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (styleAttr != oldProps->styleAttr) { - result["styleAttr"] = styleAttr; - } - - if (typeAttr != oldProps->typeAttr) { - result["typeAttr"] = typeAttr; - } - - if (indeterminate != oldProps->indeterminate) { - result["indeterminate"] = indeterminate; - } - - if ((progress != oldProps->progress) && !(std::isnan(progress) && std::isnan(oldProps->progress))) { - result["progress"] = progress; - } - - if (animating != oldProps->animating) { - result["animating"] = animating; - } - - if (color != oldProps->color) { - result["color"] = *color; - } - - if (testID != oldProps->testID) { - result["testID"] = testID; - } - return result; -} -#endif -PullToRefreshViewProps::PullToRefreshViewProps( - const PropsParserContext &context, - const PullToRefreshViewProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - tintColor(convertRawProp(context, rawProps, "tintColor", sourceProps.tintColor, {})), - titleColor(convertRawProp(context, rawProps, "titleColor", sourceProps.titleColor, {})), - title(convertRawProp(context, rawProps, "title", sourceProps.title, {})), - progressViewOffset(convertRawProp(context, rawProps, "progressViewOffset", sourceProps.progressViewOffset, {0.0})), - refreshing(convertRawProp(context, rawProps, "refreshing", sourceProps.refreshing, {false})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName PullToRefreshViewProps::getDiffPropsImplementationTarget() const { - return "PullToRefreshView"; -} - -folly::dynamic PullToRefreshViewProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = PullToRefreshViewProps(); - const PullToRefreshViewProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (tintColor != oldProps->tintColor) { - result["tintColor"] = *tintColor; - } - - if (titleColor != oldProps->titleColor) { - result["titleColor"] = *titleColor; - } - - if (title != oldProps->title) { - result["title"] = title; - } - - if ((progressViewOffset != oldProps->progressViewOffset) && !(std::isnan(progressViewOffset) && std::isnan(oldProps->progressViewOffset))) { - result["progressViewOffset"] = progressViewOffset; - } - - if (refreshing != oldProps->refreshing) { - result["refreshing"] = refreshing; - } - return result; -} -#endif -InputAccessoryProps::InputAccessoryProps( - const PropsParserContext &context, - const InputAccessoryProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - backgroundColor(convertRawProp(context, rawProps, "backgroundColor", sourceProps.backgroundColor, {})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName InputAccessoryProps::getDiffPropsImplementationTarget() const { - return "InputAccessory"; -} - -folly::dynamic InputAccessoryProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = InputAccessoryProps(); - const InputAccessoryProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (backgroundColor != oldProps->backgroundColor) { - result["backgroundColor"] = *backgroundColor; - } - return result; -} -#endif -ModalHostViewProps::ModalHostViewProps( - const PropsParserContext &context, - const ModalHostViewProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - animationType(convertRawProp(context, rawProps, "animationType", sourceProps.animationType, {ModalHostViewAnimationType::None})), - presentationStyle(convertRawProp(context, rawProps, "presentationStyle", sourceProps.presentationStyle, {ModalHostViewPresentationStyle::FullScreen})), - transparent(convertRawProp(context, rawProps, "transparent", sourceProps.transparent, {false})), - statusBarTranslucent(convertRawProp(context, rawProps, "statusBarTranslucent", sourceProps.statusBarTranslucent, {false})), - navigationBarTranslucent(convertRawProp(context, rawProps, "navigationBarTranslucent", sourceProps.navigationBarTranslucent, {false})), - hardwareAccelerated(convertRawProp(context, rawProps, "hardwareAccelerated", sourceProps.hardwareAccelerated, {false})), - visible(convertRawProp(context, rawProps, "visible", sourceProps.visible, {false})), - animated(convertRawProp(context, rawProps, "animated", sourceProps.animated, {false})), - allowSwipeDismissal(convertRawProp(context, rawProps, "allowSwipeDismissal", sourceProps.allowSwipeDismissal, {false})), - supportedOrientations(convertRawProp(context, rawProps, "supportedOrientations", ModalHostViewSupportedOrientationsMaskWrapped{ .value = sourceProps.supportedOrientations }, {static_cast(ModalHostViewSupportedOrientations::Portrait)}).value), - identifier(convertRawProp(context, rawProps, "identifier", sourceProps.identifier, {0})), - title(convertRawProp(context, rawProps, "title", sourceProps.title, {})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName ModalHostViewProps::getDiffPropsImplementationTarget() const { - return "ModalHostView"; -} - -folly::dynamic ModalHostViewProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = ModalHostViewProps(); - const ModalHostViewProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (animationType != oldProps->animationType) { - result["animationType"] = toDynamic(animationType); - } - - if (presentationStyle != oldProps->presentationStyle) { - result["presentationStyle"] = toDynamic(presentationStyle); - } - - if (transparent != oldProps->transparent) { - result["transparent"] = transparent; - } - - if (statusBarTranslucent != oldProps->statusBarTranslucent) { - result["statusBarTranslucent"] = statusBarTranslucent; - } - - if (navigationBarTranslucent != oldProps->navigationBarTranslucent) { - result["navigationBarTranslucent"] = navigationBarTranslucent; - } - - if (hardwareAccelerated != oldProps->hardwareAccelerated) { - result["hardwareAccelerated"] = hardwareAccelerated; - } - - if (visible != oldProps->visible) { - result["visible"] = visible; - } - - if (animated != oldProps->animated) { - result["animated"] = animated; - } - - if (allowSwipeDismissal != oldProps->allowSwipeDismissal) { - result["allowSwipeDismissal"] = allowSwipeDismissal; - } - - if (supportedOrientations != oldProps->supportedOrientations) { - result["supportedOrientations"] = toDynamic(supportedOrientations); - } - - if (identifier != oldProps->identifier) { - result["identifier"] = identifier; - } - - if (title != oldProps->title) { - result["title"] = title; - } - return result; -} -#endif -SafeAreaViewProps::SafeAreaViewProps( - const PropsParserContext &context, - const SafeAreaViewProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) - - {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName SafeAreaViewProps::getDiffPropsImplementationTarget() const { - return "SafeAreaView"; -} - -folly::dynamic SafeAreaViewProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = SafeAreaViewProps(); - const SafeAreaViewProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - return result; -} -#endif -SwitchProps::SwitchProps( - const PropsParserContext &context, - const SwitchProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - disabled(convertRawProp(context, rawProps, "disabled", sourceProps.disabled, {false})), - value(convertRawProp(context, rawProps, "value", sourceProps.value, {false})), - tintColor(convertRawProp(context, rawProps, "tintColor", sourceProps.tintColor, {})), - onTintColor(convertRawProp(context, rawProps, "onTintColor", sourceProps.onTintColor, {})), - thumbTintColor(convertRawProp(context, rawProps, "thumbTintColor", sourceProps.thumbTintColor, {})), - thumbColor(convertRawProp(context, rawProps, "thumbColor", sourceProps.thumbColor, {})), - trackColorForFalse(convertRawProp(context, rawProps, "trackColorForFalse", sourceProps.trackColorForFalse, {})), - trackColorForTrue(convertRawProp(context, rawProps, "trackColorForTrue", sourceProps.trackColorForTrue, {})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName SwitchProps::getDiffPropsImplementationTarget() const { - return "Switch"; -} - -folly::dynamic SwitchProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = SwitchProps(); - const SwitchProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (disabled != oldProps->disabled) { - result["disabled"] = disabled; - } - - if (value != oldProps->value) { - result["value"] = value; - } - - if (tintColor != oldProps->tintColor) { - result["tintColor"] = *tintColor; - } - - if (onTintColor != oldProps->onTintColor) { - result["onTintColor"] = *onTintColor; - } - - if (thumbTintColor != oldProps->thumbTintColor) { - result["thumbTintColor"] = *thumbTintColor; - } - - if (thumbColor != oldProps->thumbColor) { - result["thumbColor"] = *thumbColor; - } - - if (trackColorForFalse != oldProps->trackColorForFalse) { - result["trackColorForFalse"] = *trackColorForFalse; - } - - if (trackColorForTrue != oldProps->trackColorForTrue) { - result["trackColorForTrue"] = *trackColorForTrue; - } - return result; -} -#endif -UnimplementedNativeViewProps::UnimplementedNativeViewProps( - const PropsParserContext &context, - const UnimplementedNativeViewProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - name(convertRawProp(context, rawProps, "name", sourceProps.name, {""})) {} - -#ifdef RN_SERIALIZABLE_STATE -ComponentName UnimplementedNativeViewProps::getDiffPropsImplementationTarget() const { - return "UnimplementedNativeView"; -} - -folly::dynamic UnimplementedNativeViewProps::getDiffProps( - const Props* prevProps) const { - static const auto defaultProps = UnimplementedNativeViewProps(); - const UnimplementedNativeViewProps* oldProps = prevProps == nullptr - ? &defaultProps - : static_cast(prevProps); - if (this == oldProps) { - return folly::dynamic::object(); - } - folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps); - - if (name != oldProps->name) { - result["name"] = name; - } - return result; -} -#endif - -} // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/Props.h b/vnext/codegen/react/components/rnwcore/Props.h deleted file mode 100644 index 726ded89f25..00000000000 --- a/vnext/codegen/react/components/rnwcore/Props.h +++ /dev/null @@ -1,536 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GeneratePropsH.js - */ -#pragma once - -#include -#include -#include -#include -#include - -namespace facebook::react { - -class VirtualViewProps final : public ViewProps { - public: - VirtualViewProps() = default; - VirtualViewProps(const PropsParserContext& context, const VirtualViewProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - bool initialHidden{false}; - int renderState{0}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -enum class ActivityIndicatorViewSize { Small, Large }; - -static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ActivityIndicatorViewSize &result) { - auto string = (std::string)value; - if (string == "small") { result = ActivityIndicatorViewSize::Small; return; } - if (string == "large") { result = ActivityIndicatorViewSize::Large; return; } - abort(); -} - -static inline std::string toString(const ActivityIndicatorViewSize &value) { - switch (value) { - case ActivityIndicatorViewSize::Small: return "small"; - case ActivityIndicatorViewSize::Large: return "large"; - } -} - -#ifdef RN_SERIALIZABLE_STATE -static inline folly::dynamic toDynamic(const ActivityIndicatorViewSize &value) { - return toString(value); -} -#endif - -class ActivityIndicatorViewProps final : public ViewProps { - public: - ActivityIndicatorViewProps() = default; - ActivityIndicatorViewProps(const PropsParserContext& context, const ActivityIndicatorViewProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - bool hidesWhenStopped{true}; - bool animating{true}; - SharedColor color{}; - ActivityIndicatorViewSize size{ActivityIndicatorViewSize::Small}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -enum class AndroidDrawerLayoutKeyboardDismissMode { None, OnDrag }; - -static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, AndroidDrawerLayoutKeyboardDismissMode &result) { - auto string = (std::string)value; - if (string == "none") { result = AndroidDrawerLayoutKeyboardDismissMode::None; return; } - if (string == "on-drag") { result = AndroidDrawerLayoutKeyboardDismissMode::OnDrag; return; } - abort(); -} - -static inline std::string toString(const AndroidDrawerLayoutKeyboardDismissMode &value) { - switch (value) { - case AndroidDrawerLayoutKeyboardDismissMode::None: return "none"; - case AndroidDrawerLayoutKeyboardDismissMode::OnDrag: return "on-drag"; - } -} - -#ifdef RN_SERIALIZABLE_STATE -static inline folly::dynamic toDynamic(const AndroidDrawerLayoutKeyboardDismissMode &value) { - return toString(value); -} -#endif -enum class AndroidDrawerLayoutDrawerPosition { Left, Right }; - -static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, AndroidDrawerLayoutDrawerPosition &result) { - auto string = (std::string)value; - if (string == "left") { result = AndroidDrawerLayoutDrawerPosition::Left; return; } - if (string == "right") { result = AndroidDrawerLayoutDrawerPosition::Right; return; } - abort(); -} - -static inline std::string toString(const AndroidDrawerLayoutDrawerPosition &value) { - switch (value) { - case AndroidDrawerLayoutDrawerPosition::Left: return "left"; - case AndroidDrawerLayoutDrawerPosition::Right: return "right"; - } -} - -#ifdef RN_SERIALIZABLE_STATE -static inline folly::dynamic toDynamic(const AndroidDrawerLayoutDrawerPosition &value) { - return toString(value); -} -#endif -enum class AndroidDrawerLayoutDrawerLockMode { Unlocked, LockedClosed, LockedOpen }; - -static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, AndroidDrawerLayoutDrawerLockMode &result) { - auto string = (std::string)value; - if (string == "unlocked") { result = AndroidDrawerLayoutDrawerLockMode::Unlocked; return; } - if (string == "locked-closed") { result = AndroidDrawerLayoutDrawerLockMode::LockedClosed; return; } - if (string == "locked-open") { result = AndroidDrawerLayoutDrawerLockMode::LockedOpen; return; } - abort(); -} - -static inline std::string toString(const AndroidDrawerLayoutDrawerLockMode &value) { - switch (value) { - case AndroidDrawerLayoutDrawerLockMode::Unlocked: return "unlocked"; - case AndroidDrawerLayoutDrawerLockMode::LockedClosed: return "locked-closed"; - case AndroidDrawerLayoutDrawerLockMode::LockedOpen: return "locked-open"; - } -} - -#ifdef RN_SERIALIZABLE_STATE -static inline folly::dynamic toDynamic(const AndroidDrawerLayoutDrawerLockMode &value) { - return toString(value); -} -#endif - -class AndroidDrawerLayoutProps final : public ViewProps { - public: - AndroidDrawerLayoutProps() = default; - AndroidDrawerLayoutProps(const PropsParserContext& context, const AndroidDrawerLayoutProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - AndroidDrawerLayoutKeyboardDismissMode keyboardDismissMode{AndroidDrawerLayoutKeyboardDismissMode::None}; - SharedColor drawerBackgroundColor{}; - AndroidDrawerLayoutDrawerPosition drawerPosition{AndroidDrawerLayoutDrawerPosition::Left}; - Float drawerWidth{}; - AndroidDrawerLayoutDrawerLockMode drawerLockMode{AndroidDrawerLayoutDrawerLockMode::Unlocked}; - SharedColor statusBarBackgroundColor{}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class AndroidHorizontalScrollContentViewProps final : public ViewProps { - public: - AndroidHorizontalScrollContentViewProps() = default; - AndroidHorizontalScrollContentViewProps(const PropsParserContext& context, const AndroidHorizontalScrollContentViewProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - bool removeClippedSubviews{false}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -enum class AndroidSwipeRefreshLayoutSize { Default, Large }; - -static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, AndroidSwipeRefreshLayoutSize &result) { - auto string = (std::string)value; - if (string == "default") { result = AndroidSwipeRefreshLayoutSize::Default; return; } - if (string == "large") { result = AndroidSwipeRefreshLayoutSize::Large; return; } - abort(); -} - -static inline std::string toString(const AndroidSwipeRefreshLayoutSize &value) { - switch (value) { - case AndroidSwipeRefreshLayoutSize::Default: return "default"; - case AndroidSwipeRefreshLayoutSize::Large: return "large"; - } -} - -#ifdef RN_SERIALIZABLE_STATE -static inline folly::dynamic toDynamic(const AndroidSwipeRefreshLayoutSize &value) { - return toString(value); -} -#endif - -class AndroidSwipeRefreshLayoutProps final : public ViewProps { - public: - AndroidSwipeRefreshLayoutProps() = default; - AndroidSwipeRefreshLayoutProps(const PropsParserContext& context, const AndroidSwipeRefreshLayoutProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - bool enabled{true}; - std::vector colors{}; - SharedColor progressBackgroundColor{}; - AndroidSwipeRefreshLayoutSize size{AndroidSwipeRefreshLayoutSize::Default}; - Float progressViewOffset{0.0}; - bool refreshing{false}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class AndroidSwitchProps final : public ViewProps { - public: - AndroidSwitchProps() = default; - AndroidSwitchProps(const PropsParserContext& context, const AndroidSwitchProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - bool disabled{false}; - bool enabled{true}; - SharedColor thumbColor{}; - SharedColor trackColorForFalse{}; - SharedColor trackColorForTrue{}; - bool value{false}; - bool on{false}; - SharedColor thumbTintColor{}; - SharedColor trackTintColor{}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class DebuggingOverlayProps final : public ViewProps { - public: - DebuggingOverlayProps() = default; - DebuggingOverlayProps(const PropsParserContext& context, const DebuggingOverlayProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class AndroidProgressBarProps final : public ViewProps { - public: - AndroidProgressBarProps() = default; - AndroidProgressBarProps(const PropsParserContext& context, const AndroidProgressBarProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - std::string styleAttr{}; - std::string typeAttr{}; - bool indeterminate{false}; - double progress{0.0}; - bool animating{true}; - SharedColor color{}; - std::string testID{""}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class PullToRefreshViewProps final : public ViewProps { - public: - PullToRefreshViewProps() = default; - PullToRefreshViewProps(const PropsParserContext& context, const PullToRefreshViewProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - SharedColor tintColor{}; - SharedColor titleColor{}; - std::string title{}; - Float progressViewOffset{0.0}; - bool refreshing{false}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class InputAccessoryProps final : public ViewProps { - public: - InputAccessoryProps() = default; - InputAccessoryProps(const PropsParserContext& context, const InputAccessoryProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - SharedColor backgroundColor{}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -enum class ModalHostViewAnimationType { None, Slide, Fade }; - -static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ModalHostViewAnimationType &result) { - auto string = (std::string)value; - if (string == "none") { result = ModalHostViewAnimationType::None; return; } - if (string == "slide") { result = ModalHostViewAnimationType::Slide; return; } - if (string == "fade") { result = ModalHostViewAnimationType::Fade; return; } - abort(); -} - -static inline std::string toString(const ModalHostViewAnimationType &value) { - switch (value) { - case ModalHostViewAnimationType::None: return "none"; - case ModalHostViewAnimationType::Slide: return "slide"; - case ModalHostViewAnimationType::Fade: return "fade"; - } -} - -#ifdef RN_SERIALIZABLE_STATE -static inline folly::dynamic toDynamic(const ModalHostViewAnimationType &value) { - return toString(value); -} -#endif -enum class ModalHostViewPresentationStyle { FullScreen, PageSheet, FormSheet, OverFullScreen }; - -static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ModalHostViewPresentationStyle &result) { - auto string = (std::string)value; - if (string == "fullScreen") { result = ModalHostViewPresentationStyle::FullScreen; return; } - if (string == "pageSheet") { result = ModalHostViewPresentationStyle::PageSheet; return; } - if (string == "formSheet") { result = ModalHostViewPresentationStyle::FormSheet; return; } - if (string == "overFullScreen") { result = ModalHostViewPresentationStyle::OverFullScreen; return; } - abort(); -} - -static inline std::string toString(const ModalHostViewPresentationStyle &value) { - switch (value) { - case ModalHostViewPresentationStyle::FullScreen: return "fullScreen"; - case ModalHostViewPresentationStyle::PageSheet: return "pageSheet"; - case ModalHostViewPresentationStyle::FormSheet: return "formSheet"; - case ModalHostViewPresentationStyle::OverFullScreen: return "overFullScreen"; - } -} - -#ifdef RN_SERIALIZABLE_STATE -static inline folly::dynamic toDynamic(const ModalHostViewPresentationStyle &value) { - return toString(value); -} -#endif -using ModalHostViewSupportedOrientationsMask = uint32_t; - -struct ModalHostViewSupportedOrientationsMaskWrapped { - ModalHostViewSupportedOrientationsMask value; -}; - -enum class ModalHostViewSupportedOrientations: ModalHostViewSupportedOrientationsMask { - Portrait = 1 << 0, - PortraitUpsideDown = 1 << 1, - Landscape = 1 << 2, - LandscapeLeft = 1 << 3, - LandscapeRight = 1 << 4 -}; - -constexpr bool operator&( - ModalHostViewSupportedOrientationsMask const lhs, - enum ModalHostViewSupportedOrientations const rhs) { - return lhs & static_cast(rhs); -} - -constexpr ModalHostViewSupportedOrientationsMask operator|( - ModalHostViewSupportedOrientationsMask const lhs, - enum ModalHostViewSupportedOrientations const rhs) { - return lhs | static_cast(rhs); -} - -constexpr void operator|=( - ModalHostViewSupportedOrientationsMask &lhs, - enum ModalHostViewSupportedOrientations const rhs) { - lhs = lhs | static_cast(rhs); -} - -static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ModalHostViewSupportedOrientationsMaskWrapped &wrapped) { - auto items = std::vector{value}; - for (const auto &item : items) { - if (item == "portrait") { - wrapped.value |= ModalHostViewSupportedOrientations::Portrait; - continue; - } - if (item == "portrait-upside-down") { - wrapped.value |= ModalHostViewSupportedOrientations::PortraitUpsideDown; - continue; - } - if (item == "landscape") { - wrapped.value |= ModalHostViewSupportedOrientations::Landscape; - continue; - } - if (item == "landscape-left") { - wrapped.value |= ModalHostViewSupportedOrientations::LandscapeLeft; - continue; - } - if (item == "landscape-right") { - wrapped.value |= ModalHostViewSupportedOrientations::LandscapeRight; - continue; - } - abort(); - } -} - -static inline std::string toString(const ModalHostViewSupportedOrientationsMaskWrapped &wrapped) { - auto result = std::string{}; - auto separator = std::string{", "}; - - if (wrapped.value & ModalHostViewSupportedOrientations::Portrait) { - result += "portrait" + separator; - } - if (wrapped.value & ModalHostViewSupportedOrientations::PortraitUpsideDown) { - result += "portrait-upside-down" + separator; - } - if (wrapped.value & ModalHostViewSupportedOrientations::Landscape) { - result += "landscape" + separator; - } - if (wrapped.value & ModalHostViewSupportedOrientations::LandscapeLeft) { - result += "landscape-left" + separator; - } - if (wrapped.value & ModalHostViewSupportedOrientations::LandscapeRight) { - result += "landscape-right" + separator; - } - if (!result.empty()) { - result.erase(result.length() - separator.length()); - } - return result; -} - -class ModalHostViewProps final : public ViewProps { - public: - ModalHostViewProps() = default; - ModalHostViewProps(const PropsParserContext& context, const ModalHostViewProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - ModalHostViewAnimationType animationType{ModalHostViewAnimationType::None}; - ModalHostViewPresentationStyle presentationStyle{ModalHostViewPresentationStyle::FullScreen}; - bool transparent{false}; - bool statusBarTranslucent{false}; - bool navigationBarTranslucent{false}; - bool hardwareAccelerated{false}; - bool visible{false}; - bool animated{false}; - bool allowSwipeDismissal{false}; - ModalHostViewSupportedOrientationsMask supportedOrientations{static_cast(ModalHostViewSupportedOrientations::Portrait)}; - int identifier{0}; - std::string title{}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class SafeAreaViewProps final : public ViewProps { - public: - SafeAreaViewProps() = default; - SafeAreaViewProps(const PropsParserContext& context, const SafeAreaViewProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class SwitchProps final : public ViewProps { - public: - SwitchProps() = default; - SwitchProps(const PropsParserContext& context, const SwitchProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - bool disabled{false}; - bool value{false}; - SharedColor tintColor{}; - SharedColor onTintColor{}; - SharedColor thumbTintColor{}; - SharedColor thumbColor{}; - SharedColor trackColorForFalse{}; - SharedColor trackColorForTrue{}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -class UnimplementedNativeViewProps final : public ViewProps { - public: - UnimplementedNativeViewProps() = default; - UnimplementedNativeViewProps(const PropsParserContext& context, const UnimplementedNativeViewProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - std::string name{""}; - - #ifdef RN_SERIALIZABLE_STATE - ComponentName getDiffPropsImplementationTarget() const override; - - folly::dynamic getDiffProps(const Props* prevProps) const override; - #endif -}; - -} // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/PullToRefreshView.g.h b/vnext/codegen/react/components/rnwcore/PullToRefreshView.g.h deleted file mode 100644 index bcb972aae78..00000000000 --- a/vnext/codegen/react/components/rnwcore/PullToRefreshView.g.h +++ /dev/null @@ -1,246 +0,0 @@ - -/* - * This file is auto-generated from PullToRefreshViewNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(PullToRefreshViewProps) -struct PullToRefreshViewProps : winrt::implements { - PullToRefreshViewProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - tintColor = cloneFromProps->tintColor; - titleColor = cloneFromProps->titleColor; - title = cloneFromProps->title; - progressViewOffset = cloneFromProps->progressViewOffset; - refreshing = cloneFromProps->refreshing; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(tintColor) - winrt::Microsoft::ReactNative::Color tintColor{nullptr}; - - REACT_FIELD(titleColor) - winrt::Microsoft::ReactNative::Color titleColor{nullptr}; - - REACT_FIELD(title) - std::optional title; - - REACT_FIELD(progressViewOffset) - std::optional progressViewOffset{}; - - REACT_FIELD(refreshing) - bool refreshing{}; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -REACT_STRUCT(PullToRefreshView_OnRefresh) -struct PullToRefreshView_OnRefresh { -}; - -struct PullToRefreshViewEventEmitter { - PullToRefreshViewEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - using OnRefresh = PullToRefreshView_OnRefresh; - - void onRefresh(OnRefresh &value) const { - m_eventEmitter.DispatchEvent(L"refresh", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BasePullToRefreshView { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - // You must provide an implementation of this method to handle the "setNativeRefreshing" command - virtual void HandleSetNativeRefreshingCommand(bool refreshing) noexcept = 0; - - void HandleCommand(const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - auto commandName = args.CommandName(); - if (commandName == L"setNativeRefreshing") { - bool refreshing; - winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), refreshing); - userData->HandleSetNativeRefreshingCommand(refreshing); - return; - } - } - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterPullToRefreshViewNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"PullToRefreshView", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BasePullToRefreshView::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BasePullToRefreshView::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - builder.SetCustomCommandHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - userData->HandleCommand(view, args); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BasePullToRefreshView::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BasePullToRefreshView::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BasePullToRefreshView::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BasePullToRefreshView::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/SafeAreaView.g.h b/vnext/codegen/react/components/rnwcore/SafeAreaView.g.h deleted file mode 100644 index 6f37466ee69..00000000000 --- a/vnext/codegen/react/components/rnwcore/SafeAreaView.g.h +++ /dev/null @@ -1,197 +0,0 @@ - -/* - * This file is auto-generated from SafeAreaViewNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(SafeAreaViewProps) -struct SafeAreaViewProps : winrt::implements { - SafeAreaViewProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -struct SafeAreaViewEventEmitter { - SafeAreaViewEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseSafeAreaView { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterSafeAreaViewNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"SafeAreaView", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseSafeAreaView::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseSafeAreaView::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseSafeAreaView::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseSafeAreaView::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseSafeAreaView::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseSafeAreaView::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/ShadowNodes.cpp b/vnext/codegen/react/components/rnwcore/ShadowNodes.cpp deleted file mode 100644 index dccefb1d478..00000000000 --- a/vnext/codegen/react/components/rnwcore/ShadowNodes.cpp +++ /dev/null @@ -1,23 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateShadowNodeCpp.js - */ - -#include "ShadowNodes.h" - -namespace facebook::react { - -extern const char ActivityIndicatorViewComponentName[] = "ActivityIndicatorView"; -extern const char AndroidDrawerLayoutComponentName[] = "AndroidDrawerLayout"; -extern const char AndroidSwipeRefreshLayoutComponentName[] = "AndroidSwipeRefreshLayout"; -extern const char DebuggingOverlayComponentName[] = "DebuggingOverlay"; -extern const char PullToRefreshViewComponentName[] = "PullToRefreshView"; -extern const char SwitchComponentName[] = "Switch"; -extern const char UnimplementedNativeViewComponentName[] = "UnimplementedNativeView"; - -} // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/ShadowNodes.h b/vnext/codegen/react/components/rnwcore/ShadowNodes.h deleted file mode 100644 index 2c7c94720cf..00000000000 --- a/vnext/codegen/react/components/rnwcore/ShadowNodes.h +++ /dev/null @@ -1,98 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateShadowNodeH.js - */ - -#pragma once - -#include "EventEmitters.h" -#include "Props.h" -#include "States.h" -#include -#include - -namespace facebook::react { - -JSI_EXPORT extern const char ActivityIndicatorViewComponentName[]; - -/* - * `ShadowNode` for component. - */ -using ActivityIndicatorViewShadowNode = ConcreteViewShadowNode< - ActivityIndicatorViewComponentName, - ActivityIndicatorViewProps, - ActivityIndicatorViewEventEmitter, - ActivityIndicatorViewState>; - -JSI_EXPORT extern const char AndroidDrawerLayoutComponentName[]; - -/* - * `ShadowNode` for component. - */ -using AndroidDrawerLayoutShadowNode = ConcreteViewShadowNode< - AndroidDrawerLayoutComponentName, - AndroidDrawerLayoutProps, - AndroidDrawerLayoutEventEmitter, - AndroidDrawerLayoutState>; - -JSI_EXPORT extern const char AndroidSwipeRefreshLayoutComponentName[]; - -/* - * `ShadowNode` for component. - */ -using AndroidSwipeRefreshLayoutShadowNode = ConcreteViewShadowNode< - AndroidSwipeRefreshLayoutComponentName, - AndroidSwipeRefreshLayoutProps, - AndroidSwipeRefreshLayoutEventEmitter, - AndroidSwipeRefreshLayoutState>; - -JSI_EXPORT extern const char DebuggingOverlayComponentName[]; - -/* - * `ShadowNode` for component. - */ -using DebuggingOverlayShadowNode = ConcreteViewShadowNode< - DebuggingOverlayComponentName, - DebuggingOverlayProps, - DebuggingOverlayEventEmitter, - DebuggingOverlayState>; - -JSI_EXPORT extern const char PullToRefreshViewComponentName[]; - -/* - * `ShadowNode` for component. - */ -using PullToRefreshViewShadowNode = ConcreteViewShadowNode< - PullToRefreshViewComponentName, - PullToRefreshViewProps, - PullToRefreshViewEventEmitter, - PullToRefreshViewState>; - -JSI_EXPORT extern const char SwitchComponentName[]; - -/* - * `ShadowNode` for component. - */ -using SwitchShadowNode = ConcreteViewShadowNode< - SwitchComponentName, - SwitchProps, - SwitchEventEmitter, - SwitchState>; - -JSI_EXPORT extern const char UnimplementedNativeViewComponentName[]; - -/* - * `ShadowNode` for component. - */ -using UnimplementedNativeViewShadowNode = ConcreteViewShadowNode< - UnimplementedNativeViewComponentName, - UnimplementedNativeViewProps, - UnimplementedNativeViewEventEmitter, - UnimplementedNativeViewState>; - -} // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/States.cpp b/vnext/codegen/react/components/rnwcore/States.cpp deleted file mode 100644 index 1dbb184cbdd..00000000000 --- a/vnext/codegen/react/components/rnwcore/States.cpp +++ /dev/null @@ -1,16 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateStateCpp.js - */ -#include "States.h" - -namespace facebook::react { - - - -} // namespace facebook::react diff --git a/vnext/codegen/react/components/rnwcore/States.h b/vnext/codegen/react/components/rnwcore/States.h deleted file mode 100644 index 837c1ea42fe..00000000000 --- a/vnext/codegen/react/components/rnwcore/States.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateStateH.js - */ -#pragma once - -#include -#ifdef RN_SERIALIZABLE_STATE -#include -#endif - -namespace facebook::react { - -using ActivityIndicatorViewState = StateData; - -using AndroidDrawerLayoutState = StateData; - -using AndroidSwipeRefreshLayoutState = StateData; - -using DebuggingOverlayState = StateData; - -using PullToRefreshViewState = StateData; - -using SwitchState = StateData; - -using UnimplementedNativeViewState = StateData; - -} // namespace facebook::react \ No newline at end of file diff --git a/vnext/codegen/react/components/rnwcore/Switch.g.h b/vnext/codegen/react/components/rnwcore/Switch.g.h deleted file mode 100644 index 7c452873596..00000000000 --- a/vnext/codegen/react/components/rnwcore/Switch.g.h +++ /dev/null @@ -1,263 +0,0 @@ - -/* - * This file is auto-generated from SwitchNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(SwitchProps) -struct SwitchProps : winrt::implements { - SwitchProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - disabled = cloneFromProps->disabled; - value = cloneFromProps->value; - tintColor = cloneFromProps->tintColor; - onTintColor = cloneFromProps->onTintColor; - thumbTintColor = cloneFromProps->thumbTintColor; - thumbColor = cloneFromProps->thumbColor; - trackColorForFalse = cloneFromProps->trackColorForFalse; - trackColorForTrue = cloneFromProps->trackColorForTrue; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(disabled) - std::optional disabled{}; - - REACT_FIELD(value) - std::optional value{}; - - REACT_FIELD(tintColor) - winrt::Microsoft::ReactNative::Color tintColor{nullptr}; - - REACT_FIELD(onTintColor) - winrt::Microsoft::ReactNative::Color onTintColor{nullptr}; - - REACT_FIELD(thumbTintColor) - winrt::Microsoft::ReactNative::Color thumbTintColor{nullptr}; - - REACT_FIELD(thumbColor) - winrt::Microsoft::ReactNative::Color thumbColor{nullptr}; - - REACT_FIELD(trackColorForFalse) - winrt::Microsoft::ReactNative::Color trackColorForFalse{nullptr}; - - REACT_FIELD(trackColorForTrue) - winrt::Microsoft::ReactNative::Color trackColorForTrue{nullptr}; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -REACT_STRUCT(Switch_OnChange) -struct Switch_OnChange { - REACT_FIELD(value) - bool value{}; - - REACT_FIELD(target) - int32_t target{}; -}; - -struct SwitchEventEmitter { - SwitchEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - using OnChange = Switch_OnChange; - - void onChange(OnChange &value) const { - m_eventEmitter.DispatchEvent(L"change", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseSwitch { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - // You must provide an implementation of this method to handle the "setValue" command - virtual void HandleSetValueCommand(bool value) noexcept = 0; - - void HandleCommand(const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - auto commandName = args.CommandName(); - if (commandName == L"setValue") { - bool value; - winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), value); - userData->HandleSetValueCommand(value); - return; - } - } - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterSwitchNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"Switch", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseSwitch::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseSwitch::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - builder.SetCustomCommandHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept { - auto userData = view.UserData().as(); - userData->HandleCommand(view, args); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseSwitch::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseSwitch::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseSwitch::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseSwitch::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/UnimplementedNativeView.g.h b/vnext/codegen/react/components/rnwcore/UnimplementedNativeView.g.h deleted file mode 100644 index 3577f22bc08..00000000000 --- a/vnext/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +++ /dev/null @@ -1,200 +0,0 @@ - -/* - * This file is auto-generated from UnimplementedNativeViewNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(UnimplementedNativeViewProps) -struct UnimplementedNativeViewProps : winrt::implements { - UnimplementedNativeViewProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - name = cloneFromProps->name; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(name) - std::optional name; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -struct UnimplementedNativeViewEventEmitter { - UnimplementedNativeViewEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseUnimplementedNativeView { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterUnimplementedNativeViewNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"UnimplementedNativeView", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseUnimplementedNativeView::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseUnimplementedNativeView::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseUnimplementedNativeView::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseUnimplementedNativeView::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseUnimplementedNativeView::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseUnimplementedNativeView::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/react/components/rnwcore/VirtualView.g.h b/vnext/codegen/react/components/rnwcore/VirtualView.g.h deleted file mode 100644 index d0c7364971c..00000000000 --- a/vnext/codegen/react/components/rnwcore/VirtualView.g.h +++ /dev/null @@ -1,226 +0,0 @@ - -/* - * This file is auto-generated from VirtualViewNativeComponent spec file in flow / TypeScript. - */ -// clang-format off -#pragma once - -#include - -#ifdef RNW_NEW_ARCH -#include - -#include -#include -#endif // #ifdef RNW_NEW_ARCH - -#ifdef RNW_NEW_ARCH - -namespace Microsoft::ReactNativeSpecs { - -REACT_STRUCT(VirtualViewProps) -struct VirtualViewProps : winrt::implements { - VirtualViewProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) - : ViewProps(props) - { - if (cloneFrom) { - auto cloneFromProps = cloneFrom.as(); - initialHidden = cloneFromProps->initialHidden; - renderState = cloneFromProps->renderState; - } - } - - void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { - winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); - } - - REACT_FIELD(initialHidden) - std::optional initialHidden{}; - - REACT_FIELD(renderState) - int32_t renderState{}; - - const winrt::Microsoft::ReactNative::ViewProps ViewProps; -}; - -REACT_STRUCT(VirtualView_OnModeChange) -struct VirtualView_OnModeChange { - REACT_FIELD(mode) - int32_t mode{}; - - REACT_FIELD(targetRect) - VirtualViewSpec_onModeChange2 targetRect; - - REACT_FIELD(thresholdRect) - VirtualViewSpec_onModeChange3 thresholdRect; -}; - -struct VirtualViewEventEmitter { - VirtualViewEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) - : m_eventEmitter(eventEmitter) {} - - using OnModeChange = VirtualView_OnModeChange; - using OnModeChange2 = VirtualView_OnModeChange2; - using OnModeChange3 = VirtualView_OnModeChange3; - - void onModeChange(OnModeChange &value) const { - m_eventEmitter.DispatchEvent(L"modeChange", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) { - winrt::Microsoft::ReactNative::WriteValue(writer, value); - }); - } - - private: - winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr}; -}; - -template -struct BaseVirtualView { - - virtual void UpdateProps( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::com_ptr &newProps, - const winrt::com_ptr &/*oldProps*/) noexcept { - m_props = newProps; - } - - // UpdateLayoutMetrics will only be called if this method is overridden - virtual void UpdateLayoutMetrics( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, - const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { - } - - // UpdateState will only be called if this method is overridden - virtual void UpdateState( - const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept { - } - - virtual void UpdateEventEmitter(const std::shared_ptr &eventEmitter) noexcept { - m_eventEmitter = eventEmitter; - } - - // MountChildComponentView will only be called if this method is overridden - virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept { - } - - // UnmountChildComponentView will only be called if this method is overridden - virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept { - } - - // Initialize will only be called if this method is overridden - virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept { - } - - // CreateVisual will only be called if this method is overridden - virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - return view.as().Compositor().CreateSpriteVisual(); - } - - // FinalizeUpdate will only be called if this method is overridden - virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept { - } - - - - const std::shared_ptr& EventEmitter() const { return m_eventEmitter; } - const winrt::com_ptr& Props() const { return m_props; } - -private: - winrt::com_ptr m_props; - std::shared_ptr m_eventEmitter; -}; - -template -void RegisterVirtualViewNativeComponent( - winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder, - std::function builderCallback) noexcept { - packageBuilder.as().AddViewComponent( - L"VirtualView", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { - auto compBuilder = builder.as(); - - builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, - const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { - return winrt::make(props, cloneFrom); - }); - - builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentProps &newProps, - const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept { - auto userData = view.UserData().as(); - userData->UpdateProps(view, newProps ? newProps.as() : nullptr, oldProps ? oldProps.as() : nullptr); - }); - - compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, - const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { - auto userData = view.UserData().as(); - userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); - }); - - builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { - auto userData = view.UserData().as(); - userData->UpdateEventEmitter(std::make_shared(eventEmitter)); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseVirtualView::FinalizeUpdate) { - builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept { - auto userData = view.UserData().as(); - userData->FinalizeUpdate(view, mask); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseVirtualView::UpdateState) { - builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept { - auto userData = view.UserData().as(); - userData->UpdateState(view, newState); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseVirtualView::MountChildComponentView) { - builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->MountChildComponentView(view, args); - }); - } - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseVirtualView::UnmountChildComponentView) { - builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, - const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept { - auto userData = view.UserData().as(); - return userData->UnmountChildComponentView(view, args); - }); - } - - compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = winrt::make_self(); - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseVirtualView::Initialize) { - userData->Initialize(view); - } - view.UserData(*userData); - }); - - if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseVirtualView::CreateVisual) { - compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { - auto userData = view.UserData().as(); - return userData->CreateVisual(view); - }); - } - - // Allow app to further customize the builder - if (builderCallback) { - builderCallback(compBuilder); - } - }); -} - -} // namespace Microsoft::ReactNativeSpecs - -#endif // #ifdef RNW_NEW_ARCH diff --git a/vnext/codegen/rnwcoreJSI-generated.cpp b/vnext/codegen/rnwcoreJSI-generated.cpp deleted file mode 100644 index da2adc96fdc..00000000000 --- a/vnext/codegen/rnwcoreJSI-generated.cpp +++ /dev/null @@ -1,3393 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleCpp.js - */ - -#include "rnwcoreJSI.h" - -namespace facebook::react { - -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->commonTestFlag( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlagWithoutNativeImplementation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->commonTestFlagWithoutNativeImplementation( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_animatedShouldSignalBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->animatedShouldSignalBatch( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->cxxNativeAnimatedEnabled( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedRemoveJsSync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->cxxNativeAnimatedRemoveJsSync( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMainQueueSyncDispatchIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->disableMainQueueSyncDispatchIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMountItemReorderingAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->disableMountItemReorderingAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->disableTextLayoutManagerCacheAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccessibilityOrder(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableAccessibilityOrder( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccumulatedUpdatesInRawPropsAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableAccumulatedUpdatesInRawPropsAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableBridgelessArchitecture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableBridgelessArchitecture( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableCppPropsIteratorSetter(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableCppPropsIteratorSetter( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableCustomFocusSearchOnClippedElementsAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableCustomFocusSearchOnClippedElementsAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableDestroyShadowTreeRevisionAsync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableDestroyShadowTreeRevisionAsync( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableDoubleMeasurementFixAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableDoubleMeasurementFixAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableEagerRootViewAttachment(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableEagerRootViewAttachment( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricLogs(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableFabricLogs( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricRenderer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableFabricRenderer( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFixForParentTagDuringReparenting(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableFixForParentTagDuringReparenting( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFontScaleChangesUpdatingLayout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableFontScaleChangesUpdatingLayout( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableIOSTextBaselineOffsetPerLine( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSViewClipToPaddingBox(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableIOSViewClipToPaddingBox( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableInteropViewManagerClassLookUpOptimizationIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableInteropViewManagerClassLookUpOptimizationIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableLayoutAnimationsOnAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableLayoutAnimationsOnIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableMainQueueCoordinatorOnIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueModulesOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableMainQueueModulesOnIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableModuleArgumentNSNullConversionIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNativeCSSParsing(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableNativeCSSParsing( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNetworkEventReporting(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableNetworkEventReporting( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNewBackgroundAndBorderDrawables(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableNewBackgroundAndBorderDrawables( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enablePreparedTextLayout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enablePreparedTextLayout( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enablePropsUpdateReconciliationAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enablePropsUpdateReconciliationAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableResourceTimingAPI(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableResourceTimingAPI( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableSynchronousStateUpdates(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableSynchronousStateUpdates( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewCulling(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableViewCulling( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecycling(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableViewRecycling( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecyclingForText(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableViewRecyclingForText( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecyclingForView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableViewRecyclingForView( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewDebugFeatures(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableVirtualViewDebugFeatures( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewRenderState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableVirtualViewRenderState( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewWindowFocusDetection(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableVirtualViewWindowFocusDetection( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->fixMappingOfEventPrioritiesBetweenFabricAndReact( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxEnabledRelease(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->fuseboxEnabledRelease( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxNetworkInspectionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->fuseboxNetworkInspectionEnabled( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_preparedTextCacheSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->preparedTextCacheSize( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->traceTurboModulePromiseRejectionsOnAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->updateRuntimeShadowNodeReferencesOnCommit( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useAlwaysAvailableJSErrorHandling( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useFabricInterop( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useNativeViewConfigsInBridgelessMode( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useOptimizedEventBatchingOnAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useRawPropsJsiValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useRawPropsJsiValue( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useShadowNodeStateOnClone(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useShadowNodeStateOnClone( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModuleInterop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useTurboModuleInterop( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModules(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useTurboModules( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_virtualViewPrerenderRatio(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->virtualViewPrerenderRatio( - rt - ); -} - -NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeReactNativeFeatureFlagsCxx", jsInvoker) { - methodMap_["commonTestFlag"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlag}; - methodMap_["commonTestFlagWithoutNativeImplementation"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlagWithoutNativeImplementation}; - methodMap_["animatedShouldSignalBatch"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_animatedShouldSignalBatch}; - methodMap_["cxxNativeAnimatedEnabled"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedEnabled}; - methodMap_["cxxNativeAnimatedRemoveJsSync"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedRemoveJsSync}; - methodMap_["disableMainQueueSyncDispatchIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMainQueueSyncDispatchIOS}; - methodMap_["disableMountItemReorderingAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMountItemReorderingAndroid}; - methodMap_["disableTextLayoutManagerCacheAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableTextLayoutManagerCacheAndroid}; - methodMap_["enableAccessibilityOrder"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccessibilityOrder}; - methodMap_["enableAccumulatedUpdatesInRawPropsAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccumulatedUpdatesInRawPropsAndroid}; - methodMap_["enableBridgelessArchitecture"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableBridgelessArchitecture}; - methodMap_["enableCppPropsIteratorSetter"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableCppPropsIteratorSetter}; - methodMap_["enableCustomFocusSearchOnClippedElementsAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableCustomFocusSearchOnClippedElementsAndroid}; - methodMap_["enableDestroyShadowTreeRevisionAsync"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableDestroyShadowTreeRevisionAsync}; - methodMap_["enableDoubleMeasurementFixAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableDoubleMeasurementFixAndroid}; - methodMap_["enableEagerRootViewAttachment"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableEagerRootViewAttachment}; - methodMap_["enableFabricLogs"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricLogs}; - methodMap_["enableFabricRenderer"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricRenderer}; - methodMap_["enableFixForParentTagDuringReparenting"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFixForParentTagDuringReparenting}; - methodMap_["enableFontScaleChangesUpdatingLayout"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFontScaleChangesUpdatingLayout}; - methodMap_["enableIOSTextBaselineOffsetPerLine"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSTextBaselineOffsetPerLine}; - methodMap_["enableIOSViewClipToPaddingBox"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSViewClipToPaddingBox}; - methodMap_["enableInteropViewManagerClassLookUpOptimizationIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableInteropViewManagerClassLookUpOptimizationIOS}; - methodMap_["enableLayoutAnimationsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnAndroid}; - methodMap_["enableLayoutAnimationsOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnIOS}; - methodMap_["enableMainQueueCoordinatorOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueCoordinatorOnIOS}; - methodMap_["enableMainQueueModulesOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueModulesOnIOS}; - methodMap_["enableModuleArgumentNSNullConversionIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableModuleArgumentNSNullConversionIOS}; - methodMap_["enableNativeCSSParsing"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNativeCSSParsing}; - methodMap_["enableNetworkEventReporting"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNetworkEventReporting}; - methodMap_["enableNewBackgroundAndBorderDrawables"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNewBackgroundAndBorderDrawables}; - methodMap_["enablePreparedTextLayout"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enablePreparedTextLayout}; - methodMap_["enablePropsUpdateReconciliationAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enablePropsUpdateReconciliationAndroid}; - methodMap_["enableResourceTimingAPI"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableResourceTimingAPI}; - methodMap_["enableSynchronousStateUpdates"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableSynchronousStateUpdates}; - methodMap_["enableViewCulling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewCulling}; - methodMap_["enableViewRecycling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecycling}; - methodMap_["enableViewRecyclingForText"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecyclingForText}; - methodMap_["enableViewRecyclingForView"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecyclingForView}; - methodMap_["enableVirtualViewDebugFeatures"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewDebugFeatures}; - methodMap_["enableVirtualViewRenderState"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewRenderState}; - methodMap_["enableVirtualViewWindowFocusDetection"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewWindowFocusDetection}; - methodMap_["fixMappingOfEventPrioritiesBetweenFabricAndReact"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fixMappingOfEventPrioritiesBetweenFabricAndReact}; - methodMap_["fuseboxEnabledRelease"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxEnabledRelease}; - methodMap_["fuseboxNetworkInspectionEnabled"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxNetworkInspectionEnabled}; - methodMap_["preparedTextCacheSize"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_preparedTextCacheSize}; - methodMap_["traceTurboModulePromiseRejectionsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid}; - methodMap_["updateRuntimeShadowNodeReferencesOnCommit"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit}; - methodMap_["useAlwaysAvailableJSErrorHandling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling}; - methodMap_["useFabricInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop}; - methodMap_["useNativeViewConfigsInBridgelessMode"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useNativeViewConfigsInBridgelessMode}; - methodMap_["useOptimizedEventBatchingOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useOptimizedEventBatchingOnAndroid}; - methodMap_["useRawPropsJsiValue"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useRawPropsJsiValue}; - methodMap_["useShadowNodeStateOnClone"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useShadowNodeStateOnClone}; - methodMap_["useTurboModuleInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModuleInterop}; - methodMap_["useTurboModules"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModules}; - methodMap_["virtualViewPrerenderRatio"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_virtualViewPrerenderRatio}; -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isReduceMotionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isReduceMotionEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isInvertColorsEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isInvertColorsEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isHighTextContrastEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isHighTextContrastEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isTouchExplorationEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isTouchExplorationEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isAccessibilityServiceEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isAccessibilityServiceEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_setAccessibilityFocus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityFocus( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_announceForAccessibility(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibility( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_getRecommendedTimeoutMillis(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getRecommendedTimeoutMillis( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isGrayscaleEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isGrayscaleEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeAccessibilityInfoCxxSpecJSI::NativeAccessibilityInfoCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AccessibilityInfo", jsInvoker) { - methodMap_["isReduceMotionEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isReduceMotionEnabled}; - methodMap_["isInvertColorsEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isInvertColorsEnabled}; - methodMap_["isHighTextContrastEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isHighTextContrastEnabled}; - methodMap_["isTouchExplorationEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isTouchExplorationEnabled}; - methodMap_["isAccessibilityServiceEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isAccessibilityServiceEnabled}; - methodMap_["setAccessibilityFocus"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_setAccessibilityFocus}; - methodMap_["announceForAccessibility"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_announceForAccessibility}; - methodMap_["getRecommendedTimeoutMillis"] = MethodMetadata {2, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_getRecommendedTimeoutMillis}; - methodMap_["isGrayscaleEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isGrayscaleEnabled}; -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentBoldTextState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentBoldTextState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentGrayscaleState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentGrayscaleState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentInvertColorsState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentInvertColorsState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceMotionState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentReduceMotionState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentDarkerSystemColorsState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentDarkerSystemColorsState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentPrefersCrossFadeTransitionsState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceTransparencyState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentReduceTransparencyState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentVoiceOverState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentVoiceOverState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityContentSizeMultipliers( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityFocus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityFocus( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibility(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibility( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibilityWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibilityWithOptions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} - -NativeAccessibilityManagerCxxSpecJSI::NativeAccessibilityManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AccessibilityManager", jsInvoker) { - methodMap_["getCurrentBoldTextState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentBoldTextState}; - methodMap_["getCurrentGrayscaleState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentGrayscaleState}; - methodMap_["getCurrentInvertColorsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentInvertColorsState}; - methodMap_["getCurrentReduceMotionState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceMotionState}; - methodMap_["getCurrentDarkerSystemColorsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentDarkerSystemColorsState}; - methodMap_["getCurrentPrefersCrossFadeTransitionsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentPrefersCrossFadeTransitionsState}; - methodMap_["getCurrentReduceTransparencyState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceTransparencyState}; - methodMap_["getCurrentVoiceOverState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentVoiceOverState}; - methodMap_["setAccessibilityContentSizeMultipliers"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityContentSizeMultipliers}; - methodMap_["setAccessibilityFocus"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityFocus}; - methodMap_["announceForAccessibility"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibility}; - methodMap_["announceForAccessibilityWithOptions"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibilityWithOptions}; -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_showActionSheetWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showActionSheetWithOptions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_showShareActionSheetWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showShareActionSheetWithOptions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_dismissActionSheet(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismissActionSheet( - rt - ); - return jsi::Value::undefined(); -} - -NativeActionSheetManagerCxxSpecJSI::NativeActionSheetManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ActionSheetManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeActionSheetManagerCxxSpecJSI_getConstants}; - methodMap_["showActionSheetWithOptions"] = MethodMetadata {2, __hostFunction_NativeActionSheetManagerCxxSpecJSI_showActionSheetWithOptions}; - methodMap_["showShareActionSheetWithOptions"] = MethodMetadata {3, __hostFunction_NativeActionSheetManagerCxxSpecJSI_showShareActionSheetWithOptions}; - methodMap_["dismissActionSheet"] = MethodMetadata {0, __hostFunction_NativeActionSheetManagerCxxSpecJSI_dismissActionSheet}; -} -static jsi::Value __hostFunction_NativeAlertManagerCxxSpecJSI_alertWithArgs(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->alertWithArgs( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeAlertManagerCxxSpecJSI::NativeAlertManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AlertManager", jsInvoker) { - methodMap_["alertWithArgs"] = MethodMetadata {2, __hostFunction_NativeAlertManagerCxxSpecJSI_alertWithArgs}; -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_finishOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->finishOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_createAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createAnimatedNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_updateAnimatedNodeConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateAnimatedNodeConfig( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startListeningToAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopListeningToAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startAnimatingNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startAnimatingNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopAnimation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopAnimation( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_flattenAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->flattenAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_extractAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->extractAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodeToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodeToView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodeFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodeFromView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_restoreDefaultValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->restoreDefaultValues( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_dropAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dropAnimatedNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_addAnimatedEventToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addAnimatedEventToView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeAnimatedEventFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAnimatedEventFromView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_queueAndExecuteBatchedOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->queueAndExecuteBatchedOperations( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeAnimatedModuleCxxSpecJSI::NativeAnimatedModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeAnimatedModule", jsInvoker) { - methodMap_["startOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startOperationBatch}; - methodMap_["finishOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedModuleCxxSpecJSI_finishOperationBatch}; - methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_createAnimatedNode}; - methodMap_["updateAnimatedNodeConfig"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_updateAnimatedNodeConfig}; - methodMap_["getValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_getValue}; - methodMap_["startListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startListeningToAnimatedNodeValue}; - methodMap_["stopListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopListeningToAnimatedNodeValue}; - methodMap_["connectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodes}; - methodMap_["disconnectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodes}; - methodMap_["startAnimatingNode"] = MethodMetadata {4, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startAnimatingNode}; - methodMap_["stopAnimation"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopAnimation}; - methodMap_["setAnimatedNodeValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeValue}; - methodMap_["setAnimatedNodeOffset"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeOffset}; - methodMap_["flattenAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_flattenAnimatedNodeOffset}; - methodMap_["extractAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_extractAnimatedNodeOffset}; - methodMap_["connectAnimatedNodeToView"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodeToView}; - methodMap_["disconnectAnimatedNodeFromView"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodeFromView}; - methodMap_["restoreDefaultValues"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_restoreDefaultValues}; - methodMap_["dropAnimatedNode"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_dropAnimatedNode}; - methodMap_["addAnimatedEventToView"] = MethodMetadata {3, __hostFunction_NativeAnimatedModuleCxxSpecJSI_addAnimatedEventToView}; - methodMap_["removeAnimatedEventFromView"] = MethodMetadata {3, __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeAnimatedEventFromView}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeListeners}; - methodMap_["queueAndExecuteBatchedOperations"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_queueAndExecuteBatchedOperations}; -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_finishOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->finishOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_createAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createAnimatedNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_updateAnimatedNodeConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateAnimatedNodeConfig( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startListeningToAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopListeningToAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startAnimatingNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startAnimatingNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopAnimation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopAnimation( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_flattenAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->flattenAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_extractAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->extractAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodeToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodeToView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodeFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodeFromView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_restoreDefaultValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->restoreDefaultValues( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_dropAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dropAnimatedNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addAnimatedEventToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addAnimatedEventToView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeAnimatedEventFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAnimatedEventFromView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_queueAndExecuteBatchedOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->queueAndExecuteBatchedOperations( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeAnimatedTurboModuleCxxSpecJSI::NativeAnimatedTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeAnimatedTurboModule", jsInvoker) { - methodMap_["startOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startOperationBatch}; - methodMap_["finishOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_finishOperationBatch}; - methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_createAnimatedNode}; - methodMap_["updateAnimatedNodeConfig"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_updateAnimatedNodeConfig}; - methodMap_["getValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_getValue}; - methodMap_["startListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startListeningToAnimatedNodeValue}; - methodMap_["stopListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopListeningToAnimatedNodeValue}; - methodMap_["connectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodes}; - methodMap_["disconnectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodes}; - methodMap_["startAnimatingNode"] = MethodMetadata {4, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startAnimatingNode}; - methodMap_["stopAnimation"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopAnimation}; - methodMap_["setAnimatedNodeValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeValue}; - methodMap_["setAnimatedNodeOffset"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeOffset}; - methodMap_["flattenAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_flattenAnimatedNodeOffset}; - methodMap_["extractAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_extractAnimatedNodeOffset}; - methodMap_["connectAnimatedNodeToView"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodeToView}; - methodMap_["disconnectAnimatedNodeFromView"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodeFromView}; - methodMap_["restoreDefaultValues"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_restoreDefaultValues}; - methodMap_["dropAnimatedNode"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_dropAnimatedNode}; - methodMap_["addAnimatedEventToView"] = MethodMetadata {3, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addAnimatedEventToView}; - methodMap_["removeAnimatedEventFromView"] = MethodMetadata {3, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeAnimatedEventFromView}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeListeners}; - methodMap_["queueAndExecuteBatchedOperations"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_queueAndExecuteBatchedOperations}; -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_getColorScheme(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getColorScheme( - rt - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_setColorScheme(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setColorScheme( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeAppearanceCxxSpecJSI::NativeAppearanceCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Appearance", jsInvoker) { - methodMap_["getColorScheme"] = MethodMetadata {0, __hostFunction_NativeAppearanceCxxSpecJSI_getColorScheme}; - methodMap_["setColorScheme"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_setColorScheme}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_getCurrentAppState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentAppState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeAppStateCxxSpecJSI::NativeAppStateCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AppState", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeAppStateCxxSpecJSI_getConstants}; - methodMap_["getCurrentAppState"] = MethodMetadata {2, __hostFunction_NativeAppStateCxxSpecJSI_getCurrentAppState}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAppStateCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAppStateCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeAppThemeCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativeAppThemeCxxSpecJSI::NativeAppThemeCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AppTheme", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeAppThemeCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_addNetworkingHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addNetworkingHandler( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_addWebSocketHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addWebSocketHandler( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_removeWebSocketHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeWebSocketHandler( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_sendOverSocket(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendOverSocket( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_createFromParts(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createFromParts( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_release(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->release( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeBlobModuleCxxSpecJSI::NativeBlobModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("BlobModule", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeBlobModuleCxxSpecJSI_getConstants}; - methodMap_["addNetworkingHandler"] = MethodMetadata {0, __hostFunction_NativeBlobModuleCxxSpecJSI_addNetworkingHandler}; - methodMap_["addWebSocketHandler"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_addWebSocketHandler}; - methodMap_["removeWebSocketHandler"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_removeWebSocketHandler}; - methodMap_["sendOverSocket"] = MethodMetadata {2, __hostFunction_NativeBlobModuleCxxSpecJSI_sendOverSocket}; - methodMap_["createFromParts"] = MethodMetadata {2, __hostFunction_NativeBlobModuleCxxSpecJSI_createFromParts}; - methodMap_["release"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_release}; -} -static jsi::Value __hostFunction_NativeBugReportingCxxSpecJSI_startReportAProblemFlow(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startReportAProblemFlow( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBugReportingCxxSpecJSI_setExtraData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setExtraData( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} - -NativeBugReportingCxxSpecJSI::NativeBugReportingCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("BugReporting", jsInvoker) { - methodMap_["startReportAProblemFlow"] = MethodMetadata {0, __hostFunction_NativeBugReportingCxxSpecJSI_startReportAProblemFlow}; - methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeBugReportingCxxSpecJSI_setExtraData}; -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString( - rt - ); -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_setString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setString( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeClipboardCxxSpecJSI::NativeClipboardCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Clipboard", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeClipboardCxxSpecJSI_getConstants}; - methodMap_["getString"] = MethodMetadata {0, __hostFunction_NativeClipboardCxxSpecJSI_getString}; - methodMap_["setString"] = MethodMetadata {1, __hostFunction_NativeClipboardCxxSpecJSI_setString}; -} -static jsi::Value __hostFunction_NativeDeviceEventManagerCxxSpecJSI_invokeDefaultBackPressHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->invokeDefaultBackPressHandler( - rt - ); - return jsi::Value::undefined(); -} - -NativeDeviceEventManagerCxxSpecJSI::NativeDeviceEventManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DeviceEventManager", jsInvoker) { - methodMap_["invokeDefaultBackPressHandler"] = MethodMetadata {0, __hostFunction_NativeDeviceEventManagerCxxSpecJSI_invokeDefaultBackPressHandler}; -} -static jsi::Value __hostFunction_NativeDeviceInfoCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativeDeviceInfoCxxSpecJSI::NativeDeviceInfoCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DeviceInfo", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDeviceInfoCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativeDevLoadingViewCxxSpecJSI_showMessage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showMessage( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asNumber()), - count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asNumber()) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevLoadingViewCxxSpecJSI_hide(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hide( - rt - ); - return jsi::Value::undefined(); -} - -NativeDevLoadingViewCxxSpecJSI::NativeDevLoadingViewCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevLoadingView", jsInvoker) { - methodMap_["showMessage"] = MethodMetadata {3, __hostFunction_NativeDevLoadingViewCxxSpecJSI_showMessage}; - methodMap_["hide"] = MethodMetadata {0, __hostFunction_NativeDevLoadingViewCxxSpecJSI_hide}; -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_reload(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reload( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_reloadWithReason(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reloadWithReason( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_onFastRefresh(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->onFastRefresh( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setHotLoadingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHotLoadingEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setProfilingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setProfilingEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_toggleElementInspector(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->toggleElementInspector( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_addMenuItem(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addMenuItem( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_openDebugger(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->openDebugger( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setIsShakeToShowDevMenuEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeDevSettingsCxxSpecJSI::NativeDevSettingsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevSettings", jsInvoker) { - methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_reload}; - methodMap_["reloadWithReason"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_reloadWithReason}; - methodMap_["onFastRefresh"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_onFastRefresh}; - methodMap_["setHotLoadingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setHotLoadingEnabled}; - methodMap_["setProfilingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setProfilingEnabled}; - methodMap_["toggleElementInspector"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_toggleElementInspector}; - methodMap_["addMenuItem"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_addMenuItem}; - methodMap_["openDebugger"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_openDebugger}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_removeListeners}; - methodMap_["setIsShakeToShowDevMenuEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setIsShakeToShowDevMenuEnabled}; -} -static jsi::Value __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_showAlert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showAlert( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeDialogManagerAndroidCxxSpecJSI::NativeDialogManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DialogManagerAndroid", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_getConstants}; - methodMap_["showAlert"] = MethodMetadata {3, __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_showAlert}; -} -static jsi::Value __hostFunction_NativeDialogManagerWindowsCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeDialogManagerWindowsCxxSpecJSI_showAlert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showAlert( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeDialogManagerWindowsCxxSpecJSI::NativeDialogManagerWindowsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Alert", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDialogManagerWindowsCxxSpecJSI_getConstants}; - methodMap_["showAlert"] = MethodMetadata {3, __hostFunction_NativeDialogManagerWindowsCxxSpecJSI_showAlert}; -} -static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportFatalException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportFatalException( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportSoftException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportSoftException( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportException( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_dismissRedbox(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismissRedbox( - rt - ); - return jsi::Value::undefined(); -} - -NativeExceptionsManagerCxxSpecJSI::NativeExceptionsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ExceptionsManager", jsInvoker) { - methodMap_["reportFatalException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportFatalException}; - methodMap_["reportSoftException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportSoftException}; - methodMap_["reportException"] = MethodMetadata {1, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportException}; - methodMap_["dismissRedbox"] = MethodMetadata {0, __hostFunction_NativeExceptionsManagerCxxSpecJSI_dismissRedbox}; -} -static jsi::Value __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsDataURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->readAsDataURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsText(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->readAsText( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); -} - -NativeFileReaderModuleCxxSpecJSI::NativeFileReaderModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("FileReaderModule", jsInvoker) { - methodMap_["readAsDataURL"] = MethodMetadata {1, __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsDataURL}; - methodMap_["readAsText"] = MethodMetadata {2, __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsText}; -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setGlobalOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setGlobalOptions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setContext(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setContext( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_beginScroll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->beginScroll( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_endScroll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->endScroll( - rt - ); - return jsi::Value::undefined(); -} - -NativeFrameRateLoggerCxxSpecJSI::NativeFrameRateLoggerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("FrameRateLogger", jsInvoker) { - methodMap_["setGlobalOptions"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setGlobalOptions}; - methodMap_["setContext"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setContext}; - methodMap_["beginScroll"] = MethodMetadata {0, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_beginScroll}; - methodMap_["endScroll"] = MethodMetadata {0, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_endScroll}; -} -static jsi::Value __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskFinished(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->notifyTaskFinished( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskRetry(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->notifyTaskRetry( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} - -NativeHeadlessJsTaskSupportCxxSpecJSI::NativeHeadlessJsTaskSupportCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("HeadlessJsTaskSupport", jsInvoker) { - methodMap_["notifyTaskFinished"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskFinished}; - methodMap_["notifyTaskRetry"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskRetry}; -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_allowRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->allowRTL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_forceRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->forceRTL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_swapLeftAndRightInRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->swapLeftAndRightInRTL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeI18nManagerCxxSpecJSI::NativeI18nManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("I18nManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeI18nManagerCxxSpecJSI_getConstants}; - methodMap_["allowRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_allowRTL}; - methodMap_["forceRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_forceRTL}; - methodMap_["swapLeftAndRightInRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_swapLeftAndRightInRTL}; -} -static jsi::Value __hostFunction_NativeImageEditorCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageEditorCxxSpecJSI_cropImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cropImage( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageEditorCxxSpecJSI::NativeImageEditorCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageEditingManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageEditorCxxSpecJSI_getConstants}; - methodMap_["cropImage"] = MethodMetadata {4, __hostFunction_NativeImageEditorCxxSpecJSI_cropImage}; -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSize( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSizeWithHeaders(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSizeWithHeaders( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_prefetchImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImage( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_queryCache(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->queryCache( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} - -NativeImageLoaderAndroidCxxSpecJSI::NativeImageLoaderAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageLoader", jsInvoker) { - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_abortRequest}; - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getConstants}; - methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSize}; - methodMap_["getSizeWithHeaders"] = MethodMetadata {2, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSizeWithHeaders}; - methodMap_["prefetchImage"] = MethodMetadata {2, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_prefetchImage}; - methodMap_["queryCache"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_queryCache}; -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSize( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSizeWithHeaders(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSizeWithHeaders( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImage( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImageWithMetadata(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImageWithMetadata( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_queryCache(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->queryCache( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} - -NativeImageLoaderIOSCxxSpecJSI::NativeImageLoaderIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageLoader", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getConstants}; - methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSize}; - methodMap_["getSizeWithHeaders"] = MethodMetadata {2, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSizeWithHeaders}; - methodMap_["prefetchImage"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImage}; - methodMap_["prefetchImageWithMetadata"] = MethodMetadata {3, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImageWithMetadata}; - methodMap_["queryCache"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_queryCache}; -} -static jsi::Value __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getBase64ForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getBase64ForTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageStoreAndroidCxxSpecJSI::NativeImageStoreAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageStoreManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getConstants}; - methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getBase64ForTag}; -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_getBase64ForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getBase64ForTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_hasImageForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hasImageForTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_removeImageForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeImageForTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_addImageFromBase64(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addImageFromBase64( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageStoreIOSCxxSpecJSI::NativeImageStoreIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageStoreManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageStoreIOSCxxSpecJSI_getConstants}; - methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreIOSCxxSpecJSI_getBase64ForTag}; - methodMap_["hasImageForTag"] = MethodMetadata {2, __hostFunction_NativeImageStoreIOSCxxSpecJSI_hasImageForTag}; - methodMap_["removeImageForTag"] = MethodMetadata {1, __hostFunction_NativeImageStoreIOSCxxSpecJSI_removeImageForTag}; - methodMap_["addImageFromBase64"] = MethodMetadata {3, __hostFunction_NativeImageStoreIOSCxxSpecJSI_addImageFromBase64}; -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_getInitialURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialURL( - rt - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_canOpenURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->canOpenURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_openURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_openSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openSettings( - rt - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_sendIntent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->sendIntent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt).asArray(rt)) - ); -} - -NativeIntentAndroidCxxSpecJSI::NativeIntentAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("IntentAndroid", jsInvoker) { - methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeIntentAndroidCxxSpecJSI_getInitialURL}; - methodMap_["canOpenURL"] = MethodMetadata {1, __hostFunction_NativeIntentAndroidCxxSpecJSI_canOpenURL}; - methodMap_["openURL"] = MethodMetadata {1, __hostFunction_NativeIntentAndroidCxxSpecJSI_openURL}; - methodMap_["openSettings"] = MethodMetadata {0, __hostFunction_NativeIntentAndroidCxxSpecJSI_openSettings}; - methodMap_["sendIntent"] = MethodMetadata {2, __hostFunction_NativeIntentAndroidCxxSpecJSI_sendIntent}; -} -static jsi::Value __hostFunction_NativeJSCHeapCaptureCxxSpecJSI_captureComplete(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->captureComplete( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)) - ); - return jsi::Value::undefined(); -} - -NativeJSCHeapCaptureCxxSpecJSI::NativeJSCHeapCaptureCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("JSCHeapCapture", jsInvoker) { - methodMap_["captureComplete"] = MethodMetadata {2, __hostFunction_NativeJSCHeapCaptureCxxSpecJSI_captureComplete}; -} -static jsi::Value __hostFunction_NativeKeyboardObserverCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeKeyboardObserverCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeKeyboardObserverCxxSpecJSI::NativeKeyboardObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("KeyboardObserver", jsInvoker) { - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_getInitialURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialURL( - rt - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_canOpenURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->canOpenURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_openURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_openSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openSettings( - rt - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeLinkingManagerCxxSpecJSI::NativeLinkingManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("LinkingManager", jsInvoker) { - methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeLinkingManagerCxxSpecJSI_getInitialURL}; - methodMap_["canOpenURL"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_canOpenURL}; - methodMap_["openURL"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_openURL}; - methodMap_["openSettings"] = MethodMetadata {0, __hostFunction_NativeLinkingManagerCxxSpecJSI_openSettings}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeLogBoxCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeLogBoxCxxSpecJSI_hide(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hide( - rt - ); - return jsi::Value::undefined(); -} - -NativeLogBoxCxxSpecJSI::NativeLogBoxCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("LogBox", jsInvoker) { - methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeLogBoxCxxSpecJSI_show}; - methodMap_["hide"] = MethodMetadata {0, __hostFunction_NativeLogBoxCxxSpecJSI_hide}; -} -static jsi::Value __hostFunction_NativeModalManagerCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeModalManagerCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeModalManagerCxxSpecJSI::NativeModalManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ModalManager", jsInvoker) { - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeModalManagerCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeModalManagerCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_sendRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asArray(rt), - count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asObject(rt), - count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asString(rt), - count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asBool(), - count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber(), - count <= 8 ? throw jsi::JSError(rt, "Expected argument in position 8 to be passed") : args[8].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_clearCookies(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearCookies( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeNetworkingAndroidCxxSpecJSI::NativeNetworkingAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Networking", jsInvoker) { - methodMap_["sendRequest"] = MethodMetadata {9, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_sendRequest}; - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_abortRequest}; - methodMap_["clearCookies"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_clearCookies}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_sendRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_clearCookies(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearCookies( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeNetworkingIOSCxxSpecJSI::NativeNetworkingIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Networking", jsInvoker) { - methodMap_["sendRequest"] = MethodMetadata {2, __hostFunction_NativeNetworkingIOSCxxSpecJSI_sendRequest}; - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_abortRequest}; - methodMap_["clearCookies"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_clearCookies}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_checkPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->checkPermission( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestPermission( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_shouldShowRequestPermissionRationale(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->shouldShowRequestPermissionRationale( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestMultiplePermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestMultiplePermissions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} - -NativePermissionsAndroidCxxSpecJSI::NativePermissionsAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PermissionsAndroid", jsInvoker) { - methodMap_["checkPermission"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_checkPermission}; - methodMap_["requestPermission"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestPermission}; - methodMap_["shouldShowRequestPermissionRationale"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_shouldShowRequestPermissionRationale}; - methodMap_["requestMultiplePermissions"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestMultiplePermissions}; -} -static jsi::Value __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getAndroidID(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAndroidID( - rt - ); -} - -NativePlatformConstantsAndroidCxxSpecJSI::NativePlatformConstantsAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PlatformConstants", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getConstants}; - methodMap_["getAndroidID"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getAndroidID}; -} -static jsi::Value __hostFunction_NativePlatformConstantsIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativePlatformConstantsIOSCxxSpecJSI::NativePlatformConstantsIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PlatformConstants", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsIOSCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativePlatformConstantsWindowsCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativePlatformConstantsWindowsCxxSpecJSI::NativePlatformConstantsWindowsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PlatformConstants", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsWindowsCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_onFinishRemoteNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->onFinishRemoteNotification( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_setApplicationIconBadgeNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setApplicationIconBadgeNumber( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getApplicationIconBadgeNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getApplicationIconBadgeNumber( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_requestPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestPermissions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_abandonPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abandonPermissions( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_checkPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->checkPermissions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_presentLocalNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->presentLocalNotification( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_scheduleLocalNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->scheduleLocalNotification( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelAllLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancelAllLocalNotifications( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancelLocalNotifications( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getInitialNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialNotification( - rt - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getScheduledLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getScheduledLocalNotifications( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeAllDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAllDeliveredNotifications( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeDeliveredNotifications( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getDeliveredNotifications( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getAuthorizationStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getAuthorizationStatus( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativePushNotificationManagerIOSCxxSpecJSI::NativePushNotificationManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PushNotificationManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getConstants}; - methodMap_["onFinishRemoteNotification"] = MethodMetadata {2, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_onFinishRemoteNotification}; - methodMap_["setApplicationIconBadgeNumber"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_setApplicationIconBadgeNumber}; - methodMap_["getApplicationIconBadgeNumber"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getApplicationIconBadgeNumber}; - methodMap_["requestPermissions"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_requestPermissions}; - methodMap_["abandonPermissions"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_abandonPermissions}; - methodMap_["checkPermissions"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_checkPermissions}; - methodMap_["presentLocalNotification"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_presentLocalNotification}; - methodMap_["scheduleLocalNotification"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_scheduleLocalNotification}; - methodMap_["cancelAllLocalNotifications"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelAllLocalNotifications}; - methodMap_["cancelLocalNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelLocalNotifications}; - methodMap_["getInitialNotification"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getInitialNotification}; - methodMap_["getScheduledLocalNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getScheduledLocalNotifications}; - methodMap_["removeAllDeliveredNotifications"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeAllDeliveredNotifications}; - methodMap_["removeDeliveredNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeDeliveredNotifications}; - methodMap_["getDeliveredNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getDeliveredNotifications}; - methodMap_["getAuthorizationStatus"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getAuthorizationStatus}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeRedBoxCxxSpecJSI_setExtraData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setExtraData( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeRedBoxCxxSpecJSI_dismiss(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismiss( - rt - ); - return jsi::Value::undefined(); -} - -NativeRedBoxCxxSpecJSI::NativeRedBoxCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("RedBox", jsInvoker) { - methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeRedBoxCxxSpecJSI_setExtraData}; - methodMap_["dismiss"] = MethodMetadata {0, __hostFunction_NativeRedBoxCxxSpecJSI_dismiss}; -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getEnum(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEnum( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getUnsafeObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getUnsafeObject( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFuncThrows(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFuncThrows( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectThrows(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectThrows( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_promiseThrows(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->promiseThrows( - rt - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFuncAssert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFuncAssert( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectAssert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectAssert( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_promiseAssert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->promiseAssert( - rt - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getImageUrl(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getImageUrl( - rt - ); -} - -NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SampleTurboModule", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getConstants}; - methodMap_["voidFunc"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc}; - methodMap_["getBool"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getBool}; - methodMap_["getEnum"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getEnum}; - methodMap_["getNumber"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNumber}; - methodMap_["getString"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getString}; - methodMap_["getArray"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray}; - methodMap_["getObject"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject}; - methodMap_["getUnsafeObject"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getUnsafeObject}; - methodMap_["getRootTag"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag}; - methodMap_["getValue"] = MethodMetadata {3, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue}; - methodMap_["getValueWithCallback"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithCallback}; - methodMap_["getValueWithPromise"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise}; - methodMap_["voidFuncThrows"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFuncThrows}; - methodMap_["getObjectThrows"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectThrows}; - methodMap_["promiseThrows"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_promiseThrows}; - methodMap_["voidFuncAssert"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFuncAssert}; - methodMap_["getObjectAssert"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectAssert}; - methodMap_["promiseAssert"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_promiseAssert}; - methodMap_["getImageUrl"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getImageUrl}; -} -static jsi::Value __hostFunction_NativeSegmentFetcherCxxSpecJSI_fetchSegment(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->fetchSegment( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSegmentFetcherCxxSpecJSI_getSegment(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getSegment( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeSegmentFetcherCxxSpecJSI::NativeSegmentFetcherCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SegmentFetcher", jsInvoker) { - methodMap_["fetchSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherCxxSpecJSI_fetchSegment}; - methodMap_["getSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherCxxSpecJSI_getSegment}; -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_setValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setValues( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_deleteValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->deleteValues( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeSettingsManagerCxxSpecJSI::NativeSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SettingsManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSettingsManagerCxxSpecJSI_getConstants}; - methodMap_["setValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerCxxSpecJSI_setValues}; - methodMap_["deleteValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerCxxSpecJSI_deleteValues}; -} -static jsi::Value __hostFunction_NativeShareModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeShareModuleCxxSpecJSI_share(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->share( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)) - ); -} - -NativeShareModuleCxxSpecJSI::NativeShareModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ShareModule", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeShareModuleCxxSpecJSI_getConstants}; - methodMap_["share"] = MethodMetadata {2, __hostFunction_NativeShareModuleCxxSpecJSI_share}; -} -static jsi::Value __hostFunction_NativeSoundManagerCxxSpecJSI_playTouchSound(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->playTouchSound( - rt - ); - return jsi::Value::undefined(); -} - -NativeSoundManagerCxxSpecJSI::NativeSoundManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SoundManager", jsInvoker) { - methodMap_["playTouchSound"] = MethodMetadata {0, __hostFunction_NativeSoundManagerCxxSpecJSI_playTouchSound}; -} -static jsi::Value __hostFunction_NativeSourceCodeCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativeSourceCodeCxxSpecJSI::NativeSourceCodeCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SourceCode", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSourceCodeCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setColor(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setColor( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setTranslucent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setTranslucent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setStyle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setStyle( - rt, - count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setHidden(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHidden( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeStatusBarManagerAndroidCxxSpecJSI::NativeStatusBarManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("StatusBarManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_getConstants}; - methodMap_["setColor"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setColor}; - methodMap_["setTranslucent"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setTranslucent}; - methodMap_["setStyle"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setStyle}; - methodMap_["setHidden"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setHidden}; -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getHeight(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getHeight( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setNetworkActivityIndicatorVisible(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setNetworkActivityIndicatorVisible( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setStyle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setStyle( - rt, - count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setHidden(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHidden( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeStatusBarManagerIOSCxxSpecJSI::NativeStatusBarManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("StatusBarManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getConstants}; - methodMap_["getHeight"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getHeight}; - methodMap_["setNetworkActivityIndicatorVisible"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setNetworkActivityIndicatorVisible}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_removeListeners}; - methodMap_["setStyle"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setStyle}; - methodMap_["setHidden"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setHidden}; -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_createTimer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createTimer( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_deleteTimer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->deleteTimer( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_setSendIdleEvents(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setSendIdleEvents( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeTimingCxxSpecJSI::NativeTimingCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Timing", jsInvoker) { - methodMap_["createTimer"] = MethodMetadata {4, __hostFunction_NativeTimingCxxSpecJSI_createTimer}; - methodMap_["deleteTimer"] = MethodMetadata {1, __hostFunction_NativeTimingCxxSpecJSI_deleteTimer}; - methodMap_["setSendIdleEvents"] = MethodMetadata {1, __hostFunction_NativeTimingCxxSpecJSI_setSendIdleEvents}; -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravity(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showWithGravity( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravityAndOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showWithGravityAndOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(), - count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeToastAndroidCxxSpecJSI::NativeToastAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ToastAndroid", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeToastAndroidCxxSpecJSI_getConstants}; - methodMap_["show"] = MethodMetadata {2, __hostFunction_NativeToastAndroidCxxSpecJSI_show}; - methodMap_["showWithGravity"] = MethodMetadata {3, __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravity}; - methodMap_["showWithGravityAndOffset"] = MethodMetadata {5, __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravityAndOffset}; -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_createView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_updateView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_findSubviewIn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->findSubviewIn( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_dispatchViewManagerCommand(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dispatchViewManagerCommand( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt).asArray(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_measure(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measure( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_measureInWindow(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureInWindow( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_viewIsDescendantOf(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->viewIsDescendantOf( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_measureLayout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureLayout( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_measureLayoutRelativeToParent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureLayoutRelativeToParent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_setJSResponder(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setJSResponder( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_clearJSResponder(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearJSResponder( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_configureNextLayoutAnimation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->configureNextLayoutAnimation( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_setChildren(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setChildren( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_manageChildren(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->manageChildren( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asArray(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asArray(rt), - count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asObject(rt).asArray(rt), - count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_getConstantsForViewManager(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getConstantsForViewManager( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_getDefaultEventTypes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getDefaultEventTypes( - rt - ); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_setLayoutAnimationEnabledExperimental(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setLayoutAnimationEnabledExperimental( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_sendAccessibilityEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendAccessibilityEvent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_lazilyLoadView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->lazilyLoadView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_focus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->focus( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_blur(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->blur( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeUIManagerCxxSpecJSI::NativeUIManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("UIManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeUIManagerCxxSpecJSI_getConstants}; - methodMap_["createView"] = MethodMetadata {4, __hostFunction_NativeUIManagerCxxSpecJSI_createView}; - methodMap_["updateView"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_updateView}; - methodMap_["findSubviewIn"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_findSubviewIn}; - methodMap_["dispatchViewManagerCommand"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_dispatchViewManagerCommand}; - methodMap_["measure"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_measure}; - methodMap_["measureInWindow"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_measureInWindow}; - methodMap_["viewIsDescendantOf"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_viewIsDescendantOf}; - methodMap_["measureLayout"] = MethodMetadata {4, __hostFunction_NativeUIManagerCxxSpecJSI_measureLayout}; - methodMap_["measureLayoutRelativeToParent"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_measureLayoutRelativeToParent}; - methodMap_["setJSResponder"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_setJSResponder}; - methodMap_["clearJSResponder"] = MethodMetadata {0, __hostFunction_NativeUIManagerCxxSpecJSI_clearJSResponder}; - methodMap_["configureNextLayoutAnimation"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_configureNextLayoutAnimation}; - methodMap_["setChildren"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_setChildren}; - methodMap_["manageChildren"] = MethodMetadata {6, __hostFunction_NativeUIManagerCxxSpecJSI_manageChildren}; - methodMap_["getConstantsForViewManager"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_getConstantsForViewManager}; - methodMap_["getDefaultEventTypes"] = MethodMetadata {0, __hostFunction_NativeUIManagerCxxSpecJSI_getDefaultEventTypes}; - methodMap_["setLayoutAnimationEnabledExperimental"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_setLayoutAnimationEnabledExperimental}; - methodMap_["sendAccessibilityEvent"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_sendAccessibilityEvent}; - methodMap_["lazilyLoadView"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_lazilyLoadView}; - methodMap_["focus"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_focus}; - methodMap_["blur"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_blur}; -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_vibrate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->vibrate( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_vibrateByPattern(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->vibrateByPattern( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_cancel(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancel( - rt - ); - return jsi::Value::undefined(); -} - -NativeVibrationCxxSpecJSI::NativeVibrationCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Vibration", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeVibrationCxxSpecJSI_getConstants}; - methodMap_["vibrate"] = MethodMetadata {1, __hostFunction_NativeVibrationCxxSpecJSI_vibrate}; - methodMap_["vibrateByPattern"] = MethodMetadata {2, __hostFunction_NativeVibrationCxxSpecJSI_vibrateByPattern}; - methodMap_["cancel"] = MethodMetadata {0, __hostFunction_NativeVibrationCxxSpecJSI_cancel}; -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt).asArray(rt)), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_send(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->send( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_sendBinary(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendBinary( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_ping(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->ping( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_close(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->close( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeWebSocketModuleCxxSpecJSI::NativeWebSocketModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("WebSocketModule", jsInvoker) { - methodMap_["connect"] = MethodMetadata {4, __hostFunction_NativeWebSocketModuleCxxSpecJSI_connect}; - methodMap_["send"] = MethodMetadata {2, __hostFunction_NativeWebSocketModuleCxxSpecJSI_send}; - methodMap_["sendBinary"] = MethodMetadata {2, __hostFunction_NativeWebSocketModuleCxxSpecJSI_sendBinary}; - methodMap_["ping"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_ping}; - methodMap_["close"] = MethodMetadata {3, __hostFunction_NativeWebSocketModuleCxxSpecJSI_close}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_reload(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reload( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_setProfilingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setProfilingEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_setHotLoadingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHotLoadingEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeDevMenuCxxSpecJSI::NativeDevMenuCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevMenu", jsInvoker) { - methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeDevMenuCxxSpecJSI_show}; - methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevMenuCxxSpecJSI_reload}; - methodMap_["setProfilingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevMenuCxxSpecJSI_setProfilingEnabled}; - methodMap_["setHotLoadingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevMenuCxxSpecJSI_setHotLoadingEnabled}; -} -static jsi::Value __hostFunction_NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI_setReloadAndProfileConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setReloadAndProfileConfig( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI_getReloadAndProfileConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getReloadAndProfileConfig( - rt - ); -} - -NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI::NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ReactDevToolsRuntimeSettingsModule", jsInvoker) { - methodMap_["setReloadAndProfileConfig"] = MethodMetadata {1, __hostFunction_NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI_setReloadAndProfileConfig}; - methodMap_["getReloadAndProfileConfig"] = MethodMetadata {0, __hostFunction_NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI_getReloadAndProfileConfig}; -} -static jsi::Value __hostFunction_NativeReactDevToolsSettingsManagerCxxSpecJSI_setGlobalHookSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setGlobalHookSettings( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeReactDevToolsSettingsManagerCxxSpecJSI_getGlobalHookSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getGlobalHookSettings( - rt - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} - -NativeReactDevToolsSettingsManagerCxxSpecJSI::NativeReactDevToolsSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ReactDevToolsSettingsManager", jsInvoker) { - methodMap_["setGlobalHookSettings"] = MethodMetadata {1, __hostFunction_NativeReactDevToolsSettingsManagerCxxSpecJSI_setGlobalHookSettings}; - methodMap_["getGlobalHookSettings"] = MethodMetadata {0, __hostFunction_NativeReactDevToolsSettingsManagerCxxSpecJSI_getGlobalHookSettings}; -} -static jsi::Value __hostFunction_NativeIdleCallbacksCxxSpecJSI_requestIdleCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestIdleCallback( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt)) - ); -} -static jsi::Value __hostFunction_NativeIdleCallbacksCxxSpecJSI_cancelIdleCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancelIdleCallback( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); - return jsi::Value::undefined(); -} - -NativeIdleCallbacksCxxSpecJSI::NativeIdleCallbacksCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeIdleCallbacksCxx", jsInvoker) { - methodMap_["requestIdleCallback"] = MethodMetadata {2, __hostFunction_NativeIdleCallbacksCxxSpecJSI_requestIdleCallback}; - methodMap_["cancelIdleCallback"] = MethodMetadata {1, __hostFunction_NativeIdleCallbacksCxxSpecJSI_cancelIdleCallback}; -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_observe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->observe( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserve(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserve( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_observeV2(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->observeV2( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserveV2(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserveV2( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_disconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnect( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_takeRecords(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->takeRecords( - rt - ); -} - -NativeIntersectionObserverCxxSpecJSI::NativeIntersectionObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeIntersectionObserverCxx", jsInvoker) { - methodMap_["observe"] = MethodMetadata {1, __hostFunction_NativeIntersectionObserverCxxSpecJSI_observe}; - methodMap_["unobserve"] = MethodMetadata {2, __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserve}; - methodMap_["observeV2"] = MethodMetadata {1, __hostFunction_NativeIntersectionObserverCxxSpecJSI_observeV2}; - methodMap_["unobserveV2"] = MethodMetadata {2, __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserveV2}; - methodMap_["connect"] = MethodMetadata {1, __hostFunction_NativeIntersectionObserverCxxSpecJSI_connect}; - methodMap_["disconnect"] = MethodMetadata {0, __hostFunction_NativeIntersectionObserverCxxSpecJSI_disconnect}; - methodMap_["takeRecords"] = MethodMetadata {0, __hostFunction_NativeIntersectionObserverCxxSpecJSI_takeRecords}; -} -static jsi::Value __hostFunction_NativeMicrotasksCxxSpecJSI_queueMicrotask(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->queueMicrotask( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeMicrotasksCxxSpecJSI::NativeMicrotasksCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeMicrotasksCxx", jsInvoker) { - methodMap_["queueMicrotask"] = MethodMetadata {1, __hostFunction_NativeMicrotasksCxxSpecJSI_queueMicrotask}; -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_observe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->observe( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_unobserveAll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserveAll( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_disconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnect( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_takeRecords(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->takeRecords( - rt - ); -} - -NativeMutationObserverCxxSpecJSI::NativeMutationObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeMutationObserverCxx", jsInvoker) { - methodMap_["observe"] = MethodMetadata {1, __hostFunction_NativeMutationObserverCxxSpecJSI_observe}; - methodMap_["unobserveAll"] = MethodMetadata {1, __hostFunction_NativeMutationObserverCxxSpecJSI_unobserveAll}; - methodMap_["connect"] = MethodMetadata {2, __hostFunction_NativeMutationObserverCxxSpecJSI_connect}; - methodMap_["disconnect"] = MethodMetadata {0, __hostFunction_NativeMutationObserverCxxSpecJSI_disconnect}; - methodMap_["takeRecords"] = MethodMetadata {0, __hostFunction_NativeMutationObserverCxxSpecJSI_takeRecords}; -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_now(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->now( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_markWithResult(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->markWithResult( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asNumber()) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_measureWithResult(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->measureWithResult( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asNumber()), - count <= 4 || args[4].isUndefined() ? std::nullopt : std::make_optional(args[4].asString(rt)), - count <= 5 || args[5].isUndefined() ? std::nullopt : std::make_optional(args[5].asString(rt)) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_clearMarks(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearMarks( - rt, - count <= 0 || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_clearMeasures(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearMeasures( - rt, - count <= 0 || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getEntries(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEntries( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getEntriesByName(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEntriesByName( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asNumber()) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getEntriesByType(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEntriesByType( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getEventCounts(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEventCounts( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getSimpleMemoryInfo(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSimpleMemoryInfo( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getReactNativeStartupTiming(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getReactNativeStartupTiming( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_createObserver(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->createObserver( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getDroppedEntriesCount(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getDroppedEntriesCount( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_observe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->observe( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_disconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_takeRecords(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->takeRecords( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getSupportedPerformanceEntryTypes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSupportedPerformanceEntryTypes( - rt - ); -} - -NativePerformanceCxxSpecJSI::NativePerformanceCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativePerformanceCxx", jsInvoker) { - methodMap_["now"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_now}; - methodMap_["markWithResult"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_markWithResult}; - methodMap_["measureWithResult"] = MethodMetadata {6, __hostFunction_NativePerformanceCxxSpecJSI_measureWithResult}; - methodMap_["clearMarks"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_clearMarks}; - methodMap_["clearMeasures"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_clearMeasures}; - methodMap_["getEntries"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getEntries}; - methodMap_["getEntriesByName"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_getEntriesByName}; - methodMap_["getEntriesByType"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_getEntriesByType}; - methodMap_["getEventCounts"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getEventCounts}; - methodMap_["getSimpleMemoryInfo"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getSimpleMemoryInfo}; - methodMap_["getReactNativeStartupTiming"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getReactNativeStartupTiming}; - methodMap_["createObserver"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_createObserver}; - methodMap_["getDroppedEntriesCount"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_getDroppedEntriesCount}; - methodMap_["observe"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_observe}; - methodMap_["disconnect"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_disconnect}; - methodMap_["takeRecords"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_takeRecords}; - methodMap_["getSupportedPerformanceEntryTypes"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getSupportedPerformanceEntryTypes}; -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_compareDocumentPosition(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->compareDocumentPosition( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getChildNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getChildNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getParentNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getParentNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_isConnected(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->isConnected( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getBorderWidth(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBorderWidth( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getBoundingClientRect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBoundingClientRect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getInnerSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInnerSize( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getScrollPosition(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getScrollPosition( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getScrollSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getScrollSize( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getTagName(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getTagName( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getTextContent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getTextContent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_hasPointerCapture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->hasPointerCapture( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_releasePointerCapture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->releasePointerCapture( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_setPointerCapture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setPointerCapture( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_linkRootNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->linkRootNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_measure(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measure( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_measureInWindow(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureInWindow( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_measureLayout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureLayout( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_setNativeProps(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setNativeProps( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} - -NativeDOMCxxSpecJSI::NativeDOMCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeDOMCxx", jsInvoker) { - methodMap_["compareDocumentPosition"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_compareDocumentPosition}; - methodMap_["getChildNodes"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getChildNodes}; - methodMap_["getParentNode"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getParentNode}; - methodMap_["isConnected"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_isConnected}; - methodMap_["getBorderWidth"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getBorderWidth}; - methodMap_["getBoundingClientRect"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_getBoundingClientRect}; - methodMap_["getInnerSize"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getInnerSize}; - methodMap_["getScrollPosition"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getScrollPosition}; - methodMap_["getScrollSize"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getScrollSize}; - methodMap_["getTagName"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getTagName}; - methodMap_["getTextContent"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getTextContent}; - methodMap_["hasPointerCapture"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_hasPointerCapture}; - methodMap_["releasePointerCapture"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_releasePointerCapture}; - methodMap_["setPointerCapture"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_setPointerCapture}; - methodMap_["getOffset"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getOffset}; - methodMap_["linkRootNode"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_linkRootNode}; - methodMap_["measure"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_measure}; - methodMap_["measureInWindow"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_measureInWindow}; - methodMap_["measureLayout"] = MethodMetadata {4, __hostFunction_NativeDOMCxxSpecJSI_measureLayout}; - methodMap_["setNativeProps"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_setNativeProps}; -} - - -} // namespace facebook::react diff --git a/vnext/codegen/rnwcoreJSI.h b/vnext/codegen/rnwcoreJSI.h deleted file mode 100644 index 82e5a125ac8..00000000000 --- a/vnext/codegen/rnwcoreJSI.h +++ /dev/null @@ -1,9414 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleH.js - */ - -#pragma once - -#include -#include - -namespace facebook::react { - - - class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpecJSI : public TurboModule { -protected: - NativeReactNativeFeatureFlagsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual bool commonTestFlag(jsi::Runtime &rt) = 0; - virtual bool commonTestFlagWithoutNativeImplementation(jsi::Runtime &rt) = 0; - virtual bool animatedShouldSignalBatch(jsi::Runtime &rt) = 0; - virtual bool cxxNativeAnimatedEnabled(jsi::Runtime &rt) = 0; - virtual bool cxxNativeAnimatedRemoveJsSync(jsi::Runtime &rt) = 0; - virtual bool disableMainQueueSyncDispatchIOS(jsi::Runtime &rt) = 0; - virtual bool disableMountItemReorderingAndroid(jsi::Runtime &rt) = 0; - virtual bool disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt) = 0; - virtual bool enableAccessibilityOrder(jsi::Runtime &rt) = 0; - virtual bool enableAccumulatedUpdatesInRawPropsAndroid(jsi::Runtime &rt) = 0; - virtual bool enableBridgelessArchitecture(jsi::Runtime &rt) = 0; - virtual bool enableCppPropsIteratorSetter(jsi::Runtime &rt) = 0; - virtual bool enableCustomFocusSearchOnClippedElementsAndroid(jsi::Runtime &rt) = 0; - virtual bool enableDestroyShadowTreeRevisionAsync(jsi::Runtime &rt) = 0; - virtual bool enableDoubleMeasurementFixAndroid(jsi::Runtime &rt) = 0; - virtual bool enableEagerRootViewAttachment(jsi::Runtime &rt) = 0; - virtual bool enableFabricLogs(jsi::Runtime &rt) = 0; - virtual bool enableFabricRenderer(jsi::Runtime &rt) = 0; - virtual bool enableFixForParentTagDuringReparenting(jsi::Runtime &rt) = 0; - virtual bool enableFontScaleChangesUpdatingLayout(jsi::Runtime &rt) = 0; - virtual bool enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt) = 0; - virtual bool enableIOSViewClipToPaddingBox(jsi::Runtime &rt) = 0; - virtual bool enableInteropViewManagerClassLookUpOptimizationIOS(jsi::Runtime &rt) = 0; - virtual bool enableLayoutAnimationsOnAndroid(jsi::Runtime &rt) = 0; - virtual bool enableLayoutAnimationsOnIOS(jsi::Runtime &rt) = 0; - virtual bool enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt) = 0; - virtual bool enableMainQueueModulesOnIOS(jsi::Runtime &rt) = 0; - virtual bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt) = 0; - virtual bool enableNativeCSSParsing(jsi::Runtime &rt) = 0; - virtual bool enableNetworkEventReporting(jsi::Runtime &rt) = 0; - virtual bool enableNewBackgroundAndBorderDrawables(jsi::Runtime &rt) = 0; - virtual bool enablePreparedTextLayout(jsi::Runtime &rt) = 0; - virtual bool enablePropsUpdateReconciliationAndroid(jsi::Runtime &rt) = 0; - virtual bool enableResourceTimingAPI(jsi::Runtime &rt) = 0; - virtual bool enableSynchronousStateUpdates(jsi::Runtime &rt) = 0; - virtual bool enableViewCulling(jsi::Runtime &rt) = 0; - virtual bool enableViewRecycling(jsi::Runtime &rt) = 0; - virtual bool enableViewRecyclingForText(jsi::Runtime &rt) = 0; - virtual bool enableViewRecyclingForView(jsi::Runtime &rt) = 0; - virtual bool enableVirtualViewDebugFeatures(jsi::Runtime &rt) = 0; - virtual bool enableVirtualViewRenderState(jsi::Runtime &rt) = 0; - virtual bool enableVirtualViewWindowFocusDetection(jsi::Runtime &rt) = 0; - virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime &rt) = 0; - virtual bool fuseboxEnabledRelease(jsi::Runtime &rt) = 0; - virtual bool fuseboxNetworkInspectionEnabled(jsi::Runtime &rt) = 0; - virtual double preparedTextCacheSize(jsi::Runtime &rt) = 0; - virtual bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) = 0; - virtual bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) = 0; - virtual bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) = 0; - virtual bool useFabricInterop(jsi::Runtime &rt) = 0; - virtual bool useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt) = 0; - virtual bool useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt) = 0; - virtual bool useRawPropsJsiValue(jsi::Runtime &rt) = 0; - virtual bool useShadowNodeStateOnClone(jsi::Runtime &rt) = 0; - virtual bool useTurboModuleInterop(jsi::Runtime &rt) = 0; - virtual bool useTurboModules(jsi::Runtime &rt) = 0; - virtual double virtualViewPrerenderRatio(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeReactNativeFeatureFlagsCxx"; - -protected: - NativeReactNativeFeatureFlagsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeReactNativeFeatureFlagsCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeReactNativeFeatureFlagsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeReactNativeFeatureFlagsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - bool commonTestFlag(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::commonTestFlag) == 1, - "Expected commonTestFlag(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::commonTestFlag, jsInvoker_, instance_); - } - bool commonTestFlagWithoutNativeImplementation(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::commonTestFlagWithoutNativeImplementation) == 1, - "Expected commonTestFlagWithoutNativeImplementation(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::commonTestFlagWithoutNativeImplementation, jsInvoker_, instance_); - } - bool animatedShouldSignalBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::animatedShouldSignalBatch) == 1, - "Expected animatedShouldSignalBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::animatedShouldSignalBatch, jsInvoker_, instance_); - } - bool cxxNativeAnimatedEnabled(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cxxNativeAnimatedEnabled) == 1, - "Expected cxxNativeAnimatedEnabled(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cxxNativeAnimatedEnabled, jsInvoker_, instance_); - } - bool cxxNativeAnimatedRemoveJsSync(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cxxNativeAnimatedRemoveJsSync) == 1, - "Expected cxxNativeAnimatedRemoveJsSync(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cxxNativeAnimatedRemoveJsSync, jsInvoker_, instance_); - } - bool disableMainQueueSyncDispatchIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disableMainQueueSyncDispatchIOS) == 1, - "Expected disableMainQueueSyncDispatchIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disableMainQueueSyncDispatchIOS, jsInvoker_, instance_); - } - bool disableMountItemReorderingAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disableMountItemReorderingAndroid) == 1, - "Expected disableMountItemReorderingAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disableMountItemReorderingAndroid, jsInvoker_, instance_); - } - bool disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disableTextLayoutManagerCacheAndroid) == 1, - "Expected disableTextLayoutManagerCacheAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disableTextLayoutManagerCacheAndroid, jsInvoker_, instance_); - } - bool enableAccessibilityOrder(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableAccessibilityOrder) == 1, - "Expected enableAccessibilityOrder(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableAccessibilityOrder, jsInvoker_, instance_); - } - bool enableAccumulatedUpdatesInRawPropsAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableAccumulatedUpdatesInRawPropsAndroid) == 1, - "Expected enableAccumulatedUpdatesInRawPropsAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableAccumulatedUpdatesInRawPropsAndroid, jsInvoker_, instance_); - } - bool enableBridgelessArchitecture(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableBridgelessArchitecture) == 1, - "Expected enableBridgelessArchitecture(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableBridgelessArchitecture, jsInvoker_, instance_); - } - bool enableCppPropsIteratorSetter(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableCppPropsIteratorSetter) == 1, - "Expected enableCppPropsIteratorSetter(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableCppPropsIteratorSetter, jsInvoker_, instance_); - } - bool enableCustomFocusSearchOnClippedElementsAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableCustomFocusSearchOnClippedElementsAndroid) == 1, - "Expected enableCustomFocusSearchOnClippedElementsAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableCustomFocusSearchOnClippedElementsAndroid, jsInvoker_, instance_); - } - bool enableDestroyShadowTreeRevisionAsync(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableDestroyShadowTreeRevisionAsync) == 1, - "Expected enableDestroyShadowTreeRevisionAsync(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableDestroyShadowTreeRevisionAsync, jsInvoker_, instance_); - } - bool enableDoubleMeasurementFixAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableDoubleMeasurementFixAndroid) == 1, - "Expected enableDoubleMeasurementFixAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableDoubleMeasurementFixAndroid, jsInvoker_, instance_); - } - bool enableEagerRootViewAttachment(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableEagerRootViewAttachment) == 1, - "Expected enableEagerRootViewAttachment(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableEagerRootViewAttachment, jsInvoker_, instance_); - } - bool enableFabricLogs(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableFabricLogs) == 1, - "Expected enableFabricLogs(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableFabricLogs, jsInvoker_, instance_); - } - bool enableFabricRenderer(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableFabricRenderer) == 1, - "Expected enableFabricRenderer(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableFabricRenderer, jsInvoker_, instance_); - } - bool enableFixForParentTagDuringReparenting(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableFixForParentTagDuringReparenting) == 1, - "Expected enableFixForParentTagDuringReparenting(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableFixForParentTagDuringReparenting, jsInvoker_, instance_); - } - bool enableFontScaleChangesUpdatingLayout(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableFontScaleChangesUpdatingLayout) == 1, - "Expected enableFontScaleChangesUpdatingLayout(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableFontScaleChangesUpdatingLayout, jsInvoker_, instance_); - } - bool enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableIOSTextBaselineOffsetPerLine) == 1, - "Expected enableIOSTextBaselineOffsetPerLine(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableIOSTextBaselineOffsetPerLine, jsInvoker_, instance_); - } - bool enableIOSViewClipToPaddingBox(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableIOSViewClipToPaddingBox) == 1, - "Expected enableIOSViewClipToPaddingBox(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableIOSViewClipToPaddingBox, jsInvoker_, instance_); - } - bool enableInteropViewManagerClassLookUpOptimizationIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableInteropViewManagerClassLookUpOptimizationIOS) == 1, - "Expected enableInteropViewManagerClassLookUpOptimizationIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableInteropViewManagerClassLookUpOptimizationIOS, jsInvoker_, instance_); - } - bool enableLayoutAnimationsOnAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableLayoutAnimationsOnAndroid) == 1, - "Expected enableLayoutAnimationsOnAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableLayoutAnimationsOnAndroid, jsInvoker_, instance_); - } - bool enableLayoutAnimationsOnIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableLayoutAnimationsOnIOS) == 1, - "Expected enableLayoutAnimationsOnIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableLayoutAnimationsOnIOS, jsInvoker_, instance_); - } - bool enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableMainQueueCoordinatorOnIOS) == 1, - "Expected enableMainQueueCoordinatorOnIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableMainQueueCoordinatorOnIOS, jsInvoker_, instance_); - } - bool enableMainQueueModulesOnIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableMainQueueModulesOnIOS) == 1, - "Expected enableMainQueueModulesOnIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableMainQueueModulesOnIOS, jsInvoker_, instance_); - } - bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableModuleArgumentNSNullConversionIOS) == 1, - "Expected enableModuleArgumentNSNullConversionIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableModuleArgumentNSNullConversionIOS, jsInvoker_, instance_); - } - bool enableNativeCSSParsing(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableNativeCSSParsing) == 1, - "Expected enableNativeCSSParsing(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableNativeCSSParsing, jsInvoker_, instance_); - } - bool enableNetworkEventReporting(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableNetworkEventReporting) == 1, - "Expected enableNetworkEventReporting(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableNetworkEventReporting, jsInvoker_, instance_); - } - bool enableNewBackgroundAndBorderDrawables(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableNewBackgroundAndBorderDrawables) == 1, - "Expected enableNewBackgroundAndBorderDrawables(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableNewBackgroundAndBorderDrawables, jsInvoker_, instance_); - } - bool enablePreparedTextLayout(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enablePreparedTextLayout) == 1, - "Expected enablePreparedTextLayout(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enablePreparedTextLayout, jsInvoker_, instance_); - } - bool enablePropsUpdateReconciliationAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enablePropsUpdateReconciliationAndroid) == 1, - "Expected enablePropsUpdateReconciliationAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enablePropsUpdateReconciliationAndroid, jsInvoker_, instance_); - } - bool enableResourceTimingAPI(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableResourceTimingAPI) == 1, - "Expected enableResourceTimingAPI(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableResourceTimingAPI, jsInvoker_, instance_); - } - bool enableSynchronousStateUpdates(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableSynchronousStateUpdates) == 1, - "Expected enableSynchronousStateUpdates(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableSynchronousStateUpdates, jsInvoker_, instance_); - } - bool enableViewCulling(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableViewCulling) == 1, - "Expected enableViewCulling(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableViewCulling, jsInvoker_, instance_); - } - bool enableViewRecycling(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableViewRecycling) == 1, - "Expected enableViewRecycling(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableViewRecycling, jsInvoker_, instance_); - } - bool enableViewRecyclingForText(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableViewRecyclingForText) == 1, - "Expected enableViewRecyclingForText(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableViewRecyclingForText, jsInvoker_, instance_); - } - bool enableViewRecyclingForView(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableViewRecyclingForView) == 1, - "Expected enableViewRecyclingForView(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableViewRecyclingForView, jsInvoker_, instance_); - } - bool enableVirtualViewDebugFeatures(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableVirtualViewDebugFeatures) == 1, - "Expected enableVirtualViewDebugFeatures(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableVirtualViewDebugFeatures, jsInvoker_, instance_); - } - bool enableVirtualViewRenderState(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableVirtualViewRenderState) == 1, - "Expected enableVirtualViewRenderState(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableVirtualViewRenderState, jsInvoker_, instance_); - } - bool enableVirtualViewWindowFocusDetection(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableVirtualViewWindowFocusDetection) == 1, - "Expected enableVirtualViewWindowFocusDetection(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableVirtualViewWindowFocusDetection, jsInvoker_, instance_); - } - bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::fixMappingOfEventPrioritiesBetweenFabricAndReact) == 1, - "Expected fixMappingOfEventPrioritiesBetweenFabricAndReact(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::fixMappingOfEventPrioritiesBetweenFabricAndReact, jsInvoker_, instance_); - } - bool fuseboxEnabledRelease(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::fuseboxEnabledRelease) == 1, - "Expected fuseboxEnabledRelease(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::fuseboxEnabledRelease, jsInvoker_, instance_); - } - bool fuseboxNetworkInspectionEnabled(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::fuseboxNetworkInspectionEnabled) == 1, - "Expected fuseboxNetworkInspectionEnabled(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::fuseboxNetworkInspectionEnabled, jsInvoker_, instance_); - } - double preparedTextCacheSize(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::preparedTextCacheSize) == 1, - "Expected preparedTextCacheSize(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::preparedTextCacheSize, jsInvoker_, instance_); - } - bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::traceTurboModulePromiseRejectionsOnAndroid) == 1, - "Expected traceTurboModulePromiseRejectionsOnAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::traceTurboModulePromiseRejectionsOnAndroid, jsInvoker_, instance_); - } - bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::updateRuntimeShadowNodeReferencesOnCommit) == 1, - "Expected updateRuntimeShadowNodeReferencesOnCommit(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::updateRuntimeShadowNodeReferencesOnCommit, jsInvoker_, instance_); - } - bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useAlwaysAvailableJSErrorHandling) == 1, - "Expected useAlwaysAvailableJSErrorHandling(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useAlwaysAvailableJSErrorHandling, jsInvoker_, instance_); - } - bool useFabricInterop(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useFabricInterop) == 1, - "Expected useFabricInterop(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useFabricInterop, jsInvoker_, instance_); - } - bool useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useNativeViewConfigsInBridgelessMode) == 1, - "Expected useNativeViewConfigsInBridgelessMode(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useNativeViewConfigsInBridgelessMode, jsInvoker_, instance_); - } - bool useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useOptimizedEventBatchingOnAndroid) == 1, - "Expected useOptimizedEventBatchingOnAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useOptimizedEventBatchingOnAndroid, jsInvoker_, instance_); - } - bool useRawPropsJsiValue(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useRawPropsJsiValue) == 1, - "Expected useRawPropsJsiValue(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useRawPropsJsiValue, jsInvoker_, instance_); - } - bool useShadowNodeStateOnClone(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useShadowNodeStateOnClone) == 1, - "Expected useShadowNodeStateOnClone(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useShadowNodeStateOnClone, jsInvoker_, instance_); - } - bool useTurboModuleInterop(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useTurboModuleInterop) == 1, - "Expected useTurboModuleInterop(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useTurboModuleInterop, jsInvoker_, instance_); - } - bool useTurboModules(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useTurboModules) == 1, - "Expected useTurboModules(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useTurboModules, jsInvoker_, instance_); - } - double virtualViewPrerenderRatio(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::virtualViewPrerenderRatio) == 1, - "Expected virtualViewPrerenderRatio(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::virtualViewPrerenderRatio, jsInvoker_, instance_); - } - - private: - friend class NativeReactNativeFeatureFlagsCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAccessibilityInfoCxxSpecJSI : public TurboModule { -protected: - NativeAccessibilityInfoCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void isReduceMotionEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isInvertColorsEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isHighTextContrastEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isTouchExplorationEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isAccessibilityServiceEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) = 0; - virtual void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) = 0; - virtual void getRecommendedTimeoutMillis(jsi::Runtime &rt, double mSec, jsi::Function onSuccess) = 0; - virtual void isGrayscaleEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - -}; - -template -class JSI_EXPORT NativeAccessibilityInfoCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AccessibilityInfo"; - -protected: - NativeAccessibilityInfoCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAccessibilityInfoCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAccessibilityInfoCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAccessibilityInfoCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void isReduceMotionEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isReduceMotionEnabled) == 2, - "Expected isReduceMotionEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isReduceMotionEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isInvertColorsEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isInvertColorsEnabled) == 2, - "Expected isInvertColorsEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isInvertColorsEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isHighTextContrastEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isHighTextContrastEnabled) == 2, - "Expected isHighTextContrastEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isHighTextContrastEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isTouchExplorationEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isTouchExplorationEnabled) == 2, - "Expected isTouchExplorationEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isTouchExplorationEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isAccessibilityServiceEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isAccessibilityServiceEnabled) == 2, - "Expected isAccessibilityServiceEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isAccessibilityServiceEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityFocus) == 2, - "Expected setAccessibilityFocus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityFocus, jsInvoker_, instance_, std::move(reactTag)); - } - void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibility) == 2, - "Expected announceForAccessibility(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibility, jsInvoker_, instance_, std::move(announcement)); - } - void getRecommendedTimeoutMillis(jsi::Runtime &rt, double mSec, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::getRecommendedTimeoutMillis) == 3, - "Expected getRecommendedTimeoutMillis(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getRecommendedTimeoutMillis, jsInvoker_, instance_, std::move(mSec), std::move(onSuccess)); - } - void isGrayscaleEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isGrayscaleEnabled) == 2, - "Expected isGrayscaleEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isGrayscaleEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - - private: - friend class NativeAccessibilityInfoCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAccessibilityManagerCxxSpecJSI : public TurboModule { -protected: - NativeAccessibilityManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void getCurrentBoldTextState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentGrayscaleState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentInvertColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentReduceMotionState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentDarkerSystemColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentReduceTransparencyState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentVoiceOverState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, jsi::Object JSMultipliers) = 0; - virtual void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) = 0; - virtual void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) = 0; - virtual void announceForAccessibilityWithOptions(jsi::Runtime &rt, jsi::String announcement, jsi::Object options) = 0; - -}; - -template -class JSI_EXPORT NativeAccessibilityManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AccessibilityManager"; - -protected: - NativeAccessibilityManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAccessibilityManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAccessibilityManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAccessibilityManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void getCurrentBoldTextState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentBoldTextState) == 3, - "Expected getCurrentBoldTextState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentBoldTextState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentGrayscaleState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentGrayscaleState) == 3, - "Expected getCurrentGrayscaleState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentGrayscaleState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentInvertColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentInvertColorsState) == 3, - "Expected getCurrentInvertColorsState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentInvertColorsState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentReduceMotionState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentReduceMotionState) == 3, - "Expected getCurrentReduceMotionState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentReduceMotionState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentDarkerSystemColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentDarkerSystemColorsState) == 3, - "Expected getCurrentDarkerSystemColorsState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentDarkerSystemColorsState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentPrefersCrossFadeTransitionsState) == 3, - "Expected getCurrentPrefersCrossFadeTransitionsState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentPrefersCrossFadeTransitionsState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentReduceTransparencyState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentReduceTransparencyState) == 3, - "Expected getCurrentReduceTransparencyState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentReduceTransparencyState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentVoiceOverState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentVoiceOverState) == 3, - "Expected getCurrentVoiceOverState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentVoiceOverState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, jsi::Object JSMultipliers) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityContentSizeMultipliers) == 2, - "Expected setAccessibilityContentSizeMultipliers(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityContentSizeMultipliers, jsInvoker_, instance_, std::move(JSMultipliers)); - } - void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityFocus) == 2, - "Expected setAccessibilityFocus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityFocus, jsInvoker_, instance_, std::move(reactTag)); - } - void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibility) == 2, - "Expected announceForAccessibility(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibility, jsInvoker_, instance_, std::move(announcement)); - } - void announceForAccessibilityWithOptions(jsi::Runtime &rt, jsi::String announcement, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibilityWithOptions) == 3, - "Expected announceForAccessibilityWithOptions(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibilityWithOptions, jsInvoker_, instance_, std::move(announcement), std::move(options)); - } - - private: - friend class NativeAccessibilityManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeActionSheetManagerCxxSpecJSI : public TurboModule { -protected: - NativeActionSheetManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void showActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function callback) = 0; - virtual void showShareActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function failureCallback, jsi::Function successCallback) = 0; - virtual void dismissActionSheet(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeActionSheetManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ActionSheetManager"; - -protected: - NativeActionSheetManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeActionSheetManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeActionSheetManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeActionSheetManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void showActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::showActionSheetWithOptions) == 3, - "Expected showActionSheetWithOptions(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::showActionSheetWithOptions, jsInvoker_, instance_, std::move(options), std::move(callback)); - } - void showShareActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function failureCallback, jsi::Function successCallback) override { - static_assert( - bridging::getParameterCount(&T::showShareActionSheetWithOptions) == 4, - "Expected showShareActionSheetWithOptions(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showShareActionSheetWithOptions, jsInvoker_, instance_, std::move(options), std::move(failureCallback), std::move(successCallback)); - } - void dismissActionSheet(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismissActionSheet) == 1, - "Expected dismissActionSheet(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismissActionSheet, jsInvoker_, instance_); - } - - private: - friend class NativeActionSheetManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAlertManagerArgs - -template -struct NativeAlertManagerArgs { - P0 title; - P1 message; - P2 buttons; - P3 type; - P4 defaultValue; - P5 cancelButtonKey; - P6 destructiveButtonKey; - P7 preferredButtonKey; - P8 keyboardType; - P9 userInterfaceStyle; - bool operator==(const NativeAlertManagerArgs &other) const { - return title == other.title && message == other.message && buttons == other.buttons && type == other.type && defaultValue == other.defaultValue && cancelButtonKey == other.cancelButtonKey && destructiveButtonKey == other.destructiveButtonKey && preferredButtonKey == other.preferredButtonKey && keyboardType == other.keyboardType && userInterfaceStyle == other.userInterfaceStyle; - } -}; - -template -struct NativeAlertManagerArgsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "title"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttons"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "type"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "defaultValue"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "cancelButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "destructiveButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "preferredButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "keyboardType"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "userInterfaceStyle"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String titleToJs(jsi::Runtime &rt, decltype(types.title) value) { - return bridging::toJs(rt, value); - } - - static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array buttonsToJs(jsi::Runtime &rt, decltype(types.buttons) value) { - return bridging::toJs(rt, value); - } - - static jsi::String typeToJs(jsi::Runtime &rt, decltype(types.type) value) { - return bridging::toJs(rt, value); - } - - static jsi::String defaultValueToJs(jsi::Runtime &rt, decltype(types.defaultValue) value) { - return bridging::toJs(rt, value); - } - - static jsi::String cancelButtonKeyToJs(jsi::Runtime &rt, decltype(types.cancelButtonKey) value) { - return bridging::toJs(rt, value); - } - - static jsi::String destructiveButtonKeyToJs(jsi::Runtime &rt, decltype(types.destructiveButtonKey) value) { - return bridging::toJs(rt, value); - } - - static jsi::String preferredButtonKeyToJs(jsi::Runtime &rt, decltype(types.preferredButtonKey) value) { - return bridging::toJs(rt, value); - } - - static jsi::String keyboardTypeToJs(jsi::Runtime &rt, decltype(types.keyboardType) value) { - return bridging::toJs(rt, value); - } - - static jsi::String userInterfaceStyleToJs(jsi::Runtime &rt, decltype(types.userInterfaceStyle) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.title) { - result.setProperty(rt, "title", bridging::toJs(rt, value.title.value(), jsInvoker)); - } - if (value.message) { - result.setProperty(rt, "message", bridging::toJs(rt, value.message.value(), jsInvoker)); - } - if (value.buttons) { - result.setProperty(rt, "buttons", bridging::toJs(rt, value.buttons.value(), jsInvoker)); - } - if (value.type) { - result.setProperty(rt, "type", bridging::toJs(rt, value.type.value(), jsInvoker)); - } - if (value.defaultValue) { - result.setProperty(rt, "defaultValue", bridging::toJs(rt, value.defaultValue.value(), jsInvoker)); - } - if (value.cancelButtonKey) { - result.setProperty(rt, "cancelButtonKey", bridging::toJs(rt, value.cancelButtonKey.value(), jsInvoker)); - } - if (value.destructiveButtonKey) { - result.setProperty(rt, "destructiveButtonKey", bridging::toJs(rt, value.destructiveButtonKey.value(), jsInvoker)); - } - if (value.preferredButtonKey) { - result.setProperty(rt, "preferredButtonKey", bridging::toJs(rt, value.preferredButtonKey.value(), jsInvoker)); - } - if (value.keyboardType) { - result.setProperty(rt, "keyboardType", bridging::toJs(rt, value.keyboardType.value(), jsInvoker)); - } - if (value.userInterfaceStyle) { - result.setProperty(rt, "userInterfaceStyle", bridging::toJs(rt, value.userInterfaceStyle.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeAlertManagerCxxSpecJSI : public TurboModule { -protected: - NativeAlertManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void alertWithArgs(jsi::Runtime &rt, jsi::Object args, jsi::Function callback) = 0; - -}; - -template -class JSI_EXPORT NativeAlertManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AlertManager"; - -protected: - NativeAlertManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAlertManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAlertManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAlertManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void alertWithArgs(jsi::Runtime &rt, jsi::Object args, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::alertWithArgs) == 3, - "Expected alertWithArgs(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::alertWithArgs, jsInvoker_, instance_, std::move(args), std::move(callback)); - } - - private: - friend class NativeAlertManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAnimatedModuleEndResult - -template -struct NativeAnimatedModuleEndResult { - P0 finished; - P1 value; - P2 offset; - bool operator==(const NativeAnimatedModuleEndResult &other) const { - return finished == other.finished && value == other.value && offset == other.offset; - } -}; - -template -struct NativeAnimatedModuleEndResultBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "finished"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "value"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "offset"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool finishedToJs(jsi::Runtime &rt, decltype(types.finished) value) { - return bridging::toJs(rt, value); - } - - static double valueToJs(jsi::Runtime &rt, decltype(types.value) value) { - return bridging::toJs(rt, value); - } - - static double offsetToJs(jsi::Runtime &rt, decltype(types.offset) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "finished", bridging::toJs(rt, value.finished, jsInvoker)); - if (value.value) { - result.setProperty(rt, "value", bridging::toJs(rt, value.value.value(), jsInvoker)); - } - if (value.offset) { - result.setProperty(rt, "offset", bridging::toJs(rt, value.offset.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeAnimatedModuleEventMapping - -template -struct NativeAnimatedModuleEventMapping { - P0 nativeEventPath; - P1 animatedValueTag; - bool operator==(const NativeAnimatedModuleEventMapping &other) const { - return nativeEventPath == other.nativeEventPath && animatedValueTag == other.animatedValueTag; - } -}; - -template -struct NativeAnimatedModuleEventMappingBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "nativeEventPath"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "animatedValueTag"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array nativeEventPathToJs(jsi::Runtime &rt, decltype(types.nativeEventPath) value) { - return bridging::toJs(rt, value); - } - - static std::optional animatedValueTagToJs(jsi::Runtime &rt, decltype(types.animatedValueTag) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "nativeEventPath", bridging::toJs(rt, value.nativeEventPath, jsInvoker)); - result.setProperty(rt, "animatedValueTag", bridging::toJs(rt, value.animatedValueTag, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAnimatedModuleCxxSpecJSI : public TurboModule { -protected: - NativeAnimatedModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startOperationBatch(jsi::Runtime &rt) = 0; - virtual void finishOperationBatch(jsi::Runtime &rt) = 0; - virtual void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) = 0; - virtual void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) = 0; - virtual void stopAnimation(jsi::Runtime &rt, double animationId) = 0; - virtual void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) = 0; - virtual void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) = 0; - virtual void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) = 0; - virtual void dropAnimatedNode(jsi::Runtime &rt, double tag) = 0; - virtual void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) = 0; - virtual void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) = 0; - -}; - -template -class JSI_EXPORT NativeAnimatedModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeAnimatedModule"; - -protected: - NativeAnimatedModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAnimatedModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAnimatedModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAnimatedModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void startOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startOperationBatch) == 1, - "Expected startOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startOperationBatch, jsInvoker_, instance_); - } - void finishOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::finishOperationBatch) == 1, - "Expected finishOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::finishOperationBatch, jsInvoker_, instance_); - } - void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::createAnimatedNode) == 3, - "Expected createAnimatedNode(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createAnimatedNode, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::updateAnimatedNodeConfig) == 3, - "Expected updateAnimatedNodeConfig(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::updateAnimatedNodeConfig, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 3, - "Expected getValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(tag), std::move(saveValueCallback)); - } - void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::startListeningToAnimatedNodeValue) == 2, - "Expected startListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::startListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::stopListeningToAnimatedNodeValue) == 2, - "Expected stopListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodes) == 3, - "Expected connectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodes) == 3, - "Expected disconnectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) override { - static_assert( - bridging::getParameterCount(&T::startAnimatingNode) == 5, - "Expected startAnimatingNode(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::startAnimatingNode, jsInvoker_, instance_, std::move(animationId), std::move(nodeTag), std::move(config), std::move(endCallback)); - } - void stopAnimation(jsi::Runtime &rt, double animationId) override { - static_assert( - bridging::getParameterCount(&T::stopAnimation) == 2, - "Expected stopAnimation(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopAnimation, jsInvoker_, instance_, std::move(animationId)); - } - void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeValue) == 3, - "Expected setAnimatedNodeValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeValue, jsInvoker_, instance_, std::move(nodeTag), std::move(value)); - } - void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeOffset) == 3, - "Expected setAnimatedNodeOffset(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag), std::move(offset)); - } - void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::flattenAnimatedNodeOffset) == 2, - "Expected flattenAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::flattenAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::extractAnimatedNodeOffset) == 2, - "Expected extractAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::extractAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodeToView) == 3, - "Expected connectAnimatedNodeToView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodeToView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodeFromView) == 3, - "Expected disconnectAnimatedNodeFromView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodeFromView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::restoreDefaultValues) == 2, - "Expected restoreDefaultValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::restoreDefaultValues, jsInvoker_, instance_, std::move(nodeTag)); - } - void dropAnimatedNode(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::dropAnimatedNode) == 2, - "Expected dropAnimatedNode(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::dropAnimatedNode, jsInvoker_, instance_, std::move(tag)); - } - void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) override { - static_assert( - bridging::getParameterCount(&T::addAnimatedEventToView) == 4, - "Expected addAnimatedEventToView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addAnimatedEventToView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(eventMapping)); - } - void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) override { - static_assert( - bridging::getParameterCount(&T::removeAnimatedEventFromView) == 4, - "Expected removeAnimatedEventFromView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::removeAnimatedEventFromView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(animatedNodeTag)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) override { - static_assert( - bridging::getParameterCount(&T::queueAndExecuteBatchedOperations) == 2, - "Expected queueAndExecuteBatchedOperations(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queueAndExecuteBatchedOperations, jsInvoker_, instance_, std::move(operationsAndArgs)); - } - - private: - friend class NativeAnimatedModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAnimatedTurboModuleEndResult - -template -struct NativeAnimatedTurboModuleEndResult { - P0 finished; - P1 value; - P2 offset; - bool operator==(const NativeAnimatedTurboModuleEndResult &other) const { - return finished == other.finished && value == other.value && offset == other.offset; - } -}; - -template -struct NativeAnimatedTurboModuleEndResultBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "finished"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "value"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "offset"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool finishedToJs(jsi::Runtime &rt, decltype(types.finished) value) { - return bridging::toJs(rt, value); - } - - static double valueToJs(jsi::Runtime &rt, decltype(types.value) value) { - return bridging::toJs(rt, value); - } - - static double offsetToJs(jsi::Runtime &rt, decltype(types.offset) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "finished", bridging::toJs(rt, value.finished, jsInvoker)); - if (value.value) { - result.setProperty(rt, "value", bridging::toJs(rt, value.value.value(), jsInvoker)); - } - if (value.offset) { - result.setProperty(rt, "offset", bridging::toJs(rt, value.offset.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeAnimatedTurboModuleEventMapping - -template -struct NativeAnimatedTurboModuleEventMapping { - P0 nativeEventPath; - P1 animatedValueTag; - bool operator==(const NativeAnimatedTurboModuleEventMapping &other) const { - return nativeEventPath == other.nativeEventPath && animatedValueTag == other.animatedValueTag; - } -}; - -template -struct NativeAnimatedTurboModuleEventMappingBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "nativeEventPath"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "animatedValueTag"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array nativeEventPathToJs(jsi::Runtime &rt, decltype(types.nativeEventPath) value) { - return bridging::toJs(rt, value); - } - - static std::optional animatedValueTagToJs(jsi::Runtime &rt, decltype(types.animatedValueTag) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "nativeEventPath", bridging::toJs(rt, value.nativeEventPath, jsInvoker)); - result.setProperty(rt, "animatedValueTag", bridging::toJs(rt, value.animatedValueTag, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAnimatedTurboModuleCxxSpecJSI : public TurboModule { -protected: - NativeAnimatedTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startOperationBatch(jsi::Runtime &rt) = 0; - virtual void finishOperationBatch(jsi::Runtime &rt) = 0; - virtual void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) = 0; - virtual void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) = 0; - virtual void stopAnimation(jsi::Runtime &rt, double animationId) = 0; - virtual void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) = 0; - virtual void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) = 0; - virtual void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) = 0; - virtual void dropAnimatedNode(jsi::Runtime &rt, double tag) = 0; - virtual void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) = 0; - virtual void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) = 0; - -}; - -template -class JSI_EXPORT NativeAnimatedTurboModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeAnimatedTurboModule"; - -protected: - NativeAnimatedTurboModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAnimatedTurboModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAnimatedTurboModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAnimatedTurboModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void startOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startOperationBatch) == 1, - "Expected startOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startOperationBatch, jsInvoker_, instance_); - } - void finishOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::finishOperationBatch) == 1, - "Expected finishOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::finishOperationBatch, jsInvoker_, instance_); - } - void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::createAnimatedNode) == 3, - "Expected createAnimatedNode(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createAnimatedNode, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::updateAnimatedNodeConfig) == 3, - "Expected updateAnimatedNodeConfig(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::updateAnimatedNodeConfig, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 3, - "Expected getValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(tag), std::move(saveValueCallback)); - } - void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::startListeningToAnimatedNodeValue) == 2, - "Expected startListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::startListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::stopListeningToAnimatedNodeValue) == 2, - "Expected stopListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodes) == 3, - "Expected connectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodes) == 3, - "Expected disconnectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) override { - static_assert( - bridging::getParameterCount(&T::startAnimatingNode) == 5, - "Expected startAnimatingNode(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::startAnimatingNode, jsInvoker_, instance_, std::move(animationId), std::move(nodeTag), std::move(config), std::move(endCallback)); - } - void stopAnimation(jsi::Runtime &rt, double animationId) override { - static_assert( - bridging::getParameterCount(&T::stopAnimation) == 2, - "Expected stopAnimation(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopAnimation, jsInvoker_, instance_, std::move(animationId)); - } - void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeValue) == 3, - "Expected setAnimatedNodeValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeValue, jsInvoker_, instance_, std::move(nodeTag), std::move(value)); - } - void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeOffset) == 3, - "Expected setAnimatedNodeOffset(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag), std::move(offset)); - } - void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::flattenAnimatedNodeOffset) == 2, - "Expected flattenAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::flattenAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::extractAnimatedNodeOffset) == 2, - "Expected extractAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::extractAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodeToView) == 3, - "Expected connectAnimatedNodeToView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodeToView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodeFromView) == 3, - "Expected disconnectAnimatedNodeFromView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodeFromView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::restoreDefaultValues) == 2, - "Expected restoreDefaultValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::restoreDefaultValues, jsInvoker_, instance_, std::move(nodeTag)); - } - void dropAnimatedNode(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::dropAnimatedNode) == 2, - "Expected dropAnimatedNode(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::dropAnimatedNode, jsInvoker_, instance_, std::move(tag)); - } - void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) override { - static_assert( - bridging::getParameterCount(&T::addAnimatedEventToView) == 4, - "Expected addAnimatedEventToView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addAnimatedEventToView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(eventMapping)); - } - void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) override { - static_assert( - bridging::getParameterCount(&T::removeAnimatedEventFromView) == 4, - "Expected removeAnimatedEventFromView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::removeAnimatedEventFromView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(animatedNodeTag)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) override { - static_assert( - bridging::getParameterCount(&T::queueAndExecuteBatchedOperations) == 2, - "Expected queueAndExecuteBatchedOperations(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queueAndExecuteBatchedOperations, jsInvoker_, instance_, std::move(operationsAndArgs)); - } - - private: - friend class NativeAnimatedTurboModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAppearanceCxxSpecJSI : public TurboModule { -protected: - NativeAppearanceCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual std::optional getColorScheme(jsi::Runtime &rt) = 0; - virtual void setColorScheme(jsi::Runtime &rt, jsi::String colorScheme) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeAppearanceCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Appearance"; - -protected: - NativeAppearanceCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAppearanceCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAppearanceCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAppearanceCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - std::optional getColorScheme(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getColorScheme) == 1, - "Expected getColorScheme(...) to have 1 parameters"); - - return bridging::callFromJs>( - rt, &T::getColorScheme, jsInvoker_, instance_); - } - void setColorScheme(jsi::Runtime &rt, jsi::String colorScheme) override { - static_assert( - bridging::getParameterCount(&T::setColorScheme) == 2, - "Expected setColorScheme(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setColorScheme, jsInvoker_, instance_, std::move(colorScheme)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeAppearanceCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAppStateAppState - -template -struct NativeAppStateAppState { - P0 app_state; - bool operator==(const NativeAppStateAppState &other) const { - return app_state == other.app_state; - } -}; - -template -struct NativeAppStateAppStateBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "app_state"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String app_stateToJs(jsi::Runtime &rt, decltype(types.app_state) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "app_state", bridging::toJs(rt, value.app_state, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeAppStateAppStateConstants - -template -struct NativeAppStateAppStateConstants { - P0 initialAppState; - bool operator==(const NativeAppStateAppStateConstants &other) const { - return initialAppState == other.initialAppState; - } -}; - -template -struct NativeAppStateAppStateConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "initialAppState"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String initialAppStateToJs(jsi::Runtime &rt, decltype(types.initialAppState) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "initialAppState", bridging::toJs(rt, value.initialAppState, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAppStateCxxSpecJSI : public TurboModule { -protected: - NativeAppStateCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getCurrentAppState(jsi::Runtime &rt, jsi::Function success, jsi::Function error) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeAppStateCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AppState"; - -protected: - NativeAppStateCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAppStateCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAppStateCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAppStateCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getCurrentAppState(jsi::Runtime &rt, jsi::Function success, jsi::Function error) override { - static_assert( - bridging::getParameterCount(&T::getCurrentAppState) == 3, - "Expected getCurrentAppState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentAppState, jsInvoker_, instance_, std::move(success), std::move(error)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeAppStateCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAppThemeAppThemeData - -template -struct NativeAppThemeAppThemeData { - P0 isHighContrast; - P1 highContrastColors; - bool operator==(const NativeAppThemeAppThemeData &other) const { - return isHighContrast == other.isHighContrast && highContrastColors == other.highContrastColors; - } -}; - -template -struct NativeAppThemeAppThemeDataBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "isHighContrast"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "highContrastColors"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isHighContrastToJs(jsi::Runtime &rt, decltype(types.isHighContrast) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object highContrastColorsToJs(jsi::Runtime &rt, decltype(types.highContrastColors) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isHighContrast", bridging::toJs(rt, value.isHighContrast, jsInvoker)); - result.setProperty(rt, "highContrastColors", bridging::toJs(rt, value.highContrastColors, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeAppThemeHighContrastColors - -template -struct NativeAppThemeHighContrastColors { - P0 ButtonFaceColor; - P1 ButtonTextColor; - P2 GrayTextColor; - P3 HighlightColor; - P4 HighlightTextColor; - P5 HotlightColor; - P6 WindowColor; - P7 WindowTextColor; - bool operator==(const NativeAppThemeHighContrastColors &other) const { - return ButtonFaceColor == other.ButtonFaceColor && ButtonTextColor == other.ButtonTextColor && GrayTextColor == other.GrayTextColor && HighlightColor == other.HighlightColor && HighlightTextColor == other.HighlightTextColor && HotlightColor == other.HotlightColor && WindowColor == other.WindowColor && WindowTextColor == other.WindowTextColor; - } -}; - -template -struct NativeAppThemeHighContrastColorsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "ButtonFaceColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "ButtonTextColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "GrayTextColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "HighlightColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "HighlightTextColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "HotlightColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "WindowColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "WindowTextColor"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String ButtonFaceColorToJs(jsi::Runtime &rt, decltype(types.ButtonFaceColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ButtonTextColorToJs(jsi::Runtime &rt, decltype(types.ButtonTextColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String GrayTextColorToJs(jsi::Runtime &rt, decltype(types.GrayTextColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String HighlightColorToJs(jsi::Runtime &rt, decltype(types.HighlightColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String HighlightTextColorToJs(jsi::Runtime &rt, decltype(types.HighlightTextColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String HotlightColorToJs(jsi::Runtime &rt, decltype(types.HotlightColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String WindowColorToJs(jsi::Runtime &rt, decltype(types.WindowColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String WindowTextColorToJs(jsi::Runtime &rt, decltype(types.WindowTextColor) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "ButtonFaceColor", bridging::toJs(rt, value.ButtonFaceColor, jsInvoker)); - result.setProperty(rt, "ButtonTextColor", bridging::toJs(rt, value.ButtonTextColor, jsInvoker)); - result.setProperty(rt, "GrayTextColor", bridging::toJs(rt, value.GrayTextColor, jsInvoker)); - result.setProperty(rt, "HighlightColor", bridging::toJs(rt, value.HighlightColor, jsInvoker)); - result.setProperty(rt, "HighlightTextColor", bridging::toJs(rt, value.HighlightTextColor, jsInvoker)); - result.setProperty(rt, "HotlightColor", bridging::toJs(rt, value.HotlightColor, jsInvoker)); - result.setProperty(rt, "WindowColor", bridging::toJs(rt, value.WindowColor, jsInvoker)); - result.setProperty(rt, "WindowTextColor", bridging::toJs(rt, value.WindowTextColor, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAppThemeCxxSpecJSI : public TurboModule { -protected: - NativeAppThemeCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeAppThemeCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AppTheme"; - -protected: - NativeAppThemeCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAppThemeCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAppThemeCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAppThemeCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativeAppThemeCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeBlobModuleConstants - -template -struct NativeBlobModuleConstants { - P0 BLOB_URI_SCHEME; - P1 BLOB_URI_HOST; - bool operator==(const NativeBlobModuleConstants &other) const { - return BLOB_URI_SCHEME == other.BLOB_URI_SCHEME && BLOB_URI_HOST == other.BLOB_URI_HOST; - } -}; - -template -struct NativeBlobModuleConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "BLOB_URI_SCHEME"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "BLOB_URI_HOST"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static std::optional BLOB_URI_SCHEMEToJs(jsi::Runtime &rt, decltype(types.BLOB_URI_SCHEME) value) { - return bridging::toJs(rt, value); - } - - static std::optional BLOB_URI_HOSTToJs(jsi::Runtime &rt, decltype(types.BLOB_URI_HOST) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "BLOB_URI_SCHEME", bridging::toJs(rt, value.BLOB_URI_SCHEME, jsInvoker)); - result.setProperty(rt, "BLOB_URI_HOST", bridging::toJs(rt, value.BLOB_URI_HOST, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeBlobModuleCxxSpecJSI : public TurboModule { -protected: - NativeBlobModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void addNetworkingHandler(jsi::Runtime &rt) = 0; - virtual void addWebSocketHandler(jsi::Runtime &rt, double id) = 0; - virtual void removeWebSocketHandler(jsi::Runtime &rt, double id) = 0; - virtual void sendOverSocket(jsi::Runtime &rt, jsi::Object blob, double socketID) = 0; - virtual void createFromParts(jsi::Runtime &rt, jsi::Array parts, jsi::String withId) = 0; - virtual void release(jsi::Runtime &rt, jsi::String blobId) = 0; - -}; - -template -class JSI_EXPORT NativeBlobModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "BlobModule"; - -protected: - NativeBlobModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeBlobModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeBlobModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeBlobModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void addNetworkingHandler(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::addNetworkingHandler) == 1, - "Expected addNetworkingHandler(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::addNetworkingHandler, jsInvoker_, instance_); - } - void addWebSocketHandler(jsi::Runtime &rt, double id) override { - static_assert( - bridging::getParameterCount(&T::addWebSocketHandler) == 2, - "Expected addWebSocketHandler(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addWebSocketHandler, jsInvoker_, instance_, std::move(id)); - } - void removeWebSocketHandler(jsi::Runtime &rt, double id) override { - static_assert( - bridging::getParameterCount(&T::removeWebSocketHandler) == 2, - "Expected removeWebSocketHandler(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeWebSocketHandler, jsInvoker_, instance_, std::move(id)); - } - void sendOverSocket(jsi::Runtime &rt, jsi::Object blob, double socketID) override { - static_assert( - bridging::getParameterCount(&T::sendOverSocket) == 3, - "Expected sendOverSocket(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendOverSocket, jsInvoker_, instance_, std::move(blob), std::move(socketID)); - } - void createFromParts(jsi::Runtime &rt, jsi::Array parts, jsi::String withId) override { - static_assert( - bridging::getParameterCount(&T::createFromParts) == 3, - "Expected createFromParts(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createFromParts, jsInvoker_, instance_, std::move(parts), std::move(withId)); - } - void release(jsi::Runtime &rt, jsi::String blobId) override { - static_assert( - bridging::getParameterCount(&T::release) == 2, - "Expected release(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::release, jsInvoker_, instance_, std::move(blobId)); - } - - private: - friend class NativeBlobModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeBugReportingCxxSpecJSI : public TurboModule { -protected: - NativeBugReportingCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startReportAProblemFlow(jsi::Runtime &rt) = 0; - virtual void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::Object extraFiles) = 0; - -}; - -template -class JSI_EXPORT NativeBugReportingCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "BugReporting"; - -protected: - NativeBugReportingCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeBugReportingCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeBugReportingCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeBugReportingCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void startReportAProblemFlow(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startReportAProblemFlow) == 1, - "Expected startReportAProblemFlow(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startReportAProblemFlow, jsInvoker_, instance_); - } - void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::Object extraFiles) override { - static_assert( - bridging::getParameterCount(&T::setExtraData) == 3, - "Expected setExtraData(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setExtraData, jsInvoker_, instance_, std::move(extraData), std::move(extraFiles)); - } - - private: - friend class NativeBugReportingCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeClipboardCxxSpecJSI : public TurboModule { -protected: - NativeClipboardCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getString(jsi::Runtime &rt) = 0; - virtual void setString(jsi::Runtime &rt, jsi::String content) = 0; - -}; - -template -class JSI_EXPORT NativeClipboardCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Clipboard"; - -protected: - NativeClipboardCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeClipboardCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeClipboardCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeClipboardCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getString(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getString) == 1, - "Expected getString(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getString, jsInvoker_, instance_); - } - void setString(jsi::Runtime &rt, jsi::String content) override { - static_assert( - bridging::getParameterCount(&T::setString) == 2, - "Expected setString(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setString, jsInvoker_, instance_, std::move(content)); - } - - private: - friend class NativeClipboardCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDeviceEventManagerCxxSpecJSI : public TurboModule { -protected: - NativeDeviceEventManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void invokeDefaultBackPressHandler(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDeviceEventManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DeviceEventManager"; - -protected: - NativeDeviceEventManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDeviceEventManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDeviceEventManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDeviceEventManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void invokeDefaultBackPressHandler(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::invokeDefaultBackPressHandler) == 1, - "Expected invokeDefaultBackPressHandler(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::invokeDefaultBackPressHandler, jsInvoker_, instance_); - } - - private: - friend class NativeDeviceEventManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeDeviceInfoDeviceInfoConstants - -template -struct NativeDeviceInfoDeviceInfoConstants { - P0 Dimensions; - P1 isEdgeToEdge; - P2 isIPhoneX_deprecated; - bool operator==(const NativeDeviceInfoDeviceInfoConstants &other) const { - return Dimensions == other.Dimensions && isEdgeToEdge == other.isEdgeToEdge && isIPhoneX_deprecated == other.isIPhoneX_deprecated; - } -}; - -template -struct NativeDeviceInfoDeviceInfoConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "Dimensions"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isEdgeToEdge"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isIPhoneX_deprecated"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object DimensionsToJs(jsi::Runtime &rt, decltype(types.Dimensions) value) { - return bridging::toJs(rt, value); - } - - static bool isEdgeToEdgeToJs(jsi::Runtime &rt, decltype(types.isEdgeToEdge) value) { - return bridging::toJs(rt, value); - } - - static bool isIPhoneX_deprecatedToJs(jsi::Runtime &rt, decltype(types.isIPhoneX_deprecated) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "Dimensions", bridging::toJs(rt, value.Dimensions, jsInvoker)); - if (value.isEdgeToEdge) { - result.setProperty(rt, "isEdgeToEdge", bridging::toJs(rt, value.isEdgeToEdge.value(), jsInvoker)); - } - if (value.isIPhoneX_deprecated) { - result.setProperty(rt, "isIPhoneX_deprecated", bridging::toJs(rt, value.isIPhoneX_deprecated.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeDeviceInfoDimensionsPayload - -template -struct NativeDeviceInfoDimensionsPayload { - P0 window; - P1 screen; - P2 windowPhysicalPixels; - P3 screenPhysicalPixels; - bool operator==(const NativeDeviceInfoDimensionsPayload &other) const { - return window == other.window && screen == other.screen && windowPhysicalPixels == other.windowPhysicalPixels && screenPhysicalPixels == other.screenPhysicalPixels; - } -}; - -template -struct NativeDeviceInfoDimensionsPayloadBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "window"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "screen"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "windowPhysicalPixels"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "screenPhysicalPixels"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object windowToJs(jsi::Runtime &rt, decltype(types.window) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object screenToJs(jsi::Runtime &rt, decltype(types.screen) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object windowPhysicalPixelsToJs(jsi::Runtime &rt, decltype(types.windowPhysicalPixels) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object screenPhysicalPixelsToJs(jsi::Runtime &rt, decltype(types.screenPhysicalPixels) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.window) { - result.setProperty(rt, "window", bridging::toJs(rt, value.window.value(), jsInvoker)); - } - if (value.screen) { - result.setProperty(rt, "screen", bridging::toJs(rt, value.screen.value(), jsInvoker)); - } - if (value.windowPhysicalPixels) { - result.setProperty(rt, "windowPhysicalPixels", bridging::toJs(rt, value.windowPhysicalPixels.value(), jsInvoker)); - } - if (value.screenPhysicalPixels) { - result.setProperty(rt, "screenPhysicalPixels", bridging::toJs(rt, value.screenPhysicalPixels.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeDeviceInfoDisplayMetrics - -template -struct NativeDeviceInfoDisplayMetrics { - P0 width; - P1 height; - P2 scale; - P3 fontScale; - bool operator==(const NativeDeviceInfoDisplayMetrics &other) const { - return width == other.width && height == other.height && scale == other.scale && fontScale == other.fontScale; - } -}; - -template -struct NativeDeviceInfoDisplayMetricsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "width"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "height"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "scale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fontScale"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double widthToJs(jsi::Runtime &rt, decltype(types.width) value) { - return bridging::toJs(rt, value); - } - - static double heightToJs(jsi::Runtime &rt, decltype(types.height) value) { - return bridging::toJs(rt, value); - } - - static double scaleToJs(jsi::Runtime &rt, decltype(types.scale) value) { - return bridging::toJs(rt, value); - } - - static double fontScaleToJs(jsi::Runtime &rt, decltype(types.fontScale) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker)); - result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker)); - result.setProperty(rt, "scale", bridging::toJs(rt, value.scale, jsInvoker)); - result.setProperty(rt, "fontScale", bridging::toJs(rt, value.fontScale, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeDeviceInfoDisplayMetricsAndroid - -template -struct NativeDeviceInfoDisplayMetricsAndroid { - P0 width; - P1 height; - P2 scale; - P3 fontScale; - P4 densityDpi; - bool operator==(const NativeDeviceInfoDisplayMetricsAndroid &other) const { - return width == other.width && height == other.height && scale == other.scale && fontScale == other.fontScale && densityDpi == other.densityDpi; - } -}; - -template -struct NativeDeviceInfoDisplayMetricsAndroidBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "width"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "height"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "scale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fontScale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "densityDpi"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double widthToJs(jsi::Runtime &rt, decltype(types.width) value) { - return bridging::toJs(rt, value); - } - - static double heightToJs(jsi::Runtime &rt, decltype(types.height) value) { - return bridging::toJs(rt, value); - } - - static double scaleToJs(jsi::Runtime &rt, decltype(types.scale) value) { - return bridging::toJs(rt, value); - } - - static double fontScaleToJs(jsi::Runtime &rt, decltype(types.fontScale) value) { - return bridging::toJs(rt, value); - } - - static double densityDpiToJs(jsi::Runtime &rt, decltype(types.densityDpi) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker)); - result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker)); - result.setProperty(rt, "scale", bridging::toJs(rt, value.scale, jsInvoker)); - result.setProperty(rt, "fontScale", bridging::toJs(rt, value.fontScale, jsInvoker)); - result.setProperty(rt, "densityDpi", bridging::toJs(rt, value.densityDpi, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeDeviceInfoCxxSpecJSI : public TurboModule { -protected: - NativeDeviceInfoCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDeviceInfoCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DeviceInfo"; - -protected: - NativeDeviceInfoCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDeviceInfoCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDeviceInfoCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDeviceInfoCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativeDeviceInfoCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevLoadingViewCxxSpecJSI : public TurboModule { -protected: - NativeDevLoadingViewCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void showMessage(jsi::Runtime &rt, jsi::String message, std::optional withColor, std::optional withBackgroundColor) = 0; - virtual void hide(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDevLoadingViewCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DevLoadingView"; - -protected: - NativeDevLoadingViewCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevLoadingViewCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDevLoadingViewCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevLoadingViewCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void showMessage(jsi::Runtime &rt, jsi::String message, std::optional withColor, std::optional withBackgroundColor) override { - static_assert( - bridging::getParameterCount(&T::showMessage) == 4, - "Expected showMessage(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showMessage, jsInvoker_, instance_, std::move(message), std::move(withColor), std::move(withBackgroundColor)); - } - void hide(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::hide) == 1, - "Expected hide(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::hide, jsInvoker_, instance_); - } - - private: - friend class NativeDevLoadingViewCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevSettingsCxxSpecJSI : public TurboModule { -protected: - NativeDevSettingsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void reload(jsi::Runtime &rt) = 0; - virtual void reloadWithReason(jsi::Runtime &rt, jsi::String reason) = 0; - virtual void onFastRefresh(jsi::Runtime &rt) = 0; - virtual void setHotLoadingEnabled(jsi::Runtime &rt, bool isHotLoadingEnabled) = 0; - virtual void setProfilingEnabled(jsi::Runtime &rt, bool isProfilingEnabled) = 0; - virtual void toggleElementInspector(jsi::Runtime &rt) = 0; - virtual void addMenuItem(jsi::Runtime &rt, jsi::String title) = 0; - virtual void openDebugger(jsi::Runtime &rt) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, bool enabled) = 0; - -}; - -template -class JSI_EXPORT NativeDevSettingsCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DevSettings"; - -protected: - NativeDevSettingsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevSettingsCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDevSettingsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevSettingsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void reload(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::reload) == 1, - "Expected reload(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::reload, jsInvoker_, instance_); - } - void reloadWithReason(jsi::Runtime &rt, jsi::String reason) override { - static_assert( - bridging::getParameterCount(&T::reloadWithReason) == 2, - "Expected reloadWithReason(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::reloadWithReason, jsInvoker_, instance_, std::move(reason)); - } - void onFastRefresh(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::onFastRefresh) == 1, - "Expected onFastRefresh(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::onFastRefresh, jsInvoker_, instance_); - } - void setHotLoadingEnabled(jsi::Runtime &rt, bool isHotLoadingEnabled) override { - static_assert( - bridging::getParameterCount(&T::setHotLoadingEnabled) == 2, - "Expected setHotLoadingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHotLoadingEnabled, jsInvoker_, instance_, std::move(isHotLoadingEnabled)); - } - void setProfilingEnabled(jsi::Runtime &rt, bool isProfilingEnabled) override { - static_assert( - bridging::getParameterCount(&T::setProfilingEnabled) == 2, - "Expected setProfilingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setProfilingEnabled, jsInvoker_, instance_, std::move(isProfilingEnabled)); - } - void toggleElementInspector(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::toggleElementInspector) == 1, - "Expected toggleElementInspector(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::toggleElementInspector, jsInvoker_, instance_); - } - void addMenuItem(jsi::Runtime &rt, jsi::String title) override { - static_assert( - bridging::getParameterCount(&T::addMenuItem) == 2, - "Expected addMenuItem(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addMenuItem, jsInvoker_, instance_, std::move(title)); - } - void openDebugger(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::openDebugger) == 1, - "Expected openDebugger(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::openDebugger, jsInvoker_, instance_); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setIsShakeToShowDevMenuEnabled) == 2, - "Expected setIsShakeToShowDevMenuEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setIsShakeToShowDevMenuEnabled, jsInvoker_, instance_, std::move(enabled)); - } - - private: - friend class NativeDevSettingsCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeDialogManagerAndroidDialogOptions - -template -struct NativeDialogManagerAndroidDialogOptions { - P0 title; - P1 message; - P2 buttonPositive; - P3 buttonNegative; - P4 buttonNeutral; - P5 items; - P6 cancelable; - bool operator==(const NativeDialogManagerAndroidDialogOptions &other) const { - return title == other.title && message == other.message && buttonPositive == other.buttonPositive && buttonNegative == other.buttonNegative && buttonNeutral == other.buttonNeutral && items == other.items && cancelable == other.cancelable; - } -}; - -template -struct NativeDialogManagerAndroidDialogOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "title"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonPositive"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNegative"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNeutral"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "items"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "cancelable"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String titleToJs(jsi::Runtime &rt, decltype(types.title) value) { - return bridging::toJs(rt, value); - } - - static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonPositiveToJs(jsi::Runtime &rt, decltype(types.buttonPositive) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNegativeToJs(jsi::Runtime &rt, decltype(types.buttonNegative) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNeutralToJs(jsi::Runtime &rt, decltype(types.buttonNeutral) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array itemsToJs(jsi::Runtime &rt, decltype(types.items) value) { - return bridging::toJs(rt, value); - } - - static bool cancelableToJs(jsi::Runtime &rt, decltype(types.cancelable) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.title) { - result.setProperty(rt, "title", bridging::toJs(rt, value.title.value(), jsInvoker)); - } - if (value.message) { - result.setProperty(rt, "message", bridging::toJs(rt, value.message.value(), jsInvoker)); - } - if (value.buttonPositive) { - result.setProperty(rt, "buttonPositive", bridging::toJs(rt, value.buttonPositive.value(), jsInvoker)); - } - if (value.buttonNegative) { - result.setProperty(rt, "buttonNegative", bridging::toJs(rt, value.buttonNegative.value(), jsInvoker)); - } - if (value.buttonNeutral) { - result.setProperty(rt, "buttonNeutral", bridging::toJs(rt, value.buttonNeutral.value(), jsInvoker)); - } - if (value.items) { - result.setProperty(rt, "items", bridging::toJs(rt, value.items.value(), jsInvoker)); - } - if (value.cancelable) { - result.setProperty(rt, "cancelable", bridging::toJs(rt, value.cancelable.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeDialogManagerAndroidCxxSpecJSI : public TurboModule { -protected: - NativeDialogManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) = 0; - -}; - -template -class JSI_EXPORT NativeDialogManagerAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DialogManagerAndroid"; - -protected: - NativeDialogManagerAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDialogManagerAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDialogManagerAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDialogManagerAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) override { - static_assert( - bridging::getParameterCount(&T::showAlert) == 4, - "Expected showAlert(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showAlert, jsInvoker_, instance_, std::move(config), std::move(onError), std::move(onAction)); - } - - private: - friend class NativeDialogManagerAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeDialogManagerWindowsDialogOptions - -template -struct NativeDialogManagerWindowsDialogOptions { - P0 title; - P1 message; - P2 buttonPositive; - P3 buttonNegative; - P4 buttonNeutral; - P5 items; - P6 cancelable; - P7 defaultButton; - P8 rootTag; - bool operator==(const NativeDialogManagerWindowsDialogOptions &other) const { - return title == other.title && message == other.message && buttonPositive == other.buttonPositive && buttonNegative == other.buttonNegative && buttonNeutral == other.buttonNeutral && items == other.items && cancelable == other.cancelable && defaultButton == other.defaultButton && rootTag == other.rootTag; - } -}; - -template -struct NativeDialogManagerWindowsDialogOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "title"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonPositive"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNegative"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNeutral"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "items"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "cancelable"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "defaultButton"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootTag"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String titleToJs(jsi::Runtime &rt, decltype(types.title) value) { - return bridging::toJs(rt, value); - } - - static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonPositiveToJs(jsi::Runtime &rt, decltype(types.buttonPositive) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNegativeToJs(jsi::Runtime &rt, decltype(types.buttonNegative) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNeutralToJs(jsi::Runtime &rt, decltype(types.buttonNeutral) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array itemsToJs(jsi::Runtime &rt, decltype(types.items) value) { - return bridging::toJs(rt, value); - } - - static bool cancelableToJs(jsi::Runtime &rt, decltype(types.cancelable) value) { - return bridging::toJs(rt, value); - } - - static int defaultButtonToJs(jsi::Runtime &rt, decltype(types.defaultButton) value) { - return bridging::toJs(rt, value); - } - - static int rootTagToJs(jsi::Runtime &rt, decltype(types.rootTag) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.title) { - result.setProperty(rt, "title", bridging::toJs(rt, value.title.value(), jsInvoker)); - } - if (value.message) { - result.setProperty(rt, "message", bridging::toJs(rt, value.message.value(), jsInvoker)); - } - if (value.buttonPositive) { - result.setProperty(rt, "buttonPositive", bridging::toJs(rt, value.buttonPositive.value(), jsInvoker)); - } - if (value.buttonNegative) { - result.setProperty(rt, "buttonNegative", bridging::toJs(rt, value.buttonNegative.value(), jsInvoker)); - } - if (value.buttonNeutral) { - result.setProperty(rt, "buttonNeutral", bridging::toJs(rt, value.buttonNeutral.value(), jsInvoker)); - } - if (value.items) { - result.setProperty(rt, "items", bridging::toJs(rt, value.items.value(), jsInvoker)); - } - if (value.cancelable) { - result.setProperty(rt, "cancelable", bridging::toJs(rt, value.cancelable.value(), jsInvoker)); - } - if (value.defaultButton) { - result.setProperty(rt, "defaultButton", bridging::toJs(rt, value.defaultButton.value(), jsInvoker)); - } - if (value.rootTag) { - result.setProperty(rt, "rootTag", bridging::toJs(rt, value.rootTag.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeDialogManagerWindowsCxxSpecJSI : public TurboModule { -protected: - NativeDialogManagerWindowsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) = 0; - -}; - -template -class JSI_EXPORT NativeDialogManagerWindowsCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Alert"; - -protected: - NativeDialogManagerWindowsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDialogManagerWindowsCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDialogManagerWindowsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDialogManagerWindowsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) override { - static_assert( - bridging::getParameterCount(&T::showAlert) == 4, - "Expected showAlert(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showAlert, jsInvoker_, instance_, std::move(config), std::move(onError), std::move(onAction)); - } - - private: - friend class NativeDialogManagerWindowsCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeExceptionsManagerExceptionData - -template -struct NativeExceptionsManagerExceptionData { - P0 message; - P1 originalMessage; - P2 name; - P3 componentStack; - P4 stack; - P5 id; - P6 isFatal; - P7 extraData; - bool operator==(const NativeExceptionsManagerExceptionData &other) const { - return message == other.message && originalMessage == other.originalMessage && name == other.name && componentStack == other.componentStack && stack == other.stack && id == other.id && isFatal == other.isFatal && extraData == other.extraData; - } -}; - -template -struct NativeExceptionsManagerExceptionDataBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "originalMessage"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "name"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "componentStack"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "stack"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "id"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isFatal"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "extraData"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) { - return bridging::toJs(rt, value); - } - - static std::optional originalMessageToJs(jsi::Runtime &rt, decltype(types.originalMessage) value) { - return bridging::toJs(rt, value); - } - - static std::optional nameToJs(jsi::Runtime &rt, decltype(types.name) value) { - return bridging::toJs(rt, value); - } - - static std::optional componentStackToJs(jsi::Runtime &rt, decltype(types.componentStack) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array stackToJs(jsi::Runtime &rt, decltype(types.stack) value) { - return bridging::toJs(rt, value); - } - - static double idToJs(jsi::Runtime &rt, decltype(types.id) value) { - return bridging::toJs(rt, value); - } - - static bool isFatalToJs(jsi::Runtime &rt, decltype(types.isFatal) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object extraDataToJs(jsi::Runtime &rt, decltype(types.extraData) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "message", bridging::toJs(rt, value.message, jsInvoker)); - result.setProperty(rt, "originalMessage", bridging::toJs(rt, value.originalMessage, jsInvoker)); - result.setProperty(rt, "name", bridging::toJs(rt, value.name, jsInvoker)); - result.setProperty(rt, "componentStack", bridging::toJs(rt, value.componentStack, jsInvoker)); - result.setProperty(rt, "stack", bridging::toJs(rt, value.stack, jsInvoker)); - result.setProperty(rt, "id", bridging::toJs(rt, value.id, jsInvoker)); - result.setProperty(rt, "isFatal", bridging::toJs(rt, value.isFatal, jsInvoker)); - if (value.extraData) { - result.setProperty(rt, "extraData", bridging::toJs(rt, value.extraData.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeExceptionsManagerStackFrame - -template -struct NativeExceptionsManagerStackFrame { - P0 column; - P1 file; - P2 lineNumber; - P3 methodName; - P4 collapse; - bool operator==(const NativeExceptionsManagerStackFrame &other) const { - return column == other.column && file == other.file && lineNumber == other.lineNumber && methodName == other.methodName && collapse == other.collapse; - } -}; - -template -struct NativeExceptionsManagerStackFrameBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "column"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "file"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "lineNumber"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "methodName"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "collapse"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static std::optional columnToJs(jsi::Runtime &rt, decltype(types.column) value) { - return bridging::toJs(rt, value); - } - - static std::optional fileToJs(jsi::Runtime &rt, decltype(types.file) value) { - return bridging::toJs(rt, value); - } - - static std::optional lineNumberToJs(jsi::Runtime &rt, decltype(types.lineNumber) value) { - return bridging::toJs(rt, value); - } - - static jsi::String methodNameToJs(jsi::Runtime &rt, decltype(types.methodName) value) { - return bridging::toJs(rt, value); - } - - static bool collapseToJs(jsi::Runtime &rt, decltype(types.collapse) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "column", bridging::toJs(rt, value.column, jsInvoker)); - result.setProperty(rt, "file", bridging::toJs(rt, value.file, jsInvoker)); - result.setProperty(rt, "lineNumber", bridging::toJs(rt, value.lineNumber, jsInvoker)); - result.setProperty(rt, "methodName", bridging::toJs(rt, value.methodName, jsInvoker)); - if (value.collapse) { - result.setProperty(rt, "collapse", bridging::toJs(rt, value.collapse.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeExceptionsManagerCxxSpecJSI : public TurboModule { -protected: - NativeExceptionsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void reportFatalException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) = 0; - virtual void reportSoftException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) = 0; - virtual void reportException(jsi::Runtime &rt, jsi::Object data) = 0; - virtual void dismissRedbox(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeExceptionsManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ExceptionsManager"; - -protected: - NativeExceptionsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeExceptionsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeExceptionsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeExceptionsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void reportFatalException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) override { - static_assert( - bridging::getParameterCount(&T::reportFatalException) == 4, - "Expected reportFatalException(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::reportFatalException, jsInvoker_, instance_, std::move(message), std::move(stack), std::move(exceptionId)); - } - void reportSoftException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) override { - static_assert( - bridging::getParameterCount(&T::reportSoftException) == 4, - "Expected reportSoftException(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::reportSoftException, jsInvoker_, instance_, std::move(message), std::move(stack), std::move(exceptionId)); - } - void reportException(jsi::Runtime &rt, jsi::Object data) override { - static_assert( - bridging::getParameterCount(&T::reportException) == 2, - "Expected reportException(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::reportException, jsInvoker_, instance_, std::move(data)); - } - void dismissRedbox(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismissRedbox) == 1, - "Expected dismissRedbox(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismissRedbox, jsInvoker_, instance_); - } - - private: - friend class NativeExceptionsManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeFileReaderModuleCxxSpecJSI : public TurboModule { -protected: - NativeFileReaderModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value readAsDataURL(jsi::Runtime &rt, jsi::Object data) = 0; - virtual jsi::Value readAsText(jsi::Runtime &rt, jsi::Object data, jsi::String encoding) = 0; - -}; - -template -class JSI_EXPORT NativeFileReaderModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "FileReaderModule"; - -protected: - NativeFileReaderModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeFileReaderModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeFileReaderModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeFileReaderModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value readAsDataURL(jsi::Runtime &rt, jsi::Object data) override { - static_assert( - bridging::getParameterCount(&T::readAsDataURL) == 2, - "Expected readAsDataURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::readAsDataURL, jsInvoker_, instance_, std::move(data)); - } - jsi::Value readAsText(jsi::Runtime &rt, jsi::Object data, jsi::String encoding) override { - static_assert( - bridging::getParameterCount(&T::readAsText) == 3, - "Expected readAsText(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::readAsText, jsInvoker_, instance_, std::move(data), std::move(encoding)); - } - - private: - friend class NativeFileReaderModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeFrameRateLoggerCxxSpecJSI : public TurboModule { -protected: - NativeFrameRateLoggerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setGlobalOptions(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void setContext(jsi::Runtime &rt, jsi::String context) = 0; - virtual void beginScroll(jsi::Runtime &rt) = 0; - virtual void endScroll(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeFrameRateLoggerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "FrameRateLogger"; - -protected: - NativeFrameRateLoggerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeFrameRateLoggerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeFrameRateLoggerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeFrameRateLoggerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void setGlobalOptions(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::setGlobalOptions) == 2, - "Expected setGlobalOptions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setGlobalOptions, jsInvoker_, instance_, std::move(options)); - } - void setContext(jsi::Runtime &rt, jsi::String context) override { - static_assert( - bridging::getParameterCount(&T::setContext) == 2, - "Expected setContext(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setContext, jsInvoker_, instance_, std::move(context)); - } - void beginScroll(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::beginScroll) == 1, - "Expected beginScroll(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::beginScroll, jsInvoker_, instance_); - } - void endScroll(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::endScroll) == 1, - "Expected endScroll(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::endScroll, jsInvoker_, instance_); - } - - private: - friend class NativeFrameRateLoggerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeHeadlessJsTaskSupportCxxSpecJSI : public TurboModule { -protected: - NativeHeadlessJsTaskSupportCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void notifyTaskFinished(jsi::Runtime &rt, double taskId) = 0; - virtual jsi::Value notifyTaskRetry(jsi::Runtime &rt, double taskId) = 0; - -}; - -template -class JSI_EXPORT NativeHeadlessJsTaskSupportCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "HeadlessJsTaskSupport"; - -protected: - NativeHeadlessJsTaskSupportCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeHeadlessJsTaskSupportCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeHeadlessJsTaskSupportCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeHeadlessJsTaskSupportCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void notifyTaskFinished(jsi::Runtime &rt, double taskId) override { - static_assert( - bridging::getParameterCount(&T::notifyTaskFinished) == 2, - "Expected notifyTaskFinished(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::notifyTaskFinished, jsInvoker_, instance_, std::move(taskId)); - } - jsi::Value notifyTaskRetry(jsi::Runtime &rt, double taskId) override { - static_assert( - bridging::getParameterCount(&T::notifyTaskRetry) == 2, - "Expected notifyTaskRetry(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::notifyTaskRetry, jsInvoker_, instance_, std::move(taskId)); - } - - private: - friend class NativeHeadlessJsTaskSupportCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeI18nManagerI18nManagerConstants - -template -struct NativeI18nManagerI18nManagerConstants { - P0 doLeftAndRightSwapInRTL; - P1 isRTL; - P2 localeIdentifier; - bool operator==(const NativeI18nManagerI18nManagerConstants &other) const { - return doLeftAndRightSwapInRTL == other.doLeftAndRightSwapInRTL && isRTL == other.isRTL && localeIdentifier == other.localeIdentifier; - } -}; - -template -struct NativeI18nManagerI18nManagerConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "doLeftAndRightSwapInRTL"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isRTL"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "localeIdentifier"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool doLeftAndRightSwapInRTLToJs(jsi::Runtime &rt, decltype(types.doLeftAndRightSwapInRTL) value) { - return bridging::toJs(rt, value); - } - - static bool isRTLToJs(jsi::Runtime &rt, decltype(types.isRTL) value) { - return bridging::toJs(rt, value); - } - - static std::optional localeIdentifierToJs(jsi::Runtime &rt, decltype(types.localeIdentifier) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "doLeftAndRightSwapInRTL", bridging::toJs(rt, value.doLeftAndRightSwapInRTL, jsInvoker)); - result.setProperty(rt, "isRTL", bridging::toJs(rt, value.isRTL, jsInvoker)); - if (value.localeIdentifier) { - result.setProperty(rt, "localeIdentifier", bridging::toJs(rt, value.localeIdentifier.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeI18nManagerCxxSpecJSI : public TurboModule { -protected: - NativeI18nManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void allowRTL(jsi::Runtime &rt, bool allowRTL) = 0; - virtual void forceRTL(jsi::Runtime &rt, bool forceRTL) = 0; - virtual void swapLeftAndRightInRTL(jsi::Runtime &rt, bool flipStyles) = 0; - -}; - -template -class JSI_EXPORT NativeI18nManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "I18nManager"; - -protected: - NativeI18nManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeI18nManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeI18nManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeI18nManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void allowRTL(jsi::Runtime &rt, bool allowRTL) override { - static_assert( - bridging::getParameterCount(&T::allowRTL) == 2, - "Expected allowRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::allowRTL, jsInvoker_, instance_, std::move(allowRTL)); - } - void forceRTL(jsi::Runtime &rt, bool forceRTL) override { - static_assert( - bridging::getParameterCount(&T::forceRTL) == 2, - "Expected forceRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::forceRTL, jsInvoker_, instance_, std::move(forceRTL)); - } - void swapLeftAndRightInRTL(jsi::Runtime &rt, bool flipStyles) override { - static_assert( - bridging::getParameterCount(&T::swapLeftAndRightInRTL) == 2, - "Expected swapLeftAndRightInRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::swapLeftAndRightInRTL, jsInvoker_, instance_, std::move(flipStyles)); - } - - private: - friend class NativeI18nManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeImageEditorOptions - -template -struct NativeImageEditorOptions { - P0 offset; - P1 size; - P2 displaySize; - P3 resizeMode; - P4 allowExternalStorage; - bool operator==(const NativeImageEditorOptions &other) const { - return offset == other.offset && size == other.size && displaySize == other.displaySize && resizeMode == other.resizeMode && allowExternalStorage == other.allowExternalStorage; - } -}; - -template -struct NativeImageEditorOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "offset"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "size"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "displaySize"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "resizeMode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "allowExternalStorage"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object offsetToJs(jsi::Runtime &rt, decltype(types.offset) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object sizeToJs(jsi::Runtime &rt, decltype(types.size) value) { - return bridging::toJs(rt, value); - } - - static std::optional displaySizeToJs(jsi::Runtime &rt, decltype(types.displaySize) value) { - return bridging::toJs(rt, value); - } - - static std::optional resizeModeToJs(jsi::Runtime &rt, decltype(types.resizeMode) value) { - return bridging::toJs(rt, value); - } - - static bool allowExternalStorageToJs(jsi::Runtime &rt, decltype(types.allowExternalStorage) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "offset", bridging::toJs(rt, value.offset, jsInvoker)); - result.setProperty(rt, "size", bridging::toJs(rt, value.size, jsInvoker)); - if (value.displaySize) { - result.setProperty(rt, "displaySize", bridging::toJs(rt, value.displaySize.value(), jsInvoker)); - } - if (value.resizeMode) { - result.setProperty(rt, "resizeMode", bridging::toJs(rt, value.resizeMode.value(), jsInvoker)); - } - if (value.allowExternalStorage) { - result.setProperty(rt, "allowExternalStorage", bridging::toJs(rt, value.allowExternalStorage.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeImageEditorCxxSpecJSI : public TurboModule { -protected: - NativeImageEditorCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void cropImage(jsi::Runtime &rt, jsi::String uri, jsi::Object cropData, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageEditorCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageEditingManager"; - -protected: - NativeImageEditorCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageEditorCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageEditorCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageEditorCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void cropImage(jsi::Runtime &rt, jsi::String uri, jsi::Object cropData, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::cropImage) == 5, - "Expected cropImage(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::cropImage, jsInvoker_, instance_, std::move(uri), std::move(cropData), std::move(successCallback), std::move(errorCallback)); - } - - private: - friend class NativeImageEditorCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeImageLoaderAndroidImageSize - -template -struct NativeImageLoaderAndroidImageSize { - P0 width; - P1 height; - bool operator==(const NativeImageLoaderAndroidImageSize &other) const { - return width == other.width && height == other.height; - } -}; - -template -struct NativeImageLoaderAndroidImageSizeBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "width"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "height"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double widthToJs(jsi::Runtime &rt, decltype(types.width) value) { - return bridging::toJs(rt, value); - } - - static double heightToJs(jsi::Runtime &rt, decltype(types.height) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker)); - result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeImageLoaderAndroidCxxSpecJSI : public TurboModule { -protected: - NativeImageLoaderAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) = 0; - virtual jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri, double requestId) = 0; - virtual jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) = 0; - -}; - -template -class JSI_EXPORT NativeImageLoaderAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageLoader"; - -protected: - NativeImageLoaderAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageLoaderAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageLoaderAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageLoaderAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::getSize) == 2, - "Expected getSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getSize, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) override { - static_assert( - bridging::getParameterCount(&T::getSizeWithHeaders) == 3, - "Expected getSizeWithHeaders(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getSizeWithHeaders, jsInvoker_, instance_, std::move(uri), std::move(headers)); - } - jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri, double requestId) override { - static_assert( - bridging::getParameterCount(&T::prefetchImage) == 3, - "Expected prefetchImage(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImage, jsInvoker_, instance_, std::move(uri), std::move(requestId)); - } - jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) override { - static_assert( - bridging::getParameterCount(&T::queryCache) == 2, - "Expected queryCache(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queryCache, jsInvoker_, instance_, std::move(uris)); - } - - private: - friend class NativeImageLoaderAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageLoaderIOSCxxSpecJSI : public TurboModule { -protected: - NativeImageLoaderIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) = 0; - virtual jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value prefetchImageWithMetadata(jsi::Runtime &rt, jsi::String uri, jsi::String queryRootName, double rootTag) = 0; - virtual jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) = 0; - -}; - -template -class JSI_EXPORT NativeImageLoaderIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageLoader"; - -protected: - NativeImageLoaderIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageLoaderIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageLoaderIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageLoaderIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::getSize) == 2, - "Expected getSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getSize, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) override { - static_assert( - bridging::getParameterCount(&T::getSizeWithHeaders) == 3, - "Expected getSizeWithHeaders(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getSizeWithHeaders, jsInvoker_, instance_, std::move(uri), std::move(headers)); - } - jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::prefetchImage) == 2, - "Expected prefetchImage(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImage, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value prefetchImageWithMetadata(jsi::Runtime &rt, jsi::String uri, jsi::String queryRootName, double rootTag) override { - static_assert( - bridging::getParameterCount(&T::prefetchImageWithMetadata) == 4, - "Expected prefetchImageWithMetadata(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImageWithMetadata, jsInvoker_, instance_, std::move(uri), std::move(queryRootName), std::move(rootTag)); - } - jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) override { - static_assert( - bridging::getParameterCount(&T::queryCache) == 2, - "Expected queryCache(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queryCache, jsInvoker_, instance_, std::move(uris)); - } - - private: - friend class NativeImageLoaderIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageStoreAndroidCxxSpecJSI : public TurboModule { -protected: - NativeImageStoreAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageStoreAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageStoreManager"; - -protected: - NativeImageStoreAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageStoreAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageStoreAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageStoreAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::getBase64ForTag) == 4, - "Expected getBase64ForTag(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getBase64ForTag, jsInvoker_, instance_, std::move(uri), std::move(successCallback), std::move(errorCallback)); - } - - private: - friend class NativeImageStoreAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageStoreIOSCxxSpecJSI : public TurboModule { -protected: - NativeImageStoreIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) = 0; - virtual void hasImageForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function callback) = 0; - virtual void removeImageForTag(jsi::Runtime &rt, jsi::String uri) = 0; - virtual void addImageFromBase64(jsi::Runtime &rt, jsi::String base64ImageData, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageStoreIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageStoreManager"; - -protected: - NativeImageStoreIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageStoreIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageStoreIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageStoreIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::getBase64ForTag) == 4, - "Expected getBase64ForTag(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getBase64ForTag, jsInvoker_, instance_, std::move(uri), std::move(successCallback), std::move(errorCallback)); - } - void hasImageForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::hasImageForTag) == 3, - "Expected hasImageForTag(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::hasImageForTag, jsInvoker_, instance_, std::move(uri), std::move(callback)); - } - void removeImageForTag(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::removeImageForTag) == 2, - "Expected removeImageForTag(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeImageForTag, jsInvoker_, instance_, std::move(uri)); - } - void addImageFromBase64(jsi::Runtime &rt, jsi::String base64ImageData, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::addImageFromBase64) == 4, - "Expected addImageFromBase64(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addImageFromBase64, jsInvoker_, instance_, std::move(base64ImageData), std::move(successCallback), std::move(errorCallback)); - } - - private: - friend class NativeImageStoreIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeIntentAndroidCxxSpecJSI : public TurboModule { -protected: - NativeIntentAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value getInitialURL(jsi::Runtime &rt) = 0; - virtual jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openSettings(jsi::Runtime &rt) = 0; - virtual jsi::Value sendIntent(jsi::Runtime &rt, jsi::String action, std::optional extras) = 0; - -}; - -template -class JSI_EXPORT NativeIntentAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "IntentAndroid"; - -protected: - NativeIntentAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeIntentAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeIntentAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeIntentAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value getInitialURL(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialURL) == 1, - "Expected getInitialURL(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialURL, jsInvoker_, instance_); - } - jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::canOpenURL) == 2, - "Expected canOpenURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::canOpenURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::openURL) == 2, - "Expected openURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::openURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::openSettings) == 1, - "Expected openSettings(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::openSettings, jsInvoker_, instance_); - } - jsi::Value sendIntent(jsi::Runtime &rt, jsi::String action, std::optional extras) override { - static_assert( - bridging::getParameterCount(&T::sendIntent) == 3, - "Expected sendIntent(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendIntent, jsInvoker_, instance_, std::move(action), std::move(extras)); - } - - private: - friend class NativeIntentAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeJSCHeapCaptureCxxSpecJSI : public TurboModule { -protected: - NativeJSCHeapCaptureCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void captureComplete(jsi::Runtime &rt, jsi::String path, std::optional error) = 0; - -}; - -template -class JSI_EXPORT NativeJSCHeapCaptureCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "JSCHeapCapture"; - -protected: - NativeJSCHeapCaptureCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeJSCHeapCaptureCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeJSCHeapCaptureCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeJSCHeapCaptureCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void captureComplete(jsi::Runtime &rt, jsi::String path, std::optional error) override { - static_assert( - bridging::getParameterCount(&T::captureComplete) == 3, - "Expected captureComplete(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::captureComplete, jsInvoker_, instance_, std::move(path), std::move(error)); - } - - private: - friend class NativeJSCHeapCaptureCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeKeyboardObserverCxxSpecJSI : public TurboModule { -protected: - NativeKeyboardObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeKeyboardObserverCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "KeyboardObserver"; - -protected: - NativeKeyboardObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeKeyboardObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeKeyboardObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeKeyboardObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeKeyboardObserverCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeLinkingManagerCxxSpecJSI : public TurboModule { -protected: - NativeLinkingManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value getInitialURL(jsi::Runtime &rt) = 0; - virtual jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openSettings(jsi::Runtime &rt) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeLinkingManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "LinkingManager"; - -protected: - NativeLinkingManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeLinkingManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeLinkingManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeLinkingManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value getInitialURL(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialURL) == 1, - "Expected getInitialURL(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialURL, jsInvoker_, instance_); - } - jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::canOpenURL) == 2, - "Expected canOpenURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::canOpenURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::openURL) == 2, - "Expected openURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::openURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::openSettings) == 1, - "Expected openSettings(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::openSettings, jsInvoker_, instance_); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeLinkingManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeLogBoxCxxSpecJSI : public TurboModule { -protected: - NativeLogBoxCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void show(jsi::Runtime &rt) = 0; - virtual void hide(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeLogBoxCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "LogBox"; - -protected: - NativeLogBoxCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeLogBoxCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeLogBoxCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeLogBoxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void show(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::show) == 1, - "Expected show(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_); - } - void hide(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::hide) == 1, - "Expected hide(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::hide, jsInvoker_, instance_); - } - - private: - friend class NativeLogBoxCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeModalManagerCxxSpecJSI : public TurboModule { -protected: - NativeModalManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeModalManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ModalManager"; - -protected: - NativeModalManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeModalManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeModalManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeModalManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeModalManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeNetworkingAndroidCxxSpecJSI : public TurboModule { -protected: - NativeNetworkingAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void sendRequest(jsi::Runtime &rt, jsi::String method, jsi::String url, double requestId, jsi::Array headers, jsi::Object data, jsi::String responseType, bool useIncrementalUpdates, double timeout, bool withCredentials) = 0; - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual void clearCookies(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeNetworkingAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Networking"; - -protected: - NativeNetworkingAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeNetworkingAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeNetworkingAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeNetworkingAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void sendRequest(jsi::Runtime &rt, jsi::String method, jsi::String url, double requestId, jsi::Array headers, jsi::Object data, jsi::String responseType, bool useIncrementalUpdates, double timeout, bool withCredentials) override { - static_assert( - bridging::getParameterCount(&T::sendRequest) == 10, - "Expected sendRequest(...) to have 10 parameters"); - - return bridging::callFromJs( - rt, &T::sendRequest, jsInvoker_, instance_, std::move(method), std::move(url), std::move(requestId), std::move(headers), std::move(data), std::move(responseType), std::move(useIncrementalUpdates), std::move(timeout), std::move(withCredentials)); - } - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - void clearCookies(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::clearCookies) == 2, - "Expected clearCookies(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearCookies, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeNetworkingAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeNetworkingIOSCxxSpecJSI : public TurboModule { -protected: - NativeNetworkingIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void sendRequest(jsi::Runtime &rt, jsi::Object query, jsi::Function callback) = 0; - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual void clearCookies(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeNetworkingIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Networking"; - -protected: - NativeNetworkingIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeNetworkingIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeNetworkingIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeNetworkingIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void sendRequest(jsi::Runtime &rt, jsi::Object query, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::sendRequest) == 3, - "Expected sendRequest(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendRequest, jsInvoker_, instance_, std::move(query), std::move(callback)); - } - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - void clearCookies(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::clearCookies) == 2, - "Expected clearCookies(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearCookies, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeNetworkingIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativePermissionsAndroidCxxSpecJSI : public TurboModule { -protected: - NativePermissionsAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value checkPermission(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value requestPermission(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value shouldShowRequestPermissionRationale(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value requestMultiplePermissions(jsi::Runtime &rt, jsi::Array permissions) = 0; - -}; - -template -class JSI_EXPORT NativePermissionsAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PermissionsAndroid"; - -protected: - NativePermissionsAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePermissionsAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePermissionsAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePermissionsAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value checkPermission(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::checkPermission) == 2, - "Expected checkPermission(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::checkPermission, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value requestPermission(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::requestPermission) == 2, - "Expected requestPermission(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestPermission, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value shouldShowRequestPermissionRationale(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::shouldShowRequestPermissionRationale) == 2, - "Expected shouldShowRequestPermissionRationale(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::shouldShowRequestPermissionRationale, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value requestMultiplePermissions(jsi::Runtime &rt, jsi::Array permissions) override { - static_assert( - bridging::getParameterCount(&T::requestMultiplePermissions) == 2, - "Expected requestMultiplePermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestMultiplePermissions, jsInvoker_, instance_, std::move(permissions)); - } - - private: - friend class NativePermissionsAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePlatformConstantsAndroidPlatformConstantsAndroid - -template -struct NativePlatformConstantsAndroidPlatformConstantsAndroid { - P0 isTesting; - P1 isDisableAnimations; - P2 reactNativeVersion; - P3 Version; - P4 Release; - P5 Serial; - P6 Fingerprint; - P7 Model; - P8 ServerHost; - P9 uiMode; - P10 Brand; - P11 Manufacturer; - bool operator==(const NativePlatformConstantsAndroidPlatformConstantsAndroid &other) const { - return isTesting == other.isTesting && isDisableAnimations == other.isDisableAnimations && reactNativeVersion == other.reactNativeVersion && Version == other.Version && Release == other.Release && Serial == other.Serial && Fingerprint == other.Fingerprint && Model == other.Model && ServerHost == other.ServerHost && uiMode == other.uiMode && Brand == other.Brand && Manufacturer == other.Manufacturer; - } -}; - -template -struct NativePlatformConstantsAndroidPlatformConstantsAndroidBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "isTesting"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isDisableAnimations"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Version"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Release"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Serial"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Fingerprint"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Model"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "ServerHost"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "uiMode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Brand"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Manufacturer"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isTestingToJs(jsi::Runtime &rt, decltype(types.isTesting) value) { - return bridging::toJs(rt, value); - } - - static bool isDisableAnimationsToJs(jsi::Runtime &rt, decltype(types.isDisableAnimations) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeVersionToJs(jsi::Runtime &rt, decltype(types.reactNativeVersion) value) { - return bridging::toJs(rt, value); - } - - static double VersionToJs(jsi::Runtime &rt, decltype(types.Version) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ReleaseToJs(jsi::Runtime &rt, decltype(types.Release) value) { - return bridging::toJs(rt, value); - } - - static jsi::String SerialToJs(jsi::Runtime &rt, decltype(types.Serial) value) { - return bridging::toJs(rt, value); - } - - static jsi::String FingerprintToJs(jsi::Runtime &rt, decltype(types.Fingerprint) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ModelToJs(jsi::Runtime &rt, decltype(types.Model) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ServerHostToJs(jsi::Runtime &rt, decltype(types.ServerHost) value) { - return bridging::toJs(rt, value); - } - - static jsi::String uiModeToJs(jsi::Runtime &rt, decltype(types.uiMode) value) { - return bridging::toJs(rt, value); - } - - static jsi::String BrandToJs(jsi::Runtime &rt, decltype(types.Brand) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ManufacturerToJs(jsi::Runtime &rt, decltype(types.Manufacturer) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isTesting", bridging::toJs(rt, value.isTesting, jsInvoker)); - if (value.isDisableAnimations) { - result.setProperty(rt, "isDisableAnimations", bridging::toJs(rt, value.isDisableAnimations.value(), jsInvoker)); - } - result.setProperty(rt, "reactNativeVersion", bridging::toJs(rt, value.reactNativeVersion, jsInvoker)); - result.setProperty(rt, "Version", bridging::toJs(rt, value.Version, jsInvoker)); - result.setProperty(rt, "Release", bridging::toJs(rt, value.Release, jsInvoker)); - result.setProperty(rt, "Serial", bridging::toJs(rt, value.Serial, jsInvoker)); - result.setProperty(rt, "Fingerprint", bridging::toJs(rt, value.Fingerprint, jsInvoker)); - result.setProperty(rt, "Model", bridging::toJs(rt, value.Model, jsInvoker)); - if (value.ServerHost) { - result.setProperty(rt, "ServerHost", bridging::toJs(rt, value.ServerHost.value(), jsInvoker)); - } - result.setProperty(rt, "uiMode", bridging::toJs(rt, value.uiMode, jsInvoker)); - result.setProperty(rt, "Brand", bridging::toJs(rt, value.Brand, jsInvoker)); - result.setProperty(rt, "Manufacturer", bridging::toJs(rt, value.Manufacturer, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativePlatformConstantsAndroidReactNativeVersionAndroid - -template -struct NativePlatformConstantsAndroidReactNativeVersionAndroid { - P0 major; - P1 minor; - P2 patch; - P3 prerelease; - bool operator==(const NativePlatformConstantsAndroidReactNativeVersionAndroid &other) const { - return major == other.major && minor == other.minor && patch == other.patch && prerelease == other.prerelease; - } -}; - -template -struct NativePlatformConstantsAndroidReactNativeVersionAndroidBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "major"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "minor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "patch"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "prerelease"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double majorToJs(jsi::Runtime &rt, decltype(types.major) value) { - return bridging::toJs(rt, value); - } - - static double minorToJs(jsi::Runtime &rt, decltype(types.minor) value) { - return bridging::toJs(rt, value); - } - - static double patchToJs(jsi::Runtime &rt, decltype(types.patch) value) { - return bridging::toJs(rt, value); - } - - static std::optional prereleaseToJs(jsi::Runtime &rt, decltype(types.prerelease) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "major", bridging::toJs(rt, value.major, jsInvoker)); - result.setProperty(rt, "minor", bridging::toJs(rt, value.minor, jsInvoker)); - result.setProperty(rt, "patch", bridging::toJs(rt, value.patch, jsInvoker)); - result.setProperty(rt, "prerelease", bridging::toJs(rt, value.prerelease, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePlatformConstantsAndroidCxxSpecJSI : public TurboModule { -protected: - NativePlatformConstantsAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::String getAndroidID(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePlatformConstantsAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PlatformConstants"; - -protected: - NativePlatformConstantsAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePlatformConstantsAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePlatformConstantsAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePlatformConstantsAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::String getAndroidID(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getAndroidID) == 1, - "Expected getAndroidID(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getAndroidID, jsInvoker_, instance_); - } - - private: - friend class NativePlatformConstantsAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePlatformConstantsIOSPlatformConstantsIOS - -template -struct NativePlatformConstantsIOSPlatformConstantsIOS { - P0 isTesting; - P1 isDisableAnimations; - P2 reactNativeVersion; - P3 forceTouchAvailable; - P4 osVersion; - P5 systemName; - P6 interfaceIdiom; - P7 isMacCatalyst; - bool operator==(const NativePlatformConstantsIOSPlatformConstantsIOS &other) const { - return isTesting == other.isTesting && isDisableAnimations == other.isDisableAnimations && reactNativeVersion == other.reactNativeVersion && forceTouchAvailable == other.forceTouchAvailable && osVersion == other.osVersion && systemName == other.systemName && interfaceIdiom == other.interfaceIdiom && isMacCatalyst == other.isMacCatalyst; - } -}; - -template -struct NativePlatformConstantsIOSPlatformConstantsIOSBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "isTesting"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isDisableAnimations"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "forceTouchAvailable"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "osVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "systemName"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "interfaceIdiom"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isMacCatalyst"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isTestingToJs(jsi::Runtime &rt, decltype(types.isTesting) value) { - return bridging::toJs(rt, value); - } - - static bool isDisableAnimationsToJs(jsi::Runtime &rt, decltype(types.isDisableAnimations) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeVersionToJs(jsi::Runtime &rt, decltype(types.reactNativeVersion) value) { - return bridging::toJs(rt, value); - } - - static bool forceTouchAvailableToJs(jsi::Runtime &rt, decltype(types.forceTouchAvailable) value) { - return bridging::toJs(rt, value); - } - - static jsi::String osVersionToJs(jsi::Runtime &rt, decltype(types.osVersion) value) { - return bridging::toJs(rt, value); - } - - static jsi::String systemNameToJs(jsi::Runtime &rt, decltype(types.systemName) value) { - return bridging::toJs(rt, value); - } - - static jsi::String interfaceIdiomToJs(jsi::Runtime &rt, decltype(types.interfaceIdiom) value) { - return bridging::toJs(rt, value); - } - - static bool isMacCatalystToJs(jsi::Runtime &rt, decltype(types.isMacCatalyst) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isTesting", bridging::toJs(rt, value.isTesting, jsInvoker)); - if (value.isDisableAnimations) { - result.setProperty(rt, "isDisableAnimations", bridging::toJs(rt, value.isDisableAnimations.value(), jsInvoker)); - } - result.setProperty(rt, "reactNativeVersion", bridging::toJs(rt, value.reactNativeVersion, jsInvoker)); - result.setProperty(rt, "forceTouchAvailable", bridging::toJs(rt, value.forceTouchAvailable, jsInvoker)); - result.setProperty(rt, "osVersion", bridging::toJs(rt, value.osVersion, jsInvoker)); - result.setProperty(rt, "systemName", bridging::toJs(rt, value.systemName, jsInvoker)); - result.setProperty(rt, "interfaceIdiom", bridging::toJs(rt, value.interfaceIdiom, jsInvoker)); - if (value.isMacCatalyst) { - result.setProperty(rt, "isMacCatalyst", bridging::toJs(rt, value.isMacCatalyst.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativePlatformConstantsIOSCxxSpecJSI : public TurboModule { -protected: - NativePlatformConstantsIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePlatformConstantsIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PlatformConstants"; - -protected: - NativePlatformConstantsIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePlatformConstantsIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePlatformConstantsIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePlatformConstantsIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativePlatformConstantsIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePlatformConstantsWindowsPlatformConstantsWindows - -template -struct NativePlatformConstantsWindowsPlatformConstantsWindows { - P0 isTesting; - P1 isDisableAnimations; - P2 reactNativeVersion; - P3 reactNativeWindowsVersion; - P4 osVersion; - bool operator==(const NativePlatformConstantsWindowsPlatformConstantsWindows &other) const { - return isTesting == other.isTesting && isDisableAnimations == other.isDisableAnimations && reactNativeVersion == other.reactNativeVersion && reactNativeWindowsVersion == other.reactNativeWindowsVersion && osVersion == other.osVersion; - } -}; - -template -struct NativePlatformConstantsWindowsPlatformConstantsWindowsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "isTesting"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isDisableAnimations"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeWindowsVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "osVersion"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isTestingToJs(jsi::Runtime &rt, decltype(types.isTesting) value) { - return bridging::toJs(rt, value); - } - - static bool isDisableAnimationsToJs(jsi::Runtime &rt, decltype(types.isDisableAnimations) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeVersionToJs(jsi::Runtime &rt, decltype(types.reactNativeVersion) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeWindowsVersionToJs(jsi::Runtime &rt, decltype(types.reactNativeWindowsVersion) value) { - return bridging::toJs(rt, value); - } - - static double osVersionToJs(jsi::Runtime &rt, decltype(types.osVersion) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isTesting", bridging::toJs(rt, value.isTesting, jsInvoker)); - if (value.isDisableAnimations) { - result.setProperty(rt, "isDisableAnimations", bridging::toJs(rt, value.isDisableAnimations.value(), jsInvoker)); - } - result.setProperty(rt, "reactNativeVersion", bridging::toJs(rt, value.reactNativeVersion, jsInvoker)); - result.setProperty(rt, "reactNativeWindowsVersion", bridging::toJs(rt, value.reactNativeWindowsVersion, jsInvoker)); - result.setProperty(rt, "osVersion", bridging::toJs(rt, value.osVersion, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativePlatformConstantsWindowsReactNativeVersionAndroid - -template -struct NativePlatformConstantsWindowsReactNativeVersionAndroid { - P0 major; - P1 minor; - P2 patch; - P3 prerelease; - bool operator==(const NativePlatformConstantsWindowsReactNativeVersionAndroid &other) const { - return major == other.major && minor == other.minor && patch == other.patch && prerelease == other.prerelease; - } -}; - -template -struct NativePlatformConstantsWindowsReactNativeVersionAndroidBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "major"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "minor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "patch"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "prerelease"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double majorToJs(jsi::Runtime &rt, decltype(types.major) value) { - return bridging::toJs(rt, value); - } - - static double minorToJs(jsi::Runtime &rt, decltype(types.minor) value) { - return bridging::toJs(rt, value); - } - - static double patchToJs(jsi::Runtime &rt, decltype(types.patch) value) { - return bridging::toJs(rt, value); - } - - static std::optional prereleaseToJs(jsi::Runtime &rt, decltype(types.prerelease) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "major", bridging::toJs(rt, value.major, jsInvoker)); - result.setProperty(rt, "minor", bridging::toJs(rt, value.minor, jsInvoker)); - result.setProperty(rt, "patch", bridging::toJs(rt, value.patch, jsInvoker)); - result.setProperty(rt, "prerelease", bridging::toJs(rt, value.prerelease, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePlatformConstantsWindowsCxxSpecJSI : public TurboModule { -protected: - NativePlatformConstantsWindowsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePlatformConstantsWindowsCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PlatformConstants"; - -protected: - NativePlatformConstantsWindowsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePlatformConstantsWindowsCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePlatformConstantsWindowsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePlatformConstantsWindowsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativePlatformConstantsWindowsCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePushNotificationManagerIOSNotification - -template -struct NativePushNotificationManagerIOSNotification { - P0 alertTitle; - P1 alertBody; - P2 userInfo; - P3 category; - P4 fireDate; - P5 fireIntervalSeconds; - P6 applicationIconBadgeNumber; - P7 isSilent; - P8 soundName; - bool operator==(const NativePushNotificationManagerIOSNotification &other) const { - return alertTitle == other.alertTitle && alertBody == other.alertBody && userInfo == other.userInfo && category == other.category && fireDate == other.fireDate && fireIntervalSeconds == other.fireIntervalSeconds && applicationIconBadgeNumber == other.applicationIconBadgeNumber && isSilent == other.isSilent && soundName == other.soundName; - } -}; - -template -struct NativePushNotificationManagerIOSNotificationBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "alertTitle"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "alertBody"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "userInfo"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "category"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fireDate"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fireIntervalSeconds"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "applicationIconBadgeNumber"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isSilent"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "soundName"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static std::optional alertTitleToJs(jsi::Runtime &rt, decltype(types.alertTitle) value) { - return bridging::toJs(rt, value); - } - - static std::optional alertBodyToJs(jsi::Runtime &rt, decltype(types.alertBody) value) { - return bridging::toJs(rt, value); - } - - static std::optional userInfoToJs(jsi::Runtime &rt, decltype(types.userInfo) value) { - return bridging::toJs(rt, value); - } - - static std::optional categoryToJs(jsi::Runtime &rt, decltype(types.category) value) { - return bridging::toJs(rt, value); - } - - static std::optional fireDateToJs(jsi::Runtime &rt, decltype(types.fireDate) value) { - return bridging::toJs(rt, value); - } - - static std::optional fireIntervalSecondsToJs(jsi::Runtime &rt, decltype(types.fireIntervalSeconds) value) { - return bridging::toJs(rt, value); - } - - static std::optional applicationIconBadgeNumberToJs(jsi::Runtime &rt, decltype(types.applicationIconBadgeNumber) value) { - return bridging::toJs(rt, value); - } - - static std::optional isSilentToJs(jsi::Runtime &rt, decltype(types.isSilent) value) { - return bridging::toJs(rt, value); - } - - static std::optional soundNameToJs(jsi::Runtime &rt, decltype(types.soundName) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.alertTitle) { - result.setProperty(rt, "alertTitle", bridging::toJs(rt, value.alertTitle.value(), jsInvoker)); - } - if (value.alertBody) { - result.setProperty(rt, "alertBody", bridging::toJs(rt, value.alertBody.value(), jsInvoker)); - } - if (value.userInfo) { - result.setProperty(rt, "userInfo", bridging::toJs(rt, value.userInfo.value(), jsInvoker)); - } - if (value.category) { - result.setProperty(rt, "category", bridging::toJs(rt, value.category.value(), jsInvoker)); - } - if (value.fireDate) { - result.setProperty(rt, "fireDate", bridging::toJs(rt, value.fireDate.value(), jsInvoker)); - } - if (value.fireIntervalSeconds) { - result.setProperty(rt, "fireIntervalSeconds", bridging::toJs(rt, value.fireIntervalSeconds.value(), jsInvoker)); - } - if (value.applicationIconBadgeNumber) { - result.setProperty(rt, "applicationIconBadgeNumber", bridging::toJs(rt, value.applicationIconBadgeNumber.value(), jsInvoker)); - } - if (value.isSilent) { - result.setProperty(rt, "isSilent", bridging::toJs(rt, value.isSilent.value(), jsInvoker)); - } - if (value.soundName) { - result.setProperty(rt, "soundName", bridging::toJs(rt, value.soundName.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativePushNotificationManagerIOSPermissions - -template -struct NativePushNotificationManagerIOSPermissions { - P0 alert; - P1 badge; - P2 sound; - bool operator==(const NativePushNotificationManagerIOSPermissions &other) const { - return alert == other.alert && badge == other.badge && sound == other.sound; - } -}; - -template -struct NativePushNotificationManagerIOSPermissionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "alert"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "badge"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "sound"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool alertToJs(jsi::Runtime &rt, decltype(types.alert) value) { - return bridging::toJs(rt, value); - } - - static bool badgeToJs(jsi::Runtime &rt, decltype(types.badge) value) { - return bridging::toJs(rt, value); - } - - static bool soundToJs(jsi::Runtime &rt, decltype(types.sound) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "alert", bridging::toJs(rt, value.alert, jsInvoker)); - result.setProperty(rt, "badge", bridging::toJs(rt, value.badge, jsInvoker)); - result.setProperty(rt, "sound", bridging::toJs(rt, value.sound, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePushNotificationManagerIOSCxxSpecJSI : public TurboModule { -protected: - NativePushNotificationManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void onFinishRemoteNotification(jsi::Runtime &rt, jsi::String notificationId, jsi::String fetchResult) = 0; - virtual void setApplicationIconBadgeNumber(jsi::Runtime &rt, double num) = 0; - virtual void getApplicationIconBadgeNumber(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual jsi::Value requestPermissions(jsi::Runtime &rt, jsi::Object permission) = 0; - virtual void abandonPermissions(jsi::Runtime &rt) = 0; - virtual void checkPermissions(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void presentLocalNotification(jsi::Runtime &rt, jsi::Object notification) = 0; - virtual void scheduleLocalNotification(jsi::Runtime &rt, jsi::Object notification) = 0; - virtual void cancelAllLocalNotifications(jsi::Runtime &rt) = 0; - virtual void cancelLocalNotifications(jsi::Runtime &rt, jsi::Object userInfo) = 0; - virtual jsi::Value getInitialNotification(jsi::Runtime &rt) = 0; - virtual void getScheduledLocalNotifications(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void removeAllDeliveredNotifications(jsi::Runtime &rt) = 0; - virtual void removeDeliveredNotifications(jsi::Runtime &rt, jsi::Array identifiers) = 0; - virtual void getDeliveredNotifications(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void getAuthorizationStatus(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventType) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativePushNotificationManagerIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PushNotificationManager"; - -protected: - NativePushNotificationManagerIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePushNotificationManagerIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePushNotificationManagerIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePushNotificationManagerIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void onFinishRemoteNotification(jsi::Runtime &rt, jsi::String notificationId, jsi::String fetchResult) override { - static_assert( - bridging::getParameterCount(&T::onFinishRemoteNotification) == 3, - "Expected onFinishRemoteNotification(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::onFinishRemoteNotification, jsInvoker_, instance_, std::move(notificationId), std::move(fetchResult)); - } - void setApplicationIconBadgeNumber(jsi::Runtime &rt, double num) override { - static_assert( - bridging::getParameterCount(&T::setApplicationIconBadgeNumber) == 2, - "Expected setApplicationIconBadgeNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setApplicationIconBadgeNumber, jsInvoker_, instance_, std::move(num)); - } - void getApplicationIconBadgeNumber(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getApplicationIconBadgeNumber) == 2, - "Expected getApplicationIconBadgeNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getApplicationIconBadgeNumber, jsInvoker_, instance_, std::move(callback)); - } - jsi::Value requestPermissions(jsi::Runtime &rt, jsi::Object permission) override { - static_assert( - bridging::getParameterCount(&T::requestPermissions) == 2, - "Expected requestPermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestPermissions, jsInvoker_, instance_, std::move(permission)); - } - void abandonPermissions(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::abandonPermissions) == 1, - "Expected abandonPermissions(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::abandonPermissions, jsInvoker_, instance_); - } - void checkPermissions(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::checkPermissions) == 2, - "Expected checkPermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::checkPermissions, jsInvoker_, instance_, std::move(callback)); - } - void presentLocalNotification(jsi::Runtime &rt, jsi::Object notification) override { - static_assert( - bridging::getParameterCount(&T::presentLocalNotification) == 2, - "Expected presentLocalNotification(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::presentLocalNotification, jsInvoker_, instance_, std::move(notification)); - } - void scheduleLocalNotification(jsi::Runtime &rt, jsi::Object notification) override { - static_assert( - bridging::getParameterCount(&T::scheduleLocalNotification) == 2, - "Expected scheduleLocalNotification(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::scheduleLocalNotification, jsInvoker_, instance_, std::move(notification)); - } - void cancelAllLocalNotifications(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cancelAllLocalNotifications) == 1, - "Expected cancelAllLocalNotifications(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cancelAllLocalNotifications, jsInvoker_, instance_); - } - void cancelLocalNotifications(jsi::Runtime &rt, jsi::Object userInfo) override { - static_assert( - bridging::getParameterCount(&T::cancelLocalNotifications) == 2, - "Expected cancelLocalNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::cancelLocalNotifications, jsInvoker_, instance_, std::move(userInfo)); - } - jsi::Value getInitialNotification(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialNotification) == 1, - "Expected getInitialNotification(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialNotification, jsInvoker_, instance_); - } - void getScheduledLocalNotifications(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getScheduledLocalNotifications) == 2, - "Expected getScheduledLocalNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getScheduledLocalNotifications, jsInvoker_, instance_, std::move(callback)); - } - void removeAllDeliveredNotifications(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::removeAllDeliveredNotifications) == 1, - "Expected removeAllDeliveredNotifications(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::removeAllDeliveredNotifications, jsInvoker_, instance_); - } - void removeDeliveredNotifications(jsi::Runtime &rt, jsi::Array identifiers) override { - static_assert( - bridging::getParameterCount(&T::removeDeliveredNotifications) == 2, - "Expected removeDeliveredNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeDeliveredNotifications, jsInvoker_, instance_, std::move(identifiers)); - } - void getDeliveredNotifications(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getDeliveredNotifications) == 2, - "Expected getDeliveredNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getDeliveredNotifications, jsInvoker_, instance_, std::move(callback)); - } - void getAuthorizationStatus(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getAuthorizationStatus) == 2, - "Expected getAuthorizationStatus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getAuthorizationStatus, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventType) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventType)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativePushNotificationManagerIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeRedBoxCxxSpecJSI : public TurboModule { -protected: - NativeRedBoxCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::String forIdentifier) = 0; - virtual void dismiss(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeRedBoxCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "RedBox"; - -protected: - NativeRedBoxCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeRedBoxCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeRedBoxCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeRedBoxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::String forIdentifier) override { - static_assert( - bridging::getParameterCount(&T::setExtraData) == 3, - "Expected setExtraData(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setExtraData, jsInvoker_, instance_, std::move(extraData), std::move(forIdentifier)); - } - void dismiss(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismiss) == 1, - "Expected dismiss(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismiss, jsInvoker_, instance_); - } - - private: - friend class NativeRedBoxCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - -#pragma mark - NativeSampleTurboModuleEnumInt - -enum class NativeSampleTurboModuleEnumInt { A, B }; - -template <> -struct Bridging { - static NativeSampleTurboModuleEnumInt fromJs(jsi::Runtime &rt, const jsi::Value &rawValue) { - double value = (double)rawValue.asNumber(); - if (value == 23) { - return NativeSampleTurboModuleEnumInt::A; - } else if (value == 42) { - return NativeSampleTurboModuleEnumInt::B; - } else { - throw jsi::JSError(rt, "No appropriate enum member found for value in NativeSampleTurboModuleEnumInt"); - } - } - - static jsi::Value toJs(jsi::Runtime &rt, NativeSampleTurboModuleEnumInt value) { - if (value == NativeSampleTurboModuleEnumInt::A) { - return bridging::toJs(rt, 23); - } else if (value == NativeSampleTurboModuleEnumInt::B) { - return bridging::toJs(rt, 42); - } else { - throw jsi::JSError(rt, "No appropriate enum member found for enum value in NativeSampleTurboModuleEnumInt"); - } - } -}; - -#pragma mark - NativeSampleTurboModuleObjectStruct - -template -struct NativeSampleTurboModuleObjectStruct { - P0 a; - P1 b; - P2 c; - bool operator==(const NativeSampleTurboModuleObjectStruct &other) const { - return a == other.a && b == other.b && c == other.c; - } -}; - -template -struct NativeSampleTurboModuleObjectStructBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "a"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "b"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "c"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double aToJs(jsi::Runtime &rt, decltype(types.a) value) { - return bridging::toJs(rt, value); - } - - static jsi::String bToJs(jsi::Runtime &rt, decltype(types.b) value) { - return bridging::toJs(rt, value); - } - - static std::optional cToJs(jsi::Runtime &rt, decltype(types.c) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "a", bridging::toJs(rt, value.a, jsInvoker)); - result.setProperty(rt, "b", bridging::toJs(rt, value.b, jsInvoker)); - if (value.c) { - result.setProperty(rt, "c", bridging::toJs(rt, value.c.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeSampleTurboModuleCxxSpecJSI : public TurboModule { -protected: - NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void voidFunc(jsi::Runtime &rt) = 0; - virtual bool getBool(jsi::Runtime &rt, bool arg) = 0; - virtual jsi::Value getEnum(jsi::Runtime &rt, jsi::Value arg) = 0; - virtual double getNumber(jsi::Runtime &rt, double arg) = 0; - virtual jsi::String getString(jsi::Runtime &rt, jsi::String arg) = 0; - virtual jsi::Array getArray(jsi::Runtime &rt, jsi::Array arg) = 0; - virtual jsi::Object getObject(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual jsi::Object getUnsafeObject(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual double getRootTag(jsi::Runtime &rt, double arg) = 0; - virtual jsi::Object getValue(jsi::Runtime &rt, double x, jsi::String y, jsi::Object z) = 0; - virtual void getValueWithCallback(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual jsi::Value getValueWithPromise(jsi::Runtime &rt, bool error) = 0; - virtual void voidFuncThrows(jsi::Runtime &rt) = 0; - virtual jsi::Object getObjectThrows(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual jsi::Value promiseThrows(jsi::Runtime &rt) = 0; - virtual void voidFuncAssert(jsi::Runtime &rt) = 0; - virtual jsi::Object getObjectAssert(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual jsi::Value promiseAssert(jsi::Runtime &rt) = 0; - virtual jsi::Value getImageUrl(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSampleTurboModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SampleTurboModule"; - -protected: - NativeSampleTurboModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSampleTurboModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - void emitOnPress() { - static_cast&>(*delegate_.eventEmitterMap_["onPress"]).emit(); - } - - template void emitOnClick(OnClickType value) { - static_assert(bridging::supportsFromJs, "value cannnot be converted to jsi::String"); - static_cast&>(*delegate_.eventEmitterMap_["onClick"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value { - return bridging::toJs(rt, eventValue, jsInvoker); - }); - } - - template void emitOnChange(OnChangeType value) { - static_assert(bridging::supportsFromJs, "value cannnot be converted to jsi::Object"); - static_cast&>(*delegate_.eventEmitterMap_["onChange"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value { - return bridging::toJs(rt, eventValue, jsInvoker); - }); - } - - template void emitOnSubmit(std::vector value) { - static_assert(bridging::supportsFromJs, jsi::Array>, "value cannnot be converted to jsi::Array"); - static_cast&>(*delegate_.eventEmitterMap_["onSubmit"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value { - return bridging::toJs(rt, eventValue, jsInvoker); - }); - } - -private: - class Delegate : public NativeSampleTurboModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSampleTurboModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - eventEmitterMap_["onPress"] = std::make_shared>(); - eventEmitterMap_["onClick"] = std::make_shared>(); - eventEmitterMap_["onChange"] = std::make_shared>(); - eventEmitterMap_["onSubmit"] = std::make_shared>(); - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void voidFunc(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::voidFunc) == 1, - "Expected voidFunc(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::voidFunc, jsInvoker_, instance_); - } - bool getBool(jsi::Runtime &rt, bool arg) override { - static_assert( - bridging::getParameterCount(&T::getBool) == 2, - "Expected getBool(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getBool, jsInvoker_, instance_, std::move(arg)); - } - jsi::Value getEnum(jsi::Runtime &rt, jsi::Value arg) override { - static_assert( - bridging::getParameterCount(&T::getEnum) == 2, - "Expected getEnum(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getEnum, jsInvoker_, instance_, std::move(arg)); - } - double getNumber(jsi::Runtime &rt, double arg) override { - static_assert( - bridging::getParameterCount(&T::getNumber) == 2, - "Expected getNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getNumber, jsInvoker_, instance_, std::move(arg)); - } - jsi::String getString(jsi::Runtime &rt, jsi::String arg) override { - static_assert( - bridging::getParameterCount(&T::getString) == 2, - "Expected getString(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getString, jsInvoker_, instance_, std::move(arg)); - } - jsi::Array getArray(jsi::Runtime &rt, jsi::Array arg) override { - static_assert( - bridging::getParameterCount(&T::getArray) == 2, - "Expected getArray(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getArray, jsInvoker_, instance_, std::move(arg)); - } - jsi::Object getObject(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getObject) == 2, - "Expected getObject(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getObject, jsInvoker_, instance_, std::move(arg)); - } - jsi::Object getUnsafeObject(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getUnsafeObject) == 2, - "Expected getUnsafeObject(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getUnsafeObject, jsInvoker_, instance_, std::move(arg)); - } - double getRootTag(jsi::Runtime &rt, double arg) override { - static_assert( - bridging::getParameterCount(&T::getRootTag) == 2, - "Expected getRootTag(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getRootTag, jsInvoker_, instance_, std::move(arg)); - } - jsi::Object getValue(jsi::Runtime &rt, double x, jsi::String y, jsi::Object z) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 4, - "Expected getValue(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(x), std::move(y), std::move(z)); - } - void getValueWithCallback(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getValueWithCallback) == 2, - "Expected getValueWithCallback(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getValueWithCallback, jsInvoker_, instance_, std::move(callback)); - } - jsi::Value getValueWithPromise(jsi::Runtime &rt, bool error) override { - static_assert( - bridging::getParameterCount(&T::getValueWithPromise) == 2, - "Expected getValueWithPromise(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getValueWithPromise, jsInvoker_, instance_, std::move(error)); - } - void voidFuncThrows(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::voidFuncThrows) == 1, - "Expected voidFuncThrows(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::voidFuncThrows, jsInvoker_, instance_); - } - jsi::Object getObjectThrows(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getObjectThrows) == 2, - "Expected getObjectThrows(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getObjectThrows, jsInvoker_, instance_, std::move(arg)); - } - jsi::Value promiseThrows(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::promiseThrows) == 1, - "Expected promiseThrows(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::promiseThrows, jsInvoker_, instance_); - } - void voidFuncAssert(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::voidFuncAssert) == 1, - "Expected voidFuncAssert(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::voidFuncAssert, jsInvoker_, instance_); - } - jsi::Object getObjectAssert(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getObjectAssert) == 2, - "Expected getObjectAssert(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getObjectAssert, jsInvoker_, instance_, std::move(arg)); - } - jsi::Value promiseAssert(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::promiseAssert) == 1, - "Expected promiseAssert(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::promiseAssert, jsInvoker_, instance_); - } - jsi::Value getImageUrl(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getImageUrl) == 1, - "Expected getImageUrl(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getImageUrl, jsInvoker_, instance_); - } - - private: - friend class NativeSampleTurboModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSegmentFetcherCxxSpecJSI : public TurboModule { -protected: - NativeSegmentFetcherCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void fetchSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) = 0; - virtual void getSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) = 0; - -}; - -template -class JSI_EXPORT NativeSegmentFetcherCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SegmentFetcher"; - -protected: - NativeSegmentFetcherCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSegmentFetcherCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSegmentFetcherCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSegmentFetcherCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void fetchSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::fetchSegment) == 4, - "Expected fetchSegment(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::fetchSegment, jsInvoker_, instance_, std::move(segmentId), std::move(options), std::move(callback)); - } - void getSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getSegment) == 4, - "Expected getSegment(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getSegment, jsInvoker_, instance_, std::move(segmentId), std::move(options), std::move(callback)); - } - - private: - friend class NativeSegmentFetcherCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSettingsManagerCxxSpecJSI : public TurboModule { -protected: - NativeSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void setValues(jsi::Runtime &rt, jsi::Object values) = 0; - virtual void deleteValues(jsi::Runtime &rt, jsi::Array values) = 0; - -}; - -template -class JSI_EXPORT NativeSettingsManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SettingsManager"; - -protected: - NativeSettingsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSettingsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSettingsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSettingsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void setValues(jsi::Runtime &rt, jsi::Object values) override { - static_assert( - bridging::getParameterCount(&T::setValues) == 2, - "Expected setValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setValues, jsInvoker_, instance_, std::move(values)); - } - void deleteValues(jsi::Runtime &rt, jsi::Array values) override { - static_assert( - bridging::getParameterCount(&T::deleteValues) == 2, - "Expected deleteValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::deleteValues, jsInvoker_, instance_, std::move(values)); - } - - private: - friend class NativeSettingsManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeShareModuleCxxSpecJSI : public TurboModule { -protected: - NativeShareModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value share(jsi::Runtime &rt, jsi::Object content, std::optional dialogTitle) = 0; - -}; - -template -class JSI_EXPORT NativeShareModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ShareModule"; - -protected: - NativeShareModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeShareModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeShareModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeShareModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value share(jsi::Runtime &rt, jsi::Object content, std::optional dialogTitle) override { - static_assert( - bridging::getParameterCount(&T::share) == 3, - "Expected share(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::share, jsInvoker_, instance_, std::move(content), std::move(dialogTitle)); - } - - private: - friend class NativeShareModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSoundManagerCxxSpecJSI : public TurboModule { -protected: - NativeSoundManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void playTouchSound(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSoundManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SoundManager"; - -protected: - NativeSoundManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSoundManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSoundManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSoundManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void playTouchSound(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::playTouchSound) == 1, - "Expected playTouchSound(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::playTouchSound, jsInvoker_, instance_); - } - - private: - friend class NativeSoundManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeSourceCodeSourceCodeConstants - -template -struct NativeSourceCodeSourceCodeConstants { - P0 scriptURL; - bool operator==(const NativeSourceCodeSourceCodeConstants &other) const { - return scriptURL == other.scriptURL; - } -}; - -template -struct NativeSourceCodeSourceCodeConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "scriptURL"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String scriptURLToJs(jsi::Runtime &rt, decltype(types.scriptURL) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "scriptURL", bridging::toJs(rt, value.scriptURL, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeSourceCodeCxxSpecJSI : public TurboModule { -protected: - NativeSourceCodeCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSourceCodeCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SourceCode"; - -protected: - NativeSourceCodeCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSourceCodeCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSourceCodeCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSourceCodeCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativeSourceCodeCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeStatusBarManagerAndroidCxxSpecJSI : public TurboModule { -protected: - NativeStatusBarManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void setColor(jsi::Runtime &rt, double color, bool animated) = 0; - virtual void setTranslucent(jsi::Runtime &rt, bool translucent) = 0; - virtual void setStyle(jsi::Runtime &rt, std::optional statusBarStyle) = 0; - virtual void setHidden(jsi::Runtime &rt, bool hidden) = 0; - -}; - -template -class JSI_EXPORT NativeStatusBarManagerAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "StatusBarManager"; - -protected: - NativeStatusBarManagerAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeStatusBarManagerAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeStatusBarManagerAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeStatusBarManagerAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void setColor(jsi::Runtime &rt, double color, bool animated) override { - static_assert( - bridging::getParameterCount(&T::setColor) == 3, - "Expected setColor(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setColor, jsInvoker_, instance_, std::move(color), std::move(animated)); - } - void setTranslucent(jsi::Runtime &rt, bool translucent) override { - static_assert( - bridging::getParameterCount(&T::setTranslucent) == 2, - "Expected setTranslucent(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setTranslucent, jsInvoker_, instance_, std::move(translucent)); - } - void setStyle(jsi::Runtime &rt, std::optional statusBarStyle) override { - static_assert( - bridging::getParameterCount(&T::setStyle) == 2, - "Expected setStyle(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setStyle, jsInvoker_, instance_, std::move(statusBarStyle)); - } - void setHidden(jsi::Runtime &rt, bool hidden) override { - static_assert( - bridging::getParameterCount(&T::setHidden) == 2, - "Expected setHidden(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHidden, jsInvoker_, instance_, std::move(hidden)); - } - - private: - friend class NativeStatusBarManagerAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeStatusBarManagerIOSCxxSpecJSI : public TurboModule { -protected: - NativeStatusBarManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getHeight(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void setNetworkActivityIndicatorVisible(jsi::Runtime &rt, bool visible) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventType) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void setStyle(jsi::Runtime &rt, std::optional statusBarStyle, bool animated) = 0; - virtual void setHidden(jsi::Runtime &rt, bool hidden, jsi::String withAnimation) = 0; - -}; - -template -class JSI_EXPORT NativeStatusBarManagerIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "StatusBarManager"; - -protected: - NativeStatusBarManagerIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeStatusBarManagerIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeStatusBarManagerIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeStatusBarManagerIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getHeight(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getHeight) == 2, - "Expected getHeight(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getHeight, jsInvoker_, instance_, std::move(callback)); - } - void setNetworkActivityIndicatorVisible(jsi::Runtime &rt, bool visible) override { - static_assert( - bridging::getParameterCount(&T::setNetworkActivityIndicatorVisible) == 2, - "Expected setNetworkActivityIndicatorVisible(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setNetworkActivityIndicatorVisible, jsInvoker_, instance_, std::move(visible)); - } - void addListener(jsi::Runtime &rt, jsi::String eventType) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventType)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void setStyle(jsi::Runtime &rt, std::optional statusBarStyle, bool animated) override { - static_assert( - bridging::getParameterCount(&T::setStyle) == 3, - "Expected setStyle(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setStyle, jsInvoker_, instance_, std::move(statusBarStyle), std::move(animated)); - } - void setHidden(jsi::Runtime &rt, bool hidden, jsi::String withAnimation) override { - static_assert( - bridging::getParameterCount(&T::setHidden) == 3, - "Expected setHidden(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setHidden, jsInvoker_, instance_, std::move(hidden), std::move(withAnimation)); - } - - private: - friend class NativeStatusBarManagerIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeTimingCxxSpecJSI : public TurboModule { -protected: - NativeTimingCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void createTimer(jsi::Runtime &rt, double callbackID, double duration, double jsSchedulingTime, bool repeats) = 0; - virtual void deleteTimer(jsi::Runtime &rt, double timerID) = 0; - virtual void setSendIdleEvents(jsi::Runtime &rt, bool sendIdleEvents) = 0; - -}; - -template -class JSI_EXPORT NativeTimingCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Timing"; - -protected: - NativeTimingCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeTimingCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeTimingCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeTimingCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void createTimer(jsi::Runtime &rt, double callbackID, double duration, double jsSchedulingTime, bool repeats) override { - static_assert( - bridging::getParameterCount(&T::createTimer) == 5, - "Expected createTimer(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::createTimer, jsInvoker_, instance_, std::move(callbackID), std::move(duration), std::move(jsSchedulingTime), std::move(repeats)); - } - void deleteTimer(jsi::Runtime &rt, double timerID) override { - static_assert( - bridging::getParameterCount(&T::deleteTimer) == 2, - "Expected deleteTimer(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::deleteTimer, jsInvoker_, instance_, std::move(timerID)); - } - void setSendIdleEvents(jsi::Runtime &rt, bool sendIdleEvents) override { - static_assert( - bridging::getParameterCount(&T::setSendIdleEvents) == 2, - "Expected setSendIdleEvents(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setSendIdleEvents, jsInvoker_, instance_, std::move(sendIdleEvents)); - } - - private: - friend class NativeTimingCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeToastAndroidCxxSpecJSI : public TurboModule { -protected: - NativeToastAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void show(jsi::Runtime &rt, jsi::String message, double duration) = 0; - virtual void showWithGravity(jsi::Runtime &rt, jsi::String message, double duration, double gravity) = 0; - virtual void showWithGravityAndOffset(jsi::Runtime &rt, jsi::String message, double duration, double gravity, double xOffset, double yOffset) = 0; - -}; - -template -class JSI_EXPORT NativeToastAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ToastAndroid"; - -protected: - NativeToastAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeToastAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeToastAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeToastAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void show(jsi::Runtime &rt, jsi::String message, double duration) override { - static_assert( - bridging::getParameterCount(&T::show) == 3, - "Expected show(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_, std::move(message), std::move(duration)); - } - void showWithGravity(jsi::Runtime &rt, jsi::String message, double duration, double gravity) override { - static_assert( - bridging::getParameterCount(&T::showWithGravity) == 4, - "Expected showWithGravity(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showWithGravity, jsInvoker_, instance_, std::move(message), std::move(duration), std::move(gravity)); - } - void showWithGravityAndOffset(jsi::Runtime &rt, jsi::String message, double duration, double gravity, double xOffset, double yOffset) override { - static_assert( - bridging::getParameterCount(&T::showWithGravityAndOffset) == 6, - "Expected showWithGravityAndOffset(...) to have 6 parameters"); - - return bridging::callFromJs( - rt, &T::showWithGravityAndOffset, jsInvoker_, instance_, std::move(message), std::move(duration), std::move(gravity), std::move(xOffset), std::move(yOffset)); - } - - private: - friend class NativeToastAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeUIManagerCxxSpecJSI : public TurboModule { -protected: - NativeUIManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void createView(jsi::Runtime &rt, double reactTag, jsi::String viewName, double rootTag, jsi::Object props) = 0; - virtual void updateView(jsi::Runtime &rt, double reactTag, jsi::String viewName, jsi::Object props) = 0; - virtual void findSubviewIn(jsi::Runtime &rt, double reactTag, jsi::Array point, jsi::Function callback) = 0; - virtual void dispatchViewManagerCommand(jsi::Runtime &rt, double reactTag, double commandID, std::optional commandArgs) = 0; - virtual void measure(jsi::Runtime &rt, double reactTag, jsi::Function callback) = 0; - virtual void measureInWindow(jsi::Runtime &rt, double reactTag, jsi::Function callback) = 0; - virtual void viewIsDescendantOf(jsi::Runtime &rt, double reactTag, double ancestorReactTag, jsi::Function callback) = 0; - virtual void measureLayout(jsi::Runtime &rt, double reactTag, double ancestorReactTag, jsi::Function errorCallback, jsi::Function callback) = 0; - virtual void measureLayoutRelativeToParent(jsi::Runtime &rt, double reactTag, jsi::Function errorCallback, jsi::Function callback) = 0; - virtual void setJSResponder(jsi::Runtime &rt, double reactTag, bool blockNativeResponder) = 0; - virtual void clearJSResponder(jsi::Runtime &rt) = 0; - virtual void configureNextLayoutAnimation(jsi::Runtime &rt, jsi::Object config, jsi::Function callback, jsi::Function errorCallback) = 0; - virtual void setChildren(jsi::Runtime &rt, double containerTag, jsi::Array reactTags) = 0; - virtual void manageChildren(jsi::Runtime &rt, double containerTag, jsi::Array moveFromIndices, jsi::Array moveToIndices, jsi::Array addChildReactTags, jsi::Array addAtIndices, jsi::Array removeAtIndices) = 0; - virtual std::optional getConstantsForViewManager(jsi::Runtime &rt, jsi::String viewManagerName) = 0; - virtual jsi::Array getDefaultEventTypes(jsi::Runtime &rt) = 0; - virtual void setLayoutAnimationEnabledExperimental(jsi::Runtime &rt, bool enabled) = 0; - virtual void sendAccessibilityEvent(jsi::Runtime &rt, double reactTag, double eventType) = 0; - virtual jsi::Object lazilyLoadView(jsi::Runtime &rt, jsi::String name) = 0; - virtual void focus(jsi::Runtime &rt, double reactTag) = 0; - virtual void blur(jsi::Runtime &rt, double reactTag) = 0; - -}; - -template -class JSI_EXPORT NativeUIManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "UIManager"; - -protected: - NativeUIManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeUIManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeUIManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeUIManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void createView(jsi::Runtime &rt, double reactTag, jsi::String viewName, double rootTag, jsi::Object props) override { - static_assert( - bridging::getParameterCount(&T::createView) == 5, - "Expected createView(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::createView, jsInvoker_, instance_, std::move(reactTag), std::move(viewName), std::move(rootTag), std::move(props)); - } - void updateView(jsi::Runtime &rt, double reactTag, jsi::String viewName, jsi::Object props) override { - static_assert( - bridging::getParameterCount(&T::updateView) == 4, - "Expected updateView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::updateView, jsInvoker_, instance_, std::move(reactTag), std::move(viewName), std::move(props)); - } - void findSubviewIn(jsi::Runtime &rt, double reactTag, jsi::Array point, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::findSubviewIn) == 4, - "Expected findSubviewIn(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::findSubviewIn, jsInvoker_, instance_, std::move(reactTag), std::move(point), std::move(callback)); - } - void dispatchViewManagerCommand(jsi::Runtime &rt, double reactTag, double commandID, std::optional commandArgs) override { - static_assert( - bridging::getParameterCount(&T::dispatchViewManagerCommand) == 4, - "Expected dispatchViewManagerCommand(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::dispatchViewManagerCommand, jsInvoker_, instance_, std::move(reactTag), std::move(commandID), std::move(commandArgs)); - } - void measure(jsi::Runtime &rt, double reactTag, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measure) == 3, - "Expected measure(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::measure, jsInvoker_, instance_, std::move(reactTag), std::move(callback)); - } - void measureInWindow(jsi::Runtime &rt, double reactTag, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measureInWindow) == 3, - "Expected measureInWindow(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::measureInWindow, jsInvoker_, instance_, std::move(reactTag), std::move(callback)); - } - void viewIsDescendantOf(jsi::Runtime &rt, double reactTag, double ancestorReactTag, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::viewIsDescendantOf) == 4, - "Expected viewIsDescendantOf(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::viewIsDescendantOf, jsInvoker_, instance_, std::move(reactTag), std::move(ancestorReactTag), std::move(callback)); - } - void measureLayout(jsi::Runtime &rt, double reactTag, double ancestorReactTag, jsi::Function errorCallback, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measureLayout) == 5, - "Expected measureLayout(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::measureLayout, jsInvoker_, instance_, std::move(reactTag), std::move(ancestorReactTag), std::move(errorCallback), std::move(callback)); - } - void measureLayoutRelativeToParent(jsi::Runtime &rt, double reactTag, jsi::Function errorCallback, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measureLayoutRelativeToParent) == 4, - "Expected measureLayoutRelativeToParent(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::measureLayoutRelativeToParent, jsInvoker_, instance_, std::move(reactTag), std::move(errorCallback), std::move(callback)); - } - void setJSResponder(jsi::Runtime &rt, double reactTag, bool blockNativeResponder) override { - static_assert( - bridging::getParameterCount(&T::setJSResponder) == 3, - "Expected setJSResponder(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setJSResponder, jsInvoker_, instance_, std::move(reactTag), std::move(blockNativeResponder)); - } - void clearJSResponder(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::clearJSResponder) == 1, - "Expected clearJSResponder(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::clearJSResponder, jsInvoker_, instance_); - } - void configureNextLayoutAnimation(jsi::Runtime &rt, jsi::Object config, jsi::Function callback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::configureNextLayoutAnimation) == 4, - "Expected configureNextLayoutAnimation(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::configureNextLayoutAnimation, jsInvoker_, instance_, std::move(config), std::move(callback), std::move(errorCallback)); - } - void setChildren(jsi::Runtime &rt, double containerTag, jsi::Array reactTags) override { - static_assert( - bridging::getParameterCount(&T::setChildren) == 3, - "Expected setChildren(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setChildren, jsInvoker_, instance_, std::move(containerTag), std::move(reactTags)); - } - void manageChildren(jsi::Runtime &rt, double containerTag, jsi::Array moveFromIndices, jsi::Array moveToIndices, jsi::Array addChildReactTags, jsi::Array addAtIndices, jsi::Array removeAtIndices) override { - static_assert( - bridging::getParameterCount(&T::manageChildren) == 7, - "Expected manageChildren(...) to have 7 parameters"); - - return bridging::callFromJs( - rt, &T::manageChildren, jsInvoker_, instance_, std::move(containerTag), std::move(moveFromIndices), std::move(moveToIndices), std::move(addChildReactTags), std::move(addAtIndices), std::move(removeAtIndices)); - } - std::optional getConstantsForViewManager(jsi::Runtime &rt, jsi::String viewManagerName) override { - static_assert( - bridging::getParameterCount(&T::getConstantsForViewManager) == 2, - "Expected getConstantsForViewManager(...) to have 2 parameters"); - - return bridging::callFromJs>( - rt, &T::getConstantsForViewManager, jsInvoker_, instance_, std::move(viewManagerName)); - } - jsi::Array getDefaultEventTypes(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getDefaultEventTypes) == 1, - "Expected getDefaultEventTypes(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getDefaultEventTypes, jsInvoker_, instance_); - } - void setLayoutAnimationEnabledExperimental(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setLayoutAnimationEnabledExperimental) == 2, - "Expected setLayoutAnimationEnabledExperimental(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setLayoutAnimationEnabledExperimental, jsInvoker_, instance_, std::move(enabled)); - } - void sendAccessibilityEvent(jsi::Runtime &rt, double reactTag, double eventType) override { - static_assert( - bridging::getParameterCount(&T::sendAccessibilityEvent) == 3, - "Expected sendAccessibilityEvent(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendAccessibilityEvent, jsInvoker_, instance_, std::move(reactTag), std::move(eventType)); - } - jsi::Object lazilyLoadView(jsi::Runtime &rt, jsi::String name) override { - static_assert( - bridging::getParameterCount(&T::lazilyLoadView) == 2, - "Expected lazilyLoadView(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::lazilyLoadView, jsInvoker_, instance_, std::move(name)); - } - void focus(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::focus) == 2, - "Expected focus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::focus, jsInvoker_, instance_, std::move(reactTag)); - } - void blur(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::blur) == 2, - "Expected blur(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::blur, jsInvoker_, instance_, std::move(reactTag)); - } - - private: - friend class NativeUIManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeVibrationCxxSpecJSI : public TurboModule { -protected: - NativeVibrationCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void vibrate(jsi::Runtime &rt, double pattern) = 0; - virtual void vibrateByPattern(jsi::Runtime &rt, jsi::Array pattern, double repeat) = 0; - virtual void cancel(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeVibrationCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Vibration"; - -protected: - NativeVibrationCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeVibrationCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeVibrationCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeVibrationCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void vibrate(jsi::Runtime &rt, double pattern) override { - static_assert( - bridging::getParameterCount(&T::vibrate) == 2, - "Expected vibrate(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::vibrate, jsInvoker_, instance_, std::move(pattern)); - } - void vibrateByPattern(jsi::Runtime &rt, jsi::Array pattern, double repeat) override { - static_assert( - bridging::getParameterCount(&T::vibrateByPattern) == 3, - "Expected vibrateByPattern(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::vibrateByPattern, jsInvoker_, instance_, std::move(pattern), std::move(repeat)); - } - void cancel(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cancel) == 1, - "Expected cancel(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cancel, jsInvoker_, instance_); - } - - private: - friend class NativeVibrationCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeWebSocketModuleCxxSpecJSI : public TurboModule { -protected: - NativeWebSocketModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void connect(jsi::Runtime &rt, jsi::String url, std::optional protocols, jsi::Object options, double socketID) = 0; - virtual void send(jsi::Runtime &rt, jsi::String message, double forSocketID) = 0; - virtual void sendBinary(jsi::Runtime &rt, jsi::String base64String, double forSocketID) = 0; - virtual void ping(jsi::Runtime &rt, double socketID) = 0; - virtual void close(jsi::Runtime &rt, double code, jsi::String reason, double socketID) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeWebSocketModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "WebSocketModule"; - -protected: - NativeWebSocketModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeWebSocketModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeWebSocketModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeWebSocketModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void connect(jsi::Runtime &rt, jsi::String url, std::optional protocols, jsi::Object options, double socketID) override { - static_assert( - bridging::getParameterCount(&T::connect) == 5, - "Expected connect(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(url), std::move(protocols), std::move(options), std::move(socketID)); - } - void send(jsi::Runtime &rt, jsi::String message, double forSocketID) override { - static_assert( - bridging::getParameterCount(&T::send) == 3, - "Expected send(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::send, jsInvoker_, instance_, std::move(message), std::move(forSocketID)); - } - void sendBinary(jsi::Runtime &rt, jsi::String base64String, double forSocketID) override { - static_assert( - bridging::getParameterCount(&T::sendBinary) == 3, - "Expected sendBinary(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendBinary, jsInvoker_, instance_, std::move(base64String), std::move(forSocketID)); - } - void ping(jsi::Runtime &rt, double socketID) override { - static_assert( - bridging::getParameterCount(&T::ping) == 2, - "Expected ping(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::ping, jsInvoker_, instance_, std::move(socketID)); - } - void close(jsi::Runtime &rt, double code, jsi::String reason, double socketID) override { - static_assert( - bridging::getParameterCount(&T::close) == 4, - "Expected close(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::close, jsInvoker_, instance_, std::move(code), std::move(reason), std::move(socketID)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeWebSocketModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevMenuCxxSpecJSI : public TurboModule { -protected: - NativeDevMenuCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void show(jsi::Runtime &rt) = 0; - virtual void reload(jsi::Runtime &rt) = 0; - virtual void setProfilingEnabled(jsi::Runtime &rt, bool enabled) = 0; - virtual void setHotLoadingEnabled(jsi::Runtime &rt, bool enabled) = 0; - -}; - -template -class JSI_EXPORT NativeDevMenuCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DevMenu"; - -protected: - NativeDevMenuCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevMenuCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDevMenuCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevMenuCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void show(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::show) == 1, - "Expected show(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_); - } - void reload(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::reload) == 1, - "Expected reload(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::reload, jsInvoker_, instance_); - } - void setProfilingEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setProfilingEnabled) == 2, - "Expected setProfilingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setProfilingEnabled, jsInvoker_, instance_, std::move(enabled)); - } - void setHotLoadingEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setHotLoadingEnabled) == 2, - "Expected setHotLoadingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHotLoadingEnabled, jsInvoker_, instance_, std::move(enabled)); - } - - private: - friend class NativeDevMenuCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfig - -template -struct NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfig { - P0 shouldReloadAndProfile; - P1 recordChangeDescriptions; - bool operator==(const NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfig &other) const { - return shouldReloadAndProfile == other.shouldReloadAndProfile && recordChangeDescriptions == other.recordChangeDescriptions; - } -}; - -template -struct NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfigBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "shouldReloadAndProfile"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "recordChangeDescriptions"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool shouldReloadAndProfileToJs(jsi::Runtime &rt, decltype(types.shouldReloadAndProfile) value) { - return bridging::toJs(rt, value); - } - - static bool recordChangeDescriptionsToJs(jsi::Runtime &rt, decltype(types.recordChangeDescriptions) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.shouldReloadAndProfile) { - result.setProperty(rt, "shouldReloadAndProfile", bridging::toJs(rt, value.shouldReloadAndProfile.value(), jsInvoker)); - } - if (value.recordChangeDescriptions) { - result.setProperty(rt, "recordChangeDescriptions", bridging::toJs(rt, value.recordChangeDescriptions.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeReactDevToolsRuntimeSettingsModuleReloadAndProfileConfig - -template -struct NativeReactDevToolsRuntimeSettingsModuleReloadAndProfileConfig { - P0 shouldReloadAndProfile; - P1 recordChangeDescriptions; - bool operator==(const NativeReactDevToolsRuntimeSettingsModuleReloadAndProfileConfig &other) const { - return shouldReloadAndProfile == other.shouldReloadAndProfile && recordChangeDescriptions == other.recordChangeDescriptions; - } -}; - -template -struct NativeReactDevToolsRuntimeSettingsModuleReloadAndProfileConfigBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "shouldReloadAndProfile"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "recordChangeDescriptions"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool shouldReloadAndProfileToJs(jsi::Runtime &rt, decltype(types.shouldReloadAndProfile) value) { - return bridging::toJs(rt, value); - } - - static bool recordChangeDescriptionsToJs(jsi::Runtime &rt, decltype(types.recordChangeDescriptions) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "shouldReloadAndProfile", bridging::toJs(rt, value.shouldReloadAndProfile, jsInvoker)); - result.setProperty(rt, "recordChangeDescriptions", bridging::toJs(rt, value.recordChangeDescriptions, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI : public TurboModule { -protected: - NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setReloadAndProfileConfig(jsi::Runtime &rt, jsi::Object config) = 0; - virtual jsi::Object getReloadAndProfileConfig(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeReactDevToolsRuntimeSettingsModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ReactDevToolsRuntimeSettingsModule"; - -protected: - NativeReactDevToolsRuntimeSettingsModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeReactDevToolsRuntimeSettingsModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void setReloadAndProfileConfig(jsi::Runtime &rt, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::setReloadAndProfileConfig) == 2, - "Expected setReloadAndProfileConfig(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setReloadAndProfileConfig, jsInvoker_, instance_, std::move(config)); - } - jsi::Object getReloadAndProfileConfig(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getReloadAndProfileConfig) == 1, - "Expected getReloadAndProfileConfig(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getReloadAndProfileConfig, jsInvoker_, instance_); - } - - private: - friend class NativeReactDevToolsRuntimeSettingsModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeReactDevToolsSettingsManagerCxxSpecJSI : public TurboModule { -protected: - NativeReactDevToolsSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setGlobalHookSettings(jsi::Runtime &rt, jsi::String settings) = 0; - virtual std::optional getGlobalHookSettings(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeReactDevToolsSettingsManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ReactDevToolsSettingsManager"; - -protected: - NativeReactDevToolsSettingsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeReactDevToolsSettingsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeReactDevToolsSettingsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeReactDevToolsSettingsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void setGlobalHookSettings(jsi::Runtime &rt, jsi::String settings) override { - static_assert( - bridging::getParameterCount(&T::setGlobalHookSettings) == 2, - "Expected setGlobalHookSettings(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setGlobalHookSettings, jsInvoker_, instance_, std::move(settings)); - } - std::optional getGlobalHookSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getGlobalHookSettings) == 1, - "Expected getGlobalHookSettings(...) to have 1 parameters"); - - return bridging::callFromJs>( - rt, &T::getGlobalHookSettings, jsInvoker_, instance_); - } - - private: - friend class NativeReactDevToolsSettingsManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeIdleCallbacksIdleDeadline - -template -struct NativeIdleCallbacksIdleDeadline { - P0 didTimeout; - P1 timeRemaining; - bool operator==(const NativeIdleCallbacksIdleDeadline &other) const { - return didTimeout == other.didTimeout && timeRemaining == other.timeRemaining; - } -}; - -template -struct NativeIdleCallbacksIdleDeadlineBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "didTimeout"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "timeRemaining"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool didTimeoutToJs(jsi::Runtime &rt, decltype(types.didTimeout) value) { - return bridging::toJs(rt, value); - } - - static jsi::Function timeRemainingToJs(jsi::Runtime &rt, decltype(types.timeRemaining) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "didTimeout", bridging::toJs(rt, value.didTimeout, jsInvoker)); - result.setProperty(rt, "timeRemaining", bridging::toJs(rt, value.timeRemaining, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeIdleCallbacksRequestIdleCallbackOptions - -template -struct NativeIdleCallbacksRequestIdleCallbackOptions { - P0 timeout; - bool operator==(const NativeIdleCallbacksRequestIdleCallbackOptions &other) const { - return timeout == other.timeout; - } -}; - -template -struct NativeIdleCallbacksRequestIdleCallbackOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "timeout"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double timeoutToJs(jsi::Runtime &rt, decltype(types.timeout) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.timeout) { - result.setProperty(rt, "timeout", bridging::toJs(rt, value.timeout.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeIdleCallbacksCxxSpecJSI : public TurboModule { -protected: - NativeIdleCallbacksCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value requestIdleCallback(jsi::Runtime &rt, jsi::Function callback, std::optional options) = 0; - virtual void cancelIdleCallback(jsi::Runtime &rt, jsi::Value handle) = 0; - -}; - -template -class JSI_EXPORT NativeIdleCallbacksCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeIdleCallbacksCxx"; - -protected: - NativeIdleCallbacksCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeIdleCallbacksCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeIdleCallbacksCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeIdleCallbacksCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value requestIdleCallback(jsi::Runtime &rt, jsi::Function callback, std::optional options) override { - static_assert( - bridging::getParameterCount(&T::requestIdleCallback) == 3, - "Expected requestIdleCallback(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::requestIdleCallback, jsInvoker_, instance_, std::move(callback), std::move(options)); - } - void cancelIdleCallback(jsi::Runtime &rt, jsi::Value handle) override { - static_assert( - bridging::getParameterCount(&T::cancelIdleCallback) == 2, - "Expected cancelIdleCallback(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::cancelIdleCallback, jsInvoker_, instance_, std::move(handle)); - } - - private: - friend class NativeIdleCallbacksCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeIntersectionObserverNativeIntersectionObserverEntry - -template -struct NativeIntersectionObserverNativeIntersectionObserverEntry { - P0 intersectionObserverId; - P1 targetInstanceHandle; - P2 targetRect; - P3 rootRect; - P4 intersectionRect; - P5 isIntersectingAboveThresholds; - P6 time; - bool operator==(const NativeIntersectionObserverNativeIntersectionObserverEntry &other) const { - return intersectionObserverId == other.intersectionObserverId && targetInstanceHandle == other.targetInstanceHandle && targetRect == other.targetRect && rootRect == other.rootRect && intersectionRect == other.intersectionRect && isIntersectingAboveThresholds == other.isIntersectingAboveThresholds && time == other.time; - } -}; - -template -struct NativeIntersectionObserverNativeIntersectionObserverEntryBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "intersectionObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetInstanceHandle"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "intersectionRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isIntersectingAboveThresholds"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "time"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double intersectionObserverIdToJs(jsi::Runtime &rt, decltype(types.intersectionObserverId) value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetInstanceHandleToJs(jsi::Runtime &rt, decltype(types.targetInstanceHandle) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array targetRectToJs(jsi::Runtime &rt, decltype(types.targetRect) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array rootRectToJs(jsi::Runtime &rt, decltype(types.rootRect) value) { - return bridging::toJs(rt, value); - } - - static std::optional intersectionRectToJs(jsi::Runtime &rt, decltype(types.intersectionRect) value) { - return bridging::toJs(rt, value); - } - - static bool isIntersectingAboveThresholdsToJs(jsi::Runtime &rt, decltype(types.isIntersectingAboveThresholds) value) { - return bridging::toJs(rt, value); - } - - static double timeToJs(jsi::Runtime &rt, decltype(types.time) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "intersectionObserverId", bridging::toJs(rt, value.intersectionObserverId, jsInvoker)); - result.setProperty(rt, "targetInstanceHandle", bridging::toJs(rt, value.targetInstanceHandle, jsInvoker)); - result.setProperty(rt, "targetRect", bridging::toJs(rt, value.targetRect, jsInvoker)); - result.setProperty(rt, "rootRect", bridging::toJs(rt, value.rootRect, jsInvoker)); - result.setProperty(rt, "intersectionRect", bridging::toJs(rt, value.intersectionRect, jsInvoker)); - result.setProperty(rt, "isIntersectingAboveThresholds", bridging::toJs(rt, value.isIntersectingAboveThresholds, jsInvoker)); - result.setProperty(rt, "time", bridging::toJs(rt, value.time, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeIntersectionObserverNativeIntersectionObserverObserveOptions - -template -struct NativeIntersectionObserverNativeIntersectionObserverObserveOptions { - P0 intersectionObserverId; - P1 rootShadowNode; - P2 targetShadowNode; - P3 thresholds; - P4 rootThresholds; - bool operator==(const NativeIntersectionObserverNativeIntersectionObserverObserveOptions &other) const { - return intersectionObserverId == other.intersectionObserverId && rootShadowNode == other.rootShadowNode && targetShadowNode == other.targetShadowNode && thresholds == other.thresholds && rootThresholds == other.rootThresholds; - } -}; - -template -struct NativeIntersectionObserverNativeIntersectionObserverObserveOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "intersectionObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootShadowNode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetShadowNode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "thresholds"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootThresholds"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double intersectionObserverIdToJs(jsi::Runtime &rt, decltype(types.intersectionObserverId) value) { - return bridging::toJs(rt, value); - } - - static std::optional rootShadowNodeToJs(jsi::Runtime &rt, decltype(types.rootShadowNode) value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetShadowNodeToJs(jsi::Runtime &rt, decltype(types.targetShadowNode) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array thresholdsToJs(jsi::Runtime &rt, decltype(types.thresholds) value) { - return bridging::toJs(rt, value); - } - - static std::optional rootThresholdsToJs(jsi::Runtime &rt, decltype(types.rootThresholds) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "intersectionObserverId", bridging::toJs(rt, value.intersectionObserverId, jsInvoker)); - if (value.rootShadowNode) { - result.setProperty(rt, "rootShadowNode", bridging::toJs(rt, value.rootShadowNode.value(), jsInvoker)); - } - result.setProperty(rt, "targetShadowNode", bridging::toJs(rt, value.targetShadowNode, jsInvoker)); - result.setProperty(rt, "thresholds", bridging::toJs(rt, value.thresholds, jsInvoker)); - if (value.rootThresholds) { - result.setProperty(rt, "rootThresholds", bridging::toJs(rt, value.rootThresholds.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeIntersectionObserverCxxSpecJSI : public TurboModule { -protected: - NativeIntersectionObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void observe(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserve(jsi::Runtime &rt, double intersectionObserverId, jsi::Value targetShadowNode) = 0; - virtual jsi::Value observeV2(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserveV2(jsi::Runtime &rt, double intersectionObserverId, jsi::Value token) = 0; - virtual void connect(jsi::Runtime &rt, jsi::Function notifyIntersectionObserversCallback) = 0; - virtual void disconnect(jsi::Runtime &rt) = 0; - virtual jsi::Array takeRecords(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeIntersectionObserverCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeIntersectionObserverCxx"; - -protected: - NativeIntersectionObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeIntersectionObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeIntersectionObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeIntersectionObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void observe(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observe) == 2, - "Expected observe(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::observe, jsInvoker_, instance_, std::move(options)); - } - void unobserve(jsi::Runtime &rt, double intersectionObserverId, jsi::Value targetShadowNode) override { - static_assert( - bridging::getParameterCount(&T::unobserve) == 3, - "Expected unobserve(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::unobserve, jsInvoker_, instance_, std::move(intersectionObserverId), std::move(targetShadowNode)); - } - jsi::Value observeV2(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observeV2) == 2, - "Expected observeV2(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::observeV2, jsInvoker_, instance_, std::move(options)); - } - void unobserveV2(jsi::Runtime &rt, double intersectionObserverId, jsi::Value token) override { - static_assert( - bridging::getParameterCount(&T::unobserveV2) == 3, - "Expected unobserveV2(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::unobserveV2, jsInvoker_, instance_, std::move(intersectionObserverId), std::move(token)); - } - void connect(jsi::Runtime &rt, jsi::Function notifyIntersectionObserversCallback) override { - static_assert( - bridging::getParameterCount(&T::connect) == 2, - "Expected connect(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(notifyIntersectionObserversCallback)); - } - void disconnect(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disconnect) == 1, - "Expected disconnect(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disconnect, jsInvoker_, instance_); - } - jsi::Array takeRecords(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::takeRecords) == 1, - "Expected takeRecords(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::takeRecords, jsInvoker_, instance_); - } - - private: - friend class NativeIntersectionObserverCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeMicrotasksCxxSpecJSI : public TurboModule { -protected: - NativeMicrotasksCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void queueMicrotask(jsi::Runtime &rt, jsi::Function callback) = 0; - -}; - -template -class JSI_EXPORT NativeMicrotasksCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeMicrotasksCxx"; - -protected: - NativeMicrotasksCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeMicrotasksCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeMicrotasksCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeMicrotasksCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void queueMicrotask(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::queueMicrotask) == 2, - "Expected queueMicrotask(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queueMicrotask, jsInvoker_, instance_, std::move(callback)); - } - - private: - friend class NativeMicrotasksCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeMutationObserverNativeMutationObserverObserveOptions - -template -struct NativeMutationObserverNativeMutationObserverObserveOptions { - P0 mutationObserverId; - P1 targetShadowNode; - P2 subtree; - bool operator==(const NativeMutationObserverNativeMutationObserverObserveOptions &other) const { - return mutationObserverId == other.mutationObserverId && targetShadowNode == other.targetShadowNode && subtree == other.subtree; - } -}; - -template -struct NativeMutationObserverNativeMutationObserverObserveOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "mutationObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetShadowNode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "subtree"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double mutationObserverIdToJs(jsi::Runtime &rt, decltype(types.mutationObserverId) value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetShadowNodeToJs(jsi::Runtime &rt, decltype(types.targetShadowNode) value) { - return bridging::toJs(rt, value); - } - - static bool subtreeToJs(jsi::Runtime &rt, decltype(types.subtree) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "mutationObserverId", bridging::toJs(rt, value.mutationObserverId, jsInvoker)); - result.setProperty(rt, "targetShadowNode", bridging::toJs(rt, value.targetShadowNode, jsInvoker)); - result.setProperty(rt, "subtree", bridging::toJs(rt, value.subtree, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeMutationObserverNativeMutationRecord - -template -struct NativeMutationObserverNativeMutationRecord { - P0 mutationObserverId; - P1 target; - P2 addedNodes; - P3 removedNodes; - bool operator==(const NativeMutationObserverNativeMutationRecord &other) const { - return mutationObserverId == other.mutationObserverId && target == other.target && addedNodes == other.addedNodes && removedNodes == other.removedNodes; - } -}; - -template -struct NativeMutationObserverNativeMutationRecordBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "mutationObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "target"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "addedNodes"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "removedNodes"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double mutationObserverIdToJs(jsi::Runtime &rt, decltype(types.mutationObserverId) value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetToJs(jsi::Runtime &rt, decltype(types.target) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array addedNodesToJs(jsi::Runtime &rt, decltype(types.addedNodes) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array removedNodesToJs(jsi::Runtime &rt, decltype(types.removedNodes) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "mutationObserverId", bridging::toJs(rt, value.mutationObserverId, jsInvoker)); - result.setProperty(rt, "target", bridging::toJs(rt, value.target, jsInvoker)); - result.setProperty(rt, "addedNodes", bridging::toJs(rt, value.addedNodes, jsInvoker)); - result.setProperty(rt, "removedNodes", bridging::toJs(rt, value.removedNodes, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeMutationObserverCxxSpecJSI : public TurboModule { -protected: - NativeMutationObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void observe(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserveAll(jsi::Runtime &rt, double mutationObserverId) = 0; - virtual void connect(jsi::Runtime &rt, jsi::Function notifyMutationObservers, jsi::Function getPublicInstanceFromInstanceHandle) = 0; - virtual void disconnect(jsi::Runtime &rt) = 0; - virtual jsi::Array takeRecords(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeMutationObserverCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeMutationObserverCxx"; - -protected: - NativeMutationObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeMutationObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeMutationObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeMutationObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void observe(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observe) == 2, - "Expected observe(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::observe, jsInvoker_, instance_, std::move(options)); - } - void unobserveAll(jsi::Runtime &rt, double mutationObserverId) override { - static_assert( - bridging::getParameterCount(&T::unobserveAll) == 2, - "Expected unobserveAll(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::unobserveAll, jsInvoker_, instance_, std::move(mutationObserverId)); - } - void connect(jsi::Runtime &rt, jsi::Function notifyMutationObservers, jsi::Function getPublicInstanceFromInstanceHandle) override { - static_assert( - bridging::getParameterCount(&T::connect) == 3, - "Expected connect(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(notifyMutationObservers), std::move(getPublicInstanceFromInstanceHandle)); - } - void disconnect(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disconnect) == 1, - "Expected disconnect(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disconnect, jsInvoker_, instance_); - } - jsi::Array takeRecords(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::takeRecords) == 1, - "Expected takeRecords(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::takeRecords, jsInvoker_, instance_); - } - - private: - friend class NativeMutationObserverCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - - -#pragma mark - NativePerformancePerformanceObserverInit - -template -struct NativePerformancePerformanceObserverInit { - P0 entryTypes; - P1 type; - P2 buffered; - P3 durationThreshold; - bool operator==(const NativePerformancePerformanceObserverInit &other) const { - return entryTypes == other.entryTypes && type == other.type && buffered == other.buffered && durationThreshold == other.durationThreshold; - } -}; - -template -struct NativePerformancePerformanceObserverInitBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "entryTypes"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "type"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buffered"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "durationThreshold"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array entryTypesToJs(jsi::Runtime &rt, decltype(types.entryTypes) value) { - return bridging::toJs(rt, value); - } - - static double typeToJs(jsi::Runtime &rt, decltype(types.type) value) { - return bridging::toJs(rt, value); - } - - static bool bufferedToJs(jsi::Runtime &rt, decltype(types.buffered) value) { - return bridging::toJs(rt, value); - } - - static double durationThresholdToJs(jsi::Runtime &rt, decltype(types.durationThreshold) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.entryTypes) { - result.setProperty(rt, "entryTypes", bridging::toJs(rt, value.entryTypes.value(), jsInvoker)); - } - if (value.type) { - result.setProperty(rt, "type", bridging::toJs(rt, value.type.value(), jsInvoker)); - } - if (value.buffered) { - result.setProperty(rt, "buffered", bridging::toJs(rt, value.buffered.value(), jsInvoker)); - } - if (value.durationThreshold) { - result.setProperty(rt, "durationThreshold", bridging::toJs(rt, value.durationThreshold.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativePerformanceRawPerformanceEntry - -template -struct NativePerformanceRawPerformanceEntry { - P0 name; - P1 entryType; - P2 startTime; - P3 duration; - P4 processingStart; - P5 processingEnd; - P6 interactionId; - P7 fetchStart; - P8 requestStart; - P9 connectStart; - P10 connectEnd; - P11 responseStart; - P12 responseEnd; - P13 responseStatus; - bool operator==(const NativePerformanceRawPerformanceEntry &other) const { - return name == other.name && entryType == other.entryType && startTime == other.startTime && duration == other.duration && processingStart == other.processingStart && processingEnd == other.processingEnd && interactionId == other.interactionId && fetchStart == other.fetchStart && requestStart == other.requestStart && connectStart == other.connectStart && connectEnd == other.connectEnd && responseStart == other.responseStart && responseEnd == other.responseEnd && responseStatus == other.responseStatus; - } -}; - -template -struct NativePerformanceRawPerformanceEntryBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "name"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "entryType"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "startTime"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "duration"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "processingStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "processingEnd"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "interactionId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fetchStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "requestStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "connectStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "connectEnd"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "responseStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "responseEnd"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "responseStatus"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String nameToJs(jsi::Runtime &rt, decltype(types.name) value) { - return bridging::toJs(rt, value); - } - - static double entryTypeToJs(jsi::Runtime &rt, decltype(types.entryType) value) { - return bridging::toJs(rt, value); - } - - static double startTimeToJs(jsi::Runtime &rt, decltype(types.startTime) value) { - return bridging::toJs(rt, value); - } - - static double durationToJs(jsi::Runtime &rt, decltype(types.duration) value) { - return bridging::toJs(rt, value); - } - - static double processingStartToJs(jsi::Runtime &rt, decltype(types.processingStart) value) { - return bridging::toJs(rt, value); - } - - static double processingEndToJs(jsi::Runtime &rt, decltype(types.processingEnd) value) { - return bridging::toJs(rt, value); - } - - static double interactionIdToJs(jsi::Runtime &rt, decltype(types.interactionId) value) { - return bridging::toJs(rt, value); - } - - static double fetchStartToJs(jsi::Runtime &rt, decltype(types.fetchStart) value) { - return bridging::toJs(rt, value); - } - - static double requestStartToJs(jsi::Runtime &rt, decltype(types.requestStart) value) { - return bridging::toJs(rt, value); - } - - static double connectStartToJs(jsi::Runtime &rt, decltype(types.connectStart) value) { - return bridging::toJs(rt, value); - } - - static double connectEndToJs(jsi::Runtime &rt, decltype(types.connectEnd) value) { - return bridging::toJs(rt, value); - } - - static double responseStartToJs(jsi::Runtime &rt, decltype(types.responseStart) value) { - return bridging::toJs(rt, value); - } - - static double responseEndToJs(jsi::Runtime &rt, decltype(types.responseEnd) value) { - return bridging::toJs(rt, value); - } - - static double responseStatusToJs(jsi::Runtime &rt, decltype(types.responseStatus) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "name", bridging::toJs(rt, value.name, jsInvoker)); - result.setProperty(rt, "entryType", bridging::toJs(rt, value.entryType, jsInvoker)); - result.setProperty(rt, "startTime", bridging::toJs(rt, value.startTime, jsInvoker)); - result.setProperty(rt, "duration", bridging::toJs(rt, value.duration, jsInvoker)); - if (value.processingStart) { - result.setProperty(rt, "processingStart", bridging::toJs(rt, value.processingStart.value(), jsInvoker)); - } - if (value.processingEnd) { - result.setProperty(rt, "processingEnd", bridging::toJs(rt, value.processingEnd.value(), jsInvoker)); - } - if (value.interactionId) { - result.setProperty(rt, "interactionId", bridging::toJs(rt, value.interactionId.value(), jsInvoker)); - } - if (value.fetchStart) { - result.setProperty(rt, "fetchStart", bridging::toJs(rt, value.fetchStart.value(), jsInvoker)); - } - if (value.requestStart) { - result.setProperty(rt, "requestStart", bridging::toJs(rt, value.requestStart.value(), jsInvoker)); - } - if (value.connectStart) { - result.setProperty(rt, "connectStart", bridging::toJs(rt, value.connectStart.value(), jsInvoker)); - } - if (value.connectEnd) { - result.setProperty(rt, "connectEnd", bridging::toJs(rt, value.connectEnd.value(), jsInvoker)); - } - if (value.responseStart) { - result.setProperty(rt, "responseStart", bridging::toJs(rt, value.responseStart.value(), jsInvoker)); - } - if (value.responseEnd) { - result.setProperty(rt, "responseEnd", bridging::toJs(rt, value.responseEnd.value(), jsInvoker)); - } - if (value.responseStatus) { - result.setProperty(rt, "responseStatus", bridging::toJs(rt, value.responseStatus.value(), jsInvoker)); - } - return result; - } -}; - - -class JSI_EXPORT NativePerformanceCxxSpecJSI : public TurboModule { -protected: - NativePerformanceCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual double now(jsi::Runtime &rt) = 0; - virtual double markWithResult(jsi::Runtime &rt, jsi::String name, std::optional startTime) = 0; - virtual jsi::Array measureWithResult(jsi::Runtime &rt, jsi::String name, double startTime, double endTime, std::optional duration, std::optional startMark, std::optional endMark) = 0; - virtual void clearMarks(jsi::Runtime &rt, std::optional entryName) = 0; - virtual void clearMeasures(jsi::Runtime &rt, std::optional entryName) = 0; - virtual jsi::Array getEntries(jsi::Runtime &rt) = 0; - virtual jsi::Array getEntriesByName(jsi::Runtime &rt, jsi::String entryName, std::optional entryType) = 0; - virtual jsi::Array getEntriesByType(jsi::Runtime &rt, double entryType) = 0; - virtual jsi::Array getEventCounts(jsi::Runtime &rt) = 0; - virtual jsi::Object getSimpleMemoryInfo(jsi::Runtime &rt) = 0; - virtual jsi::Object getReactNativeStartupTiming(jsi::Runtime &rt) = 0; - virtual jsi::Value createObserver(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual double getDroppedEntriesCount(jsi::Runtime &rt, jsi::Value observer) = 0; - virtual void observe(jsi::Runtime &rt, jsi::Value observer, jsi::Object options) = 0; - virtual void disconnect(jsi::Runtime &rt, jsi::Value observer) = 0; - virtual jsi::Array takeRecords(jsi::Runtime &rt, jsi::Value observer, bool sort) = 0; - virtual jsi::Array getSupportedPerformanceEntryTypes(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePerformanceCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativePerformanceCxx"; - -protected: - NativePerformanceCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePerformanceCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePerformanceCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePerformanceCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - double now(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::now) == 1, - "Expected now(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::now, jsInvoker_, instance_); - } - double markWithResult(jsi::Runtime &rt, jsi::String name, std::optional startTime) override { - static_assert( - bridging::getParameterCount(&T::markWithResult) == 3, - "Expected markWithResult(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::markWithResult, jsInvoker_, instance_, std::move(name), std::move(startTime)); - } - jsi::Array measureWithResult(jsi::Runtime &rt, jsi::String name, double startTime, double endTime, std::optional duration, std::optional startMark, std::optional endMark) override { - static_assert( - bridging::getParameterCount(&T::measureWithResult) == 7, - "Expected measureWithResult(...) to have 7 parameters"); - - return bridging::callFromJs( - rt, &T::measureWithResult, jsInvoker_, instance_, std::move(name), std::move(startTime), std::move(endTime), std::move(duration), std::move(startMark), std::move(endMark)); - } - void clearMarks(jsi::Runtime &rt, std::optional entryName) override { - static_assert( - bridging::getParameterCount(&T::clearMarks) == 2, - "Expected clearMarks(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearMarks, jsInvoker_, instance_, std::move(entryName)); - } - void clearMeasures(jsi::Runtime &rt, std::optional entryName) override { - static_assert( - bridging::getParameterCount(&T::clearMeasures) == 2, - "Expected clearMeasures(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearMeasures, jsInvoker_, instance_, std::move(entryName)); - } - jsi::Array getEntries(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getEntries) == 1, - "Expected getEntries(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getEntries, jsInvoker_, instance_); - } - jsi::Array getEntriesByName(jsi::Runtime &rt, jsi::String entryName, std::optional entryType) override { - static_assert( - bridging::getParameterCount(&T::getEntriesByName) == 3, - "Expected getEntriesByName(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getEntriesByName, jsInvoker_, instance_, std::move(entryName), std::move(entryType)); - } - jsi::Array getEntriesByType(jsi::Runtime &rt, double entryType) override { - static_assert( - bridging::getParameterCount(&T::getEntriesByType) == 2, - "Expected getEntriesByType(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getEntriesByType, jsInvoker_, instance_, std::move(entryType)); - } - jsi::Array getEventCounts(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getEventCounts) == 1, - "Expected getEventCounts(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getEventCounts, jsInvoker_, instance_); - } - jsi::Object getSimpleMemoryInfo(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getSimpleMemoryInfo) == 1, - "Expected getSimpleMemoryInfo(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getSimpleMemoryInfo, jsInvoker_, instance_); - } - jsi::Object getReactNativeStartupTiming(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getReactNativeStartupTiming) == 1, - "Expected getReactNativeStartupTiming(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getReactNativeStartupTiming, jsInvoker_, instance_); - } - jsi::Value createObserver(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::createObserver) == 2, - "Expected createObserver(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::createObserver, jsInvoker_, instance_, std::move(callback)); - } - double getDroppedEntriesCount(jsi::Runtime &rt, jsi::Value observer) override { - static_assert( - bridging::getParameterCount(&T::getDroppedEntriesCount) == 2, - "Expected getDroppedEntriesCount(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getDroppedEntriesCount, jsInvoker_, instance_, std::move(observer)); - } - void observe(jsi::Runtime &rt, jsi::Value observer, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observe) == 3, - "Expected observe(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::observe, jsInvoker_, instance_, std::move(observer), std::move(options)); - } - void disconnect(jsi::Runtime &rt, jsi::Value observer) override { - static_assert( - bridging::getParameterCount(&T::disconnect) == 2, - "Expected disconnect(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::disconnect, jsInvoker_, instance_, std::move(observer)); - } - jsi::Array takeRecords(jsi::Runtime &rt, jsi::Value observer, bool sort) override { - static_assert( - bridging::getParameterCount(&T::takeRecords) == 3, - "Expected takeRecords(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::takeRecords, jsInvoker_, instance_, std::move(observer), std::move(sort)); - } - jsi::Array getSupportedPerformanceEntryTypes(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getSupportedPerformanceEntryTypes) == 1, - "Expected getSupportedPerformanceEntryTypes(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getSupportedPerformanceEntryTypes, jsInvoker_, instance_); - } - - private: - friend class NativePerformanceCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDOMCxxSpecJSI : public TurboModule { -protected: - NativeDOMCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual double compareDocumentPosition(jsi::Runtime &rt, jsi::Value nativeNodeReference, jsi::Value otherNativeNodeReference) = 0; - virtual jsi::Array getChildNodes(jsi::Runtime &rt, jsi::Value nativeNodeReference) = 0; - virtual jsi::Value getParentNode(jsi::Runtime &rt, jsi::Value nativeNodeReference) = 0; - virtual bool isConnected(jsi::Runtime &rt, jsi::Value nativeNodeReference) = 0; - virtual jsi::Array getBorderWidth(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::Array getBoundingClientRect(jsi::Runtime &rt, jsi::Value nativeElementReference, bool includeTransform) = 0; - virtual jsi::Array getInnerSize(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::Array getScrollPosition(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::Array getScrollSize(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::String getTagName(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::String getTextContent(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual bool hasPointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) = 0; - virtual void releasePointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) = 0; - virtual void setPointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) = 0; - virtual jsi::Array getOffset(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::Value linkRootNode(jsi::Runtime &rt, double rootTag, jsi::Value instanceHandle) = 0; - virtual void measure(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Function callback) = 0; - virtual void measureInWindow(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Function callback) = 0; - virtual void measureLayout(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Value relativeNode, jsi::Function onFail, jsi::Function onSuccess) = 0; - virtual void setNativeProps(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Value updatePayload) = 0; - -}; - -template -class JSI_EXPORT NativeDOMCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeDOMCxx"; - -protected: - NativeDOMCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDOMCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDOMCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDOMCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - double compareDocumentPosition(jsi::Runtime &rt, jsi::Value nativeNodeReference, jsi::Value otherNativeNodeReference) override { - static_assert( - bridging::getParameterCount(&T::compareDocumentPosition) == 3, - "Expected compareDocumentPosition(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::compareDocumentPosition, jsInvoker_, instance_, std::move(nativeNodeReference), std::move(otherNativeNodeReference)); - } - jsi::Array getChildNodes(jsi::Runtime &rt, jsi::Value nativeNodeReference) override { - static_assert( - bridging::getParameterCount(&T::getChildNodes) == 2, - "Expected getChildNodes(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getChildNodes, jsInvoker_, instance_, std::move(nativeNodeReference)); - } - jsi::Value getParentNode(jsi::Runtime &rt, jsi::Value nativeNodeReference) override { - static_assert( - bridging::getParameterCount(&T::getParentNode) == 2, - "Expected getParentNode(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getParentNode, jsInvoker_, instance_, std::move(nativeNodeReference)); - } - bool isConnected(jsi::Runtime &rt, jsi::Value nativeNodeReference) override { - static_assert( - bridging::getParameterCount(&T::isConnected) == 2, - "Expected isConnected(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isConnected, jsInvoker_, instance_, std::move(nativeNodeReference)); - } - jsi::Array getBorderWidth(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getBorderWidth) == 2, - "Expected getBorderWidth(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getBorderWidth, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::Array getBoundingClientRect(jsi::Runtime &rt, jsi::Value nativeElementReference, bool includeTransform) override { - static_assert( - bridging::getParameterCount(&T::getBoundingClientRect) == 3, - "Expected getBoundingClientRect(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getBoundingClientRect, jsInvoker_, instance_, std::move(nativeElementReference), std::move(includeTransform)); - } - jsi::Array getInnerSize(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getInnerSize) == 2, - "Expected getInnerSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getInnerSize, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::Array getScrollPosition(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getScrollPosition) == 2, - "Expected getScrollPosition(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getScrollPosition, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::Array getScrollSize(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getScrollSize) == 2, - "Expected getScrollSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getScrollSize, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::String getTagName(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getTagName) == 2, - "Expected getTagName(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getTagName, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::String getTextContent(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getTextContent) == 2, - "Expected getTextContent(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getTextContent, jsInvoker_, instance_, std::move(nativeElementReference)); - } - bool hasPointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) override { - static_assert( - bridging::getParameterCount(&T::hasPointerCapture) == 3, - "Expected hasPointerCapture(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::hasPointerCapture, jsInvoker_, instance_, std::move(nativeElementReference), std::move(pointerId)); - } - void releasePointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) override { - static_assert( - bridging::getParameterCount(&T::releasePointerCapture) == 3, - "Expected releasePointerCapture(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::releasePointerCapture, jsInvoker_, instance_, std::move(nativeElementReference), std::move(pointerId)); - } - void setPointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) override { - static_assert( - bridging::getParameterCount(&T::setPointerCapture) == 3, - "Expected setPointerCapture(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setPointerCapture, jsInvoker_, instance_, std::move(nativeElementReference), std::move(pointerId)); - } - jsi::Array getOffset(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getOffset) == 2, - "Expected getOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getOffset, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::Value linkRootNode(jsi::Runtime &rt, double rootTag, jsi::Value instanceHandle) override { - static_assert( - bridging::getParameterCount(&T::linkRootNode) == 3, - "Expected linkRootNode(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::linkRootNode, jsInvoker_, instance_, std::move(rootTag), std::move(instanceHandle)); - } - void measure(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measure) == 3, - "Expected measure(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::measure, jsInvoker_, instance_, std::move(nativeElementReference), std::move(callback)); - } - void measureInWindow(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measureInWindow) == 3, - "Expected measureInWindow(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::measureInWindow, jsInvoker_, instance_, std::move(nativeElementReference), std::move(callback)); - } - void measureLayout(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Value relativeNode, jsi::Function onFail, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::measureLayout) == 5, - "Expected measureLayout(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::measureLayout, jsInvoker_, instance_, std::move(nativeElementReference), std::move(relativeNode), std::move(onFail), std::move(onSuccess)); - } - void setNativeProps(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Value updatePayload) override { - static_assert( - bridging::getParameterCount(&T::setNativeProps) == 3, - "Expected setNativeProps(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setNativeProps, jsInvoker_, instance_, std::move(nativeElementReference), std::move(updatePayload)); - } - - private: - friend class NativeDOMCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - -} // namespace facebook::react From 82ee1497908420c4dff7d07bf27521fb70b7d544 Mon Sep 17 00:00:00 2001 From: vineethkuttan Date: Tue, 14 Oct 2025 14:15:39 +0530 Subject: [PATCH 2/4] yarn change --- ...ative-windows-f30357b1-bd89-4504-9375-58b1457ccf06.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-f30357b1-bd89-4504-9375-58b1457ccf06.json diff --git a/change/react-native-windows-f30357b1-bd89-4504-9375-58b1457ccf06.json b/change/react-native-windows-f30357b1-bd89-4504-9375-58b1457ccf06.json new file mode 100644 index 00000000000..851e802533e --- /dev/null +++ b/change/react-native-windows-f30357b1-bd89-4504-9375-58b1457ccf06.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Removing Codegen files", + "packageName": "react-native-windows", + "email": "kvineeth@microsoft.com", + "dependentChangeType": "patch" +} From 5475451b39d387051822217d9e2ebf9c3f2b8ffe Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Tue, 14 Oct 2025 18:21:01 +0530 Subject: [PATCH 3/4] Nuget Packing fix --- .ado/templates/prep-and-pack-nuget.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ado/templates/prep-and-pack-nuget.yml b/.ado/templates/prep-and-pack-nuget.yml index 45caf5b79d3..0a9eab00764 100644 --- a/.ado/templates/prep-and-pack-nuget.yml +++ b/.ado/templates/prep-and-pack-nuget.yml @@ -72,7 +72,10 @@ steps: inputs: artifact: ${{ parameters.artifactName2 }}.${{ slice.platform }}.${{ slice.configuration }} path: ${{parameters.nugetroot}}/${{ parameters.artifactName2 }}/${{ slice.platform }}/${{ slice.configuration }} - + + - pwsh: yarn build + displayName: Run yarn build + - task: PowerShell@2 displayName: Copy MSRN Resources to NuGet layout inputs: From d16c8134f75a99bcd175294d99e9e11eedb1c560 Mon Sep 17 00:00:00 2001 From: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com> Date: Wed, 15 Oct 2025 14:43:16 +0530 Subject: [PATCH 4/4] Pull latest changes --- vnext/codegen/NativePerformanceSpec.g.h | 225 - .../NativeReactNativeFeatureFlagsSpec.g.h | 383 - vnext/codegen/rnwcoreJSI-generated.cpp | 3412 ------ vnext/codegen/rnwcoreJSI.h | 9396 ----------------- 4 files changed, 13416 deletions(-) delete mode 100644 vnext/codegen/NativePerformanceSpec.g.h delete mode 100644 vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h delete mode 100644 vnext/codegen/rnwcoreJSI-generated.cpp delete mode 100644 vnext/codegen/rnwcoreJSI.h diff --git a/vnext/codegen/NativePerformanceSpec.g.h b/vnext/codegen/NativePerformanceSpec.g.h deleted file mode 100644 index 5d058ccdb96..00000000000 --- a/vnext/codegen/NativePerformanceSpec.g.h +++ /dev/null @@ -1,225 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct PerformanceSpec_NativeMemoryInfo { - -}; - -struct PerformanceSpec_PerformanceObserverInit { - std::optional> entryTypes; - std::optional type; - std::optional buffered; - std::optional durationThreshold; -}; - -struct PerformanceSpec_RawPerformanceEntry { - std::string name; - double entryType; - double startTime; - double duration; - std::optional processingStart; - std::optional processingEnd; - std::optional interactionId; - std::optional fetchStart; - std::optional requestStart; - std::optional connectStart; - std::optional connectEnd; - std::optional responseStart; - std::optional responseEnd; - std::optional responseStatus; -}; - -struct PerformanceSpec_ReactNativeStartupTiming { - -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PerformanceSpec_NativeMemoryInfo*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PerformanceSpec_PerformanceObserverInit*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"entryTypes", &PerformanceSpec_PerformanceObserverInit::entryTypes}, - {L"type", &PerformanceSpec_PerformanceObserverInit::type}, - {L"buffered", &PerformanceSpec_PerformanceObserverInit::buffered}, - {L"durationThreshold", &PerformanceSpec_PerformanceObserverInit::durationThreshold}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PerformanceSpec_RawPerformanceEntry*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"name", &PerformanceSpec_RawPerformanceEntry::name}, - {L"entryType", &PerformanceSpec_RawPerformanceEntry::entryType}, - {L"startTime", &PerformanceSpec_RawPerformanceEntry::startTime}, - {L"duration", &PerformanceSpec_RawPerformanceEntry::duration}, - {L"processingStart", &PerformanceSpec_RawPerformanceEntry::processingStart}, - {L"processingEnd", &PerformanceSpec_RawPerformanceEntry::processingEnd}, - {L"interactionId", &PerformanceSpec_RawPerformanceEntry::interactionId}, - {L"fetchStart", &PerformanceSpec_RawPerformanceEntry::fetchStart}, - {L"requestStart", &PerformanceSpec_RawPerformanceEntry::requestStart}, - {L"connectStart", &PerformanceSpec_RawPerformanceEntry::connectStart}, - {L"connectEnd", &PerformanceSpec_RawPerformanceEntry::connectEnd}, - {L"responseStart", &PerformanceSpec_RawPerformanceEntry::responseStart}, - {L"responseEnd", &PerformanceSpec_RawPerformanceEntry::responseEnd}, - {L"responseStatus", &PerformanceSpec_RawPerformanceEntry::responseStatus}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PerformanceSpec_ReactNativeStartupTiming*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - - }; - return fieldMap; -} - -struct PerformanceSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - SyncMethod{0, L"now"}, - SyncMethod{1, L"markWithResult"}, - SyncMethod(std::string, double, double, double, std::string, std::string) noexcept>{2, L"measure"}, - SyncMethod(std::string, double, double, double, std::string, std::string) noexcept>{3, L"measureWithResult"}, - Method{4, L"clearMarks"}, - Method{5, L"clearMeasures"}, - SyncMethod() noexcept>{6, L"getEntries"}, - SyncMethod(std::string, std::optional) noexcept>{7, L"getEntriesByName"}, - SyncMethod(double) noexcept>{8, L"getEntriesByType"}, - SyncMethod<::React::JSValueArray() noexcept>{9, L"getEventCounts"}, - SyncMethod<::React::JSValue() noexcept>{10, L"getSimpleMemoryInfo"}, - SyncMethod<::React::JSValue() noexcept>{11, L"getReactNativeStartupTiming"}, - SyncMethod<(Callback<>) noexcept>{12, L"createObserver"}, - SyncMethod{13, L"getDroppedEntriesCount"}, - Method{14, L"observe"}, - Method{15, L"disconnect"}, - SyncMethod(, bool) noexcept>{16, L"takeRecords"}, - SyncMethod() noexcept>{17, L"getSupportedPerformanceEntryTypes"}, - Method{18, L"setCurrentTimeStampForTesting"}, - Method{19, L"clearEventCountsForTesting"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "now", - " REACT_SYNC_METHOD(now) double now() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(now) static double now() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "markWithResult", - " REACT_SYNC_METHOD(markWithResult) double markWithResult(std::string name, double startTime) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(markWithResult) static double markWithResult(std::string name, double startTime) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "measure", - " REACT_SYNC_METHOD(measure) std::vector measure(std::string name, double startTime, double endTime, double duration, std::string startMark, std::string endMark) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(measure) static std::vector measure(std::string name, double startTime, double endTime, double duration, std::string startMark, std::string endMark) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "measureWithResult", - " REACT_SYNC_METHOD(measureWithResult) std::vector measureWithResult(std::string name, double startTime, double endTime, double duration, std::string startMark, std::string endMark) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(measureWithResult) static std::vector measureWithResult(std::string name, double startTime, double endTime, double duration, std::string startMark, std::string endMark) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "clearMarks", - " REACT_METHOD(clearMarks) void clearMarks(std::string entryName) noexcept { /* implementation */ }\n" - " REACT_METHOD(clearMarks) static void clearMarks(std::string entryName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "clearMeasures", - " REACT_METHOD(clearMeasures) void clearMeasures(std::string entryName) noexcept { /* implementation */ }\n" - " REACT_METHOD(clearMeasures) static void clearMeasures(std::string entryName) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "getEntries", - " REACT_SYNC_METHOD(getEntries) std::vector getEntries() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEntries) static std::vector getEntries() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "getEntriesByName", - " REACT_SYNC_METHOD(getEntriesByName) std::vector getEntriesByName(std::string entryName, std::optional entryType) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEntriesByName) static std::vector getEntriesByName(std::string entryName, std::optional entryType) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "getEntriesByType", - " REACT_SYNC_METHOD(getEntriesByType) std::vector getEntriesByType(double entryType) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEntriesByType) static std::vector getEntriesByType(double entryType) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "getEventCounts", - " REACT_SYNC_METHOD(getEventCounts) ::React::JSValueArray getEventCounts() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getEventCounts) static ::React::JSValueArray getEventCounts() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "getSimpleMemoryInfo", - " REACT_SYNC_METHOD(getSimpleMemoryInfo) ::React::JSValue getSimpleMemoryInfo() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getSimpleMemoryInfo) static ::React::JSValue getSimpleMemoryInfo() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "getReactNativeStartupTiming", - " REACT_SYNC_METHOD(getReactNativeStartupTiming) ::React::JSValue getReactNativeStartupTiming() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getReactNativeStartupTiming) static ::React::JSValue getReactNativeStartupTiming() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "createObserver", - " REACT_SYNC_METHOD(createObserver) createObserver(std::function const & callback) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(createObserver) static createObserver(std::function const & callback) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "getDroppedEntriesCount", - " REACT_SYNC_METHOD(getDroppedEntriesCount) double getDroppedEntriesCount( observer) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getDroppedEntriesCount) static double getDroppedEntriesCount( observer) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "observe", - " REACT_METHOD(observe) void observe( observer, PerformanceSpec_PerformanceObserverInit && options) noexcept { /* implementation */ }\n" - " REACT_METHOD(observe) static void observe( observer, PerformanceSpec_PerformanceObserverInit && options) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "disconnect", - " REACT_METHOD(disconnect) void disconnect( observer) noexcept { /* implementation */ }\n" - " REACT_METHOD(disconnect) static void disconnect( observer) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "takeRecords", - " REACT_SYNC_METHOD(takeRecords) std::vector takeRecords( observer, bool sort) noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(takeRecords) static std::vector takeRecords( observer, bool sort) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "getSupportedPerformanceEntryTypes", - " REACT_SYNC_METHOD(getSupportedPerformanceEntryTypes) std::vector getSupportedPerformanceEntryTypes() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getSupportedPerformanceEntryTypes) static std::vector getSupportedPerformanceEntryTypes() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 18, - "setCurrentTimeStampForTesting", - " REACT_METHOD(setCurrentTimeStampForTesting) void setCurrentTimeStampForTesting(double timeStamp) noexcept { /* implementation */ }\n" - " REACT_METHOD(setCurrentTimeStampForTesting) static void setCurrentTimeStampForTesting(double timeStamp) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 19, - "clearEventCountsForTesting", - " REACT_METHOD(clearEventCountsForTesting) void clearEventCountsForTesting() noexcept { /* implementation */ }\n" - " REACT_METHOD(clearEventCountsForTesting) static void clearEventCountsForTesting() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h b/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h deleted file mode 100644 index a0c80911e2e..00000000000 --- a/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h +++ /dev/null @@ -1,383 +0,0 @@ - -/* - * 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 -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct ReactNativeFeatureFlagsSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - SyncMethod{0, L"commonTestFlag"}, - SyncMethod{1, L"commonTestFlagWithoutNativeImplementation"}, - SyncMethod{2, L"animatedShouldSignalBatch"}, - SyncMethod{3, L"cxxNativeAnimatedEnabled"}, - SyncMethod{4, L"cxxNativeAnimatedRemoveJsSync"}, - SyncMethod{5, L"disableMainQueueSyncDispatchIOS"}, - SyncMethod{6, L"disableMountItemReorderingAndroid"}, - SyncMethod{7, L"disableTextLayoutManagerCacheAndroid"}, - SyncMethod{8, L"enableAccessibilityOrder"}, - SyncMethod{9, L"enableAccumulatedUpdatesInRawPropsAndroid"}, - SyncMethod{10, L"enableAndroidTextMeasurementOptimizations"}, - SyncMethod{11, L"enableBridgelessArchitecture"}, - SyncMethod{12, L"enableCppPropsIteratorSetter"}, - SyncMethod{13, L"enableCustomFocusSearchOnClippedElementsAndroid"}, - SyncMethod{14, L"enableDestroyShadowTreeRevisionAsync"}, - SyncMethod{15, L"enableDoubleMeasurementFixAndroid"}, - SyncMethod{16, L"enableEagerRootViewAttachment"}, - SyncMethod{17, L"enableFabricLogs"}, - SyncMethod{18, L"enableFabricRenderer"}, - SyncMethod{19, L"enableFixForParentTagDuringReparenting"}, - SyncMethod{20, L"enableFontScaleChangesUpdatingLayout"}, - SyncMethod{21, L"enableIOSTextBaselineOffsetPerLine"}, - SyncMethod{22, L"enableIOSViewClipToPaddingBox"}, - SyncMethod{23, L"enableInteropViewManagerClassLookUpOptimizationIOS"}, - SyncMethod{24, L"enableLayoutAnimationsOnAndroid"}, - SyncMethod{25, L"enableLayoutAnimationsOnIOS"}, - SyncMethod{26, L"enableMainQueueCoordinatorOnIOS"}, - SyncMethod{27, L"enableMainQueueModulesOnIOS"}, - SyncMethod{28, L"enableModuleArgumentNSNullConversionIOS"}, - SyncMethod{29, L"enableNativeCSSParsing"}, - SyncMethod{30, L"enableNetworkEventReporting"}, - SyncMethod{31, L"enableNewBackgroundAndBorderDrawables"}, - SyncMethod{32, L"enablePreparedTextLayout"}, - SyncMethod{33, L"enablePropsUpdateReconciliationAndroid"}, - SyncMethod{34, L"enableResourceTimingAPI"}, - SyncMethod{35, L"enableSynchronousStateUpdates"}, - SyncMethod{36, L"enableViewCulling"}, - SyncMethod{37, L"enableViewRecycling"}, - SyncMethod{38, L"enableViewRecyclingForText"}, - SyncMethod{39, L"enableViewRecyclingForView"}, - SyncMethod{40, L"enableVirtualViewDebugFeatures"}, - SyncMethod{41, L"enableVirtualViewRenderState"}, - SyncMethod{42, L"enableVirtualViewWindowFocusDetection"}, - SyncMethod{43, L"fixMappingOfEventPrioritiesBetweenFabricAndReact"}, - SyncMethod{44, L"fuseboxEnabledRelease"}, - SyncMethod{45, L"fuseboxNetworkInspectionEnabled"}, - SyncMethod{46, L"hideOffscreenVirtualViewsOnIOS"}, - SyncMethod{47, L"preparedTextCacheSize"}, - SyncMethod{48, L"traceTurboModulePromiseRejectionsOnAndroid"}, - SyncMethod{49, L"updateRuntimeShadowNodeReferencesOnCommit"}, - SyncMethod{50, L"useAlwaysAvailableJSErrorHandling"}, - SyncMethod{51, L"useFabricInterop"}, - SyncMethod{52, L"useNativeViewConfigsInBridgelessMode"}, - SyncMethod{53, L"useOptimizedEventBatchingOnAndroid"}, - SyncMethod{54, L"useRawPropsJsiValue"}, - SyncMethod{55, L"useShadowNodeStateOnClone"}, - SyncMethod{56, L"useTurboModuleInterop"}, - SyncMethod{57, L"useTurboModules"}, - SyncMethod{58, L"virtualViewPrerenderRatio"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "commonTestFlag", - " REACT_SYNC_METHOD(commonTestFlag) bool commonTestFlag() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(commonTestFlag) static bool commonTestFlag() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "commonTestFlagWithoutNativeImplementation", - " REACT_SYNC_METHOD(commonTestFlagWithoutNativeImplementation) bool commonTestFlagWithoutNativeImplementation() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(commonTestFlagWithoutNativeImplementation) static bool commonTestFlagWithoutNativeImplementation() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 2, - "animatedShouldSignalBatch", - " REACT_SYNC_METHOD(animatedShouldSignalBatch) bool animatedShouldSignalBatch() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(animatedShouldSignalBatch) static bool animatedShouldSignalBatch() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 3, - "cxxNativeAnimatedEnabled", - " REACT_SYNC_METHOD(cxxNativeAnimatedEnabled) bool cxxNativeAnimatedEnabled() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(cxxNativeAnimatedEnabled) static bool cxxNativeAnimatedEnabled() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 4, - "cxxNativeAnimatedRemoveJsSync", - " REACT_SYNC_METHOD(cxxNativeAnimatedRemoveJsSync) bool cxxNativeAnimatedRemoveJsSync() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(cxxNativeAnimatedRemoveJsSync) static bool cxxNativeAnimatedRemoveJsSync() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 5, - "disableMainQueueSyncDispatchIOS", - " REACT_SYNC_METHOD(disableMainQueueSyncDispatchIOS) bool disableMainQueueSyncDispatchIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(disableMainQueueSyncDispatchIOS) static bool disableMainQueueSyncDispatchIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 6, - "disableMountItemReorderingAndroid", - " REACT_SYNC_METHOD(disableMountItemReorderingAndroid) bool disableMountItemReorderingAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(disableMountItemReorderingAndroid) static bool disableMountItemReorderingAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 7, - "disableTextLayoutManagerCacheAndroid", - " REACT_SYNC_METHOD(disableTextLayoutManagerCacheAndroid) bool disableTextLayoutManagerCacheAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(disableTextLayoutManagerCacheAndroid) static bool disableTextLayoutManagerCacheAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 8, - "enableAccessibilityOrder", - " REACT_SYNC_METHOD(enableAccessibilityOrder) bool enableAccessibilityOrder() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableAccessibilityOrder) static bool enableAccessibilityOrder() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 9, - "enableAccumulatedUpdatesInRawPropsAndroid", - " REACT_SYNC_METHOD(enableAccumulatedUpdatesInRawPropsAndroid) bool enableAccumulatedUpdatesInRawPropsAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableAccumulatedUpdatesInRawPropsAndroid) static bool enableAccumulatedUpdatesInRawPropsAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 10, - "enableAndroidTextMeasurementOptimizations", - " REACT_SYNC_METHOD(enableAndroidTextMeasurementOptimizations) bool enableAndroidTextMeasurementOptimizations() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableAndroidTextMeasurementOptimizations) static bool enableAndroidTextMeasurementOptimizations() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 11, - "enableBridgelessArchitecture", - " REACT_SYNC_METHOD(enableBridgelessArchitecture) bool enableBridgelessArchitecture() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableBridgelessArchitecture) static bool enableBridgelessArchitecture() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 12, - "enableCppPropsIteratorSetter", - " REACT_SYNC_METHOD(enableCppPropsIteratorSetter) bool enableCppPropsIteratorSetter() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableCppPropsIteratorSetter) static bool enableCppPropsIteratorSetter() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 13, - "enableCustomFocusSearchOnClippedElementsAndroid", - " REACT_SYNC_METHOD(enableCustomFocusSearchOnClippedElementsAndroid) bool enableCustomFocusSearchOnClippedElementsAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableCustomFocusSearchOnClippedElementsAndroid) static bool enableCustomFocusSearchOnClippedElementsAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 14, - "enableDestroyShadowTreeRevisionAsync", - " REACT_SYNC_METHOD(enableDestroyShadowTreeRevisionAsync) bool enableDestroyShadowTreeRevisionAsync() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableDestroyShadowTreeRevisionAsync) static bool enableDestroyShadowTreeRevisionAsync() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 15, - "enableDoubleMeasurementFixAndroid", - " REACT_SYNC_METHOD(enableDoubleMeasurementFixAndroid) bool enableDoubleMeasurementFixAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableDoubleMeasurementFixAndroid) static bool enableDoubleMeasurementFixAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 16, - "enableEagerRootViewAttachment", - " REACT_SYNC_METHOD(enableEagerRootViewAttachment) bool enableEagerRootViewAttachment() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableEagerRootViewAttachment) static bool enableEagerRootViewAttachment() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 17, - "enableFabricLogs", - " REACT_SYNC_METHOD(enableFabricLogs) bool enableFabricLogs() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableFabricLogs) static bool enableFabricLogs() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 18, - "enableFabricRenderer", - " REACT_SYNC_METHOD(enableFabricRenderer) bool enableFabricRenderer() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableFabricRenderer) static bool enableFabricRenderer() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 19, - "enableFixForParentTagDuringReparenting", - " REACT_SYNC_METHOD(enableFixForParentTagDuringReparenting) bool enableFixForParentTagDuringReparenting() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableFixForParentTagDuringReparenting) static bool enableFixForParentTagDuringReparenting() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 20, - "enableFontScaleChangesUpdatingLayout", - " REACT_SYNC_METHOD(enableFontScaleChangesUpdatingLayout) bool enableFontScaleChangesUpdatingLayout() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableFontScaleChangesUpdatingLayout) static bool enableFontScaleChangesUpdatingLayout() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 21, - "enableIOSTextBaselineOffsetPerLine", - " REACT_SYNC_METHOD(enableIOSTextBaselineOffsetPerLine) bool enableIOSTextBaselineOffsetPerLine() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableIOSTextBaselineOffsetPerLine) static bool enableIOSTextBaselineOffsetPerLine() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 22, - "enableIOSViewClipToPaddingBox", - " REACT_SYNC_METHOD(enableIOSViewClipToPaddingBox) bool enableIOSViewClipToPaddingBox() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableIOSViewClipToPaddingBox) static bool enableIOSViewClipToPaddingBox() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 23, - "enableInteropViewManagerClassLookUpOptimizationIOS", - " REACT_SYNC_METHOD(enableInteropViewManagerClassLookUpOptimizationIOS) bool enableInteropViewManagerClassLookUpOptimizationIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableInteropViewManagerClassLookUpOptimizationIOS) static bool enableInteropViewManagerClassLookUpOptimizationIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 24, - "enableLayoutAnimationsOnAndroid", - " REACT_SYNC_METHOD(enableLayoutAnimationsOnAndroid) bool enableLayoutAnimationsOnAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableLayoutAnimationsOnAndroid) static bool enableLayoutAnimationsOnAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 25, - "enableLayoutAnimationsOnIOS", - " REACT_SYNC_METHOD(enableLayoutAnimationsOnIOS) bool enableLayoutAnimationsOnIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableLayoutAnimationsOnIOS) static bool enableLayoutAnimationsOnIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 26, - "enableMainQueueCoordinatorOnIOS", - " REACT_SYNC_METHOD(enableMainQueueCoordinatorOnIOS) bool enableMainQueueCoordinatorOnIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableMainQueueCoordinatorOnIOS) static bool enableMainQueueCoordinatorOnIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 27, - "enableMainQueueModulesOnIOS", - " REACT_SYNC_METHOD(enableMainQueueModulesOnIOS) bool enableMainQueueModulesOnIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableMainQueueModulesOnIOS) static bool enableMainQueueModulesOnIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 28, - "enableModuleArgumentNSNullConversionIOS", - " REACT_SYNC_METHOD(enableModuleArgumentNSNullConversionIOS) bool enableModuleArgumentNSNullConversionIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableModuleArgumentNSNullConversionIOS) static bool enableModuleArgumentNSNullConversionIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 29, - "enableNativeCSSParsing", - " REACT_SYNC_METHOD(enableNativeCSSParsing) bool enableNativeCSSParsing() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableNativeCSSParsing) static bool enableNativeCSSParsing() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 30, - "enableNetworkEventReporting", - " REACT_SYNC_METHOD(enableNetworkEventReporting) bool enableNetworkEventReporting() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableNetworkEventReporting) static bool enableNetworkEventReporting() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 31, - "enableNewBackgroundAndBorderDrawables", - " REACT_SYNC_METHOD(enableNewBackgroundAndBorderDrawables) bool enableNewBackgroundAndBorderDrawables() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableNewBackgroundAndBorderDrawables) static bool enableNewBackgroundAndBorderDrawables() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 32, - "enablePreparedTextLayout", - " REACT_SYNC_METHOD(enablePreparedTextLayout) bool enablePreparedTextLayout() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enablePreparedTextLayout) static bool enablePreparedTextLayout() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 33, - "enablePropsUpdateReconciliationAndroid", - " REACT_SYNC_METHOD(enablePropsUpdateReconciliationAndroid) bool enablePropsUpdateReconciliationAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enablePropsUpdateReconciliationAndroid) static bool enablePropsUpdateReconciliationAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 34, - "enableResourceTimingAPI", - " REACT_SYNC_METHOD(enableResourceTimingAPI) bool enableResourceTimingAPI() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableResourceTimingAPI) static bool enableResourceTimingAPI() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 35, - "enableSynchronousStateUpdates", - " REACT_SYNC_METHOD(enableSynchronousStateUpdates) bool enableSynchronousStateUpdates() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableSynchronousStateUpdates) static bool enableSynchronousStateUpdates() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 36, - "enableViewCulling", - " REACT_SYNC_METHOD(enableViewCulling) bool enableViewCulling() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableViewCulling) static bool enableViewCulling() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 37, - "enableViewRecycling", - " REACT_SYNC_METHOD(enableViewRecycling) bool enableViewRecycling() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableViewRecycling) static bool enableViewRecycling() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 38, - "enableViewRecyclingForText", - " REACT_SYNC_METHOD(enableViewRecyclingForText) bool enableViewRecyclingForText() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableViewRecyclingForText) static bool enableViewRecyclingForText() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 39, - "enableViewRecyclingForView", - " REACT_SYNC_METHOD(enableViewRecyclingForView) bool enableViewRecyclingForView() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableViewRecyclingForView) static bool enableViewRecyclingForView() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 40, - "enableVirtualViewDebugFeatures", - " REACT_SYNC_METHOD(enableVirtualViewDebugFeatures) bool enableVirtualViewDebugFeatures() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableVirtualViewDebugFeatures) static bool enableVirtualViewDebugFeatures() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 41, - "enableVirtualViewRenderState", - " REACT_SYNC_METHOD(enableVirtualViewRenderState) bool enableVirtualViewRenderState() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableVirtualViewRenderState) static bool enableVirtualViewRenderState() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 42, - "enableVirtualViewWindowFocusDetection", - " REACT_SYNC_METHOD(enableVirtualViewWindowFocusDetection) bool enableVirtualViewWindowFocusDetection() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(enableVirtualViewWindowFocusDetection) static bool enableVirtualViewWindowFocusDetection() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 43, - "fixMappingOfEventPrioritiesBetweenFabricAndReact", - " REACT_SYNC_METHOD(fixMappingOfEventPrioritiesBetweenFabricAndReact) bool fixMappingOfEventPrioritiesBetweenFabricAndReact() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(fixMappingOfEventPrioritiesBetweenFabricAndReact) static bool fixMappingOfEventPrioritiesBetweenFabricAndReact() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 44, - "fuseboxEnabledRelease", - " REACT_SYNC_METHOD(fuseboxEnabledRelease) bool fuseboxEnabledRelease() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(fuseboxEnabledRelease) static bool fuseboxEnabledRelease() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 45, - "fuseboxNetworkInspectionEnabled", - " REACT_SYNC_METHOD(fuseboxNetworkInspectionEnabled) bool fuseboxNetworkInspectionEnabled() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(fuseboxNetworkInspectionEnabled) static bool fuseboxNetworkInspectionEnabled() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 46, - "hideOffscreenVirtualViewsOnIOS", - " REACT_SYNC_METHOD(hideOffscreenVirtualViewsOnIOS) bool hideOffscreenVirtualViewsOnIOS() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(hideOffscreenVirtualViewsOnIOS) static bool hideOffscreenVirtualViewsOnIOS() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 47, - "preparedTextCacheSize", - " REACT_SYNC_METHOD(preparedTextCacheSize) double preparedTextCacheSize() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(preparedTextCacheSize) static double preparedTextCacheSize() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 48, - "traceTurboModulePromiseRejectionsOnAndroid", - " REACT_SYNC_METHOD(traceTurboModulePromiseRejectionsOnAndroid) bool traceTurboModulePromiseRejectionsOnAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(traceTurboModulePromiseRejectionsOnAndroid) static bool traceTurboModulePromiseRejectionsOnAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 49, - "updateRuntimeShadowNodeReferencesOnCommit", - " REACT_SYNC_METHOD(updateRuntimeShadowNodeReferencesOnCommit) bool updateRuntimeShadowNodeReferencesOnCommit() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(updateRuntimeShadowNodeReferencesOnCommit) static bool updateRuntimeShadowNodeReferencesOnCommit() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 50, - "useAlwaysAvailableJSErrorHandling", - " REACT_SYNC_METHOD(useAlwaysAvailableJSErrorHandling) bool useAlwaysAvailableJSErrorHandling() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useAlwaysAvailableJSErrorHandling) static bool useAlwaysAvailableJSErrorHandling() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 51, - "useFabricInterop", - " REACT_SYNC_METHOD(useFabricInterop) bool useFabricInterop() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useFabricInterop) static bool useFabricInterop() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 52, - "useNativeViewConfigsInBridgelessMode", - " REACT_SYNC_METHOD(useNativeViewConfigsInBridgelessMode) bool useNativeViewConfigsInBridgelessMode() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useNativeViewConfigsInBridgelessMode) static bool useNativeViewConfigsInBridgelessMode() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 53, - "useOptimizedEventBatchingOnAndroid", - " REACT_SYNC_METHOD(useOptimizedEventBatchingOnAndroid) bool useOptimizedEventBatchingOnAndroid() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useOptimizedEventBatchingOnAndroid) static bool useOptimizedEventBatchingOnAndroid() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 54, - "useRawPropsJsiValue", - " REACT_SYNC_METHOD(useRawPropsJsiValue) bool useRawPropsJsiValue() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useRawPropsJsiValue) static bool useRawPropsJsiValue() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 55, - "useShadowNodeStateOnClone", - " REACT_SYNC_METHOD(useShadowNodeStateOnClone) bool useShadowNodeStateOnClone() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useShadowNodeStateOnClone) static bool useShadowNodeStateOnClone() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 56, - "useTurboModuleInterop", - " REACT_SYNC_METHOD(useTurboModuleInterop) bool useTurboModuleInterop() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useTurboModuleInterop) static bool useTurboModuleInterop() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 57, - "useTurboModules", - " REACT_SYNC_METHOD(useTurboModules) bool useTurboModules() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(useTurboModules) static bool useTurboModules() noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 58, - "virtualViewPrerenderRatio", - " REACT_SYNC_METHOD(virtualViewPrerenderRatio) double virtualViewPrerenderRatio() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(virtualViewPrerenderRatio) static double virtualViewPrerenderRatio() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/rnwcoreJSI-generated.cpp b/vnext/codegen/rnwcoreJSI-generated.cpp deleted file mode 100644 index cddc9cff31f..00000000000 --- a/vnext/codegen/rnwcoreJSI-generated.cpp +++ /dev/null @@ -1,3412 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleCpp.js - */ - -#include "rnwcoreJSI.h" - -namespace facebook::react { - -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->commonTestFlag( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlagWithoutNativeImplementation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->commonTestFlagWithoutNativeImplementation( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_animatedShouldSignalBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->animatedShouldSignalBatch( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->cxxNativeAnimatedEnabled( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedRemoveJsSync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->cxxNativeAnimatedRemoveJsSync( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMainQueueSyncDispatchIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->disableMainQueueSyncDispatchIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMountItemReorderingAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->disableMountItemReorderingAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->disableTextLayoutManagerCacheAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccessibilityOrder(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableAccessibilityOrder( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccumulatedUpdatesInRawPropsAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableAccumulatedUpdatesInRawPropsAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAndroidTextMeasurementOptimizations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableAndroidTextMeasurementOptimizations( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableBridgelessArchitecture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableBridgelessArchitecture( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableCppPropsIteratorSetter(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableCppPropsIteratorSetter( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableCustomFocusSearchOnClippedElementsAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableCustomFocusSearchOnClippedElementsAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableDestroyShadowTreeRevisionAsync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableDestroyShadowTreeRevisionAsync( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableDoubleMeasurementFixAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableDoubleMeasurementFixAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableEagerRootViewAttachment(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableEagerRootViewAttachment( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricLogs(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableFabricLogs( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricRenderer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableFabricRenderer( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFixForParentTagDuringReparenting(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableFixForParentTagDuringReparenting( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFontScaleChangesUpdatingLayout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableFontScaleChangesUpdatingLayout( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableIOSTextBaselineOffsetPerLine( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSViewClipToPaddingBox(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableIOSViewClipToPaddingBox( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableInteropViewManagerClassLookUpOptimizationIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableInteropViewManagerClassLookUpOptimizationIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableLayoutAnimationsOnAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableLayoutAnimationsOnIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableMainQueueCoordinatorOnIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueModulesOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableMainQueueModulesOnIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableModuleArgumentNSNullConversionIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNativeCSSParsing(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableNativeCSSParsing( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNetworkEventReporting(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableNetworkEventReporting( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNewBackgroundAndBorderDrawables(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableNewBackgroundAndBorderDrawables( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enablePreparedTextLayout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enablePreparedTextLayout( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enablePropsUpdateReconciliationAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enablePropsUpdateReconciliationAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableResourceTimingAPI(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableResourceTimingAPI( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableSynchronousStateUpdates(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableSynchronousStateUpdates( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewCulling(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableViewCulling( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecycling(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableViewRecycling( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecyclingForText(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableViewRecyclingForText( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecyclingForView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableViewRecyclingForView( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewDebugFeatures(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableVirtualViewDebugFeatures( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewRenderState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableVirtualViewRenderState( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewWindowFocusDetection(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->enableVirtualViewWindowFocusDetection( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->fixMappingOfEventPrioritiesBetweenFabricAndReact( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxEnabledRelease(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->fuseboxEnabledRelease( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxNetworkInspectionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->fuseboxNetworkInspectionEnabled( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_hideOffscreenVirtualViewsOnIOS(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->hideOffscreenVirtualViewsOnIOS( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_preparedTextCacheSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->preparedTextCacheSize( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->traceTurboModulePromiseRejectionsOnAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->updateRuntimeShadowNodeReferencesOnCommit( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useAlwaysAvailableJSErrorHandling( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useFabricInterop( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useNativeViewConfigsInBridgelessMode( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useOptimizedEventBatchingOnAndroid( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useRawPropsJsiValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useRawPropsJsiValue( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useShadowNodeStateOnClone(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useShadowNodeStateOnClone( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModuleInterop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useTurboModuleInterop( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModules(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->useTurboModules( - rt - ); -} -static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_virtualViewPrerenderRatio(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->virtualViewPrerenderRatio( - rt - ); -} - -NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeReactNativeFeatureFlagsCxx", jsInvoker) { - methodMap_["commonTestFlag"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlag}; - methodMap_["commonTestFlagWithoutNativeImplementation"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlagWithoutNativeImplementation}; - methodMap_["animatedShouldSignalBatch"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_animatedShouldSignalBatch}; - methodMap_["cxxNativeAnimatedEnabled"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedEnabled}; - methodMap_["cxxNativeAnimatedRemoveJsSync"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedRemoveJsSync}; - methodMap_["disableMainQueueSyncDispatchIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMainQueueSyncDispatchIOS}; - methodMap_["disableMountItemReorderingAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMountItemReorderingAndroid}; - methodMap_["disableTextLayoutManagerCacheAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableTextLayoutManagerCacheAndroid}; - methodMap_["enableAccessibilityOrder"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccessibilityOrder}; - methodMap_["enableAccumulatedUpdatesInRawPropsAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAccumulatedUpdatesInRawPropsAndroid}; - methodMap_["enableAndroidTextMeasurementOptimizations"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableAndroidTextMeasurementOptimizations}; - methodMap_["enableBridgelessArchitecture"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableBridgelessArchitecture}; - methodMap_["enableCppPropsIteratorSetter"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableCppPropsIteratorSetter}; - methodMap_["enableCustomFocusSearchOnClippedElementsAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableCustomFocusSearchOnClippedElementsAndroid}; - methodMap_["enableDestroyShadowTreeRevisionAsync"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableDestroyShadowTreeRevisionAsync}; - methodMap_["enableDoubleMeasurementFixAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableDoubleMeasurementFixAndroid}; - methodMap_["enableEagerRootViewAttachment"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableEagerRootViewAttachment}; - methodMap_["enableFabricLogs"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricLogs}; - methodMap_["enableFabricRenderer"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFabricRenderer}; - methodMap_["enableFixForParentTagDuringReparenting"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFixForParentTagDuringReparenting}; - methodMap_["enableFontScaleChangesUpdatingLayout"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableFontScaleChangesUpdatingLayout}; - methodMap_["enableIOSTextBaselineOffsetPerLine"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSTextBaselineOffsetPerLine}; - methodMap_["enableIOSViewClipToPaddingBox"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableIOSViewClipToPaddingBox}; - methodMap_["enableInteropViewManagerClassLookUpOptimizationIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableInteropViewManagerClassLookUpOptimizationIOS}; - methodMap_["enableLayoutAnimationsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnAndroid}; - methodMap_["enableLayoutAnimationsOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableLayoutAnimationsOnIOS}; - methodMap_["enableMainQueueCoordinatorOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueCoordinatorOnIOS}; - methodMap_["enableMainQueueModulesOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMainQueueModulesOnIOS}; - methodMap_["enableModuleArgumentNSNullConversionIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableModuleArgumentNSNullConversionIOS}; - methodMap_["enableNativeCSSParsing"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNativeCSSParsing}; - methodMap_["enableNetworkEventReporting"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNetworkEventReporting}; - methodMap_["enableNewBackgroundAndBorderDrawables"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableNewBackgroundAndBorderDrawables}; - methodMap_["enablePreparedTextLayout"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enablePreparedTextLayout}; - methodMap_["enablePropsUpdateReconciliationAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enablePropsUpdateReconciliationAndroid}; - methodMap_["enableResourceTimingAPI"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableResourceTimingAPI}; - methodMap_["enableSynchronousStateUpdates"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableSynchronousStateUpdates}; - methodMap_["enableViewCulling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewCulling}; - methodMap_["enableViewRecycling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecycling}; - methodMap_["enableViewRecyclingForText"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecyclingForText}; - methodMap_["enableViewRecyclingForView"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableViewRecyclingForView}; - methodMap_["enableVirtualViewDebugFeatures"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewDebugFeatures}; - methodMap_["enableVirtualViewRenderState"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewRenderState}; - methodMap_["enableVirtualViewWindowFocusDetection"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableVirtualViewWindowFocusDetection}; - methodMap_["fixMappingOfEventPrioritiesBetweenFabricAndReact"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fixMappingOfEventPrioritiesBetweenFabricAndReact}; - methodMap_["fuseboxEnabledRelease"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxEnabledRelease}; - methodMap_["fuseboxNetworkInspectionEnabled"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_fuseboxNetworkInspectionEnabled}; - methodMap_["hideOffscreenVirtualViewsOnIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_hideOffscreenVirtualViewsOnIOS}; - methodMap_["preparedTextCacheSize"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_preparedTextCacheSize}; - methodMap_["traceTurboModulePromiseRejectionsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid}; - methodMap_["updateRuntimeShadowNodeReferencesOnCommit"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit}; - methodMap_["useAlwaysAvailableJSErrorHandling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling}; - methodMap_["useFabricInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop}; - methodMap_["useNativeViewConfigsInBridgelessMode"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useNativeViewConfigsInBridgelessMode}; - methodMap_["useOptimizedEventBatchingOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useOptimizedEventBatchingOnAndroid}; - methodMap_["useRawPropsJsiValue"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useRawPropsJsiValue}; - methodMap_["useShadowNodeStateOnClone"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useShadowNodeStateOnClone}; - methodMap_["useTurboModuleInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModuleInterop}; - methodMap_["useTurboModules"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModules}; - methodMap_["virtualViewPrerenderRatio"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_virtualViewPrerenderRatio}; -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isReduceMotionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isReduceMotionEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isInvertColorsEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isInvertColorsEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isHighTextContrastEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isHighTextContrastEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isTouchExplorationEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isTouchExplorationEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isAccessibilityServiceEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isAccessibilityServiceEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_setAccessibilityFocus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityFocus( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_announceForAccessibility(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibility( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_getRecommendedTimeoutMillis(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getRecommendedTimeoutMillis( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isGrayscaleEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->isGrayscaleEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeAccessibilityInfoCxxSpecJSI::NativeAccessibilityInfoCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AccessibilityInfo", jsInvoker) { - methodMap_["isReduceMotionEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isReduceMotionEnabled}; - methodMap_["isInvertColorsEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isInvertColorsEnabled}; - methodMap_["isHighTextContrastEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isHighTextContrastEnabled}; - methodMap_["isTouchExplorationEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isTouchExplorationEnabled}; - methodMap_["isAccessibilityServiceEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isAccessibilityServiceEnabled}; - methodMap_["setAccessibilityFocus"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_setAccessibilityFocus}; - methodMap_["announceForAccessibility"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_announceForAccessibility}; - methodMap_["getRecommendedTimeoutMillis"] = MethodMetadata {2, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_getRecommendedTimeoutMillis}; - methodMap_["isGrayscaleEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isGrayscaleEnabled}; -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentBoldTextState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentBoldTextState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentGrayscaleState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentGrayscaleState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentInvertColorsState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentInvertColorsState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceMotionState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentReduceMotionState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentDarkerSystemColorsState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentDarkerSystemColorsState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentPrefersCrossFadeTransitionsState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceTransparencyState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentReduceTransparencyState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentVoiceOverState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentVoiceOverState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityContentSizeMultipliers( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityFocus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAccessibilityFocus( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibility(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibility( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibilityWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->announceForAccessibilityWithOptions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} - -NativeAccessibilityManagerCxxSpecJSI::NativeAccessibilityManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AccessibilityManager", jsInvoker) { - methodMap_["getCurrentBoldTextState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentBoldTextState}; - methodMap_["getCurrentGrayscaleState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentGrayscaleState}; - methodMap_["getCurrentInvertColorsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentInvertColorsState}; - methodMap_["getCurrentReduceMotionState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceMotionState}; - methodMap_["getCurrentDarkerSystemColorsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentDarkerSystemColorsState}; - methodMap_["getCurrentPrefersCrossFadeTransitionsState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentPrefersCrossFadeTransitionsState}; - methodMap_["getCurrentReduceTransparencyState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentReduceTransparencyState}; - methodMap_["getCurrentVoiceOverState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_getCurrentVoiceOverState}; - methodMap_["setAccessibilityContentSizeMultipliers"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityContentSizeMultipliers}; - methodMap_["setAccessibilityFocus"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_setAccessibilityFocus}; - methodMap_["announceForAccessibility"] = MethodMetadata {1, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibility}; - methodMap_["announceForAccessibilityWithOptions"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerCxxSpecJSI_announceForAccessibilityWithOptions}; -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_showActionSheetWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showActionSheetWithOptions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_showShareActionSheetWithOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showShareActionSheetWithOptions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeActionSheetManagerCxxSpecJSI_dismissActionSheet(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismissActionSheet( - rt - ); - return jsi::Value::undefined(); -} - -NativeActionSheetManagerCxxSpecJSI::NativeActionSheetManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ActionSheetManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeActionSheetManagerCxxSpecJSI_getConstants}; - methodMap_["showActionSheetWithOptions"] = MethodMetadata {2, __hostFunction_NativeActionSheetManagerCxxSpecJSI_showActionSheetWithOptions}; - methodMap_["showShareActionSheetWithOptions"] = MethodMetadata {3, __hostFunction_NativeActionSheetManagerCxxSpecJSI_showShareActionSheetWithOptions}; - methodMap_["dismissActionSheet"] = MethodMetadata {0, __hostFunction_NativeActionSheetManagerCxxSpecJSI_dismissActionSheet}; -} -static jsi::Value __hostFunction_NativeAlertManagerCxxSpecJSI_alertWithArgs(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->alertWithArgs( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeAlertManagerCxxSpecJSI::NativeAlertManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AlertManager", jsInvoker) { - methodMap_["alertWithArgs"] = MethodMetadata {2, __hostFunction_NativeAlertManagerCxxSpecJSI_alertWithArgs}; -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_finishOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->finishOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_createAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createAnimatedNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_updateAnimatedNodeConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateAnimatedNodeConfig( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startListeningToAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopListeningToAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_startAnimatingNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startAnimatingNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopAnimation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopAnimation( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_flattenAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->flattenAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_extractAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->extractAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodeToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodeToView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodeFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodeFromView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_restoreDefaultValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->restoreDefaultValues( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_dropAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dropAnimatedNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_addAnimatedEventToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addAnimatedEventToView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeAnimatedEventFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAnimatedEventFromView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedModuleCxxSpecJSI_queueAndExecuteBatchedOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->queueAndExecuteBatchedOperations( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeAnimatedModuleCxxSpecJSI::NativeAnimatedModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeAnimatedModule", jsInvoker) { - methodMap_["startOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startOperationBatch}; - methodMap_["finishOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedModuleCxxSpecJSI_finishOperationBatch}; - methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_createAnimatedNode}; - methodMap_["updateAnimatedNodeConfig"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_updateAnimatedNodeConfig}; - methodMap_["getValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_getValue}; - methodMap_["startListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startListeningToAnimatedNodeValue}; - methodMap_["stopListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopListeningToAnimatedNodeValue}; - methodMap_["connectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodes}; - methodMap_["disconnectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodes}; - methodMap_["startAnimatingNode"] = MethodMetadata {4, __hostFunction_NativeAnimatedModuleCxxSpecJSI_startAnimatingNode}; - methodMap_["stopAnimation"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_stopAnimation}; - methodMap_["setAnimatedNodeValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeValue}; - methodMap_["setAnimatedNodeOffset"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_setAnimatedNodeOffset}; - methodMap_["flattenAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_flattenAnimatedNodeOffset}; - methodMap_["extractAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_extractAnimatedNodeOffset}; - methodMap_["connectAnimatedNodeToView"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_connectAnimatedNodeToView}; - methodMap_["disconnectAnimatedNodeFromView"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleCxxSpecJSI_disconnectAnimatedNodeFromView}; - methodMap_["restoreDefaultValues"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_restoreDefaultValues}; - methodMap_["dropAnimatedNode"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_dropAnimatedNode}; - methodMap_["addAnimatedEventToView"] = MethodMetadata {3, __hostFunction_NativeAnimatedModuleCxxSpecJSI_addAnimatedEventToView}; - methodMap_["removeAnimatedEventFromView"] = MethodMetadata {3, __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeAnimatedEventFromView}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_removeListeners}; - methodMap_["queueAndExecuteBatchedOperations"] = MethodMetadata {1, __hostFunction_NativeAnimatedModuleCxxSpecJSI_queueAndExecuteBatchedOperations}; -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_finishOperationBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->finishOperationBatch( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_createAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createAnimatedNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_updateAnimatedNodeConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateAnimatedNodeConfig( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startListeningToAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopListeningToAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopListeningToAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startAnimatingNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->startAnimatingNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopAnimation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->stopAnimation( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_flattenAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->flattenAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_extractAnimatedNodeOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->extractAnimatedNodeOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodeToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connectAnimatedNodeToView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodeFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnectAnimatedNodeFromView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_restoreDefaultValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->restoreDefaultValues( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_dropAnimatedNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dropAnimatedNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addAnimatedEventToView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addAnimatedEventToView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeAnimatedEventFromView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAnimatedEventFromView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_queueAndExecuteBatchedOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->queueAndExecuteBatchedOperations( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeAnimatedTurboModuleCxxSpecJSI::NativeAnimatedTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeAnimatedTurboModule", jsInvoker) { - methodMap_["startOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startOperationBatch}; - methodMap_["finishOperationBatch"] = MethodMetadata {0, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_finishOperationBatch}; - methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_createAnimatedNode}; - methodMap_["updateAnimatedNodeConfig"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_updateAnimatedNodeConfig}; - methodMap_["getValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_getValue}; - methodMap_["startListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startListeningToAnimatedNodeValue}; - methodMap_["stopListeningToAnimatedNodeValue"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopListeningToAnimatedNodeValue}; - methodMap_["connectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodes}; - methodMap_["disconnectAnimatedNodes"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodes}; - methodMap_["startAnimatingNode"] = MethodMetadata {4, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_startAnimatingNode}; - methodMap_["stopAnimation"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_stopAnimation}; - methodMap_["setAnimatedNodeValue"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeValue}; - methodMap_["setAnimatedNodeOffset"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_setAnimatedNodeOffset}; - methodMap_["flattenAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_flattenAnimatedNodeOffset}; - methodMap_["extractAnimatedNodeOffset"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_extractAnimatedNodeOffset}; - methodMap_["connectAnimatedNodeToView"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_connectAnimatedNodeToView}; - methodMap_["disconnectAnimatedNodeFromView"] = MethodMetadata {2, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_disconnectAnimatedNodeFromView}; - methodMap_["restoreDefaultValues"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_restoreDefaultValues}; - methodMap_["dropAnimatedNode"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_dropAnimatedNode}; - methodMap_["addAnimatedEventToView"] = MethodMetadata {3, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addAnimatedEventToView}; - methodMap_["removeAnimatedEventFromView"] = MethodMetadata {3, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeAnimatedEventFromView}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_removeListeners}; - methodMap_["queueAndExecuteBatchedOperations"] = MethodMetadata {1, __hostFunction_NativeAnimatedTurboModuleCxxSpecJSI_queueAndExecuteBatchedOperations}; -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_getColorScheme(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getColorScheme( - rt - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_setColorScheme(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setColorScheme( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppearanceCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeAppearanceCxxSpecJSI::NativeAppearanceCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Appearance", jsInvoker) { - methodMap_["getColorScheme"] = MethodMetadata {0, __hostFunction_NativeAppearanceCxxSpecJSI_getColorScheme}; - methodMap_["setColorScheme"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_setColorScheme}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAppearanceCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_getCurrentAppState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getCurrentAppState( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeAppStateCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeAppStateCxxSpecJSI::NativeAppStateCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AppState", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeAppStateCxxSpecJSI_getConstants}; - methodMap_["getCurrentAppState"] = MethodMetadata {2, __hostFunction_NativeAppStateCxxSpecJSI_getCurrentAppState}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAppStateCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAppStateCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeAppThemeCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativeAppThemeCxxSpecJSI::NativeAppThemeCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("AppTheme", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeAppThemeCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_addNetworkingHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addNetworkingHandler( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_addWebSocketHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addWebSocketHandler( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_removeWebSocketHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeWebSocketHandler( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_sendOverSocket(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendOverSocket( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_createFromParts(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createFromParts( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeBlobModuleCxxSpecJSI_release(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->release( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeBlobModuleCxxSpecJSI::NativeBlobModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("BlobModule", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeBlobModuleCxxSpecJSI_getConstants}; - methodMap_["addNetworkingHandler"] = MethodMetadata {0, __hostFunction_NativeBlobModuleCxxSpecJSI_addNetworkingHandler}; - methodMap_["addWebSocketHandler"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_addWebSocketHandler}; - methodMap_["removeWebSocketHandler"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_removeWebSocketHandler}; - methodMap_["sendOverSocket"] = MethodMetadata {2, __hostFunction_NativeBlobModuleCxxSpecJSI_sendOverSocket}; - methodMap_["createFromParts"] = MethodMetadata {2, __hostFunction_NativeBlobModuleCxxSpecJSI_createFromParts}; - methodMap_["release"] = MethodMetadata {1, __hostFunction_NativeBlobModuleCxxSpecJSI_release}; -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString( - rt - ); -} -static jsi::Value __hostFunction_NativeClipboardCxxSpecJSI_setString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setString( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeClipboardCxxSpecJSI::NativeClipboardCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Clipboard", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeClipboardCxxSpecJSI_getConstants}; - methodMap_["getString"] = MethodMetadata {0, __hostFunction_NativeClipboardCxxSpecJSI_getString}; - methodMap_["setString"] = MethodMetadata {1, __hostFunction_NativeClipboardCxxSpecJSI_setString}; -} -static jsi::Value __hostFunction_NativeDeviceEventManagerCxxSpecJSI_invokeDefaultBackPressHandler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->invokeDefaultBackPressHandler( - rt - ); - return jsi::Value::undefined(); -} - -NativeDeviceEventManagerCxxSpecJSI::NativeDeviceEventManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DeviceEventManager", jsInvoker) { - methodMap_["invokeDefaultBackPressHandler"] = MethodMetadata {0, __hostFunction_NativeDeviceEventManagerCxxSpecJSI_invokeDefaultBackPressHandler}; -} -static jsi::Value __hostFunction_NativeDeviceInfoCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativeDeviceInfoCxxSpecJSI::NativeDeviceInfoCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DeviceInfo", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDeviceInfoCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativeDevLoadingViewCxxSpecJSI_showMessage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showMessage( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asNumber()), - count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asNumber()) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevLoadingViewCxxSpecJSI_hide(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hide( - rt - ); - return jsi::Value::undefined(); -} - -NativeDevLoadingViewCxxSpecJSI::NativeDevLoadingViewCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevLoadingView", jsInvoker) { - methodMap_["showMessage"] = MethodMetadata {3, __hostFunction_NativeDevLoadingViewCxxSpecJSI_showMessage}; - methodMap_["hide"] = MethodMetadata {0, __hostFunction_NativeDevLoadingViewCxxSpecJSI_hide}; -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_reload(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reload( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_reloadWithReason(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reloadWithReason( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_onFastRefresh(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->onFastRefresh( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setHotLoadingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHotLoadingEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setProfilingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setProfilingEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_toggleElementInspector(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->toggleElementInspector( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_addMenuItem(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addMenuItem( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_openDebugger(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->openDebugger( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevSettingsCxxSpecJSI_setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setIsShakeToShowDevMenuEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeDevSettingsCxxSpecJSI::NativeDevSettingsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevSettings", jsInvoker) { - methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_reload}; - methodMap_["reloadWithReason"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_reloadWithReason}; - methodMap_["onFastRefresh"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_onFastRefresh}; - methodMap_["setHotLoadingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setHotLoadingEnabled}; - methodMap_["setProfilingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setProfilingEnabled}; - methodMap_["toggleElementInspector"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_toggleElementInspector}; - methodMap_["addMenuItem"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_addMenuItem}; - methodMap_["openDebugger"] = MethodMetadata {0, __hostFunction_NativeDevSettingsCxxSpecJSI_openDebugger}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_removeListeners}; - methodMap_["setIsShakeToShowDevMenuEnabled"] = MethodMetadata {1, __hostFunction_NativeDevSettingsCxxSpecJSI_setIsShakeToShowDevMenuEnabled}; -} -static jsi::Value __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_showAlert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showAlert( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeDialogManagerAndroidCxxSpecJSI::NativeDialogManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DialogManagerAndroid", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_getConstants}; - methodMap_["showAlert"] = MethodMetadata {3, __hostFunction_NativeDialogManagerAndroidCxxSpecJSI_showAlert}; -} -static jsi::Value __hostFunction_NativeDialogManagerWindowsCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeDialogManagerWindowsCxxSpecJSI_showAlert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showAlert( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeDialogManagerWindowsCxxSpecJSI::NativeDialogManagerWindowsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Alert", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDialogManagerWindowsCxxSpecJSI_getConstants}; - methodMap_["showAlert"] = MethodMetadata {3, __hostFunction_NativeDialogManagerWindowsCxxSpecJSI_showAlert}; -} -static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportFatalException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportFatalException( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportSoftException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportSoftException( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportException(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reportException( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeExceptionsManagerCxxSpecJSI_dismissRedbox(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismissRedbox( - rt - ); - return jsi::Value::undefined(); -} - -NativeExceptionsManagerCxxSpecJSI::NativeExceptionsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ExceptionsManager", jsInvoker) { - methodMap_["reportFatalException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportFatalException}; - methodMap_["reportSoftException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportSoftException}; - methodMap_["reportException"] = MethodMetadata {1, __hostFunction_NativeExceptionsManagerCxxSpecJSI_reportException}; - methodMap_["dismissRedbox"] = MethodMetadata {0, __hostFunction_NativeExceptionsManagerCxxSpecJSI_dismissRedbox}; -} -static jsi::Value __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsDataURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->readAsDataURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsText(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->readAsText( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); -} - -NativeFileReaderModuleCxxSpecJSI::NativeFileReaderModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("FileReaderModule", jsInvoker) { - methodMap_["readAsDataURL"] = MethodMetadata {1, __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsDataURL}; - methodMap_["readAsText"] = MethodMetadata {2, __hostFunction_NativeFileReaderModuleCxxSpecJSI_readAsText}; -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setGlobalOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setGlobalOptions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setContext(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setContext( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_beginScroll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->beginScroll( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeFrameRateLoggerCxxSpecJSI_endScroll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->endScroll( - rt - ); - return jsi::Value::undefined(); -} - -NativeFrameRateLoggerCxxSpecJSI::NativeFrameRateLoggerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("FrameRateLogger", jsInvoker) { - methodMap_["setGlobalOptions"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setGlobalOptions}; - methodMap_["setContext"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_setContext}; - methodMap_["beginScroll"] = MethodMetadata {0, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_beginScroll}; - methodMap_["endScroll"] = MethodMetadata {0, __hostFunction_NativeFrameRateLoggerCxxSpecJSI_endScroll}; -} -static jsi::Value __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskFinished(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->notifyTaskFinished( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskRetry(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->notifyTaskRetry( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} - -NativeHeadlessJsTaskSupportCxxSpecJSI::NativeHeadlessJsTaskSupportCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("HeadlessJsTaskSupport", jsInvoker) { - methodMap_["notifyTaskFinished"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskFinished}; - methodMap_["notifyTaskRetry"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportCxxSpecJSI_notifyTaskRetry}; -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_allowRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->allowRTL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_forceRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->forceRTL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeI18nManagerCxxSpecJSI_swapLeftAndRightInRTL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->swapLeftAndRightInRTL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeI18nManagerCxxSpecJSI::NativeI18nManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("I18nManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeI18nManagerCxxSpecJSI_getConstants}; - methodMap_["allowRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_allowRTL}; - methodMap_["forceRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_forceRTL}; - methodMap_["swapLeftAndRightInRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerCxxSpecJSI_swapLeftAndRightInRTL}; -} -static jsi::Value __hostFunction_NativeImageEditorCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageEditorCxxSpecJSI_cropImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cropImage( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageEditorCxxSpecJSI::NativeImageEditorCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageEditingManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageEditorCxxSpecJSI_getConstants}; - methodMap_["cropImage"] = MethodMetadata {4, __hostFunction_NativeImageEditorCxxSpecJSI_cropImage}; -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSize( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSizeWithHeaders(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSizeWithHeaders( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_prefetchImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImage( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); -} -static jsi::Value __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_queryCache(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->queryCache( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} - -NativeImageLoaderAndroidCxxSpecJSI::NativeImageLoaderAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageLoader", jsInvoker) { - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_abortRequest}; - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getConstants}; - methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSize}; - methodMap_["getSizeWithHeaders"] = MethodMetadata {2, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_getSizeWithHeaders}; - methodMap_["prefetchImage"] = MethodMetadata {2, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_prefetchImage}; - methodMap_["queryCache"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidCxxSpecJSI_queryCache}; -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSize( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSizeWithHeaders(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSizeWithHeaders( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImage( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImageWithMetadata(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->prefetchImageWithMetadata( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); -} -static jsi::Value __hostFunction_NativeImageLoaderIOSCxxSpecJSI_queryCache(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->queryCache( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} - -NativeImageLoaderIOSCxxSpecJSI::NativeImageLoaderIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageLoader", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getConstants}; - methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSize}; - methodMap_["getSizeWithHeaders"] = MethodMetadata {2, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_getSizeWithHeaders}; - methodMap_["prefetchImage"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImage}; - methodMap_["prefetchImageWithMetadata"] = MethodMetadata {3, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_prefetchImageWithMetadata}; - methodMap_["queryCache"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSCxxSpecJSI_queryCache}; -} -static jsi::Value __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getBase64ForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getBase64ForTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageStoreAndroidCxxSpecJSI::NativeImageStoreAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageStoreManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getConstants}; - methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreAndroidCxxSpecJSI_getBase64ForTag}; -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_getBase64ForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getBase64ForTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_hasImageForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hasImageForTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_removeImageForTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeImageForTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeImageStoreIOSCxxSpecJSI_addImageFromBase64(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addImageFromBase64( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeImageStoreIOSCxxSpecJSI::NativeImageStoreIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ImageStoreManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeImageStoreIOSCxxSpecJSI_getConstants}; - methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreIOSCxxSpecJSI_getBase64ForTag}; - methodMap_["hasImageForTag"] = MethodMetadata {2, __hostFunction_NativeImageStoreIOSCxxSpecJSI_hasImageForTag}; - methodMap_["removeImageForTag"] = MethodMetadata {1, __hostFunction_NativeImageStoreIOSCxxSpecJSI_removeImageForTag}; - methodMap_["addImageFromBase64"] = MethodMetadata {3, __hostFunction_NativeImageStoreIOSCxxSpecJSI_addImageFromBase64}; -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_getInitialURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialURL( - rt - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_canOpenURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->canOpenURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_openURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_openSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openSettings( - rt - ); -} -static jsi::Value __hostFunction_NativeIntentAndroidCxxSpecJSI_sendIntent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->sendIntent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt).asArray(rt)) - ); -} - -NativeIntentAndroidCxxSpecJSI::NativeIntentAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("IntentAndroid", jsInvoker) { - methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeIntentAndroidCxxSpecJSI_getInitialURL}; - methodMap_["canOpenURL"] = MethodMetadata {1, __hostFunction_NativeIntentAndroidCxxSpecJSI_canOpenURL}; - methodMap_["openURL"] = MethodMetadata {1, __hostFunction_NativeIntentAndroidCxxSpecJSI_openURL}; - methodMap_["openSettings"] = MethodMetadata {0, __hostFunction_NativeIntentAndroidCxxSpecJSI_openSettings}; - methodMap_["sendIntent"] = MethodMetadata {2, __hostFunction_NativeIntentAndroidCxxSpecJSI_sendIntent}; -} -static jsi::Value __hostFunction_NativeJSCHeapCaptureCxxSpecJSI_captureComplete(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->captureComplete( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)) - ); - return jsi::Value::undefined(); -} - -NativeJSCHeapCaptureCxxSpecJSI::NativeJSCHeapCaptureCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("JSCHeapCapture", jsInvoker) { - methodMap_["captureComplete"] = MethodMetadata {2, __hostFunction_NativeJSCHeapCaptureCxxSpecJSI_captureComplete}; -} -static jsi::Value __hostFunction_NativeKeyboardObserverCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeKeyboardObserverCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeKeyboardObserverCxxSpecJSI::NativeKeyboardObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("KeyboardObserver", jsInvoker) { - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_getInitialURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialURL( - rt - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_canOpenURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->canOpenURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_openURL(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openURL( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_openSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->openSettings( - rt - ); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeLinkingManagerCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeLinkingManagerCxxSpecJSI::NativeLinkingManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("LinkingManager", jsInvoker) { - methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeLinkingManagerCxxSpecJSI_getInitialURL}; - methodMap_["canOpenURL"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_canOpenURL}; - methodMap_["openURL"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_openURL}; - methodMap_["openSettings"] = MethodMetadata {0, __hostFunction_NativeLinkingManagerCxxSpecJSI_openSettings}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeLinkingManagerCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeLogBoxCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeLogBoxCxxSpecJSI_hide(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->hide( - rt - ); - return jsi::Value::undefined(); -} - -NativeLogBoxCxxSpecJSI::NativeLogBoxCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("LogBox", jsInvoker) { - methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeLogBoxCxxSpecJSI_show}; - methodMap_["hide"] = MethodMetadata {0, __hostFunction_NativeLogBoxCxxSpecJSI_hide}; -} -static jsi::Value __hostFunction_NativeModalManagerCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeModalManagerCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeModalManagerCxxSpecJSI::NativeModalManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ModalManager", jsInvoker) { - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeModalManagerCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeModalManagerCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_sendRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asArray(rt), - count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asObject(rt), - count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asString(rt), - count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asBool(), - count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber(), - count <= 8 ? throw jsi::JSError(rt, "Expected argument in position 8 to be passed") : args[8].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_clearCookies(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearCookies( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingAndroidCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeNetworkingAndroidCxxSpecJSI::NativeNetworkingAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Networking", jsInvoker) { - methodMap_["sendRequest"] = MethodMetadata {9, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_sendRequest}; - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_abortRequest}; - methodMap_["clearCookies"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_clearCookies}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeNetworkingAndroidCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_sendRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_abortRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abortRequest( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_clearCookies(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearCookies( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeNetworkingIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeNetworkingIOSCxxSpecJSI::NativeNetworkingIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Networking", jsInvoker) { - methodMap_["sendRequest"] = MethodMetadata {2, __hostFunction_NativeNetworkingIOSCxxSpecJSI_sendRequest}; - methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_abortRequest}; - methodMap_["clearCookies"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_clearCookies}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeNetworkingIOSCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_checkPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->checkPermission( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestPermission( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_shouldShowRequestPermissionRationale(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->shouldShowRequestPermissionRationale( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestMultiplePermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestMultiplePermissions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} - -NativePermissionsAndroidCxxSpecJSI::NativePermissionsAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PermissionsAndroid", jsInvoker) { - methodMap_["checkPermission"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_checkPermission}; - methodMap_["requestPermission"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestPermission}; - methodMap_["shouldShowRequestPermissionRationale"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_shouldShowRequestPermissionRationale}; - methodMap_["requestMultiplePermissions"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidCxxSpecJSI_requestMultiplePermissions}; -} -static jsi::Value __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getAndroidID(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getAndroidID( - rt - ); -} - -NativePlatformConstantsAndroidCxxSpecJSI::NativePlatformConstantsAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PlatformConstants", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getConstants}; - methodMap_["getAndroidID"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsAndroidCxxSpecJSI_getAndroidID}; -} -static jsi::Value __hostFunction_NativePlatformConstantsIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativePlatformConstantsIOSCxxSpecJSI::NativePlatformConstantsIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PlatformConstants", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsIOSCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativePlatformConstantsWindowsCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativePlatformConstantsWindowsCxxSpecJSI::NativePlatformConstantsWindowsCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PlatformConstants", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsWindowsCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_onFinishRemoteNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->onFinishRemoteNotification( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_setApplicationIconBadgeNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setApplicationIconBadgeNumber( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getApplicationIconBadgeNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getApplicationIconBadgeNumber( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_requestPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestPermissions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_abandonPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->abandonPermissions( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_checkPermissions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->checkPermissions( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_presentLocalNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->presentLocalNotification( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_scheduleLocalNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->scheduleLocalNotification( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelAllLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancelAllLocalNotifications( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancelLocalNotifications( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getInitialNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInitialNotification( - rt - ); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getScheduledLocalNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getScheduledLocalNotifications( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeAllDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeAllDeliveredNotifications( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeDeliveredNotifications( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getDeliveredNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getDeliveredNotifications( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getAuthorizationStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getAuthorizationStatus( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativePushNotificationManagerIOSCxxSpecJSI::NativePushNotificationManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("PushNotificationManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getConstants}; - methodMap_["onFinishRemoteNotification"] = MethodMetadata {2, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_onFinishRemoteNotification}; - methodMap_["setApplicationIconBadgeNumber"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_setApplicationIconBadgeNumber}; - methodMap_["getApplicationIconBadgeNumber"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getApplicationIconBadgeNumber}; - methodMap_["requestPermissions"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_requestPermissions}; - methodMap_["abandonPermissions"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_abandonPermissions}; - methodMap_["checkPermissions"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_checkPermissions}; - methodMap_["presentLocalNotification"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_presentLocalNotification}; - methodMap_["scheduleLocalNotification"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_scheduleLocalNotification}; - methodMap_["cancelAllLocalNotifications"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelAllLocalNotifications}; - methodMap_["cancelLocalNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_cancelLocalNotifications}; - methodMap_["getInitialNotification"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getInitialNotification}; - methodMap_["getScheduledLocalNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getScheduledLocalNotifications}; - methodMap_["removeAllDeliveredNotifications"] = MethodMetadata {0, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeAllDeliveredNotifications}; - methodMap_["removeDeliveredNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeDeliveredNotifications}; - methodMap_["getDeliveredNotifications"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getDeliveredNotifications}; - methodMap_["getAuthorizationStatus"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_getAuthorizationStatus}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativePushNotificationManagerIOSCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeRedBoxCxxSpecJSI_setExtraData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setExtraData( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeRedBoxCxxSpecJSI_dismiss(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dismiss( - rt - ); - return jsi::Value::undefined(); -} - -NativeRedBoxCxxSpecJSI::NativeRedBoxCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("RedBox", jsInvoker) { - methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeRedBoxCxxSpecJSI_setExtraData}; - methodMap_["dismiss"] = MethodMetadata {0, __hostFunction_NativeRedBoxCxxSpecJSI_dismiss}; -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFunc( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBool( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getEnum(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEnum( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getNumber( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getString( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getArray( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObject( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getUnsafeObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getUnsafeObject( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRootTag( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValue( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getValueWithCallback( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getValueWithPromise( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFuncThrows(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFuncThrows( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectThrows(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectThrows( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_promiseThrows(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->promiseThrows( - rt - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFuncAssert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->voidFuncAssert( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectAssert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getObjectAssert( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_promiseAssert(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->promiseAssert( - rt - ); -} -static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getImageUrl(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getImageUrl( - rt - ); -} - -NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SampleTurboModule", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getConstants}; - methodMap_["voidFunc"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFunc}; - methodMap_["getBool"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getBool}; - methodMap_["getEnum"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getEnum}; - methodMap_["getNumber"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getNumber}; - methodMap_["getString"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getString}; - methodMap_["getArray"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray}; - methodMap_["getObject"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject}; - methodMap_["getUnsafeObject"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getUnsafeObject}; - methodMap_["getRootTag"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag}; - methodMap_["getValue"] = MethodMetadata {3, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue}; - methodMap_["getValueWithCallback"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithCallback}; - methodMap_["getValueWithPromise"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise}; - methodMap_["voidFuncThrows"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFuncThrows}; - methodMap_["getObjectThrows"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectThrows}; - methodMap_["promiseThrows"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_promiseThrows}; - methodMap_["voidFuncAssert"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_voidFuncAssert}; - methodMap_["getObjectAssert"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObjectAssert}; - methodMap_["promiseAssert"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_promiseAssert}; - methodMap_["getImageUrl"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getImageUrl}; -} -static jsi::Value __hostFunction_NativeSegmentFetcherCxxSpecJSI_fetchSegment(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->fetchSegment( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSegmentFetcherCxxSpecJSI_getSegment(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getSegment( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeSegmentFetcherCxxSpecJSI::NativeSegmentFetcherCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SegmentFetcher", jsInvoker) { - methodMap_["fetchSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherCxxSpecJSI_fetchSegment}; - methodMap_["getSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherCxxSpecJSI_getSegment}; -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_setValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setValues( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeSettingsManagerCxxSpecJSI_deleteValues(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->deleteValues( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} - -NativeSettingsManagerCxxSpecJSI::NativeSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SettingsManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSettingsManagerCxxSpecJSI_getConstants}; - methodMap_["setValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerCxxSpecJSI_setValues}; - methodMap_["deleteValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerCxxSpecJSI_deleteValues}; -} -static jsi::Value __hostFunction_NativeShareModuleCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeShareModuleCxxSpecJSI_share(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->share( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt)) - ); -} - -NativeShareModuleCxxSpecJSI::NativeShareModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ShareModule", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeShareModuleCxxSpecJSI_getConstants}; - methodMap_["share"] = MethodMetadata {2, __hostFunction_NativeShareModuleCxxSpecJSI_share}; -} -static jsi::Value __hostFunction_NativeSoundManagerCxxSpecJSI_playTouchSound(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->playTouchSound( - rt - ); - return jsi::Value::undefined(); -} - -NativeSoundManagerCxxSpecJSI::NativeSoundManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SoundManager", jsInvoker) { - methodMap_["playTouchSound"] = MethodMetadata {0, __hostFunction_NativeSoundManagerCxxSpecJSI_playTouchSound}; -} -static jsi::Value __hostFunction_NativeSourceCodeCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} - -NativeSourceCodeCxxSpecJSI::NativeSourceCodeCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("SourceCode", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSourceCodeCxxSpecJSI_getConstants}; -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setColor(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setColor( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setTranslucent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setTranslucent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setStyle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setStyle( - rt, - count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setHidden(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHidden( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeStatusBarManagerAndroidCxxSpecJSI::NativeStatusBarManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("StatusBarManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_getConstants}; - methodMap_["setColor"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setColor}; - methodMap_["setTranslucent"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setTranslucent}; - methodMap_["setStyle"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setStyle}; - methodMap_["setHidden"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerAndroidCxxSpecJSI_setHidden}; -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getHeight(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->getHeight( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setNetworkActivityIndicatorVisible(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setNetworkActivityIndicatorVisible( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setStyle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setStyle( - rt, - count <= 0 || args[0].isNull() || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setHidden(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHidden( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt) - ); - return jsi::Value::undefined(); -} - -NativeStatusBarManagerIOSCxxSpecJSI::NativeStatusBarManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("StatusBarManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getConstants}; - methodMap_["getHeight"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_getHeight}; - methodMap_["setNetworkActivityIndicatorVisible"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setNetworkActivityIndicatorVisible}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_removeListeners}; - methodMap_["setStyle"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setStyle}; - methodMap_["setHidden"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerIOSCxxSpecJSI_setHidden}; -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_createTimer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createTimer( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_deleteTimer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->deleteTimer( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeTimingCxxSpecJSI_setSendIdleEvents(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setSendIdleEvents( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeTimingCxxSpecJSI::NativeTimingCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Timing", jsInvoker) { - methodMap_["createTimer"] = MethodMetadata {4, __hostFunction_NativeTimingCxxSpecJSI_createTimer}; - methodMap_["deleteTimer"] = MethodMetadata {1, __hostFunction_NativeTimingCxxSpecJSI_deleteTimer}; - methodMap_["setSendIdleEvents"] = MethodMetadata {1, __hostFunction_NativeTimingCxxSpecJSI_setSendIdleEvents}; -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravity(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showWithGravity( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravityAndOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->showWithGravityAndOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(), - count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeToastAndroidCxxSpecJSI::NativeToastAndroidCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ToastAndroid", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeToastAndroidCxxSpecJSI_getConstants}; - methodMap_["show"] = MethodMetadata {2, __hostFunction_NativeToastAndroidCxxSpecJSI_show}; - methodMap_["showWithGravity"] = MethodMetadata {3, __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravity}; - methodMap_["showWithGravityAndOffset"] = MethodMetadata {5, __hostFunction_NativeToastAndroidCxxSpecJSI_showWithGravityAndOffset}; -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_createView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->createView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_updateView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->updateView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_findSubviewIn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->findSubviewIn( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_dispatchViewManagerCommand(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->dispatchViewManagerCommand( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt).asArray(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_measure(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measure( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_measureInWindow(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureInWindow( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_viewIsDescendantOf(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->viewIsDescendantOf( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_measureLayout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureLayout( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_measureLayoutRelativeToParent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureLayoutRelativeToParent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_setJSResponder(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setJSResponder( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_clearJSResponder(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearJSResponder( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_configureNextLayoutAnimation(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->configureNextLayoutAnimation( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_setChildren(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setChildren( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_manageChildren(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->manageChildren( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asArray(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asArray(rt), - count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asObject(rt).asArray(rt), - count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asObject(rt).asArray(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_getConstantsForViewManager(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getConstantsForViewManager( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_getDefaultEventTypes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getDefaultEventTypes( - rt - ); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_setLayoutAnimationEnabledExperimental(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setLayoutAnimationEnabledExperimental( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_sendAccessibilityEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendAccessibilityEvent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_lazilyLoadView(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->lazilyLoadView( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_focus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->focus( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_blur(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->blur( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeUIManagerCxxSpecJSI::NativeUIManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("UIManager", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeUIManagerCxxSpecJSI_getConstants}; - methodMap_["createView"] = MethodMetadata {4, __hostFunction_NativeUIManagerCxxSpecJSI_createView}; - methodMap_["updateView"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_updateView}; - methodMap_["findSubviewIn"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_findSubviewIn}; - methodMap_["dispatchViewManagerCommand"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_dispatchViewManagerCommand}; - methodMap_["measure"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_measure}; - methodMap_["measureInWindow"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_measureInWindow}; - methodMap_["viewIsDescendantOf"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_viewIsDescendantOf}; - methodMap_["measureLayout"] = MethodMetadata {4, __hostFunction_NativeUIManagerCxxSpecJSI_measureLayout}; - methodMap_["measureLayoutRelativeToParent"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_measureLayoutRelativeToParent}; - methodMap_["setJSResponder"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_setJSResponder}; - methodMap_["clearJSResponder"] = MethodMetadata {0, __hostFunction_NativeUIManagerCxxSpecJSI_clearJSResponder}; - methodMap_["configureNextLayoutAnimation"] = MethodMetadata {3, __hostFunction_NativeUIManagerCxxSpecJSI_configureNextLayoutAnimation}; - methodMap_["setChildren"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_setChildren}; - methodMap_["manageChildren"] = MethodMetadata {6, __hostFunction_NativeUIManagerCxxSpecJSI_manageChildren}; - methodMap_["getConstantsForViewManager"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_getConstantsForViewManager}; - methodMap_["getDefaultEventTypes"] = MethodMetadata {0, __hostFunction_NativeUIManagerCxxSpecJSI_getDefaultEventTypes}; - methodMap_["setLayoutAnimationEnabledExperimental"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_setLayoutAnimationEnabledExperimental}; - methodMap_["sendAccessibilityEvent"] = MethodMetadata {2, __hostFunction_NativeUIManagerCxxSpecJSI_sendAccessibilityEvent}; - methodMap_["lazilyLoadView"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_lazilyLoadView}; - methodMap_["focus"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_focus}; - methodMap_["blur"] = MethodMetadata {1, __hostFunction_NativeUIManagerCxxSpecJSI_blur}; -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getConstants( - rt - ); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_vibrate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->vibrate( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_vibrateByPattern(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->vibrateByPattern( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeVibrationCxxSpecJSI_cancel(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancel( - rt - ); - return jsi::Value::undefined(); -} - -NativeVibrationCxxSpecJSI::NativeVibrationCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("Vibration", jsInvoker) { - methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeVibrationCxxSpecJSI_getConstants}; - methodMap_["vibrate"] = MethodMetadata {1, __hostFunction_NativeVibrationCxxSpecJSI_vibrate}; - methodMap_["vibrateByPattern"] = MethodMetadata {2, __hostFunction_NativeVibrationCxxSpecJSI_vibrateByPattern}; - methodMap_["cancel"] = MethodMetadata {0, __hostFunction_NativeVibrationCxxSpecJSI_cancel}; -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt).asArray(rt)), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_send(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->send( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_sendBinary(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->sendBinary( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_ping(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->ping( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_close(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->close( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->addListener( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeWebSocketModuleCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->removeListeners( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} - -NativeWebSocketModuleCxxSpecJSI::NativeWebSocketModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("WebSocketModule", jsInvoker) { - methodMap_["connect"] = MethodMetadata {4, __hostFunction_NativeWebSocketModuleCxxSpecJSI_connect}; - methodMap_["send"] = MethodMetadata {2, __hostFunction_NativeWebSocketModuleCxxSpecJSI_send}; - methodMap_["sendBinary"] = MethodMetadata {2, __hostFunction_NativeWebSocketModuleCxxSpecJSI_sendBinary}; - methodMap_["ping"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_ping}; - methodMap_["close"] = MethodMetadata {3, __hostFunction_NativeWebSocketModuleCxxSpecJSI_close}; - methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_addListener}; - methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeWebSocketModuleCxxSpecJSI_removeListeners}; -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_show(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->show( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_reload(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->reload( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_setProfilingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setProfilingEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDevMenuCxxSpecJSI_setHotLoadingEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setHotLoadingEnabled( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool() - ); - return jsi::Value::undefined(); -} - -NativeDevMenuCxxSpecJSI::NativeDevMenuCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("DevMenu", jsInvoker) { - methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeDevMenuCxxSpecJSI_show}; - methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevMenuCxxSpecJSI_reload}; - methodMap_["setProfilingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevMenuCxxSpecJSI_setProfilingEnabled}; - methodMap_["setHotLoadingEnabled"] = MethodMetadata {1, __hostFunction_NativeDevMenuCxxSpecJSI_setHotLoadingEnabled}; -} -static jsi::Value __hostFunction_NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI_setReloadAndProfileConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setReloadAndProfileConfig( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI_getReloadAndProfileConfig(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getReloadAndProfileConfig( - rt - ); -} - -NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI::NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ReactDevToolsRuntimeSettingsModule", jsInvoker) { - methodMap_["setReloadAndProfileConfig"] = MethodMetadata {1, __hostFunction_NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI_setReloadAndProfileConfig}; - methodMap_["getReloadAndProfileConfig"] = MethodMetadata {0, __hostFunction_NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI_getReloadAndProfileConfig}; -} -static jsi::Value __hostFunction_NativeReactDevToolsSettingsManagerCxxSpecJSI_setGlobalHookSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setGlobalHookSettings( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeReactDevToolsSettingsManagerCxxSpecJSI_getGlobalHookSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - auto result = static_cast(&turboModule)->getGlobalHookSettings( - rt - ); - return result ? jsi::Value(std::move(*result)) : jsi::Value::null(); -} - -NativeReactDevToolsSettingsManagerCxxSpecJSI::NativeReactDevToolsSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("ReactDevToolsSettingsManager", jsInvoker) { - methodMap_["setGlobalHookSettings"] = MethodMetadata {1, __hostFunction_NativeReactDevToolsSettingsManagerCxxSpecJSI_setGlobalHookSettings}; - methodMap_["getGlobalHookSettings"] = MethodMetadata {0, __hostFunction_NativeReactDevToolsSettingsManagerCxxSpecJSI_getGlobalHookSettings}; -} -static jsi::Value __hostFunction_NativeIdleCallbacksCxxSpecJSI_requestIdleCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->requestIdleCallback( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt)) - ); -} -static jsi::Value __hostFunction_NativeIdleCallbacksCxxSpecJSI_cancelIdleCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->cancelIdleCallback( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); - return jsi::Value::undefined(); -} - -NativeIdleCallbacksCxxSpecJSI::NativeIdleCallbacksCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeIdleCallbacksCxx", jsInvoker) { - methodMap_["requestIdleCallback"] = MethodMetadata {2, __hostFunction_NativeIdleCallbacksCxxSpecJSI_requestIdleCallback}; - methodMap_["cancelIdleCallback"] = MethodMetadata {1, __hostFunction_NativeIdleCallbacksCxxSpecJSI_cancelIdleCallback}; -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_observe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->observe( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserve(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserve( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_observeV2(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->observeV2( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserveV2(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserveV2( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_disconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnect( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeIntersectionObserverCxxSpecJSI_takeRecords(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->takeRecords( - rt - ); -} - -NativeIntersectionObserverCxxSpecJSI::NativeIntersectionObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeIntersectionObserverCxx", jsInvoker) { - methodMap_["observe"] = MethodMetadata {1, __hostFunction_NativeIntersectionObserverCxxSpecJSI_observe}; - methodMap_["unobserve"] = MethodMetadata {2, __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserve}; - methodMap_["observeV2"] = MethodMetadata {1, __hostFunction_NativeIntersectionObserverCxxSpecJSI_observeV2}; - methodMap_["unobserveV2"] = MethodMetadata {2, __hostFunction_NativeIntersectionObserverCxxSpecJSI_unobserveV2}; - methodMap_["connect"] = MethodMetadata {1, __hostFunction_NativeIntersectionObserverCxxSpecJSI_connect}; - methodMap_["disconnect"] = MethodMetadata {0, __hostFunction_NativeIntersectionObserverCxxSpecJSI_disconnect}; - methodMap_["takeRecords"] = MethodMetadata {0, __hostFunction_NativeIntersectionObserverCxxSpecJSI_takeRecords}; -} -static jsi::Value __hostFunction_NativeMicrotasksCxxSpecJSI_queueMicrotask(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->queueMicrotask( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} - -NativeMicrotasksCxxSpecJSI::NativeMicrotasksCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeMicrotasksCxx", jsInvoker) { - methodMap_["queueMicrotask"] = MethodMetadata {1, __hostFunction_NativeMicrotasksCxxSpecJSI_queueMicrotask}; -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_observe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->observe( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_unobserveAll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->unobserveAll( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_connect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->connect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_disconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnect( - rt - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeMutationObserverCxxSpecJSI_takeRecords(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->takeRecords( - rt - ); -} - -NativeMutationObserverCxxSpecJSI::NativeMutationObserverCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeMutationObserverCxx", jsInvoker) { - methodMap_["observe"] = MethodMetadata {1, __hostFunction_NativeMutationObserverCxxSpecJSI_observe}; - methodMap_["unobserveAll"] = MethodMetadata {1, __hostFunction_NativeMutationObserverCxxSpecJSI_unobserveAll}; - methodMap_["connect"] = MethodMetadata {2, __hostFunction_NativeMutationObserverCxxSpecJSI_connect}; - methodMap_["disconnect"] = MethodMetadata {0, __hostFunction_NativeMutationObserverCxxSpecJSI_disconnect}; - methodMap_["takeRecords"] = MethodMetadata {0, __hostFunction_NativeMutationObserverCxxSpecJSI_takeRecords}; -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_now(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->now( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_markWithResult(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->markWithResult( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asNumber()) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_measure(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->measure( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asNumber()), - count <= 2 || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asNumber()), - count <= 3 || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asNumber()), - count <= 4 || args[4].isUndefined() ? std::nullopt : std::make_optional(args[4].asString(rt)), - count <= 5 || args[5].isUndefined() ? std::nullopt : std::make_optional(args[5].asString(rt)) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_measureWithResult(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->measureWithResult( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(), - count <= 3 || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asNumber()), - count <= 4 || args[4].isUndefined() ? std::nullopt : std::make_optional(args[4].asString(rt)), - count <= 5 || args[5].isUndefined() ? std::nullopt : std::make_optional(args[5].asString(rt)) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_clearMarks(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearMarks( - rt, - count <= 0 || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_clearMeasures(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearMeasures( - rt, - count <= 0 || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asString(rt)) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getEntries(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEntries( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getEntriesByName(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEntriesByName( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt), - count <= 1 || args[1].isNull() || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asNumber()) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getEntriesByType(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEntriesByType( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getEventCounts(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getEventCounts( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getSimpleMemoryInfo(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSimpleMemoryInfo( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getReactNativeStartupTiming(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getReactNativeStartupTiming( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_createObserver(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->createObserver( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asFunction(rt) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getDroppedEntriesCount(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getDroppedEntriesCount( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_observe(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->observe( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_disconnect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->disconnect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_takeRecords(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->takeRecords( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_getSupportedPerformanceEntryTypes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getSupportedPerformanceEntryTypes( - rt - ); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_setCurrentTimeStampForTesting(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setCurrentTimeStampForTesting( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativePerformanceCxxSpecJSI_clearEventCountsForTesting(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->clearEventCountsForTesting( - rt - ); - return jsi::Value::undefined(); -} - -NativePerformanceCxxSpecJSI::NativePerformanceCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativePerformanceCxx", jsInvoker) { - methodMap_["now"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_now}; - methodMap_["markWithResult"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_markWithResult}; - methodMap_["measure"] = MethodMetadata {6, __hostFunction_NativePerformanceCxxSpecJSI_measure}; - methodMap_["measureWithResult"] = MethodMetadata {6, __hostFunction_NativePerformanceCxxSpecJSI_measureWithResult}; - methodMap_["clearMarks"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_clearMarks}; - methodMap_["clearMeasures"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_clearMeasures}; - methodMap_["getEntries"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getEntries}; - methodMap_["getEntriesByName"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_getEntriesByName}; - methodMap_["getEntriesByType"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_getEntriesByType}; - methodMap_["getEventCounts"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getEventCounts}; - methodMap_["getSimpleMemoryInfo"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getSimpleMemoryInfo}; - methodMap_["getReactNativeStartupTiming"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getReactNativeStartupTiming}; - methodMap_["createObserver"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_createObserver}; - methodMap_["getDroppedEntriesCount"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_getDroppedEntriesCount}; - methodMap_["observe"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_observe}; - methodMap_["disconnect"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_disconnect}; - methodMap_["takeRecords"] = MethodMetadata {2, __hostFunction_NativePerformanceCxxSpecJSI_takeRecords}; - methodMap_["getSupportedPerformanceEntryTypes"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_getSupportedPerformanceEntryTypes}; - methodMap_["setCurrentTimeStampForTesting"] = MethodMetadata {1, __hostFunction_NativePerformanceCxxSpecJSI_setCurrentTimeStampForTesting}; - methodMap_["clearEventCountsForTesting"] = MethodMetadata {0, __hostFunction_NativePerformanceCxxSpecJSI_clearEventCountsForTesting}; -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_compareDocumentPosition(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->compareDocumentPosition( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getChildNodes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getChildNodes( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getParentNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getParentNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_isConnected(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->isConnected( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getBorderWidth(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBorderWidth( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getBoundingClientRect(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getBoundingClientRect( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool() - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getInnerSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getInnerSize( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getScrollPosition(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getScrollPosition( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getScrollSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getScrollSize( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getTagName(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getTagName( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getTextContent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getTextContent( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_hasPointerCapture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->hasPointerCapture( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_releasePointerCapture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->releasePointerCapture( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_setPointerCapture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setPointerCapture( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber() - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_getOffset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getOffset( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_linkRootNode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->linkRootNode( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_measure(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measure( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_measureInWindow(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureInWindow( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_measureLayout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->measureLayout( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]), - count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt).asFunction(rt), - count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asFunction(rt) - ); - return jsi::Value::undefined(); -} -static jsi::Value __hostFunction_NativeDOMCxxSpecJSI_setNativeProps(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - static_cast(&turboModule)->setNativeProps( - rt, - count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : jsi::Value(rt, args[0]), - count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : jsi::Value(rt, args[1]) - ); - return jsi::Value::undefined(); -} - -NativeDOMCxxSpecJSI::NativeDOMCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeDOMCxx", jsInvoker) { - methodMap_["compareDocumentPosition"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_compareDocumentPosition}; - methodMap_["getChildNodes"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getChildNodes}; - methodMap_["getParentNode"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getParentNode}; - methodMap_["isConnected"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_isConnected}; - methodMap_["getBorderWidth"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getBorderWidth}; - methodMap_["getBoundingClientRect"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_getBoundingClientRect}; - methodMap_["getInnerSize"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getInnerSize}; - methodMap_["getScrollPosition"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getScrollPosition}; - methodMap_["getScrollSize"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getScrollSize}; - methodMap_["getTagName"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getTagName}; - methodMap_["getTextContent"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getTextContent}; - methodMap_["hasPointerCapture"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_hasPointerCapture}; - methodMap_["releasePointerCapture"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_releasePointerCapture}; - methodMap_["setPointerCapture"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_setPointerCapture}; - methodMap_["getOffset"] = MethodMetadata {1, __hostFunction_NativeDOMCxxSpecJSI_getOffset}; - methodMap_["linkRootNode"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_linkRootNode}; - methodMap_["measure"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_measure}; - methodMap_["measureInWindow"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_measureInWindow}; - methodMap_["measureLayout"] = MethodMetadata {4, __hostFunction_NativeDOMCxxSpecJSI_measureLayout}; - methodMap_["setNativeProps"] = MethodMetadata {2, __hostFunction_NativeDOMCxxSpecJSI_setNativeProps}; -} - - -} // namespace facebook::react diff --git a/vnext/codegen/rnwcoreJSI.h b/vnext/codegen/rnwcoreJSI.h deleted file mode 100644 index 73349b5bed0..00000000000 --- a/vnext/codegen/rnwcoreJSI.h +++ /dev/null @@ -1,9396 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleH.js - */ - -#pragma once - -#include -#include - -namespace facebook::react { - - - class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpecJSI : public TurboModule { -protected: - NativeReactNativeFeatureFlagsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual bool commonTestFlag(jsi::Runtime &rt) = 0; - virtual bool commonTestFlagWithoutNativeImplementation(jsi::Runtime &rt) = 0; - virtual bool animatedShouldSignalBatch(jsi::Runtime &rt) = 0; - virtual bool cxxNativeAnimatedEnabled(jsi::Runtime &rt) = 0; - virtual bool cxxNativeAnimatedRemoveJsSync(jsi::Runtime &rt) = 0; - virtual bool disableMainQueueSyncDispatchIOS(jsi::Runtime &rt) = 0; - virtual bool disableMountItemReorderingAndroid(jsi::Runtime &rt) = 0; - virtual bool disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt) = 0; - virtual bool enableAccessibilityOrder(jsi::Runtime &rt) = 0; - virtual bool enableAccumulatedUpdatesInRawPropsAndroid(jsi::Runtime &rt) = 0; - virtual bool enableAndroidTextMeasurementOptimizations(jsi::Runtime &rt) = 0; - virtual bool enableBridgelessArchitecture(jsi::Runtime &rt) = 0; - virtual bool enableCppPropsIteratorSetter(jsi::Runtime &rt) = 0; - virtual bool enableCustomFocusSearchOnClippedElementsAndroid(jsi::Runtime &rt) = 0; - virtual bool enableDestroyShadowTreeRevisionAsync(jsi::Runtime &rt) = 0; - virtual bool enableDoubleMeasurementFixAndroid(jsi::Runtime &rt) = 0; - virtual bool enableEagerRootViewAttachment(jsi::Runtime &rt) = 0; - virtual bool enableFabricLogs(jsi::Runtime &rt) = 0; - virtual bool enableFabricRenderer(jsi::Runtime &rt) = 0; - virtual bool enableFixForParentTagDuringReparenting(jsi::Runtime &rt) = 0; - virtual bool enableFontScaleChangesUpdatingLayout(jsi::Runtime &rt) = 0; - virtual bool enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt) = 0; - virtual bool enableIOSViewClipToPaddingBox(jsi::Runtime &rt) = 0; - virtual bool enableInteropViewManagerClassLookUpOptimizationIOS(jsi::Runtime &rt) = 0; - virtual bool enableLayoutAnimationsOnAndroid(jsi::Runtime &rt) = 0; - virtual bool enableLayoutAnimationsOnIOS(jsi::Runtime &rt) = 0; - virtual bool enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt) = 0; - virtual bool enableMainQueueModulesOnIOS(jsi::Runtime &rt) = 0; - virtual bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt) = 0; - virtual bool enableNativeCSSParsing(jsi::Runtime &rt) = 0; - virtual bool enableNetworkEventReporting(jsi::Runtime &rt) = 0; - virtual bool enableNewBackgroundAndBorderDrawables(jsi::Runtime &rt) = 0; - virtual bool enablePreparedTextLayout(jsi::Runtime &rt) = 0; - virtual bool enablePropsUpdateReconciliationAndroid(jsi::Runtime &rt) = 0; - virtual bool enableResourceTimingAPI(jsi::Runtime &rt) = 0; - virtual bool enableSynchronousStateUpdates(jsi::Runtime &rt) = 0; - virtual bool enableViewCulling(jsi::Runtime &rt) = 0; - virtual bool enableViewRecycling(jsi::Runtime &rt) = 0; - virtual bool enableViewRecyclingForText(jsi::Runtime &rt) = 0; - virtual bool enableViewRecyclingForView(jsi::Runtime &rt) = 0; - virtual bool enableVirtualViewDebugFeatures(jsi::Runtime &rt) = 0; - virtual bool enableVirtualViewRenderState(jsi::Runtime &rt) = 0; - virtual bool enableVirtualViewWindowFocusDetection(jsi::Runtime &rt) = 0; - virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime &rt) = 0; - virtual bool fuseboxEnabledRelease(jsi::Runtime &rt) = 0; - virtual bool fuseboxNetworkInspectionEnabled(jsi::Runtime &rt) = 0; - virtual bool hideOffscreenVirtualViewsOnIOS(jsi::Runtime &rt) = 0; - virtual double preparedTextCacheSize(jsi::Runtime &rt) = 0; - virtual bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) = 0; - virtual bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) = 0; - virtual bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) = 0; - virtual bool useFabricInterop(jsi::Runtime &rt) = 0; - virtual bool useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt) = 0; - virtual bool useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt) = 0; - virtual bool useRawPropsJsiValue(jsi::Runtime &rt) = 0; - virtual bool useShadowNodeStateOnClone(jsi::Runtime &rt) = 0; - virtual bool useTurboModuleInterop(jsi::Runtime &rt) = 0; - virtual bool useTurboModules(jsi::Runtime &rt) = 0; - virtual double virtualViewPrerenderRatio(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeReactNativeFeatureFlagsCxx"; - -protected: - NativeReactNativeFeatureFlagsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeReactNativeFeatureFlagsCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeReactNativeFeatureFlagsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeReactNativeFeatureFlagsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - bool commonTestFlag(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::commonTestFlag) == 1, - "Expected commonTestFlag(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::commonTestFlag, jsInvoker_, instance_); - } - bool commonTestFlagWithoutNativeImplementation(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::commonTestFlagWithoutNativeImplementation) == 1, - "Expected commonTestFlagWithoutNativeImplementation(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::commonTestFlagWithoutNativeImplementation, jsInvoker_, instance_); - } - bool animatedShouldSignalBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::animatedShouldSignalBatch) == 1, - "Expected animatedShouldSignalBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::animatedShouldSignalBatch, jsInvoker_, instance_); - } - bool cxxNativeAnimatedEnabled(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cxxNativeAnimatedEnabled) == 1, - "Expected cxxNativeAnimatedEnabled(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cxxNativeAnimatedEnabled, jsInvoker_, instance_); - } - bool cxxNativeAnimatedRemoveJsSync(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cxxNativeAnimatedRemoveJsSync) == 1, - "Expected cxxNativeAnimatedRemoveJsSync(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cxxNativeAnimatedRemoveJsSync, jsInvoker_, instance_); - } - bool disableMainQueueSyncDispatchIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disableMainQueueSyncDispatchIOS) == 1, - "Expected disableMainQueueSyncDispatchIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disableMainQueueSyncDispatchIOS, jsInvoker_, instance_); - } - bool disableMountItemReorderingAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disableMountItemReorderingAndroid) == 1, - "Expected disableMountItemReorderingAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disableMountItemReorderingAndroid, jsInvoker_, instance_); - } - bool disableTextLayoutManagerCacheAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disableTextLayoutManagerCacheAndroid) == 1, - "Expected disableTextLayoutManagerCacheAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disableTextLayoutManagerCacheAndroid, jsInvoker_, instance_); - } - bool enableAccessibilityOrder(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableAccessibilityOrder) == 1, - "Expected enableAccessibilityOrder(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableAccessibilityOrder, jsInvoker_, instance_); - } - bool enableAccumulatedUpdatesInRawPropsAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableAccumulatedUpdatesInRawPropsAndroid) == 1, - "Expected enableAccumulatedUpdatesInRawPropsAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableAccumulatedUpdatesInRawPropsAndroid, jsInvoker_, instance_); - } - bool enableAndroidTextMeasurementOptimizations(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableAndroidTextMeasurementOptimizations) == 1, - "Expected enableAndroidTextMeasurementOptimizations(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableAndroidTextMeasurementOptimizations, jsInvoker_, instance_); - } - bool enableBridgelessArchitecture(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableBridgelessArchitecture) == 1, - "Expected enableBridgelessArchitecture(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableBridgelessArchitecture, jsInvoker_, instance_); - } - bool enableCppPropsIteratorSetter(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableCppPropsIteratorSetter) == 1, - "Expected enableCppPropsIteratorSetter(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableCppPropsIteratorSetter, jsInvoker_, instance_); - } - bool enableCustomFocusSearchOnClippedElementsAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableCustomFocusSearchOnClippedElementsAndroid) == 1, - "Expected enableCustomFocusSearchOnClippedElementsAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableCustomFocusSearchOnClippedElementsAndroid, jsInvoker_, instance_); - } - bool enableDestroyShadowTreeRevisionAsync(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableDestroyShadowTreeRevisionAsync) == 1, - "Expected enableDestroyShadowTreeRevisionAsync(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableDestroyShadowTreeRevisionAsync, jsInvoker_, instance_); - } - bool enableDoubleMeasurementFixAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableDoubleMeasurementFixAndroid) == 1, - "Expected enableDoubleMeasurementFixAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableDoubleMeasurementFixAndroid, jsInvoker_, instance_); - } - bool enableEagerRootViewAttachment(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableEagerRootViewAttachment) == 1, - "Expected enableEagerRootViewAttachment(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableEagerRootViewAttachment, jsInvoker_, instance_); - } - bool enableFabricLogs(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableFabricLogs) == 1, - "Expected enableFabricLogs(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableFabricLogs, jsInvoker_, instance_); - } - bool enableFabricRenderer(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableFabricRenderer) == 1, - "Expected enableFabricRenderer(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableFabricRenderer, jsInvoker_, instance_); - } - bool enableFixForParentTagDuringReparenting(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableFixForParentTagDuringReparenting) == 1, - "Expected enableFixForParentTagDuringReparenting(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableFixForParentTagDuringReparenting, jsInvoker_, instance_); - } - bool enableFontScaleChangesUpdatingLayout(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableFontScaleChangesUpdatingLayout) == 1, - "Expected enableFontScaleChangesUpdatingLayout(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableFontScaleChangesUpdatingLayout, jsInvoker_, instance_); - } - bool enableIOSTextBaselineOffsetPerLine(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableIOSTextBaselineOffsetPerLine) == 1, - "Expected enableIOSTextBaselineOffsetPerLine(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableIOSTextBaselineOffsetPerLine, jsInvoker_, instance_); - } - bool enableIOSViewClipToPaddingBox(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableIOSViewClipToPaddingBox) == 1, - "Expected enableIOSViewClipToPaddingBox(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableIOSViewClipToPaddingBox, jsInvoker_, instance_); - } - bool enableInteropViewManagerClassLookUpOptimizationIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableInteropViewManagerClassLookUpOptimizationIOS) == 1, - "Expected enableInteropViewManagerClassLookUpOptimizationIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableInteropViewManagerClassLookUpOptimizationIOS, jsInvoker_, instance_); - } - bool enableLayoutAnimationsOnAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableLayoutAnimationsOnAndroid) == 1, - "Expected enableLayoutAnimationsOnAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableLayoutAnimationsOnAndroid, jsInvoker_, instance_); - } - bool enableLayoutAnimationsOnIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableLayoutAnimationsOnIOS) == 1, - "Expected enableLayoutAnimationsOnIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableLayoutAnimationsOnIOS, jsInvoker_, instance_); - } - bool enableMainQueueCoordinatorOnIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableMainQueueCoordinatorOnIOS) == 1, - "Expected enableMainQueueCoordinatorOnIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableMainQueueCoordinatorOnIOS, jsInvoker_, instance_); - } - bool enableMainQueueModulesOnIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableMainQueueModulesOnIOS) == 1, - "Expected enableMainQueueModulesOnIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableMainQueueModulesOnIOS, jsInvoker_, instance_); - } - bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableModuleArgumentNSNullConversionIOS) == 1, - "Expected enableModuleArgumentNSNullConversionIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableModuleArgumentNSNullConversionIOS, jsInvoker_, instance_); - } - bool enableNativeCSSParsing(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableNativeCSSParsing) == 1, - "Expected enableNativeCSSParsing(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableNativeCSSParsing, jsInvoker_, instance_); - } - bool enableNetworkEventReporting(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableNetworkEventReporting) == 1, - "Expected enableNetworkEventReporting(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableNetworkEventReporting, jsInvoker_, instance_); - } - bool enableNewBackgroundAndBorderDrawables(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableNewBackgroundAndBorderDrawables) == 1, - "Expected enableNewBackgroundAndBorderDrawables(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableNewBackgroundAndBorderDrawables, jsInvoker_, instance_); - } - bool enablePreparedTextLayout(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enablePreparedTextLayout) == 1, - "Expected enablePreparedTextLayout(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enablePreparedTextLayout, jsInvoker_, instance_); - } - bool enablePropsUpdateReconciliationAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enablePropsUpdateReconciliationAndroid) == 1, - "Expected enablePropsUpdateReconciliationAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enablePropsUpdateReconciliationAndroid, jsInvoker_, instance_); - } - bool enableResourceTimingAPI(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableResourceTimingAPI) == 1, - "Expected enableResourceTimingAPI(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableResourceTimingAPI, jsInvoker_, instance_); - } - bool enableSynchronousStateUpdates(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableSynchronousStateUpdates) == 1, - "Expected enableSynchronousStateUpdates(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableSynchronousStateUpdates, jsInvoker_, instance_); - } - bool enableViewCulling(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableViewCulling) == 1, - "Expected enableViewCulling(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableViewCulling, jsInvoker_, instance_); - } - bool enableViewRecycling(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableViewRecycling) == 1, - "Expected enableViewRecycling(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableViewRecycling, jsInvoker_, instance_); - } - bool enableViewRecyclingForText(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableViewRecyclingForText) == 1, - "Expected enableViewRecyclingForText(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableViewRecyclingForText, jsInvoker_, instance_); - } - bool enableViewRecyclingForView(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableViewRecyclingForView) == 1, - "Expected enableViewRecyclingForView(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableViewRecyclingForView, jsInvoker_, instance_); - } - bool enableVirtualViewDebugFeatures(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableVirtualViewDebugFeatures) == 1, - "Expected enableVirtualViewDebugFeatures(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableVirtualViewDebugFeatures, jsInvoker_, instance_); - } - bool enableVirtualViewRenderState(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableVirtualViewRenderState) == 1, - "Expected enableVirtualViewRenderState(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableVirtualViewRenderState, jsInvoker_, instance_); - } - bool enableVirtualViewWindowFocusDetection(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::enableVirtualViewWindowFocusDetection) == 1, - "Expected enableVirtualViewWindowFocusDetection(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::enableVirtualViewWindowFocusDetection, jsInvoker_, instance_); - } - bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::fixMappingOfEventPrioritiesBetweenFabricAndReact) == 1, - "Expected fixMappingOfEventPrioritiesBetweenFabricAndReact(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::fixMappingOfEventPrioritiesBetweenFabricAndReact, jsInvoker_, instance_); - } - bool fuseboxEnabledRelease(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::fuseboxEnabledRelease) == 1, - "Expected fuseboxEnabledRelease(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::fuseboxEnabledRelease, jsInvoker_, instance_); - } - bool fuseboxNetworkInspectionEnabled(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::fuseboxNetworkInspectionEnabled) == 1, - "Expected fuseboxNetworkInspectionEnabled(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::fuseboxNetworkInspectionEnabled, jsInvoker_, instance_); - } - bool hideOffscreenVirtualViewsOnIOS(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::hideOffscreenVirtualViewsOnIOS) == 1, - "Expected hideOffscreenVirtualViewsOnIOS(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::hideOffscreenVirtualViewsOnIOS, jsInvoker_, instance_); - } - double preparedTextCacheSize(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::preparedTextCacheSize) == 1, - "Expected preparedTextCacheSize(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::preparedTextCacheSize, jsInvoker_, instance_); - } - bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::traceTurboModulePromiseRejectionsOnAndroid) == 1, - "Expected traceTurboModulePromiseRejectionsOnAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::traceTurboModulePromiseRejectionsOnAndroid, jsInvoker_, instance_); - } - bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::updateRuntimeShadowNodeReferencesOnCommit) == 1, - "Expected updateRuntimeShadowNodeReferencesOnCommit(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::updateRuntimeShadowNodeReferencesOnCommit, jsInvoker_, instance_); - } - bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useAlwaysAvailableJSErrorHandling) == 1, - "Expected useAlwaysAvailableJSErrorHandling(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useAlwaysAvailableJSErrorHandling, jsInvoker_, instance_); - } - bool useFabricInterop(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useFabricInterop) == 1, - "Expected useFabricInterop(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useFabricInterop, jsInvoker_, instance_); - } - bool useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useNativeViewConfigsInBridgelessMode) == 1, - "Expected useNativeViewConfigsInBridgelessMode(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useNativeViewConfigsInBridgelessMode, jsInvoker_, instance_); - } - bool useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useOptimizedEventBatchingOnAndroid) == 1, - "Expected useOptimizedEventBatchingOnAndroid(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useOptimizedEventBatchingOnAndroid, jsInvoker_, instance_); - } - bool useRawPropsJsiValue(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useRawPropsJsiValue) == 1, - "Expected useRawPropsJsiValue(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useRawPropsJsiValue, jsInvoker_, instance_); - } - bool useShadowNodeStateOnClone(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useShadowNodeStateOnClone) == 1, - "Expected useShadowNodeStateOnClone(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useShadowNodeStateOnClone, jsInvoker_, instance_); - } - bool useTurboModuleInterop(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useTurboModuleInterop) == 1, - "Expected useTurboModuleInterop(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useTurboModuleInterop, jsInvoker_, instance_); - } - bool useTurboModules(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::useTurboModules) == 1, - "Expected useTurboModules(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::useTurboModules, jsInvoker_, instance_); - } - double virtualViewPrerenderRatio(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::virtualViewPrerenderRatio) == 1, - "Expected virtualViewPrerenderRatio(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::virtualViewPrerenderRatio, jsInvoker_, instance_); - } - - private: - friend class NativeReactNativeFeatureFlagsCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAccessibilityInfoCxxSpecJSI : public TurboModule { -protected: - NativeAccessibilityInfoCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void isReduceMotionEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isInvertColorsEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isHighTextContrastEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isTouchExplorationEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void isAccessibilityServiceEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - virtual void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) = 0; - virtual void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) = 0; - virtual void getRecommendedTimeoutMillis(jsi::Runtime &rt, double mSec, jsi::Function onSuccess) = 0; - virtual void isGrayscaleEnabled(jsi::Runtime &rt, jsi::Function onSuccess) = 0; - -}; - -template -class JSI_EXPORT NativeAccessibilityInfoCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AccessibilityInfo"; - -protected: - NativeAccessibilityInfoCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAccessibilityInfoCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAccessibilityInfoCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAccessibilityInfoCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void isReduceMotionEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isReduceMotionEnabled) == 2, - "Expected isReduceMotionEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isReduceMotionEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isInvertColorsEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isInvertColorsEnabled) == 2, - "Expected isInvertColorsEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isInvertColorsEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isHighTextContrastEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isHighTextContrastEnabled) == 2, - "Expected isHighTextContrastEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isHighTextContrastEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isTouchExplorationEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isTouchExplorationEnabled) == 2, - "Expected isTouchExplorationEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isTouchExplorationEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void isAccessibilityServiceEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isAccessibilityServiceEnabled) == 2, - "Expected isAccessibilityServiceEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isAccessibilityServiceEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityFocus) == 2, - "Expected setAccessibilityFocus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityFocus, jsInvoker_, instance_, std::move(reactTag)); - } - void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibility) == 2, - "Expected announceForAccessibility(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibility, jsInvoker_, instance_, std::move(announcement)); - } - void getRecommendedTimeoutMillis(jsi::Runtime &rt, double mSec, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::getRecommendedTimeoutMillis) == 3, - "Expected getRecommendedTimeoutMillis(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getRecommendedTimeoutMillis, jsInvoker_, instance_, std::move(mSec), std::move(onSuccess)); - } - void isGrayscaleEnabled(jsi::Runtime &rt, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::isGrayscaleEnabled) == 2, - "Expected isGrayscaleEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isGrayscaleEnabled, jsInvoker_, instance_, std::move(onSuccess)); - } - - private: - friend class NativeAccessibilityInfoCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAccessibilityManagerCxxSpecJSI : public TurboModule { -protected: - NativeAccessibilityManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void getCurrentBoldTextState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentGrayscaleState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentInvertColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentReduceMotionState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentDarkerSystemColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentReduceTransparencyState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void getCurrentVoiceOverState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) = 0; - virtual void setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, jsi::Object JSMultipliers) = 0; - virtual void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) = 0; - virtual void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) = 0; - virtual void announceForAccessibilityWithOptions(jsi::Runtime &rt, jsi::String announcement, jsi::Object options) = 0; - -}; - -template -class JSI_EXPORT NativeAccessibilityManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AccessibilityManager"; - -protected: - NativeAccessibilityManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAccessibilityManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAccessibilityManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAccessibilityManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void getCurrentBoldTextState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentBoldTextState) == 3, - "Expected getCurrentBoldTextState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentBoldTextState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentGrayscaleState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentGrayscaleState) == 3, - "Expected getCurrentGrayscaleState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentGrayscaleState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentInvertColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentInvertColorsState) == 3, - "Expected getCurrentInvertColorsState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentInvertColorsState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentReduceMotionState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentReduceMotionState) == 3, - "Expected getCurrentReduceMotionState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentReduceMotionState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentDarkerSystemColorsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentDarkerSystemColorsState) == 3, - "Expected getCurrentDarkerSystemColorsState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentDarkerSystemColorsState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentPrefersCrossFadeTransitionsState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentPrefersCrossFadeTransitionsState) == 3, - "Expected getCurrentPrefersCrossFadeTransitionsState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentPrefersCrossFadeTransitionsState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentReduceTransparencyState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentReduceTransparencyState) == 3, - "Expected getCurrentReduceTransparencyState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentReduceTransparencyState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void getCurrentVoiceOverState(jsi::Runtime &rt, jsi::Function onSuccess, jsi::Function onError) override { - static_assert( - bridging::getParameterCount(&T::getCurrentVoiceOverState) == 3, - "Expected getCurrentVoiceOverState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentVoiceOverState, jsInvoker_, instance_, std::move(onSuccess), std::move(onError)); - } - void setAccessibilityContentSizeMultipliers(jsi::Runtime &rt, jsi::Object JSMultipliers) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityContentSizeMultipliers) == 2, - "Expected setAccessibilityContentSizeMultipliers(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityContentSizeMultipliers, jsInvoker_, instance_, std::move(JSMultipliers)); - } - void setAccessibilityFocus(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::setAccessibilityFocus) == 2, - "Expected setAccessibilityFocus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setAccessibilityFocus, jsInvoker_, instance_, std::move(reactTag)); - } - void announceForAccessibility(jsi::Runtime &rt, jsi::String announcement) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibility) == 2, - "Expected announceForAccessibility(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibility, jsInvoker_, instance_, std::move(announcement)); - } - void announceForAccessibilityWithOptions(jsi::Runtime &rt, jsi::String announcement, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::announceForAccessibilityWithOptions) == 3, - "Expected announceForAccessibilityWithOptions(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::announceForAccessibilityWithOptions, jsInvoker_, instance_, std::move(announcement), std::move(options)); - } - - private: - friend class NativeAccessibilityManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeActionSheetManagerCxxSpecJSI : public TurboModule { -protected: - NativeActionSheetManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void showActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function callback) = 0; - virtual void showShareActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function failureCallback, jsi::Function successCallback) = 0; - virtual void dismissActionSheet(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeActionSheetManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ActionSheetManager"; - -protected: - NativeActionSheetManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeActionSheetManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeActionSheetManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeActionSheetManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void showActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::showActionSheetWithOptions) == 3, - "Expected showActionSheetWithOptions(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::showActionSheetWithOptions, jsInvoker_, instance_, std::move(options), std::move(callback)); - } - void showShareActionSheetWithOptions(jsi::Runtime &rt, jsi::Object options, jsi::Function failureCallback, jsi::Function successCallback) override { - static_assert( - bridging::getParameterCount(&T::showShareActionSheetWithOptions) == 4, - "Expected showShareActionSheetWithOptions(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showShareActionSheetWithOptions, jsInvoker_, instance_, std::move(options), std::move(failureCallback), std::move(successCallback)); - } - void dismissActionSheet(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismissActionSheet) == 1, - "Expected dismissActionSheet(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismissActionSheet, jsInvoker_, instance_); - } - - private: - friend class NativeActionSheetManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAlertManagerArgs - -template -struct NativeAlertManagerArgs { - P0 title; - P1 message; - P2 buttons; - P3 type; - P4 defaultValue; - P5 cancelButtonKey; - P6 destructiveButtonKey; - P7 preferredButtonKey; - P8 keyboardType; - P9 userInterfaceStyle; - bool operator==(const NativeAlertManagerArgs &other) const { - return title == other.title && message == other.message && buttons == other.buttons && type == other.type && defaultValue == other.defaultValue && cancelButtonKey == other.cancelButtonKey && destructiveButtonKey == other.destructiveButtonKey && preferredButtonKey == other.preferredButtonKey && keyboardType == other.keyboardType && userInterfaceStyle == other.userInterfaceStyle; - } -}; - -template -struct NativeAlertManagerArgsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "title"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttons"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "type"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "defaultValue"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "cancelButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "destructiveButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "preferredButtonKey"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "keyboardType"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "userInterfaceStyle"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String titleToJs(jsi::Runtime &rt, decltype(types.title) value) { - return bridging::toJs(rt, value); - } - - static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array buttonsToJs(jsi::Runtime &rt, decltype(types.buttons) value) { - return bridging::toJs(rt, value); - } - - static jsi::String typeToJs(jsi::Runtime &rt, decltype(types.type) value) { - return bridging::toJs(rt, value); - } - - static jsi::String defaultValueToJs(jsi::Runtime &rt, decltype(types.defaultValue) value) { - return bridging::toJs(rt, value); - } - - static jsi::String cancelButtonKeyToJs(jsi::Runtime &rt, decltype(types.cancelButtonKey) value) { - return bridging::toJs(rt, value); - } - - static jsi::String destructiveButtonKeyToJs(jsi::Runtime &rt, decltype(types.destructiveButtonKey) value) { - return bridging::toJs(rt, value); - } - - static jsi::String preferredButtonKeyToJs(jsi::Runtime &rt, decltype(types.preferredButtonKey) value) { - return bridging::toJs(rt, value); - } - - static jsi::String keyboardTypeToJs(jsi::Runtime &rt, decltype(types.keyboardType) value) { - return bridging::toJs(rt, value); - } - - static jsi::String userInterfaceStyleToJs(jsi::Runtime &rt, decltype(types.userInterfaceStyle) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.title) { - result.setProperty(rt, "title", bridging::toJs(rt, value.title.value(), jsInvoker)); - } - if (value.message) { - result.setProperty(rt, "message", bridging::toJs(rt, value.message.value(), jsInvoker)); - } - if (value.buttons) { - result.setProperty(rt, "buttons", bridging::toJs(rt, value.buttons.value(), jsInvoker)); - } - if (value.type) { - result.setProperty(rt, "type", bridging::toJs(rt, value.type.value(), jsInvoker)); - } - if (value.defaultValue) { - result.setProperty(rt, "defaultValue", bridging::toJs(rt, value.defaultValue.value(), jsInvoker)); - } - if (value.cancelButtonKey) { - result.setProperty(rt, "cancelButtonKey", bridging::toJs(rt, value.cancelButtonKey.value(), jsInvoker)); - } - if (value.destructiveButtonKey) { - result.setProperty(rt, "destructiveButtonKey", bridging::toJs(rt, value.destructiveButtonKey.value(), jsInvoker)); - } - if (value.preferredButtonKey) { - result.setProperty(rt, "preferredButtonKey", bridging::toJs(rt, value.preferredButtonKey.value(), jsInvoker)); - } - if (value.keyboardType) { - result.setProperty(rt, "keyboardType", bridging::toJs(rt, value.keyboardType.value(), jsInvoker)); - } - if (value.userInterfaceStyle) { - result.setProperty(rt, "userInterfaceStyle", bridging::toJs(rt, value.userInterfaceStyle.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeAlertManagerCxxSpecJSI : public TurboModule { -protected: - NativeAlertManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void alertWithArgs(jsi::Runtime &rt, jsi::Object args, jsi::Function callback) = 0; - -}; - -template -class JSI_EXPORT NativeAlertManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AlertManager"; - -protected: - NativeAlertManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAlertManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAlertManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAlertManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void alertWithArgs(jsi::Runtime &rt, jsi::Object args, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::alertWithArgs) == 3, - "Expected alertWithArgs(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::alertWithArgs, jsInvoker_, instance_, std::move(args), std::move(callback)); - } - - private: - friend class NativeAlertManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAnimatedModuleEndResult - -template -struct NativeAnimatedModuleEndResult { - P0 finished; - P1 value; - P2 offset; - bool operator==(const NativeAnimatedModuleEndResult &other) const { - return finished == other.finished && value == other.value && offset == other.offset; - } -}; - -template -struct NativeAnimatedModuleEndResultBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "finished"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "value"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "offset"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool finishedToJs(jsi::Runtime &rt, decltype(types.finished) value) { - return bridging::toJs(rt, value); - } - - static double valueToJs(jsi::Runtime &rt, decltype(types.value) value) { - return bridging::toJs(rt, value); - } - - static double offsetToJs(jsi::Runtime &rt, decltype(types.offset) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "finished", bridging::toJs(rt, value.finished, jsInvoker)); - if (value.value) { - result.setProperty(rt, "value", bridging::toJs(rt, value.value.value(), jsInvoker)); - } - if (value.offset) { - result.setProperty(rt, "offset", bridging::toJs(rt, value.offset.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeAnimatedModuleEventMapping - -template -struct NativeAnimatedModuleEventMapping { - P0 nativeEventPath; - P1 animatedValueTag; - bool operator==(const NativeAnimatedModuleEventMapping &other) const { - return nativeEventPath == other.nativeEventPath && animatedValueTag == other.animatedValueTag; - } -}; - -template -struct NativeAnimatedModuleEventMappingBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "nativeEventPath"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "animatedValueTag"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array nativeEventPathToJs(jsi::Runtime &rt, decltype(types.nativeEventPath) value) { - return bridging::toJs(rt, value); - } - - static std::optional animatedValueTagToJs(jsi::Runtime &rt, decltype(types.animatedValueTag) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "nativeEventPath", bridging::toJs(rt, value.nativeEventPath, jsInvoker)); - result.setProperty(rt, "animatedValueTag", bridging::toJs(rt, value.animatedValueTag, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAnimatedModuleCxxSpecJSI : public TurboModule { -protected: - NativeAnimatedModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startOperationBatch(jsi::Runtime &rt) = 0; - virtual void finishOperationBatch(jsi::Runtime &rt) = 0; - virtual void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) = 0; - virtual void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) = 0; - virtual void stopAnimation(jsi::Runtime &rt, double animationId) = 0; - virtual void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) = 0; - virtual void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) = 0; - virtual void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) = 0; - virtual void dropAnimatedNode(jsi::Runtime &rt, double tag) = 0; - virtual void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) = 0; - virtual void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) = 0; - -}; - -template -class JSI_EXPORT NativeAnimatedModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeAnimatedModule"; - -protected: - NativeAnimatedModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAnimatedModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAnimatedModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAnimatedModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void startOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startOperationBatch) == 1, - "Expected startOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startOperationBatch, jsInvoker_, instance_); - } - void finishOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::finishOperationBatch) == 1, - "Expected finishOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::finishOperationBatch, jsInvoker_, instance_); - } - void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::createAnimatedNode) == 3, - "Expected createAnimatedNode(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createAnimatedNode, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::updateAnimatedNodeConfig) == 3, - "Expected updateAnimatedNodeConfig(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::updateAnimatedNodeConfig, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 3, - "Expected getValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(tag), std::move(saveValueCallback)); - } - void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::startListeningToAnimatedNodeValue) == 2, - "Expected startListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::startListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::stopListeningToAnimatedNodeValue) == 2, - "Expected stopListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodes) == 3, - "Expected connectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodes) == 3, - "Expected disconnectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) override { - static_assert( - bridging::getParameterCount(&T::startAnimatingNode) == 5, - "Expected startAnimatingNode(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::startAnimatingNode, jsInvoker_, instance_, std::move(animationId), std::move(nodeTag), std::move(config), std::move(endCallback)); - } - void stopAnimation(jsi::Runtime &rt, double animationId) override { - static_assert( - bridging::getParameterCount(&T::stopAnimation) == 2, - "Expected stopAnimation(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopAnimation, jsInvoker_, instance_, std::move(animationId)); - } - void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeValue) == 3, - "Expected setAnimatedNodeValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeValue, jsInvoker_, instance_, std::move(nodeTag), std::move(value)); - } - void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeOffset) == 3, - "Expected setAnimatedNodeOffset(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag), std::move(offset)); - } - void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::flattenAnimatedNodeOffset) == 2, - "Expected flattenAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::flattenAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::extractAnimatedNodeOffset) == 2, - "Expected extractAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::extractAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodeToView) == 3, - "Expected connectAnimatedNodeToView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodeToView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodeFromView) == 3, - "Expected disconnectAnimatedNodeFromView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodeFromView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::restoreDefaultValues) == 2, - "Expected restoreDefaultValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::restoreDefaultValues, jsInvoker_, instance_, std::move(nodeTag)); - } - void dropAnimatedNode(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::dropAnimatedNode) == 2, - "Expected dropAnimatedNode(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::dropAnimatedNode, jsInvoker_, instance_, std::move(tag)); - } - void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) override { - static_assert( - bridging::getParameterCount(&T::addAnimatedEventToView) == 4, - "Expected addAnimatedEventToView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addAnimatedEventToView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(eventMapping)); - } - void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) override { - static_assert( - bridging::getParameterCount(&T::removeAnimatedEventFromView) == 4, - "Expected removeAnimatedEventFromView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::removeAnimatedEventFromView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(animatedNodeTag)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) override { - static_assert( - bridging::getParameterCount(&T::queueAndExecuteBatchedOperations) == 2, - "Expected queueAndExecuteBatchedOperations(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queueAndExecuteBatchedOperations, jsInvoker_, instance_, std::move(operationsAndArgs)); - } - - private: - friend class NativeAnimatedModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAnimatedTurboModuleEndResult - -template -struct NativeAnimatedTurboModuleEndResult { - P0 finished; - P1 value; - P2 offset; - bool operator==(const NativeAnimatedTurboModuleEndResult &other) const { - return finished == other.finished && value == other.value && offset == other.offset; - } -}; - -template -struct NativeAnimatedTurboModuleEndResultBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "finished"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "value"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "offset"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool finishedToJs(jsi::Runtime &rt, decltype(types.finished) value) { - return bridging::toJs(rt, value); - } - - static double valueToJs(jsi::Runtime &rt, decltype(types.value) value) { - return bridging::toJs(rt, value); - } - - static double offsetToJs(jsi::Runtime &rt, decltype(types.offset) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "finished", bridging::toJs(rt, value.finished, jsInvoker)); - if (value.value) { - result.setProperty(rt, "value", bridging::toJs(rt, value.value.value(), jsInvoker)); - } - if (value.offset) { - result.setProperty(rt, "offset", bridging::toJs(rt, value.offset.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeAnimatedTurboModuleEventMapping - -template -struct NativeAnimatedTurboModuleEventMapping { - P0 nativeEventPath; - P1 animatedValueTag; - bool operator==(const NativeAnimatedTurboModuleEventMapping &other) const { - return nativeEventPath == other.nativeEventPath && animatedValueTag == other.animatedValueTag; - } -}; - -template -struct NativeAnimatedTurboModuleEventMappingBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "nativeEventPath"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "animatedValueTag"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array nativeEventPathToJs(jsi::Runtime &rt, decltype(types.nativeEventPath) value) { - return bridging::toJs(rt, value); - } - - static std::optional animatedValueTagToJs(jsi::Runtime &rt, decltype(types.animatedValueTag) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "nativeEventPath", bridging::toJs(rt, value.nativeEventPath, jsInvoker)); - result.setProperty(rt, "animatedValueTag", bridging::toJs(rt, value.animatedValueTag, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAnimatedTurboModuleCxxSpecJSI : public TurboModule { -protected: - NativeAnimatedTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void startOperationBatch(jsi::Runtime &rt) = 0; - virtual void finishOperationBatch(jsi::Runtime &rt) = 0; - virtual void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) = 0; - virtual void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) = 0; - virtual void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) = 0; - virtual void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) = 0; - virtual void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) = 0; - virtual void stopAnimation(jsi::Runtime &rt, double animationId) = 0; - virtual void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) = 0; - virtual void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) = 0; - virtual void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) = 0; - virtual void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) = 0; - virtual void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) = 0; - virtual void dropAnimatedNode(jsi::Runtime &rt, double tag) = 0; - virtual void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) = 0; - virtual void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) = 0; - -}; - -template -class JSI_EXPORT NativeAnimatedTurboModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeAnimatedTurboModule"; - -protected: - NativeAnimatedTurboModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAnimatedTurboModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAnimatedTurboModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAnimatedTurboModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void startOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::startOperationBatch) == 1, - "Expected startOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::startOperationBatch, jsInvoker_, instance_); - } - void finishOperationBatch(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::finishOperationBatch) == 1, - "Expected finishOperationBatch(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::finishOperationBatch, jsInvoker_, instance_); - } - void createAnimatedNode(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::createAnimatedNode) == 3, - "Expected createAnimatedNode(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createAnimatedNode, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void updateAnimatedNodeConfig(jsi::Runtime &rt, double tag, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::updateAnimatedNodeConfig) == 3, - "Expected updateAnimatedNodeConfig(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::updateAnimatedNodeConfig, jsInvoker_, instance_, std::move(tag), std::move(config)); - } - void getValue(jsi::Runtime &rt, double tag, jsi::Function saveValueCallback) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 3, - "Expected getValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(tag), std::move(saveValueCallback)); - } - void startListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::startListeningToAnimatedNodeValue) == 2, - "Expected startListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::startListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void stopListeningToAnimatedNodeValue(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::stopListeningToAnimatedNodeValue) == 2, - "Expected stopListeningToAnimatedNodeValue(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopListeningToAnimatedNodeValue, jsInvoker_, instance_, std::move(tag)); - } - void connectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodes) == 3, - "Expected connectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void disconnectAnimatedNodes(jsi::Runtime &rt, double parentTag, double childTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodes) == 3, - "Expected disconnectAnimatedNodes(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodes, jsInvoker_, instance_, std::move(parentTag), std::move(childTag)); - } - void startAnimatingNode(jsi::Runtime &rt, double animationId, double nodeTag, jsi::Object config, jsi::Function endCallback) override { - static_assert( - bridging::getParameterCount(&T::startAnimatingNode) == 5, - "Expected startAnimatingNode(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::startAnimatingNode, jsInvoker_, instance_, std::move(animationId), std::move(nodeTag), std::move(config), std::move(endCallback)); - } - void stopAnimation(jsi::Runtime &rt, double animationId) override { - static_assert( - bridging::getParameterCount(&T::stopAnimation) == 2, - "Expected stopAnimation(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::stopAnimation, jsInvoker_, instance_, std::move(animationId)); - } - void setAnimatedNodeValue(jsi::Runtime &rt, double nodeTag, double value) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeValue) == 3, - "Expected setAnimatedNodeValue(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeValue, jsInvoker_, instance_, std::move(nodeTag), std::move(value)); - } - void setAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag, double offset) override { - static_assert( - bridging::getParameterCount(&T::setAnimatedNodeOffset) == 3, - "Expected setAnimatedNodeOffset(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag), std::move(offset)); - } - void flattenAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::flattenAnimatedNodeOffset) == 2, - "Expected flattenAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::flattenAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void extractAnimatedNodeOffset(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::extractAnimatedNodeOffset) == 2, - "Expected extractAnimatedNodeOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::extractAnimatedNodeOffset, jsInvoker_, instance_, std::move(nodeTag)); - } - void connectAnimatedNodeToView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::connectAnimatedNodeToView) == 3, - "Expected connectAnimatedNodeToView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connectAnimatedNodeToView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void disconnectAnimatedNodeFromView(jsi::Runtime &rt, double nodeTag, double viewTag) override { - static_assert( - bridging::getParameterCount(&T::disconnectAnimatedNodeFromView) == 3, - "Expected disconnectAnimatedNodeFromView(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::disconnectAnimatedNodeFromView, jsInvoker_, instance_, std::move(nodeTag), std::move(viewTag)); - } - void restoreDefaultValues(jsi::Runtime &rt, double nodeTag) override { - static_assert( - bridging::getParameterCount(&T::restoreDefaultValues) == 2, - "Expected restoreDefaultValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::restoreDefaultValues, jsInvoker_, instance_, std::move(nodeTag)); - } - void dropAnimatedNode(jsi::Runtime &rt, double tag) override { - static_assert( - bridging::getParameterCount(&T::dropAnimatedNode) == 2, - "Expected dropAnimatedNode(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::dropAnimatedNode, jsInvoker_, instance_, std::move(tag)); - } - void addAnimatedEventToView(jsi::Runtime &rt, double viewTag, jsi::String eventName, jsi::Object eventMapping) override { - static_assert( - bridging::getParameterCount(&T::addAnimatedEventToView) == 4, - "Expected addAnimatedEventToView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addAnimatedEventToView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(eventMapping)); - } - void removeAnimatedEventFromView(jsi::Runtime &rt, double viewTag, jsi::String eventName, double animatedNodeTag) override { - static_assert( - bridging::getParameterCount(&T::removeAnimatedEventFromView) == 4, - "Expected removeAnimatedEventFromView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::removeAnimatedEventFromView, jsInvoker_, instance_, std::move(viewTag), std::move(eventName), std::move(animatedNodeTag)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void queueAndExecuteBatchedOperations(jsi::Runtime &rt, jsi::Array operationsAndArgs) override { - static_assert( - bridging::getParameterCount(&T::queueAndExecuteBatchedOperations) == 2, - "Expected queueAndExecuteBatchedOperations(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queueAndExecuteBatchedOperations, jsInvoker_, instance_, std::move(operationsAndArgs)); - } - - private: - friend class NativeAnimatedTurboModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeAppearanceCxxSpecJSI : public TurboModule { -protected: - NativeAppearanceCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual std::optional getColorScheme(jsi::Runtime &rt) = 0; - virtual void setColorScheme(jsi::Runtime &rt, jsi::String colorScheme) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeAppearanceCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Appearance"; - -protected: - NativeAppearanceCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAppearanceCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAppearanceCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAppearanceCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - std::optional getColorScheme(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getColorScheme) == 1, - "Expected getColorScheme(...) to have 1 parameters"); - - return bridging::callFromJs>( - rt, &T::getColorScheme, jsInvoker_, instance_); - } - void setColorScheme(jsi::Runtime &rt, jsi::String colorScheme) override { - static_assert( - bridging::getParameterCount(&T::setColorScheme) == 2, - "Expected setColorScheme(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setColorScheme, jsInvoker_, instance_, std::move(colorScheme)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeAppearanceCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAppStateAppState - -template -struct NativeAppStateAppState { - P0 app_state; - bool operator==(const NativeAppStateAppState &other) const { - return app_state == other.app_state; - } -}; - -template -struct NativeAppStateAppStateBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "app_state"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String app_stateToJs(jsi::Runtime &rt, decltype(types.app_state) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "app_state", bridging::toJs(rt, value.app_state, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeAppStateAppStateConstants - -template -struct NativeAppStateAppStateConstants { - P0 initialAppState; - bool operator==(const NativeAppStateAppStateConstants &other) const { - return initialAppState == other.initialAppState; - } -}; - -template -struct NativeAppStateAppStateConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "initialAppState"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String initialAppStateToJs(jsi::Runtime &rt, decltype(types.initialAppState) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "initialAppState", bridging::toJs(rt, value.initialAppState, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAppStateCxxSpecJSI : public TurboModule { -protected: - NativeAppStateCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getCurrentAppState(jsi::Runtime &rt, jsi::Function success, jsi::Function error) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeAppStateCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AppState"; - -protected: - NativeAppStateCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAppStateCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAppStateCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAppStateCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getCurrentAppState(jsi::Runtime &rt, jsi::Function success, jsi::Function error) override { - static_assert( - bridging::getParameterCount(&T::getCurrentAppState) == 3, - "Expected getCurrentAppState(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getCurrentAppState, jsInvoker_, instance_, std::move(success), std::move(error)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeAppStateCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeAppThemeAppThemeData - -template -struct NativeAppThemeAppThemeData { - P0 isHighContrast; - P1 highContrastColors; - bool operator==(const NativeAppThemeAppThemeData &other) const { - return isHighContrast == other.isHighContrast && highContrastColors == other.highContrastColors; - } -}; - -template -struct NativeAppThemeAppThemeDataBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "isHighContrast"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "highContrastColors"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isHighContrastToJs(jsi::Runtime &rt, decltype(types.isHighContrast) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object highContrastColorsToJs(jsi::Runtime &rt, decltype(types.highContrastColors) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isHighContrast", bridging::toJs(rt, value.isHighContrast, jsInvoker)); - result.setProperty(rt, "highContrastColors", bridging::toJs(rt, value.highContrastColors, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeAppThemeHighContrastColors - -template -struct NativeAppThemeHighContrastColors { - P0 ButtonFaceColor; - P1 ButtonTextColor; - P2 GrayTextColor; - P3 HighlightColor; - P4 HighlightTextColor; - P5 HotlightColor; - P6 WindowColor; - P7 WindowTextColor; - bool operator==(const NativeAppThemeHighContrastColors &other) const { - return ButtonFaceColor == other.ButtonFaceColor && ButtonTextColor == other.ButtonTextColor && GrayTextColor == other.GrayTextColor && HighlightColor == other.HighlightColor && HighlightTextColor == other.HighlightTextColor && HotlightColor == other.HotlightColor && WindowColor == other.WindowColor && WindowTextColor == other.WindowTextColor; - } -}; - -template -struct NativeAppThemeHighContrastColorsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "ButtonFaceColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "ButtonTextColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "GrayTextColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "HighlightColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "HighlightTextColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "HotlightColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "WindowColor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "WindowTextColor"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String ButtonFaceColorToJs(jsi::Runtime &rt, decltype(types.ButtonFaceColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ButtonTextColorToJs(jsi::Runtime &rt, decltype(types.ButtonTextColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String GrayTextColorToJs(jsi::Runtime &rt, decltype(types.GrayTextColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String HighlightColorToJs(jsi::Runtime &rt, decltype(types.HighlightColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String HighlightTextColorToJs(jsi::Runtime &rt, decltype(types.HighlightTextColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String HotlightColorToJs(jsi::Runtime &rt, decltype(types.HotlightColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String WindowColorToJs(jsi::Runtime &rt, decltype(types.WindowColor) value) { - return bridging::toJs(rt, value); - } - - static jsi::String WindowTextColorToJs(jsi::Runtime &rt, decltype(types.WindowTextColor) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "ButtonFaceColor", bridging::toJs(rt, value.ButtonFaceColor, jsInvoker)); - result.setProperty(rt, "ButtonTextColor", bridging::toJs(rt, value.ButtonTextColor, jsInvoker)); - result.setProperty(rt, "GrayTextColor", bridging::toJs(rt, value.GrayTextColor, jsInvoker)); - result.setProperty(rt, "HighlightColor", bridging::toJs(rt, value.HighlightColor, jsInvoker)); - result.setProperty(rt, "HighlightTextColor", bridging::toJs(rt, value.HighlightTextColor, jsInvoker)); - result.setProperty(rt, "HotlightColor", bridging::toJs(rt, value.HotlightColor, jsInvoker)); - result.setProperty(rt, "WindowColor", bridging::toJs(rt, value.WindowColor, jsInvoker)); - result.setProperty(rt, "WindowTextColor", bridging::toJs(rt, value.WindowTextColor, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeAppThemeCxxSpecJSI : public TurboModule { -protected: - NativeAppThemeCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeAppThemeCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "AppTheme"; - -protected: - NativeAppThemeCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeAppThemeCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeAppThemeCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeAppThemeCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativeAppThemeCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeBlobModuleConstants - -template -struct NativeBlobModuleConstants { - P0 BLOB_URI_SCHEME; - P1 BLOB_URI_HOST; - bool operator==(const NativeBlobModuleConstants &other) const { - return BLOB_URI_SCHEME == other.BLOB_URI_SCHEME && BLOB_URI_HOST == other.BLOB_URI_HOST; - } -}; - -template -struct NativeBlobModuleConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "BLOB_URI_SCHEME"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "BLOB_URI_HOST"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static std::optional BLOB_URI_SCHEMEToJs(jsi::Runtime &rt, decltype(types.BLOB_URI_SCHEME) value) { - return bridging::toJs(rt, value); - } - - static std::optional BLOB_URI_HOSTToJs(jsi::Runtime &rt, decltype(types.BLOB_URI_HOST) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "BLOB_URI_SCHEME", bridging::toJs(rt, value.BLOB_URI_SCHEME, jsInvoker)); - result.setProperty(rt, "BLOB_URI_HOST", bridging::toJs(rt, value.BLOB_URI_HOST, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeBlobModuleCxxSpecJSI : public TurboModule { -protected: - NativeBlobModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void addNetworkingHandler(jsi::Runtime &rt) = 0; - virtual void addWebSocketHandler(jsi::Runtime &rt, double id) = 0; - virtual void removeWebSocketHandler(jsi::Runtime &rt, double id) = 0; - virtual void sendOverSocket(jsi::Runtime &rt, jsi::Object blob, double socketID) = 0; - virtual void createFromParts(jsi::Runtime &rt, jsi::Array parts, jsi::String withId) = 0; - virtual void release(jsi::Runtime &rt, jsi::String blobId) = 0; - -}; - -template -class JSI_EXPORT NativeBlobModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "BlobModule"; - -protected: - NativeBlobModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeBlobModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeBlobModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeBlobModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void addNetworkingHandler(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::addNetworkingHandler) == 1, - "Expected addNetworkingHandler(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::addNetworkingHandler, jsInvoker_, instance_); - } - void addWebSocketHandler(jsi::Runtime &rt, double id) override { - static_assert( - bridging::getParameterCount(&T::addWebSocketHandler) == 2, - "Expected addWebSocketHandler(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addWebSocketHandler, jsInvoker_, instance_, std::move(id)); - } - void removeWebSocketHandler(jsi::Runtime &rt, double id) override { - static_assert( - bridging::getParameterCount(&T::removeWebSocketHandler) == 2, - "Expected removeWebSocketHandler(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeWebSocketHandler, jsInvoker_, instance_, std::move(id)); - } - void sendOverSocket(jsi::Runtime &rt, jsi::Object blob, double socketID) override { - static_assert( - bridging::getParameterCount(&T::sendOverSocket) == 3, - "Expected sendOverSocket(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendOverSocket, jsInvoker_, instance_, std::move(blob), std::move(socketID)); - } - void createFromParts(jsi::Runtime &rt, jsi::Array parts, jsi::String withId) override { - static_assert( - bridging::getParameterCount(&T::createFromParts) == 3, - "Expected createFromParts(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::createFromParts, jsInvoker_, instance_, std::move(parts), std::move(withId)); - } - void release(jsi::Runtime &rt, jsi::String blobId) override { - static_assert( - bridging::getParameterCount(&T::release) == 2, - "Expected release(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::release, jsInvoker_, instance_, std::move(blobId)); - } - - private: - friend class NativeBlobModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeClipboardCxxSpecJSI : public TurboModule { -protected: - NativeClipboardCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getString(jsi::Runtime &rt) = 0; - virtual void setString(jsi::Runtime &rt, jsi::String content) = 0; - -}; - -template -class JSI_EXPORT NativeClipboardCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Clipboard"; - -protected: - NativeClipboardCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeClipboardCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeClipboardCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeClipboardCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getString(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getString) == 1, - "Expected getString(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getString, jsInvoker_, instance_); - } - void setString(jsi::Runtime &rt, jsi::String content) override { - static_assert( - bridging::getParameterCount(&T::setString) == 2, - "Expected setString(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setString, jsInvoker_, instance_, std::move(content)); - } - - private: - friend class NativeClipboardCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDeviceEventManagerCxxSpecJSI : public TurboModule { -protected: - NativeDeviceEventManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void invokeDefaultBackPressHandler(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDeviceEventManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DeviceEventManager"; - -protected: - NativeDeviceEventManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDeviceEventManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDeviceEventManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDeviceEventManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void invokeDefaultBackPressHandler(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::invokeDefaultBackPressHandler) == 1, - "Expected invokeDefaultBackPressHandler(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::invokeDefaultBackPressHandler, jsInvoker_, instance_); - } - - private: - friend class NativeDeviceEventManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeDeviceInfoDeviceInfoConstants - -template -struct NativeDeviceInfoDeviceInfoConstants { - P0 Dimensions; - P1 isEdgeToEdge; - P2 isIPhoneX_deprecated; - bool operator==(const NativeDeviceInfoDeviceInfoConstants &other) const { - return Dimensions == other.Dimensions && isEdgeToEdge == other.isEdgeToEdge && isIPhoneX_deprecated == other.isIPhoneX_deprecated; - } -}; - -template -struct NativeDeviceInfoDeviceInfoConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "Dimensions"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isEdgeToEdge"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isIPhoneX_deprecated"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object DimensionsToJs(jsi::Runtime &rt, decltype(types.Dimensions) value) { - return bridging::toJs(rt, value); - } - - static bool isEdgeToEdgeToJs(jsi::Runtime &rt, decltype(types.isEdgeToEdge) value) { - return bridging::toJs(rt, value); - } - - static bool isIPhoneX_deprecatedToJs(jsi::Runtime &rt, decltype(types.isIPhoneX_deprecated) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "Dimensions", bridging::toJs(rt, value.Dimensions, jsInvoker)); - if (value.isEdgeToEdge) { - result.setProperty(rt, "isEdgeToEdge", bridging::toJs(rt, value.isEdgeToEdge.value(), jsInvoker)); - } - if (value.isIPhoneX_deprecated) { - result.setProperty(rt, "isIPhoneX_deprecated", bridging::toJs(rt, value.isIPhoneX_deprecated.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeDeviceInfoDimensionsPayload - -template -struct NativeDeviceInfoDimensionsPayload { - P0 window; - P1 screen; - P2 windowPhysicalPixels; - P3 screenPhysicalPixels; - bool operator==(const NativeDeviceInfoDimensionsPayload &other) const { - return window == other.window && screen == other.screen && windowPhysicalPixels == other.windowPhysicalPixels && screenPhysicalPixels == other.screenPhysicalPixels; - } -}; - -template -struct NativeDeviceInfoDimensionsPayloadBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "window"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "screen"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "windowPhysicalPixels"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "screenPhysicalPixels"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object windowToJs(jsi::Runtime &rt, decltype(types.window) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object screenToJs(jsi::Runtime &rt, decltype(types.screen) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object windowPhysicalPixelsToJs(jsi::Runtime &rt, decltype(types.windowPhysicalPixels) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object screenPhysicalPixelsToJs(jsi::Runtime &rt, decltype(types.screenPhysicalPixels) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.window) { - result.setProperty(rt, "window", bridging::toJs(rt, value.window.value(), jsInvoker)); - } - if (value.screen) { - result.setProperty(rt, "screen", bridging::toJs(rt, value.screen.value(), jsInvoker)); - } - if (value.windowPhysicalPixels) { - result.setProperty(rt, "windowPhysicalPixels", bridging::toJs(rt, value.windowPhysicalPixels.value(), jsInvoker)); - } - if (value.screenPhysicalPixels) { - result.setProperty(rt, "screenPhysicalPixels", bridging::toJs(rt, value.screenPhysicalPixels.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeDeviceInfoDisplayMetrics - -template -struct NativeDeviceInfoDisplayMetrics { - P0 width; - P1 height; - P2 scale; - P3 fontScale; - bool operator==(const NativeDeviceInfoDisplayMetrics &other) const { - return width == other.width && height == other.height && scale == other.scale && fontScale == other.fontScale; - } -}; - -template -struct NativeDeviceInfoDisplayMetricsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "width"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "height"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "scale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fontScale"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double widthToJs(jsi::Runtime &rt, decltype(types.width) value) { - return bridging::toJs(rt, value); - } - - static double heightToJs(jsi::Runtime &rt, decltype(types.height) value) { - return bridging::toJs(rt, value); - } - - static double scaleToJs(jsi::Runtime &rt, decltype(types.scale) value) { - return bridging::toJs(rt, value); - } - - static double fontScaleToJs(jsi::Runtime &rt, decltype(types.fontScale) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker)); - result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker)); - result.setProperty(rt, "scale", bridging::toJs(rt, value.scale, jsInvoker)); - result.setProperty(rt, "fontScale", bridging::toJs(rt, value.fontScale, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeDeviceInfoDisplayMetricsAndroid - -template -struct NativeDeviceInfoDisplayMetricsAndroid { - P0 width; - P1 height; - P2 scale; - P3 fontScale; - P4 densityDpi; - bool operator==(const NativeDeviceInfoDisplayMetricsAndroid &other) const { - return width == other.width && height == other.height && scale == other.scale && fontScale == other.fontScale && densityDpi == other.densityDpi; - } -}; - -template -struct NativeDeviceInfoDisplayMetricsAndroidBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "width"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "height"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "scale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fontScale"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "densityDpi"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double widthToJs(jsi::Runtime &rt, decltype(types.width) value) { - return bridging::toJs(rt, value); - } - - static double heightToJs(jsi::Runtime &rt, decltype(types.height) value) { - return bridging::toJs(rt, value); - } - - static double scaleToJs(jsi::Runtime &rt, decltype(types.scale) value) { - return bridging::toJs(rt, value); - } - - static double fontScaleToJs(jsi::Runtime &rt, decltype(types.fontScale) value) { - return bridging::toJs(rt, value); - } - - static double densityDpiToJs(jsi::Runtime &rt, decltype(types.densityDpi) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker)); - result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker)); - result.setProperty(rt, "scale", bridging::toJs(rt, value.scale, jsInvoker)); - result.setProperty(rt, "fontScale", bridging::toJs(rt, value.fontScale, jsInvoker)); - result.setProperty(rt, "densityDpi", bridging::toJs(rt, value.densityDpi, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeDeviceInfoCxxSpecJSI : public TurboModule { -protected: - NativeDeviceInfoCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDeviceInfoCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DeviceInfo"; - -protected: - NativeDeviceInfoCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDeviceInfoCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDeviceInfoCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDeviceInfoCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativeDeviceInfoCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevLoadingViewCxxSpecJSI : public TurboModule { -protected: - NativeDevLoadingViewCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void showMessage(jsi::Runtime &rt, jsi::String message, std::optional withColor, std::optional withBackgroundColor) = 0; - virtual void hide(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeDevLoadingViewCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DevLoadingView"; - -protected: - NativeDevLoadingViewCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevLoadingViewCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDevLoadingViewCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevLoadingViewCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void showMessage(jsi::Runtime &rt, jsi::String message, std::optional withColor, std::optional withBackgroundColor) override { - static_assert( - bridging::getParameterCount(&T::showMessage) == 4, - "Expected showMessage(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showMessage, jsInvoker_, instance_, std::move(message), std::move(withColor), std::move(withBackgroundColor)); - } - void hide(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::hide) == 1, - "Expected hide(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::hide, jsInvoker_, instance_); - } - - private: - friend class NativeDevLoadingViewCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevSettingsCxxSpecJSI : public TurboModule { -protected: - NativeDevSettingsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void reload(jsi::Runtime &rt) = 0; - virtual void reloadWithReason(jsi::Runtime &rt, jsi::String reason) = 0; - virtual void onFastRefresh(jsi::Runtime &rt) = 0; - virtual void setHotLoadingEnabled(jsi::Runtime &rt, bool isHotLoadingEnabled) = 0; - virtual void setProfilingEnabled(jsi::Runtime &rt, bool isProfilingEnabled) = 0; - virtual void toggleElementInspector(jsi::Runtime &rt) = 0; - virtual void addMenuItem(jsi::Runtime &rt, jsi::String title) = 0; - virtual void openDebugger(jsi::Runtime &rt) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, bool enabled) = 0; - -}; - -template -class JSI_EXPORT NativeDevSettingsCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DevSettings"; - -protected: - NativeDevSettingsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevSettingsCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDevSettingsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevSettingsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void reload(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::reload) == 1, - "Expected reload(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::reload, jsInvoker_, instance_); - } - void reloadWithReason(jsi::Runtime &rt, jsi::String reason) override { - static_assert( - bridging::getParameterCount(&T::reloadWithReason) == 2, - "Expected reloadWithReason(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::reloadWithReason, jsInvoker_, instance_, std::move(reason)); - } - void onFastRefresh(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::onFastRefresh) == 1, - "Expected onFastRefresh(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::onFastRefresh, jsInvoker_, instance_); - } - void setHotLoadingEnabled(jsi::Runtime &rt, bool isHotLoadingEnabled) override { - static_assert( - bridging::getParameterCount(&T::setHotLoadingEnabled) == 2, - "Expected setHotLoadingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHotLoadingEnabled, jsInvoker_, instance_, std::move(isHotLoadingEnabled)); - } - void setProfilingEnabled(jsi::Runtime &rt, bool isProfilingEnabled) override { - static_assert( - bridging::getParameterCount(&T::setProfilingEnabled) == 2, - "Expected setProfilingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setProfilingEnabled, jsInvoker_, instance_, std::move(isProfilingEnabled)); - } - void toggleElementInspector(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::toggleElementInspector) == 1, - "Expected toggleElementInspector(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::toggleElementInspector, jsInvoker_, instance_); - } - void addMenuItem(jsi::Runtime &rt, jsi::String title) override { - static_assert( - bridging::getParameterCount(&T::addMenuItem) == 2, - "Expected addMenuItem(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addMenuItem, jsInvoker_, instance_, std::move(title)); - } - void openDebugger(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::openDebugger) == 1, - "Expected openDebugger(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::openDebugger, jsInvoker_, instance_); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void setIsShakeToShowDevMenuEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setIsShakeToShowDevMenuEnabled) == 2, - "Expected setIsShakeToShowDevMenuEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setIsShakeToShowDevMenuEnabled, jsInvoker_, instance_, std::move(enabled)); - } - - private: - friend class NativeDevSettingsCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeDialogManagerAndroidDialogOptions - -template -struct NativeDialogManagerAndroidDialogOptions { - P0 title; - P1 message; - P2 buttonPositive; - P3 buttonNegative; - P4 buttonNeutral; - P5 items; - P6 cancelable; - bool operator==(const NativeDialogManagerAndroidDialogOptions &other) const { - return title == other.title && message == other.message && buttonPositive == other.buttonPositive && buttonNegative == other.buttonNegative && buttonNeutral == other.buttonNeutral && items == other.items && cancelable == other.cancelable; - } -}; - -template -struct NativeDialogManagerAndroidDialogOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "title"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonPositive"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNegative"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNeutral"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "items"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "cancelable"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String titleToJs(jsi::Runtime &rt, decltype(types.title) value) { - return bridging::toJs(rt, value); - } - - static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonPositiveToJs(jsi::Runtime &rt, decltype(types.buttonPositive) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNegativeToJs(jsi::Runtime &rt, decltype(types.buttonNegative) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNeutralToJs(jsi::Runtime &rt, decltype(types.buttonNeutral) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array itemsToJs(jsi::Runtime &rt, decltype(types.items) value) { - return bridging::toJs(rt, value); - } - - static bool cancelableToJs(jsi::Runtime &rt, decltype(types.cancelable) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.title) { - result.setProperty(rt, "title", bridging::toJs(rt, value.title.value(), jsInvoker)); - } - if (value.message) { - result.setProperty(rt, "message", bridging::toJs(rt, value.message.value(), jsInvoker)); - } - if (value.buttonPositive) { - result.setProperty(rt, "buttonPositive", bridging::toJs(rt, value.buttonPositive.value(), jsInvoker)); - } - if (value.buttonNegative) { - result.setProperty(rt, "buttonNegative", bridging::toJs(rt, value.buttonNegative.value(), jsInvoker)); - } - if (value.buttonNeutral) { - result.setProperty(rt, "buttonNeutral", bridging::toJs(rt, value.buttonNeutral.value(), jsInvoker)); - } - if (value.items) { - result.setProperty(rt, "items", bridging::toJs(rt, value.items.value(), jsInvoker)); - } - if (value.cancelable) { - result.setProperty(rt, "cancelable", bridging::toJs(rt, value.cancelable.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeDialogManagerAndroidCxxSpecJSI : public TurboModule { -protected: - NativeDialogManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) = 0; - -}; - -template -class JSI_EXPORT NativeDialogManagerAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DialogManagerAndroid"; - -protected: - NativeDialogManagerAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDialogManagerAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDialogManagerAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDialogManagerAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) override { - static_assert( - bridging::getParameterCount(&T::showAlert) == 4, - "Expected showAlert(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showAlert, jsInvoker_, instance_, std::move(config), std::move(onError), std::move(onAction)); - } - - private: - friend class NativeDialogManagerAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeDialogManagerWindowsDialogOptions - -template -struct NativeDialogManagerWindowsDialogOptions { - P0 title; - P1 message; - P2 buttonPositive; - P3 buttonNegative; - P4 buttonNeutral; - P5 items; - P6 cancelable; - P7 defaultButton; - P8 rootTag; - bool operator==(const NativeDialogManagerWindowsDialogOptions &other) const { - return title == other.title && message == other.message && buttonPositive == other.buttonPositive && buttonNegative == other.buttonNegative && buttonNeutral == other.buttonNeutral && items == other.items && cancelable == other.cancelable && defaultButton == other.defaultButton && rootTag == other.rootTag; - } -}; - -template -struct NativeDialogManagerWindowsDialogOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "title"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonPositive"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNegative"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buttonNeutral"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "items"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "cancelable"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "defaultButton"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootTag"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String titleToJs(jsi::Runtime &rt, decltype(types.title) value) { - return bridging::toJs(rt, value); - } - - static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonPositiveToJs(jsi::Runtime &rt, decltype(types.buttonPositive) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNegativeToJs(jsi::Runtime &rt, decltype(types.buttonNegative) value) { - return bridging::toJs(rt, value); - } - - static jsi::String buttonNeutralToJs(jsi::Runtime &rt, decltype(types.buttonNeutral) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array itemsToJs(jsi::Runtime &rt, decltype(types.items) value) { - return bridging::toJs(rt, value); - } - - static bool cancelableToJs(jsi::Runtime &rt, decltype(types.cancelable) value) { - return bridging::toJs(rt, value); - } - - static int defaultButtonToJs(jsi::Runtime &rt, decltype(types.defaultButton) value) { - return bridging::toJs(rt, value); - } - - static int rootTagToJs(jsi::Runtime &rt, decltype(types.rootTag) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.title) { - result.setProperty(rt, "title", bridging::toJs(rt, value.title.value(), jsInvoker)); - } - if (value.message) { - result.setProperty(rt, "message", bridging::toJs(rt, value.message.value(), jsInvoker)); - } - if (value.buttonPositive) { - result.setProperty(rt, "buttonPositive", bridging::toJs(rt, value.buttonPositive.value(), jsInvoker)); - } - if (value.buttonNegative) { - result.setProperty(rt, "buttonNegative", bridging::toJs(rt, value.buttonNegative.value(), jsInvoker)); - } - if (value.buttonNeutral) { - result.setProperty(rt, "buttonNeutral", bridging::toJs(rt, value.buttonNeutral.value(), jsInvoker)); - } - if (value.items) { - result.setProperty(rt, "items", bridging::toJs(rt, value.items.value(), jsInvoker)); - } - if (value.cancelable) { - result.setProperty(rt, "cancelable", bridging::toJs(rt, value.cancelable.value(), jsInvoker)); - } - if (value.defaultButton) { - result.setProperty(rt, "defaultButton", bridging::toJs(rt, value.defaultButton.value(), jsInvoker)); - } - if (value.rootTag) { - result.setProperty(rt, "rootTag", bridging::toJs(rt, value.rootTag.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeDialogManagerWindowsCxxSpecJSI : public TurboModule { -protected: - NativeDialogManagerWindowsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) = 0; - -}; - -template -class JSI_EXPORT NativeDialogManagerWindowsCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Alert"; - -protected: - NativeDialogManagerWindowsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDialogManagerWindowsCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDialogManagerWindowsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDialogManagerWindowsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void showAlert(jsi::Runtime &rt, jsi::Object config, jsi::Function onError, jsi::Function onAction) override { - static_assert( - bridging::getParameterCount(&T::showAlert) == 4, - "Expected showAlert(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showAlert, jsInvoker_, instance_, std::move(config), std::move(onError), std::move(onAction)); - } - - private: - friend class NativeDialogManagerWindowsCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeExceptionsManagerExceptionData - -template -struct NativeExceptionsManagerExceptionData { - P0 message; - P1 originalMessage; - P2 name; - P3 componentStack; - P4 stack; - P5 id; - P6 isFatal; - P7 extraData; - bool operator==(const NativeExceptionsManagerExceptionData &other) const { - return message == other.message && originalMessage == other.originalMessage && name == other.name && componentStack == other.componentStack && stack == other.stack && id == other.id && isFatal == other.isFatal && extraData == other.extraData; - } -}; - -template -struct NativeExceptionsManagerExceptionDataBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "message"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "originalMessage"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "name"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "componentStack"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "stack"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "id"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isFatal"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "extraData"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) { - return bridging::toJs(rt, value); - } - - static std::optional originalMessageToJs(jsi::Runtime &rt, decltype(types.originalMessage) value) { - return bridging::toJs(rt, value); - } - - static std::optional nameToJs(jsi::Runtime &rt, decltype(types.name) value) { - return bridging::toJs(rt, value); - } - - static std::optional componentStackToJs(jsi::Runtime &rt, decltype(types.componentStack) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array stackToJs(jsi::Runtime &rt, decltype(types.stack) value) { - return bridging::toJs(rt, value); - } - - static double idToJs(jsi::Runtime &rt, decltype(types.id) value) { - return bridging::toJs(rt, value); - } - - static bool isFatalToJs(jsi::Runtime &rt, decltype(types.isFatal) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object extraDataToJs(jsi::Runtime &rt, decltype(types.extraData) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "message", bridging::toJs(rt, value.message, jsInvoker)); - result.setProperty(rt, "originalMessage", bridging::toJs(rt, value.originalMessage, jsInvoker)); - result.setProperty(rt, "name", bridging::toJs(rt, value.name, jsInvoker)); - result.setProperty(rt, "componentStack", bridging::toJs(rt, value.componentStack, jsInvoker)); - result.setProperty(rt, "stack", bridging::toJs(rt, value.stack, jsInvoker)); - result.setProperty(rt, "id", bridging::toJs(rt, value.id, jsInvoker)); - result.setProperty(rt, "isFatal", bridging::toJs(rt, value.isFatal, jsInvoker)); - if (value.extraData) { - result.setProperty(rt, "extraData", bridging::toJs(rt, value.extraData.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeExceptionsManagerStackFrame - -template -struct NativeExceptionsManagerStackFrame { - P0 column; - P1 file; - P2 lineNumber; - P3 methodName; - P4 collapse; - bool operator==(const NativeExceptionsManagerStackFrame &other) const { - return column == other.column && file == other.file && lineNumber == other.lineNumber && methodName == other.methodName && collapse == other.collapse; - } -}; - -template -struct NativeExceptionsManagerStackFrameBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "column"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "file"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "lineNumber"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "methodName"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "collapse"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static std::optional columnToJs(jsi::Runtime &rt, decltype(types.column) value) { - return bridging::toJs(rt, value); - } - - static std::optional fileToJs(jsi::Runtime &rt, decltype(types.file) value) { - return bridging::toJs(rt, value); - } - - static std::optional lineNumberToJs(jsi::Runtime &rt, decltype(types.lineNumber) value) { - return bridging::toJs(rt, value); - } - - static jsi::String methodNameToJs(jsi::Runtime &rt, decltype(types.methodName) value) { - return bridging::toJs(rt, value); - } - - static bool collapseToJs(jsi::Runtime &rt, decltype(types.collapse) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "column", bridging::toJs(rt, value.column, jsInvoker)); - result.setProperty(rt, "file", bridging::toJs(rt, value.file, jsInvoker)); - result.setProperty(rt, "lineNumber", bridging::toJs(rt, value.lineNumber, jsInvoker)); - result.setProperty(rt, "methodName", bridging::toJs(rt, value.methodName, jsInvoker)); - if (value.collapse) { - result.setProperty(rt, "collapse", bridging::toJs(rt, value.collapse.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeExceptionsManagerCxxSpecJSI : public TurboModule { -protected: - NativeExceptionsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void reportFatalException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) = 0; - virtual void reportSoftException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) = 0; - virtual void reportException(jsi::Runtime &rt, jsi::Object data) = 0; - virtual void dismissRedbox(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeExceptionsManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ExceptionsManager"; - -protected: - NativeExceptionsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeExceptionsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeExceptionsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeExceptionsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void reportFatalException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) override { - static_assert( - bridging::getParameterCount(&T::reportFatalException) == 4, - "Expected reportFatalException(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::reportFatalException, jsInvoker_, instance_, std::move(message), std::move(stack), std::move(exceptionId)); - } - void reportSoftException(jsi::Runtime &rt, jsi::String message, jsi::Array stack, double exceptionId) override { - static_assert( - bridging::getParameterCount(&T::reportSoftException) == 4, - "Expected reportSoftException(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::reportSoftException, jsInvoker_, instance_, std::move(message), std::move(stack), std::move(exceptionId)); - } - void reportException(jsi::Runtime &rt, jsi::Object data) override { - static_assert( - bridging::getParameterCount(&T::reportException) == 2, - "Expected reportException(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::reportException, jsInvoker_, instance_, std::move(data)); - } - void dismissRedbox(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismissRedbox) == 1, - "Expected dismissRedbox(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismissRedbox, jsInvoker_, instance_); - } - - private: - friend class NativeExceptionsManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeFileReaderModuleCxxSpecJSI : public TurboModule { -protected: - NativeFileReaderModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value readAsDataURL(jsi::Runtime &rt, jsi::Object data) = 0; - virtual jsi::Value readAsText(jsi::Runtime &rt, jsi::Object data, jsi::String encoding) = 0; - -}; - -template -class JSI_EXPORT NativeFileReaderModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "FileReaderModule"; - -protected: - NativeFileReaderModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeFileReaderModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeFileReaderModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeFileReaderModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value readAsDataURL(jsi::Runtime &rt, jsi::Object data) override { - static_assert( - bridging::getParameterCount(&T::readAsDataURL) == 2, - "Expected readAsDataURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::readAsDataURL, jsInvoker_, instance_, std::move(data)); - } - jsi::Value readAsText(jsi::Runtime &rt, jsi::Object data, jsi::String encoding) override { - static_assert( - bridging::getParameterCount(&T::readAsText) == 3, - "Expected readAsText(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::readAsText, jsInvoker_, instance_, std::move(data), std::move(encoding)); - } - - private: - friend class NativeFileReaderModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeFrameRateLoggerCxxSpecJSI : public TurboModule { -protected: - NativeFrameRateLoggerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setGlobalOptions(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void setContext(jsi::Runtime &rt, jsi::String context) = 0; - virtual void beginScroll(jsi::Runtime &rt) = 0; - virtual void endScroll(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeFrameRateLoggerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "FrameRateLogger"; - -protected: - NativeFrameRateLoggerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeFrameRateLoggerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeFrameRateLoggerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeFrameRateLoggerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void setGlobalOptions(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::setGlobalOptions) == 2, - "Expected setGlobalOptions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setGlobalOptions, jsInvoker_, instance_, std::move(options)); - } - void setContext(jsi::Runtime &rt, jsi::String context) override { - static_assert( - bridging::getParameterCount(&T::setContext) == 2, - "Expected setContext(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setContext, jsInvoker_, instance_, std::move(context)); - } - void beginScroll(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::beginScroll) == 1, - "Expected beginScroll(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::beginScroll, jsInvoker_, instance_); - } - void endScroll(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::endScroll) == 1, - "Expected endScroll(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::endScroll, jsInvoker_, instance_); - } - - private: - friend class NativeFrameRateLoggerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeHeadlessJsTaskSupportCxxSpecJSI : public TurboModule { -protected: - NativeHeadlessJsTaskSupportCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void notifyTaskFinished(jsi::Runtime &rt, double taskId) = 0; - virtual jsi::Value notifyTaskRetry(jsi::Runtime &rt, double taskId) = 0; - -}; - -template -class JSI_EXPORT NativeHeadlessJsTaskSupportCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "HeadlessJsTaskSupport"; - -protected: - NativeHeadlessJsTaskSupportCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeHeadlessJsTaskSupportCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeHeadlessJsTaskSupportCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeHeadlessJsTaskSupportCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void notifyTaskFinished(jsi::Runtime &rt, double taskId) override { - static_assert( - bridging::getParameterCount(&T::notifyTaskFinished) == 2, - "Expected notifyTaskFinished(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::notifyTaskFinished, jsInvoker_, instance_, std::move(taskId)); - } - jsi::Value notifyTaskRetry(jsi::Runtime &rt, double taskId) override { - static_assert( - bridging::getParameterCount(&T::notifyTaskRetry) == 2, - "Expected notifyTaskRetry(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::notifyTaskRetry, jsInvoker_, instance_, std::move(taskId)); - } - - private: - friend class NativeHeadlessJsTaskSupportCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeI18nManagerI18nManagerConstants - -template -struct NativeI18nManagerI18nManagerConstants { - P0 doLeftAndRightSwapInRTL; - P1 isRTL; - P2 localeIdentifier; - bool operator==(const NativeI18nManagerI18nManagerConstants &other) const { - return doLeftAndRightSwapInRTL == other.doLeftAndRightSwapInRTL && isRTL == other.isRTL && localeIdentifier == other.localeIdentifier; - } -}; - -template -struct NativeI18nManagerI18nManagerConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "doLeftAndRightSwapInRTL"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isRTL"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "localeIdentifier"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool doLeftAndRightSwapInRTLToJs(jsi::Runtime &rt, decltype(types.doLeftAndRightSwapInRTL) value) { - return bridging::toJs(rt, value); - } - - static bool isRTLToJs(jsi::Runtime &rt, decltype(types.isRTL) value) { - return bridging::toJs(rt, value); - } - - static std::optional localeIdentifierToJs(jsi::Runtime &rt, decltype(types.localeIdentifier) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "doLeftAndRightSwapInRTL", bridging::toJs(rt, value.doLeftAndRightSwapInRTL, jsInvoker)); - result.setProperty(rt, "isRTL", bridging::toJs(rt, value.isRTL, jsInvoker)); - if (value.localeIdentifier) { - result.setProperty(rt, "localeIdentifier", bridging::toJs(rt, value.localeIdentifier.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeI18nManagerCxxSpecJSI : public TurboModule { -protected: - NativeI18nManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void allowRTL(jsi::Runtime &rt, bool allowRTL) = 0; - virtual void forceRTL(jsi::Runtime &rt, bool forceRTL) = 0; - virtual void swapLeftAndRightInRTL(jsi::Runtime &rt, bool flipStyles) = 0; - -}; - -template -class JSI_EXPORT NativeI18nManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "I18nManager"; - -protected: - NativeI18nManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeI18nManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeI18nManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeI18nManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void allowRTL(jsi::Runtime &rt, bool allowRTL) override { - static_assert( - bridging::getParameterCount(&T::allowRTL) == 2, - "Expected allowRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::allowRTL, jsInvoker_, instance_, std::move(allowRTL)); - } - void forceRTL(jsi::Runtime &rt, bool forceRTL) override { - static_assert( - bridging::getParameterCount(&T::forceRTL) == 2, - "Expected forceRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::forceRTL, jsInvoker_, instance_, std::move(forceRTL)); - } - void swapLeftAndRightInRTL(jsi::Runtime &rt, bool flipStyles) override { - static_assert( - bridging::getParameterCount(&T::swapLeftAndRightInRTL) == 2, - "Expected swapLeftAndRightInRTL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::swapLeftAndRightInRTL, jsInvoker_, instance_, std::move(flipStyles)); - } - - private: - friend class NativeI18nManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeImageEditorOptions - -template -struct NativeImageEditorOptions { - P0 offset; - P1 size; - P2 displaySize; - P3 resizeMode; - P4 allowExternalStorage; - bool operator==(const NativeImageEditorOptions &other) const { - return offset == other.offset && size == other.size && displaySize == other.displaySize && resizeMode == other.resizeMode && allowExternalStorage == other.allowExternalStorage; - } -}; - -template -struct NativeImageEditorOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "offset"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "size"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "displaySize"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "resizeMode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "allowExternalStorage"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Object offsetToJs(jsi::Runtime &rt, decltype(types.offset) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object sizeToJs(jsi::Runtime &rt, decltype(types.size) value) { - return bridging::toJs(rt, value); - } - - static std::optional displaySizeToJs(jsi::Runtime &rt, decltype(types.displaySize) value) { - return bridging::toJs(rt, value); - } - - static std::optional resizeModeToJs(jsi::Runtime &rt, decltype(types.resizeMode) value) { - return bridging::toJs(rt, value); - } - - static bool allowExternalStorageToJs(jsi::Runtime &rt, decltype(types.allowExternalStorage) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "offset", bridging::toJs(rt, value.offset, jsInvoker)); - result.setProperty(rt, "size", bridging::toJs(rt, value.size, jsInvoker)); - if (value.displaySize) { - result.setProperty(rt, "displaySize", bridging::toJs(rt, value.displaySize.value(), jsInvoker)); - } - if (value.resizeMode) { - result.setProperty(rt, "resizeMode", bridging::toJs(rt, value.resizeMode.value(), jsInvoker)); - } - if (value.allowExternalStorage) { - result.setProperty(rt, "allowExternalStorage", bridging::toJs(rt, value.allowExternalStorage.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeImageEditorCxxSpecJSI : public TurboModule { -protected: - NativeImageEditorCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void cropImage(jsi::Runtime &rt, jsi::String uri, jsi::Object cropData, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageEditorCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageEditingManager"; - -protected: - NativeImageEditorCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageEditorCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageEditorCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageEditorCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void cropImage(jsi::Runtime &rt, jsi::String uri, jsi::Object cropData, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::cropImage) == 5, - "Expected cropImage(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::cropImage, jsInvoker_, instance_, std::move(uri), std::move(cropData), std::move(successCallback), std::move(errorCallback)); - } - - private: - friend class NativeImageEditorCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeImageLoaderAndroidImageSize - -template -struct NativeImageLoaderAndroidImageSize { - P0 width; - P1 height; - bool operator==(const NativeImageLoaderAndroidImageSize &other) const { - return width == other.width && height == other.height; - } -}; - -template -struct NativeImageLoaderAndroidImageSizeBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "width"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "height"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double widthToJs(jsi::Runtime &rt, decltype(types.width) value) { - return bridging::toJs(rt, value); - } - - static double heightToJs(jsi::Runtime &rt, decltype(types.height) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "width", bridging::toJs(rt, value.width, jsInvoker)); - result.setProperty(rt, "height", bridging::toJs(rt, value.height, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeImageLoaderAndroidCxxSpecJSI : public TurboModule { -protected: - NativeImageLoaderAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) = 0; - virtual jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri, double requestId) = 0; - virtual jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) = 0; - -}; - -template -class JSI_EXPORT NativeImageLoaderAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageLoader"; - -protected: - NativeImageLoaderAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageLoaderAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageLoaderAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageLoaderAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::getSize) == 2, - "Expected getSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getSize, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) override { - static_assert( - bridging::getParameterCount(&T::getSizeWithHeaders) == 3, - "Expected getSizeWithHeaders(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getSizeWithHeaders, jsInvoker_, instance_, std::move(uri), std::move(headers)); - } - jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri, double requestId) override { - static_assert( - bridging::getParameterCount(&T::prefetchImage) == 3, - "Expected prefetchImage(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImage, jsInvoker_, instance_, std::move(uri), std::move(requestId)); - } - jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) override { - static_assert( - bridging::getParameterCount(&T::queryCache) == 2, - "Expected queryCache(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queryCache, jsInvoker_, instance_, std::move(uris)); - } - - private: - friend class NativeImageLoaderAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageLoaderIOSCxxSpecJSI : public TurboModule { -protected: - NativeImageLoaderIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) = 0; - virtual jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri) = 0; - virtual jsi::Value prefetchImageWithMetadata(jsi::Runtime &rt, jsi::String uri, jsi::String queryRootName, double rootTag) = 0; - virtual jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) = 0; - -}; - -template -class JSI_EXPORT NativeImageLoaderIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageLoader"; - -protected: - NativeImageLoaderIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageLoaderIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageLoaderIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageLoaderIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value getSize(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::getSize) == 2, - "Expected getSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getSize, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value getSizeWithHeaders(jsi::Runtime &rt, jsi::String uri, jsi::Object headers) override { - static_assert( - bridging::getParameterCount(&T::getSizeWithHeaders) == 3, - "Expected getSizeWithHeaders(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getSizeWithHeaders, jsInvoker_, instance_, std::move(uri), std::move(headers)); - } - jsi::Value prefetchImage(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::prefetchImage) == 2, - "Expected prefetchImage(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImage, jsInvoker_, instance_, std::move(uri)); - } - jsi::Value prefetchImageWithMetadata(jsi::Runtime &rt, jsi::String uri, jsi::String queryRootName, double rootTag) override { - static_assert( - bridging::getParameterCount(&T::prefetchImageWithMetadata) == 4, - "Expected prefetchImageWithMetadata(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::prefetchImageWithMetadata, jsInvoker_, instance_, std::move(uri), std::move(queryRootName), std::move(rootTag)); - } - jsi::Value queryCache(jsi::Runtime &rt, jsi::Array uris) override { - static_assert( - bridging::getParameterCount(&T::queryCache) == 2, - "Expected queryCache(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queryCache, jsInvoker_, instance_, std::move(uris)); - } - - private: - friend class NativeImageLoaderIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageStoreAndroidCxxSpecJSI : public TurboModule { -protected: - NativeImageStoreAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageStoreAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageStoreManager"; - -protected: - NativeImageStoreAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageStoreAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageStoreAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageStoreAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::getBase64ForTag) == 4, - "Expected getBase64ForTag(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getBase64ForTag, jsInvoker_, instance_, std::move(uri), std::move(successCallback), std::move(errorCallback)); - } - - private: - friend class NativeImageStoreAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeImageStoreIOSCxxSpecJSI : public TurboModule { -protected: - NativeImageStoreIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) = 0; - virtual void hasImageForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function callback) = 0; - virtual void removeImageForTag(jsi::Runtime &rt, jsi::String uri) = 0; - virtual void addImageFromBase64(jsi::Runtime &rt, jsi::String base64ImageData, jsi::Function successCallback, jsi::Function errorCallback) = 0; - -}; - -template -class JSI_EXPORT NativeImageStoreIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ImageStoreManager"; - -protected: - NativeImageStoreIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeImageStoreIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeImageStoreIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeImageStoreIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getBase64ForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::getBase64ForTag) == 4, - "Expected getBase64ForTag(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getBase64ForTag, jsInvoker_, instance_, std::move(uri), std::move(successCallback), std::move(errorCallback)); - } - void hasImageForTag(jsi::Runtime &rt, jsi::String uri, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::hasImageForTag) == 3, - "Expected hasImageForTag(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::hasImageForTag, jsInvoker_, instance_, std::move(uri), std::move(callback)); - } - void removeImageForTag(jsi::Runtime &rt, jsi::String uri) override { - static_assert( - bridging::getParameterCount(&T::removeImageForTag) == 2, - "Expected removeImageForTag(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeImageForTag, jsInvoker_, instance_, std::move(uri)); - } - void addImageFromBase64(jsi::Runtime &rt, jsi::String base64ImageData, jsi::Function successCallback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::addImageFromBase64) == 4, - "Expected addImageFromBase64(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::addImageFromBase64, jsInvoker_, instance_, std::move(base64ImageData), std::move(successCallback), std::move(errorCallback)); - } - - private: - friend class NativeImageStoreIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeIntentAndroidCxxSpecJSI : public TurboModule { -protected: - NativeIntentAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value getInitialURL(jsi::Runtime &rt) = 0; - virtual jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openSettings(jsi::Runtime &rt) = 0; - virtual jsi::Value sendIntent(jsi::Runtime &rt, jsi::String action, std::optional extras) = 0; - -}; - -template -class JSI_EXPORT NativeIntentAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "IntentAndroid"; - -protected: - NativeIntentAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeIntentAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeIntentAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeIntentAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value getInitialURL(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialURL) == 1, - "Expected getInitialURL(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialURL, jsInvoker_, instance_); - } - jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::canOpenURL) == 2, - "Expected canOpenURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::canOpenURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::openURL) == 2, - "Expected openURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::openURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::openSettings) == 1, - "Expected openSettings(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::openSettings, jsInvoker_, instance_); - } - jsi::Value sendIntent(jsi::Runtime &rt, jsi::String action, std::optional extras) override { - static_assert( - bridging::getParameterCount(&T::sendIntent) == 3, - "Expected sendIntent(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendIntent, jsInvoker_, instance_, std::move(action), std::move(extras)); - } - - private: - friend class NativeIntentAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeJSCHeapCaptureCxxSpecJSI : public TurboModule { -protected: - NativeJSCHeapCaptureCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void captureComplete(jsi::Runtime &rt, jsi::String path, std::optional error) = 0; - -}; - -template -class JSI_EXPORT NativeJSCHeapCaptureCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "JSCHeapCapture"; - -protected: - NativeJSCHeapCaptureCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeJSCHeapCaptureCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeJSCHeapCaptureCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeJSCHeapCaptureCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void captureComplete(jsi::Runtime &rt, jsi::String path, std::optional error) override { - static_assert( - bridging::getParameterCount(&T::captureComplete) == 3, - "Expected captureComplete(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::captureComplete, jsInvoker_, instance_, std::move(path), std::move(error)); - } - - private: - friend class NativeJSCHeapCaptureCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeKeyboardObserverCxxSpecJSI : public TurboModule { -protected: - NativeKeyboardObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeKeyboardObserverCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "KeyboardObserver"; - -protected: - NativeKeyboardObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeKeyboardObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeKeyboardObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeKeyboardObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeKeyboardObserverCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeLinkingManagerCxxSpecJSI : public TurboModule { -protected: - NativeLinkingManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value getInitialURL(jsi::Runtime &rt) = 0; - virtual jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openURL(jsi::Runtime &rt, jsi::String url) = 0; - virtual jsi::Value openSettings(jsi::Runtime &rt) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeLinkingManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "LinkingManager"; - -protected: - NativeLinkingManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeLinkingManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeLinkingManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeLinkingManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value getInitialURL(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialURL) == 1, - "Expected getInitialURL(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialURL, jsInvoker_, instance_); - } - jsi::Value canOpenURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::canOpenURL) == 2, - "Expected canOpenURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::canOpenURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openURL(jsi::Runtime &rt, jsi::String url) override { - static_assert( - bridging::getParameterCount(&T::openURL) == 2, - "Expected openURL(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::openURL, jsInvoker_, instance_, std::move(url)); - } - jsi::Value openSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::openSettings) == 1, - "Expected openSettings(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::openSettings, jsInvoker_, instance_); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeLinkingManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeLogBoxCxxSpecJSI : public TurboModule { -protected: - NativeLogBoxCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void show(jsi::Runtime &rt) = 0; - virtual void hide(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeLogBoxCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "LogBox"; - -protected: - NativeLogBoxCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeLogBoxCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeLogBoxCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeLogBoxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void show(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::show) == 1, - "Expected show(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_); - } - void hide(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::hide) == 1, - "Expected hide(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::hide, jsInvoker_, instance_); - } - - private: - friend class NativeLogBoxCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeModalManagerCxxSpecJSI : public TurboModule { -protected: - NativeModalManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeModalManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ModalManager"; - -protected: - NativeModalManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeModalManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeModalManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeModalManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeModalManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeNetworkingAndroidCxxSpecJSI : public TurboModule { -protected: - NativeNetworkingAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void sendRequest(jsi::Runtime &rt, jsi::String method, jsi::String url, double requestId, jsi::Array headers, jsi::Object data, jsi::String responseType, bool useIncrementalUpdates, double timeout, bool withCredentials) = 0; - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual void clearCookies(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeNetworkingAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Networking"; - -protected: - NativeNetworkingAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeNetworkingAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeNetworkingAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeNetworkingAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void sendRequest(jsi::Runtime &rt, jsi::String method, jsi::String url, double requestId, jsi::Array headers, jsi::Object data, jsi::String responseType, bool useIncrementalUpdates, double timeout, bool withCredentials) override { - static_assert( - bridging::getParameterCount(&T::sendRequest) == 10, - "Expected sendRequest(...) to have 10 parameters"); - - return bridging::callFromJs( - rt, &T::sendRequest, jsInvoker_, instance_, std::move(method), std::move(url), std::move(requestId), std::move(headers), std::move(data), std::move(responseType), std::move(useIncrementalUpdates), std::move(timeout), std::move(withCredentials)); - } - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - void clearCookies(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::clearCookies) == 2, - "Expected clearCookies(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearCookies, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeNetworkingAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeNetworkingIOSCxxSpecJSI : public TurboModule { -protected: - NativeNetworkingIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void sendRequest(jsi::Runtime &rt, jsi::Object query, jsi::Function callback) = 0; - virtual void abortRequest(jsi::Runtime &rt, double requestId) = 0; - virtual void clearCookies(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeNetworkingIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Networking"; - -protected: - NativeNetworkingIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeNetworkingIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeNetworkingIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeNetworkingIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void sendRequest(jsi::Runtime &rt, jsi::Object query, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::sendRequest) == 3, - "Expected sendRequest(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendRequest, jsInvoker_, instance_, std::move(query), std::move(callback)); - } - void abortRequest(jsi::Runtime &rt, double requestId) override { - static_assert( - bridging::getParameterCount(&T::abortRequest) == 2, - "Expected abortRequest(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::abortRequest, jsInvoker_, instance_, std::move(requestId)); - } - void clearCookies(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::clearCookies) == 2, - "Expected clearCookies(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearCookies, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeNetworkingIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativePermissionsAndroidCxxSpecJSI : public TurboModule { -protected: - NativePermissionsAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value checkPermission(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value requestPermission(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value shouldShowRequestPermissionRationale(jsi::Runtime &rt, jsi::String permission) = 0; - virtual jsi::Value requestMultiplePermissions(jsi::Runtime &rt, jsi::Array permissions) = 0; - -}; - -template -class JSI_EXPORT NativePermissionsAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PermissionsAndroid"; - -protected: - NativePermissionsAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePermissionsAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePermissionsAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePermissionsAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value checkPermission(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::checkPermission) == 2, - "Expected checkPermission(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::checkPermission, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value requestPermission(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::requestPermission) == 2, - "Expected requestPermission(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestPermission, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value shouldShowRequestPermissionRationale(jsi::Runtime &rt, jsi::String permission) override { - static_assert( - bridging::getParameterCount(&T::shouldShowRequestPermissionRationale) == 2, - "Expected shouldShowRequestPermissionRationale(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::shouldShowRequestPermissionRationale, jsInvoker_, instance_, std::move(permission)); - } - jsi::Value requestMultiplePermissions(jsi::Runtime &rt, jsi::Array permissions) override { - static_assert( - bridging::getParameterCount(&T::requestMultiplePermissions) == 2, - "Expected requestMultiplePermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestMultiplePermissions, jsInvoker_, instance_, std::move(permissions)); - } - - private: - friend class NativePermissionsAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePlatformConstantsAndroidPlatformConstantsAndroid - -template -struct NativePlatformConstantsAndroidPlatformConstantsAndroid { - P0 isTesting; - P1 isDisableAnimations; - P2 reactNativeVersion; - P3 Version; - P4 Release; - P5 Serial; - P6 Fingerprint; - P7 Model; - P8 ServerHost; - P9 uiMode; - P10 Brand; - P11 Manufacturer; - bool operator==(const NativePlatformConstantsAndroidPlatformConstantsAndroid &other) const { - return isTesting == other.isTesting && isDisableAnimations == other.isDisableAnimations && reactNativeVersion == other.reactNativeVersion && Version == other.Version && Release == other.Release && Serial == other.Serial && Fingerprint == other.Fingerprint && Model == other.Model && ServerHost == other.ServerHost && uiMode == other.uiMode && Brand == other.Brand && Manufacturer == other.Manufacturer; - } -}; - -template -struct NativePlatformConstantsAndroidPlatformConstantsAndroidBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "isTesting"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isDisableAnimations"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Version"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Release"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Serial"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Fingerprint"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Model"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "ServerHost"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "uiMode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Brand"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "Manufacturer"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isTestingToJs(jsi::Runtime &rt, decltype(types.isTesting) value) { - return bridging::toJs(rt, value); - } - - static bool isDisableAnimationsToJs(jsi::Runtime &rt, decltype(types.isDisableAnimations) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeVersionToJs(jsi::Runtime &rt, decltype(types.reactNativeVersion) value) { - return bridging::toJs(rt, value); - } - - static double VersionToJs(jsi::Runtime &rt, decltype(types.Version) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ReleaseToJs(jsi::Runtime &rt, decltype(types.Release) value) { - return bridging::toJs(rt, value); - } - - static jsi::String SerialToJs(jsi::Runtime &rt, decltype(types.Serial) value) { - return bridging::toJs(rt, value); - } - - static jsi::String FingerprintToJs(jsi::Runtime &rt, decltype(types.Fingerprint) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ModelToJs(jsi::Runtime &rt, decltype(types.Model) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ServerHostToJs(jsi::Runtime &rt, decltype(types.ServerHost) value) { - return bridging::toJs(rt, value); - } - - static jsi::String uiModeToJs(jsi::Runtime &rt, decltype(types.uiMode) value) { - return bridging::toJs(rt, value); - } - - static jsi::String BrandToJs(jsi::Runtime &rt, decltype(types.Brand) value) { - return bridging::toJs(rt, value); - } - - static jsi::String ManufacturerToJs(jsi::Runtime &rt, decltype(types.Manufacturer) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isTesting", bridging::toJs(rt, value.isTesting, jsInvoker)); - if (value.isDisableAnimations) { - result.setProperty(rt, "isDisableAnimations", bridging::toJs(rt, value.isDisableAnimations.value(), jsInvoker)); - } - result.setProperty(rt, "reactNativeVersion", bridging::toJs(rt, value.reactNativeVersion, jsInvoker)); - result.setProperty(rt, "Version", bridging::toJs(rt, value.Version, jsInvoker)); - result.setProperty(rt, "Release", bridging::toJs(rt, value.Release, jsInvoker)); - result.setProperty(rt, "Serial", bridging::toJs(rt, value.Serial, jsInvoker)); - result.setProperty(rt, "Fingerprint", bridging::toJs(rt, value.Fingerprint, jsInvoker)); - result.setProperty(rt, "Model", bridging::toJs(rt, value.Model, jsInvoker)); - if (value.ServerHost) { - result.setProperty(rt, "ServerHost", bridging::toJs(rt, value.ServerHost.value(), jsInvoker)); - } - result.setProperty(rt, "uiMode", bridging::toJs(rt, value.uiMode, jsInvoker)); - result.setProperty(rt, "Brand", bridging::toJs(rt, value.Brand, jsInvoker)); - result.setProperty(rt, "Manufacturer", bridging::toJs(rt, value.Manufacturer, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativePlatformConstantsAndroidReactNativeVersionAndroid - -template -struct NativePlatformConstantsAndroidReactNativeVersionAndroid { - P0 major; - P1 minor; - P2 patch; - P3 prerelease; - bool operator==(const NativePlatformConstantsAndroidReactNativeVersionAndroid &other) const { - return major == other.major && minor == other.minor && patch == other.patch && prerelease == other.prerelease; - } -}; - -template -struct NativePlatformConstantsAndroidReactNativeVersionAndroidBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "major"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "minor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "patch"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "prerelease"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double majorToJs(jsi::Runtime &rt, decltype(types.major) value) { - return bridging::toJs(rt, value); - } - - static double minorToJs(jsi::Runtime &rt, decltype(types.minor) value) { - return bridging::toJs(rt, value); - } - - static double patchToJs(jsi::Runtime &rt, decltype(types.patch) value) { - return bridging::toJs(rt, value); - } - - static std::optional prereleaseToJs(jsi::Runtime &rt, decltype(types.prerelease) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "major", bridging::toJs(rt, value.major, jsInvoker)); - result.setProperty(rt, "minor", bridging::toJs(rt, value.minor, jsInvoker)); - result.setProperty(rt, "patch", bridging::toJs(rt, value.patch, jsInvoker)); - result.setProperty(rt, "prerelease", bridging::toJs(rt, value.prerelease, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePlatformConstantsAndroidCxxSpecJSI : public TurboModule { -protected: - NativePlatformConstantsAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::String getAndroidID(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePlatformConstantsAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PlatformConstants"; - -protected: - NativePlatformConstantsAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePlatformConstantsAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePlatformConstantsAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePlatformConstantsAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::String getAndroidID(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getAndroidID) == 1, - "Expected getAndroidID(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getAndroidID, jsInvoker_, instance_); - } - - private: - friend class NativePlatformConstantsAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePlatformConstantsIOSPlatformConstantsIOS - -template -struct NativePlatformConstantsIOSPlatformConstantsIOS { - P0 isTesting; - P1 isDisableAnimations; - P2 reactNativeVersion; - P3 forceTouchAvailable; - P4 osVersion; - P5 systemName; - P6 interfaceIdiom; - P7 isMacCatalyst; - bool operator==(const NativePlatformConstantsIOSPlatformConstantsIOS &other) const { - return isTesting == other.isTesting && isDisableAnimations == other.isDisableAnimations && reactNativeVersion == other.reactNativeVersion && forceTouchAvailable == other.forceTouchAvailable && osVersion == other.osVersion && systemName == other.systemName && interfaceIdiom == other.interfaceIdiom && isMacCatalyst == other.isMacCatalyst; - } -}; - -template -struct NativePlatformConstantsIOSPlatformConstantsIOSBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "isTesting"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isDisableAnimations"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "forceTouchAvailable"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "osVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "systemName"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "interfaceIdiom"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isMacCatalyst"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isTestingToJs(jsi::Runtime &rt, decltype(types.isTesting) value) { - return bridging::toJs(rt, value); - } - - static bool isDisableAnimationsToJs(jsi::Runtime &rt, decltype(types.isDisableAnimations) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeVersionToJs(jsi::Runtime &rt, decltype(types.reactNativeVersion) value) { - return bridging::toJs(rt, value); - } - - static bool forceTouchAvailableToJs(jsi::Runtime &rt, decltype(types.forceTouchAvailable) value) { - return bridging::toJs(rt, value); - } - - static jsi::String osVersionToJs(jsi::Runtime &rt, decltype(types.osVersion) value) { - return bridging::toJs(rt, value); - } - - static jsi::String systemNameToJs(jsi::Runtime &rt, decltype(types.systemName) value) { - return bridging::toJs(rt, value); - } - - static jsi::String interfaceIdiomToJs(jsi::Runtime &rt, decltype(types.interfaceIdiom) value) { - return bridging::toJs(rt, value); - } - - static bool isMacCatalystToJs(jsi::Runtime &rt, decltype(types.isMacCatalyst) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isTesting", bridging::toJs(rt, value.isTesting, jsInvoker)); - if (value.isDisableAnimations) { - result.setProperty(rt, "isDisableAnimations", bridging::toJs(rt, value.isDisableAnimations.value(), jsInvoker)); - } - result.setProperty(rt, "reactNativeVersion", bridging::toJs(rt, value.reactNativeVersion, jsInvoker)); - result.setProperty(rt, "forceTouchAvailable", bridging::toJs(rt, value.forceTouchAvailable, jsInvoker)); - result.setProperty(rt, "osVersion", bridging::toJs(rt, value.osVersion, jsInvoker)); - result.setProperty(rt, "systemName", bridging::toJs(rt, value.systemName, jsInvoker)); - result.setProperty(rt, "interfaceIdiom", bridging::toJs(rt, value.interfaceIdiom, jsInvoker)); - if (value.isMacCatalyst) { - result.setProperty(rt, "isMacCatalyst", bridging::toJs(rt, value.isMacCatalyst.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativePlatformConstantsIOSCxxSpecJSI : public TurboModule { -protected: - NativePlatformConstantsIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePlatformConstantsIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PlatformConstants"; - -protected: - NativePlatformConstantsIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePlatformConstantsIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePlatformConstantsIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePlatformConstantsIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativePlatformConstantsIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePlatformConstantsWindowsPlatformConstantsWindows - -template -struct NativePlatformConstantsWindowsPlatformConstantsWindows { - P0 isTesting; - P1 isDisableAnimations; - P2 reactNativeVersion; - P3 reactNativeWindowsVersion; - P4 osVersion; - bool operator==(const NativePlatformConstantsWindowsPlatformConstantsWindows &other) const { - return isTesting == other.isTesting && isDisableAnimations == other.isDisableAnimations && reactNativeVersion == other.reactNativeVersion && reactNativeWindowsVersion == other.reactNativeWindowsVersion && osVersion == other.osVersion; - } -}; - -template -struct NativePlatformConstantsWindowsPlatformConstantsWindowsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "isTesting"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isDisableAnimations"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "reactNativeWindowsVersion"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "osVersion"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool isTestingToJs(jsi::Runtime &rt, decltype(types.isTesting) value) { - return bridging::toJs(rt, value); - } - - static bool isDisableAnimationsToJs(jsi::Runtime &rt, decltype(types.isDisableAnimations) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeVersionToJs(jsi::Runtime &rt, decltype(types.reactNativeVersion) value) { - return bridging::toJs(rt, value); - } - - static jsi::Object reactNativeWindowsVersionToJs(jsi::Runtime &rt, decltype(types.reactNativeWindowsVersion) value) { - return bridging::toJs(rt, value); - } - - static double osVersionToJs(jsi::Runtime &rt, decltype(types.osVersion) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "isTesting", bridging::toJs(rt, value.isTesting, jsInvoker)); - if (value.isDisableAnimations) { - result.setProperty(rt, "isDisableAnimations", bridging::toJs(rt, value.isDisableAnimations.value(), jsInvoker)); - } - result.setProperty(rt, "reactNativeVersion", bridging::toJs(rt, value.reactNativeVersion, jsInvoker)); - result.setProperty(rt, "reactNativeWindowsVersion", bridging::toJs(rt, value.reactNativeWindowsVersion, jsInvoker)); - result.setProperty(rt, "osVersion", bridging::toJs(rt, value.osVersion, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativePlatformConstantsWindowsReactNativeVersionAndroid - -template -struct NativePlatformConstantsWindowsReactNativeVersionAndroid { - P0 major; - P1 minor; - P2 patch; - P3 prerelease; - bool operator==(const NativePlatformConstantsWindowsReactNativeVersionAndroid &other) const { - return major == other.major && minor == other.minor && patch == other.patch && prerelease == other.prerelease; - } -}; - -template -struct NativePlatformConstantsWindowsReactNativeVersionAndroidBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "major"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "minor"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "patch"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "prerelease"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double majorToJs(jsi::Runtime &rt, decltype(types.major) value) { - return bridging::toJs(rt, value); - } - - static double minorToJs(jsi::Runtime &rt, decltype(types.minor) value) { - return bridging::toJs(rt, value); - } - - static double patchToJs(jsi::Runtime &rt, decltype(types.patch) value) { - return bridging::toJs(rt, value); - } - - static std::optional prereleaseToJs(jsi::Runtime &rt, decltype(types.prerelease) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "major", bridging::toJs(rt, value.major, jsInvoker)); - result.setProperty(rt, "minor", bridging::toJs(rt, value.minor, jsInvoker)); - result.setProperty(rt, "patch", bridging::toJs(rt, value.patch, jsInvoker)); - result.setProperty(rt, "prerelease", bridging::toJs(rt, value.prerelease, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePlatformConstantsWindowsCxxSpecJSI : public TurboModule { -protected: - NativePlatformConstantsWindowsCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePlatformConstantsWindowsCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PlatformConstants"; - -protected: - NativePlatformConstantsWindowsCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePlatformConstantsWindowsCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePlatformConstantsWindowsCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePlatformConstantsWindowsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativePlatformConstantsWindowsCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativePushNotificationManagerIOSNotification - -template -struct NativePushNotificationManagerIOSNotification { - P0 alertTitle; - P1 alertBody; - P2 userInfo; - P3 category; - P4 fireDate; - P5 fireIntervalSeconds; - P6 applicationIconBadgeNumber; - P7 isSilent; - P8 soundName; - bool operator==(const NativePushNotificationManagerIOSNotification &other) const { - return alertTitle == other.alertTitle && alertBody == other.alertBody && userInfo == other.userInfo && category == other.category && fireDate == other.fireDate && fireIntervalSeconds == other.fireIntervalSeconds && applicationIconBadgeNumber == other.applicationIconBadgeNumber && isSilent == other.isSilent && soundName == other.soundName; - } -}; - -template -struct NativePushNotificationManagerIOSNotificationBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "alertTitle"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "alertBody"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "userInfo"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "category"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fireDate"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fireIntervalSeconds"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "applicationIconBadgeNumber"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isSilent"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "soundName"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static std::optional alertTitleToJs(jsi::Runtime &rt, decltype(types.alertTitle) value) { - return bridging::toJs(rt, value); - } - - static std::optional alertBodyToJs(jsi::Runtime &rt, decltype(types.alertBody) value) { - return bridging::toJs(rt, value); - } - - static std::optional userInfoToJs(jsi::Runtime &rt, decltype(types.userInfo) value) { - return bridging::toJs(rt, value); - } - - static std::optional categoryToJs(jsi::Runtime &rt, decltype(types.category) value) { - return bridging::toJs(rt, value); - } - - static std::optional fireDateToJs(jsi::Runtime &rt, decltype(types.fireDate) value) { - return bridging::toJs(rt, value); - } - - static std::optional fireIntervalSecondsToJs(jsi::Runtime &rt, decltype(types.fireIntervalSeconds) value) { - return bridging::toJs(rt, value); - } - - static std::optional applicationIconBadgeNumberToJs(jsi::Runtime &rt, decltype(types.applicationIconBadgeNumber) value) { - return bridging::toJs(rt, value); - } - - static std::optional isSilentToJs(jsi::Runtime &rt, decltype(types.isSilent) value) { - return bridging::toJs(rt, value); - } - - static std::optional soundNameToJs(jsi::Runtime &rt, decltype(types.soundName) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.alertTitle) { - result.setProperty(rt, "alertTitle", bridging::toJs(rt, value.alertTitle.value(), jsInvoker)); - } - if (value.alertBody) { - result.setProperty(rt, "alertBody", bridging::toJs(rt, value.alertBody.value(), jsInvoker)); - } - if (value.userInfo) { - result.setProperty(rt, "userInfo", bridging::toJs(rt, value.userInfo.value(), jsInvoker)); - } - if (value.category) { - result.setProperty(rt, "category", bridging::toJs(rt, value.category.value(), jsInvoker)); - } - if (value.fireDate) { - result.setProperty(rt, "fireDate", bridging::toJs(rt, value.fireDate.value(), jsInvoker)); - } - if (value.fireIntervalSeconds) { - result.setProperty(rt, "fireIntervalSeconds", bridging::toJs(rt, value.fireIntervalSeconds.value(), jsInvoker)); - } - if (value.applicationIconBadgeNumber) { - result.setProperty(rt, "applicationIconBadgeNumber", bridging::toJs(rt, value.applicationIconBadgeNumber.value(), jsInvoker)); - } - if (value.isSilent) { - result.setProperty(rt, "isSilent", bridging::toJs(rt, value.isSilent.value(), jsInvoker)); - } - if (value.soundName) { - result.setProperty(rt, "soundName", bridging::toJs(rt, value.soundName.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativePushNotificationManagerIOSPermissions - -template -struct NativePushNotificationManagerIOSPermissions { - P0 alert; - P1 badge; - P2 sound; - bool operator==(const NativePushNotificationManagerIOSPermissions &other) const { - return alert == other.alert && badge == other.badge && sound == other.sound; - } -}; - -template -struct NativePushNotificationManagerIOSPermissionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "alert"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "badge"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "sound"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool alertToJs(jsi::Runtime &rt, decltype(types.alert) value) { - return bridging::toJs(rt, value); - } - - static bool badgeToJs(jsi::Runtime &rt, decltype(types.badge) value) { - return bridging::toJs(rt, value); - } - - static bool soundToJs(jsi::Runtime &rt, decltype(types.sound) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "alert", bridging::toJs(rt, value.alert, jsInvoker)); - result.setProperty(rt, "badge", bridging::toJs(rt, value.badge, jsInvoker)); - result.setProperty(rt, "sound", bridging::toJs(rt, value.sound, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativePushNotificationManagerIOSCxxSpecJSI : public TurboModule { -protected: - NativePushNotificationManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void onFinishRemoteNotification(jsi::Runtime &rt, jsi::String notificationId, jsi::String fetchResult) = 0; - virtual void setApplicationIconBadgeNumber(jsi::Runtime &rt, double num) = 0; - virtual void getApplicationIconBadgeNumber(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual jsi::Value requestPermissions(jsi::Runtime &rt, jsi::Object permission) = 0; - virtual void abandonPermissions(jsi::Runtime &rt) = 0; - virtual void checkPermissions(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void presentLocalNotification(jsi::Runtime &rt, jsi::Object notification) = 0; - virtual void scheduleLocalNotification(jsi::Runtime &rt, jsi::Object notification) = 0; - virtual void cancelAllLocalNotifications(jsi::Runtime &rt) = 0; - virtual void cancelLocalNotifications(jsi::Runtime &rt, jsi::Object userInfo) = 0; - virtual jsi::Value getInitialNotification(jsi::Runtime &rt) = 0; - virtual void getScheduledLocalNotifications(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void removeAllDeliveredNotifications(jsi::Runtime &rt) = 0; - virtual void removeDeliveredNotifications(jsi::Runtime &rt, jsi::Array identifiers) = 0; - virtual void getDeliveredNotifications(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void getAuthorizationStatus(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventType) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativePushNotificationManagerIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "PushNotificationManager"; - -protected: - NativePushNotificationManagerIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePushNotificationManagerIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePushNotificationManagerIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePushNotificationManagerIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void onFinishRemoteNotification(jsi::Runtime &rt, jsi::String notificationId, jsi::String fetchResult) override { - static_assert( - bridging::getParameterCount(&T::onFinishRemoteNotification) == 3, - "Expected onFinishRemoteNotification(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::onFinishRemoteNotification, jsInvoker_, instance_, std::move(notificationId), std::move(fetchResult)); - } - void setApplicationIconBadgeNumber(jsi::Runtime &rt, double num) override { - static_assert( - bridging::getParameterCount(&T::setApplicationIconBadgeNumber) == 2, - "Expected setApplicationIconBadgeNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setApplicationIconBadgeNumber, jsInvoker_, instance_, std::move(num)); - } - void getApplicationIconBadgeNumber(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getApplicationIconBadgeNumber) == 2, - "Expected getApplicationIconBadgeNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getApplicationIconBadgeNumber, jsInvoker_, instance_, std::move(callback)); - } - jsi::Value requestPermissions(jsi::Runtime &rt, jsi::Object permission) override { - static_assert( - bridging::getParameterCount(&T::requestPermissions) == 2, - "Expected requestPermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::requestPermissions, jsInvoker_, instance_, std::move(permission)); - } - void abandonPermissions(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::abandonPermissions) == 1, - "Expected abandonPermissions(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::abandonPermissions, jsInvoker_, instance_); - } - void checkPermissions(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::checkPermissions) == 2, - "Expected checkPermissions(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::checkPermissions, jsInvoker_, instance_, std::move(callback)); - } - void presentLocalNotification(jsi::Runtime &rt, jsi::Object notification) override { - static_assert( - bridging::getParameterCount(&T::presentLocalNotification) == 2, - "Expected presentLocalNotification(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::presentLocalNotification, jsInvoker_, instance_, std::move(notification)); - } - void scheduleLocalNotification(jsi::Runtime &rt, jsi::Object notification) override { - static_assert( - bridging::getParameterCount(&T::scheduleLocalNotification) == 2, - "Expected scheduleLocalNotification(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::scheduleLocalNotification, jsInvoker_, instance_, std::move(notification)); - } - void cancelAllLocalNotifications(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cancelAllLocalNotifications) == 1, - "Expected cancelAllLocalNotifications(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cancelAllLocalNotifications, jsInvoker_, instance_); - } - void cancelLocalNotifications(jsi::Runtime &rt, jsi::Object userInfo) override { - static_assert( - bridging::getParameterCount(&T::cancelLocalNotifications) == 2, - "Expected cancelLocalNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::cancelLocalNotifications, jsInvoker_, instance_, std::move(userInfo)); - } - jsi::Value getInitialNotification(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getInitialNotification) == 1, - "Expected getInitialNotification(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getInitialNotification, jsInvoker_, instance_); - } - void getScheduledLocalNotifications(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getScheduledLocalNotifications) == 2, - "Expected getScheduledLocalNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getScheduledLocalNotifications, jsInvoker_, instance_, std::move(callback)); - } - void removeAllDeliveredNotifications(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::removeAllDeliveredNotifications) == 1, - "Expected removeAllDeliveredNotifications(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::removeAllDeliveredNotifications, jsInvoker_, instance_); - } - void removeDeliveredNotifications(jsi::Runtime &rt, jsi::Array identifiers) override { - static_assert( - bridging::getParameterCount(&T::removeDeliveredNotifications) == 2, - "Expected removeDeliveredNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeDeliveredNotifications, jsInvoker_, instance_, std::move(identifiers)); - } - void getDeliveredNotifications(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getDeliveredNotifications) == 2, - "Expected getDeliveredNotifications(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getDeliveredNotifications, jsInvoker_, instance_, std::move(callback)); - } - void getAuthorizationStatus(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getAuthorizationStatus) == 2, - "Expected getAuthorizationStatus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getAuthorizationStatus, jsInvoker_, instance_, std::move(callback)); - } - void addListener(jsi::Runtime &rt, jsi::String eventType) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventType)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativePushNotificationManagerIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeRedBoxCxxSpecJSI : public TurboModule { -protected: - NativeRedBoxCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::String forIdentifier) = 0; - virtual void dismiss(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeRedBoxCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "RedBox"; - -protected: - NativeRedBoxCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeRedBoxCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeRedBoxCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeRedBoxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void setExtraData(jsi::Runtime &rt, jsi::Object extraData, jsi::String forIdentifier) override { - static_assert( - bridging::getParameterCount(&T::setExtraData) == 3, - "Expected setExtraData(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setExtraData, jsInvoker_, instance_, std::move(extraData), std::move(forIdentifier)); - } - void dismiss(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::dismiss) == 1, - "Expected dismiss(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::dismiss, jsInvoker_, instance_); - } - - private: - friend class NativeRedBoxCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - -#pragma mark - NativeSampleTurboModuleEnumInt - -enum class NativeSampleTurboModuleEnumInt { A, B }; - -template <> -struct Bridging { - static NativeSampleTurboModuleEnumInt fromJs(jsi::Runtime &rt, const jsi::Value &rawValue) { - double value = (double)rawValue.asNumber(); - if (value == 23) { - return NativeSampleTurboModuleEnumInt::A; - } else if (value == 42) { - return NativeSampleTurboModuleEnumInt::B; - } else { - throw jsi::JSError(rt, "No appropriate enum member found for value in NativeSampleTurboModuleEnumInt"); - } - } - - static jsi::Value toJs(jsi::Runtime &rt, NativeSampleTurboModuleEnumInt value) { - if (value == NativeSampleTurboModuleEnumInt::A) { - return bridging::toJs(rt, 23); - } else if (value == NativeSampleTurboModuleEnumInt::B) { - return bridging::toJs(rt, 42); - } else { - throw jsi::JSError(rt, "No appropriate enum member found for enum value in NativeSampleTurboModuleEnumInt"); - } - } -}; - -#pragma mark - NativeSampleTurboModuleObjectStruct - -template -struct NativeSampleTurboModuleObjectStruct { - P0 a; - P1 b; - P2 c; - bool operator==(const NativeSampleTurboModuleObjectStruct &other) const { - return a == other.a && b == other.b && c == other.c; - } -}; - -template -struct NativeSampleTurboModuleObjectStructBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "a"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "b"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "c"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double aToJs(jsi::Runtime &rt, decltype(types.a) value) { - return bridging::toJs(rt, value); - } - - static jsi::String bToJs(jsi::Runtime &rt, decltype(types.b) value) { - return bridging::toJs(rt, value); - } - - static std::optional cToJs(jsi::Runtime &rt, decltype(types.c) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "a", bridging::toJs(rt, value.a, jsInvoker)); - result.setProperty(rt, "b", bridging::toJs(rt, value.b, jsInvoker)); - if (value.c) { - result.setProperty(rt, "c", bridging::toJs(rt, value.c.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeSampleTurboModuleCxxSpecJSI : public TurboModule { -protected: - NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void voidFunc(jsi::Runtime &rt) = 0; - virtual bool getBool(jsi::Runtime &rt, bool arg) = 0; - virtual jsi::Value getEnum(jsi::Runtime &rt, jsi::Value arg) = 0; - virtual double getNumber(jsi::Runtime &rt, double arg) = 0; - virtual jsi::String getString(jsi::Runtime &rt, jsi::String arg) = 0; - virtual jsi::Array getArray(jsi::Runtime &rt, jsi::Array arg) = 0; - virtual jsi::Object getObject(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual jsi::Object getUnsafeObject(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual double getRootTag(jsi::Runtime &rt, double arg) = 0; - virtual jsi::Object getValue(jsi::Runtime &rt, double x, jsi::String y, jsi::Object z) = 0; - virtual void getValueWithCallback(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual jsi::Value getValueWithPromise(jsi::Runtime &rt, bool error) = 0; - virtual void voidFuncThrows(jsi::Runtime &rt) = 0; - virtual jsi::Object getObjectThrows(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual jsi::Value promiseThrows(jsi::Runtime &rt) = 0; - virtual void voidFuncAssert(jsi::Runtime &rt) = 0; - virtual jsi::Object getObjectAssert(jsi::Runtime &rt, jsi::Object arg) = 0; - virtual jsi::Value promiseAssert(jsi::Runtime &rt) = 0; - virtual jsi::Value getImageUrl(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSampleTurboModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SampleTurboModule"; - -protected: - NativeSampleTurboModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSampleTurboModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - void emitOnPress() { - static_cast&>(*delegate_.eventEmitterMap_["onPress"]).emit(); - } - - template void emitOnClick(OnClickType value) { - static_assert(bridging::supportsFromJs, "value cannnot be converted to jsi::String"); - static_cast&>(*delegate_.eventEmitterMap_["onClick"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value { - return bridging::toJs(rt, eventValue, jsInvoker); - }); - } - - template void emitOnChange(OnChangeType value) { - static_assert(bridging::supportsFromJs, "value cannnot be converted to jsi::Object"); - static_cast&>(*delegate_.eventEmitterMap_["onChange"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value { - return bridging::toJs(rt, eventValue, jsInvoker); - }); - } - - template void emitOnSubmit(std::vector value) { - static_assert(bridging::supportsFromJs, jsi::Array>, "value cannnot be converted to jsi::Array"); - static_cast&>(*delegate_.eventEmitterMap_["onSubmit"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value { - return bridging::toJs(rt, eventValue, jsInvoker); - }); - } - -private: - class Delegate : public NativeSampleTurboModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSampleTurboModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - eventEmitterMap_["onPress"] = std::make_shared>(); - eventEmitterMap_["onClick"] = std::make_shared>(); - eventEmitterMap_["onChange"] = std::make_shared>(); - eventEmitterMap_["onSubmit"] = std::make_shared>(); - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void voidFunc(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::voidFunc) == 1, - "Expected voidFunc(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::voidFunc, jsInvoker_, instance_); - } - bool getBool(jsi::Runtime &rt, bool arg) override { - static_assert( - bridging::getParameterCount(&T::getBool) == 2, - "Expected getBool(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getBool, jsInvoker_, instance_, std::move(arg)); - } - jsi::Value getEnum(jsi::Runtime &rt, jsi::Value arg) override { - static_assert( - bridging::getParameterCount(&T::getEnum) == 2, - "Expected getEnum(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getEnum, jsInvoker_, instance_, std::move(arg)); - } - double getNumber(jsi::Runtime &rt, double arg) override { - static_assert( - bridging::getParameterCount(&T::getNumber) == 2, - "Expected getNumber(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getNumber, jsInvoker_, instance_, std::move(arg)); - } - jsi::String getString(jsi::Runtime &rt, jsi::String arg) override { - static_assert( - bridging::getParameterCount(&T::getString) == 2, - "Expected getString(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getString, jsInvoker_, instance_, std::move(arg)); - } - jsi::Array getArray(jsi::Runtime &rt, jsi::Array arg) override { - static_assert( - bridging::getParameterCount(&T::getArray) == 2, - "Expected getArray(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getArray, jsInvoker_, instance_, std::move(arg)); - } - jsi::Object getObject(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getObject) == 2, - "Expected getObject(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getObject, jsInvoker_, instance_, std::move(arg)); - } - jsi::Object getUnsafeObject(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getUnsafeObject) == 2, - "Expected getUnsafeObject(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getUnsafeObject, jsInvoker_, instance_, std::move(arg)); - } - double getRootTag(jsi::Runtime &rt, double arg) override { - static_assert( - bridging::getParameterCount(&T::getRootTag) == 2, - "Expected getRootTag(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getRootTag, jsInvoker_, instance_, std::move(arg)); - } - jsi::Object getValue(jsi::Runtime &rt, double x, jsi::String y, jsi::Object z) override { - static_assert( - bridging::getParameterCount(&T::getValue) == 4, - "Expected getValue(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getValue, jsInvoker_, instance_, std::move(x), std::move(y), std::move(z)); - } - void getValueWithCallback(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getValueWithCallback) == 2, - "Expected getValueWithCallback(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getValueWithCallback, jsInvoker_, instance_, std::move(callback)); - } - jsi::Value getValueWithPromise(jsi::Runtime &rt, bool error) override { - static_assert( - bridging::getParameterCount(&T::getValueWithPromise) == 2, - "Expected getValueWithPromise(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getValueWithPromise, jsInvoker_, instance_, std::move(error)); - } - void voidFuncThrows(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::voidFuncThrows) == 1, - "Expected voidFuncThrows(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::voidFuncThrows, jsInvoker_, instance_); - } - jsi::Object getObjectThrows(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getObjectThrows) == 2, - "Expected getObjectThrows(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getObjectThrows, jsInvoker_, instance_, std::move(arg)); - } - jsi::Value promiseThrows(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::promiseThrows) == 1, - "Expected promiseThrows(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::promiseThrows, jsInvoker_, instance_); - } - void voidFuncAssert(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::voidFuncAssert) == 1, - "Expected voidFuncAssert(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::voidFuncAssert, jsInvoker_, instance_); - } - jsi::Object getObjectAssert(jsi::Runtime &rt, jsi::Object arg) override { - static_assert( - bridging::getParameterCount(&T::getObjectAssert) == 2, - "Expected getObjectAssert(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getObjectAssert, jsInvoker_, instance_, std::move(arg)); - } - jsi::Value promiseAssert(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::promiseAssert) == 1, - "Expected promiseAssert(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::promiseAssert, jsInvoker_, instance_); - } - jsi::Value getImageUrl(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getImageUrl) == 1, - "Expected getImageUrl(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getImageUrl, jsInvoker_, instance_); - } - - private: - friend class NativeSampleTurboModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSegmentFetcherCxxSpecJSI : public TurboModule { -protected: - NativeSegmentFetcherCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void fetchSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) = 0; - virtual void getSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) = 0; - -}; - -template -class JSI_EXPORT NativeSegmentFetcherCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SegmentFetcher"; - -protected: - NativeSegmentFetcherCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSegmentFetcherCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSegmentFetcherCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSegmentFetcherCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void fetchSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::fetchSegment) == 4, - "Expected fetchSegment(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::fetchSegment, jsInvoker_, instance_, std::move(segmentId), std::move(options), std::move(callback)); - } - void getSegment(jsi::Runtime &rt, double segmentId, jsi::Object options, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getSegment) == 4, - "Expected getSegment(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::getSegment, jsInvoker_, instance_, std::move(segmentId), std::move(options), std::move(callback)); - } - - private: - friend class NativeSegmentFetcherCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSettingsManagerCxxSpecJSI : public TurboModule { -protected: - NativeSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void setValues(jsi::Runtime &rt, jsi::Object values) = 0; - virtual void deleteValues(jsi::Runtime &rt, jsi::Array values) = 0; - -}; - -template -class JSI_EXPORT NativeSettingsManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SettingsManager"; - -protected: - NativeSettingsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSettingsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSettingsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSettingsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void setValues(jsi::Runtime &rt, jsi::Object values) override { - static_assert( - bridging::getParameterCount(&T::setValues) == 2, - "Expected setValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setValues, jsInvoker_, instance_, std::move(values)); - } - void deleteValues(jsi::Runtime &rt, jsi::Array values) override { - static_assert( - bridging::getParameterCount(&T::deleteValues) == 2, - "Expected deleteValues(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::deleteValues, jsInvoker_, instance_, std::move(values)); - } - - private: - friend class NativeSettingsManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeShareModuleCxxSpecJSI : public TurboModule { -protected: - NativeShareModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual jsi::Value share(jsi::Runtime &rt, jsi::Object content, std::optional dialogTitle) = 0; - -}; - -template -class JSI_EXPORT NativeShareModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ShareModule"; - -protected: - NativeShareModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeShareModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeShareModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeShareModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - jsi::Value share(jsi::Runtime &rt, jsi::Object content, std::optional dialogTitle) override { - static_assert( - bridging::getParameterCount(&T::share) == 3, - "Expected share(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::share, jsInvoker_, instance_, std::move(content), std::move(dialogTitle)); - } - - private: - friend class NativeShareModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeSoundManagerCxxSpecJSI : public TurboModule { -protected: - NativeSoundManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void playTouchSound(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSoundManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SoundManager"; - -protected: - NativeSoundManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSoundManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSoundManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSoundManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void playTouchSound(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::playTouchSound) == 1, - "Expected playTouchSound(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::playTouchSound, jsInvoker_, instance_); - } - - private: - friend class NativeSoundManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeSourceCodeSourceCodeConstants - -template -struct NativeSourceCodeSourceCodeConstants { - P0 scriptURL; - bool operator==(const NativeSourceCodeSourceCodeConstants &other) const { - return scriptURL == other.scriptURL; - } -}; - -template -struct NativeSourceCodeSourceCodeConstantsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "scriptURL"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String scriptURLToJs(jsi::Runtime &rt, decltype(types.scriptURL) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "scriptURL", bridging::toJs(rt, value.scriptURL, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeSourceCodeCxxSpecJSI : public TurboModule { -protected: - NativeSourceCodeCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSourceCodeCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "SourceCode"; - -protected: - NativeSourceCodeCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSourceCodeCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSourceCodeCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSourceCodeCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - - private: - friend class NativeSourceCodeCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeStatusBarManagerAndroidCxxSpecJSI : public TurboModule { -protected: - NativeStatusBarManagerAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void setColor(jsi::Runtime &rt, double color, bool animated) = 0; - virtual void setTranslucent(jsi::Runtime &rt, bool translucent) = 0; - virtual void setStyle(jsi::Runtime &rt, std::optional statusBarStyle) = 0; - virtual void setHidden(jsi::Runtime &rt, bool hidden) = 0; - -}; - -template -class JSI_EXPORT NativeStatusBarManagerAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "StatusBarManager"; - -protected: - NativeStatusBarManagerAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeStatusBarManagerAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeStatusBarManagerAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeStatusBarManagerAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void setColor(jsi::Runtime &rt, double color, bool animated) override { - static_assert( - bridging::getParameterCount(&T::setColor) == 3, - "Expected setColor(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setColor, jsInvoker_, instance_, std::move(color), std::move(animated)); - } - void setTranslucent(jsi::Runtime &rt, bool translucent) override { - static_assert( - bridging::getParameterCount(&T::setTranslucent) == 2, - "Expected setTranslucent(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setTranslucent, jsInvoker_, instance_, std::move(translucent)); - } - void setStyle(jsi::Runtime &rt, std::optional statusBarStyle) override { - static_assert( - bridging::getParameterCount(&T::setStyle) == 2, - "Expected setStyle(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setStyle, jsInvoker_, instance_, std::move(statusBarStyle)); - } - void setHidden(jsi::Runtime &rt, bool hidden) override { - static_assert( - bridging::getParameterCount(&T::setHidden) == 2, - "Expected setHidden(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHidden, jsInvoker_, instance_, std::move(hidden)); - } - - private: - friend class NativeStatusBarManagerAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeStatusBarManagerIOSCxxSpecJSI : public TurboModule { -protected: - NativeStatusBarManagerIOSCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void getHeight(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual void setNetworkActivityIndicatorVisible(jsi::Runtime &rt, bool visible) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventType) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - virtual void setStyle(jsi::Runtime &rt, std::optional statusBarStyle, bool animated) = 0; - virtual void setHidden(jsi::Runtime &rt, bool hidden, jsi::String withAnimation) = 0; - -}; - -template -class JSI_EXPORT NativeStatusBarManagerIOSCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "StatusBarManager"; - -protected: - NativeStatusBarManagerIOSCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeStatusBarManagerIOSCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeStatusBarManagerIOSCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeStatusBarManagerIOSCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void getHeight(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::getHeight) == 2, - "Expected getHeight(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getHeight, jsInvoker_, instance_, std::move(callback)); - } - void setNetworkActivityIndicatorVisible(jsi::Runtime &rt, bool visible) override { - static_assert( - bridging::getParameterCount(&T::setNetworkActivityIndicatorVisible) == 2, - "Expected setNetworkActivityIndicatorVisible(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setNetworkActivityIndicatorVisible, jsInvoker_, instance_, std::move(visible)); - } - void addListener(jsi::Runtime &rt, jsi::String eventType) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventType)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - void setStyle(jsi::Runtime &rt, std::optional statusBarStyle, bool animated) override { - static_assert( - bridging::getParameterCount(&T::setStyle) == 3, - "Expected setStyle(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setStyle, jsInvoker_, instance_, std::move(statusBarStyle), std::move(animated)); - } - void setHidden(jsi::Runtime &rt, bool hidden, jsi::String withAnimation) override { - static_assert( - bridging::getParameterCount(&T::setHidden) == 3, - "Expected setHidden(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setHidden, jsInvoker_, instance_, std::move(hidden), std::move(withAnimation)); - } - - private: - friend class NativeStatusBarManagerIOSCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeTimingCxxSpecJSI : public TurboModule { -protected: - NativeTimingCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void createTimer(jsi::Runtime &rt, double callbackID, double duration, double jsSchedulingTime, bool repeats) = 0; - virtual void deleteTimer(jsi::Runtime &rt, double timerID) = 0; - virtual void setSendIdleEvents(jsi::Runtime &rt, bool sendIdleEvents) = 0; - -}; - -template -class JSI_EXPORT NativeTimingCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Timing"; - -protected: - NativeTimingCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeTimingCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeTimingCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeTimingCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void createTimer(jsi::Runtime &rt, double callbackID, double duration, double jsSchedulingTime, bool repeats) override { - static_assert( - bridging::getParameterCount(&T::createTimer) == 5, - "Expected createTimer(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::createTimer, jsInvoker_, instance_, std::move(callbackID), std::move(duration), std::move(jsSchedulingTime), std::move(repeats)); - } - void deleteTimer(jsi::Runtime &rt, double timerID) override { - static_assert( - bridging::getParameterCount(&T::deleteTimer) == 2, - "Expected deleteTimer(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::deleteTimer, jsInvoker_, instance_, std::move(timerID)); - } - void setSendIdleEvents(jsi::Runtime &rt, bool sendIdleEvents) override { - static_assert( - bridging::getParameterCount(&T::setSendIdleEvents) == 2, - "Expected setSendIdleEvents(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setSendIdleEvents, jsInvoker_, instance_, std::move(sendIdleEvents)); - } - - private: - friend class NativeTimingCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeToastAndroidCxxSpecJSI : public TurboModule { -protected: - NativeToastAndroidCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void show(jsi::Runtime &rt, jsi::String message, double duration) = 0; - virtual void showWithGravity(jsi::Runtime &rt, jsi::String message, double duration, double gravity) = 0; - virtual void showWithGravityAndOffset(jsi::Runtime &rt, jsi::String message, double duration, double gravity, double xOffset, double yOffset) = 0; - -}; - -template -class JSI_EXPORT NativeToastAndroidCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ToastAndroid"; - -protected: - NativeToastAndroidCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeToastAndroidCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeToastAndroidCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeToastAndroidCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void show(jsi::Runtime &rt, jsi::String message, double duration) override { - static_assert( - bridging::getParameterCount(&T::show) == 3, - "Expected show(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_, std::move(message), std::move(duration)); - } - void showWithGravity(jsi::Runtime &rt, jsi::String message, double duration, double gravity) override { - static_assert( - bridging::getParameterCount(&T::showWithGravity) == 4, - "Expected showWithGravity(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::showWithGravity, jsInvoker_, instance_, std::move(message), std::move(duration), std::move(gravity)); - } - void showWithGravityAndOffset(jsi::Runtime &rt, jsi::String message, double duration, double gravity, double xOffset, double yOffset) override { - static_assert( - bridging::getParameterCount(&T::showWithGravityAndOffset) == 6, - "Expected showWithGravityAndOffset(...) to have 6 parameters"); - - return bridging::callFromJs( - rt, &T::showWithGravityAndOffset, jsInvoker_, instance_, std::move(message), std::move(duration), std::move(gravity), std::move(xOffset), std::move(yOffset)); - } - - private: - friend class NativeToastAndroidCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeUIManagerCxxSpecJSI : public TurboModule { -protected: - NativeUIManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void createView(jsi::Runtime &rt, double reactTag, jsi::String viewName, double rootTag, jsi::Object props) = 0; - virtual void updateView(jsi::Runtime &rt, double reactTag, jsi::String viewName, jsi::Object props) = 0; - virtual void findSubviewIn(jsi::Runtime &rt, double reactTag, jsi::Array point, jsi::Function callback) = 0; - virtual void dispatchViewManagerCommand(jsi::Runtime &rt, double reactTag, double commandID, std::optional commandArgs) = 0; - virtual void measure(jsi::Runtime &rt, double reactTag, jsi::Function callback) = 0; - virtual void measureInWindow(jsi::Runtime &rt, double reactTag, jsi::Function callback) = 0; - virtual void viewIsDescendantOf(jsi::Runtime &rt, double reactTag, double ancestorReactTag, jsi::Function callback) = 0; - virtual void measureLayout(jsi::Runtime &rt, double reactTag, double ancestorReactTag, jsi::Function errorCallback, jsi::Function callback) = 0; - virtual void measureLayoutRelativeToParent(jsi::Runtime &rt, double reactTag, jsi::Function errorCallback, jsi::Function callback) = 0; - virtual void setJSResponder(jsi::Runtime &rt, double reactTag, bool blockNativeResponder) = 0; - virtual void clearJSResponder(jsi::Runtime &rt) = 0; - virtual void configureNextLayoutAnimation(jsi::Runtime &rt, jsi::Object config, jsi::Function callback, jsi::Function errorCallback) = 0; - virtual void setChildren(jsi::Runtime &rt, double containerTag, jsi::Array reactTags) = 0; - virtual void manageChildren(jsi::Runtime &rt, double containerTag, jsi::Array moveFromIndices, jsi::Array moveToIndices, jsi::Array addChildReactTags, jsi::Array addAtIndices, jsi::Array removeAtIndices) = 0; - virtual std::optional getConstantsForViewManager(jsi::Runtime &rt, jsi::String viewManagerName) = 0; - virtual jsi::Array getDefaultEventTypes(jsi::Runtime &rt) = 0; - virtual void setLayoutAnimationEnabledExperimental(jsi::Runtime &rt, bool enabled) = 0; - virtual void sendAccessibilityEvent(jsi::Runtime &rt, double reactTag, double eventType) = 0; - virtual jsi::Object lazilyLoadView(jsi::Runtime &rt, jsi::String name) = 0; - virtual void focus(jsi::Runtime &rt, double reactTag) = 0; - virtual void blur(jsi::Runtime &rt, double reactTag) = 0; - -}; - -template -class JSI_EXPORT NativeUIManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "UIManager"; - -protected: - NativeUIManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeUIManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeUIManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeUIManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void createView(jsi::Runtime &rt, double reactTag, jsi::String viewName, double rootTag, jsi::Object props) override { - static_assert( - bridging::getParameterCount(&T::createView) == 5, - "Expected createView(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::createView, jsInvoker_, instance_, std::move(reactTag), std::move(viewName), std::move(rootTag), std::move(props)); - } - void updateView(jsi::Runtime &rt, double reactTag, jsi::String viewName, jsi::Object props) override { - static_assert( - bridging::getParameterCount(&T::updateView) == 4, - "Expected updateView(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::updateView, jsInvoker_, instance_, std::move(reactTag), std::move(viewName), std::move(props)); - } - void findSubviewIn(jsi::Runtime &rt, double reactTag, jsi::Array point, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::findSubviewIn) == 4, - "Expected findSubviewIn(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::findSubviewIn, jsInvoker_, instance_, std::move(reactTag), std::move(point), std::move(callback)); - } - void dispatchViewManagerCommand(jsi::Runtime &rt, double reactTag, double commandID, std::optional commandArgs) override { - static_assert( - bridging::getParameterCount(&T::dispatchViewManagerCommand) == 4, - "Expected dispatchViewManagerCommand(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::dispatchViewManagerCommand, jsInvoker_, instance_, std::move(reactTag), std::move(commandID), std::move(commandArgs)); - } - void measure(jsi::Runtime &rt, double reactTag, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measure) == 3, - "Expected measure(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::measure, jsInvoker_, instance_, std::move(reactTag), std::move(callback)); - } - void measureInWindow(jsi::Runtime &rt, double reactTag, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measureInWindow) == 3, - "Expected measureInWindow(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::measureInWindow, jsInvoker_, instance_, std::move(reactTag), std::move(callback)); - } - void viewIsDescendantOf(jsi::Runtime &rt, double reactTag, double ancestorReactTag, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::viewIsDescendantOf) == 4, - "Expected viewIsDescendantOf(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::viewIsDescendantOf, jsInvoker_, instance_, std::move(reactTag), std::move(ancestorReactTag), std::move(callback)); - } - void measureLayout(jsi::Runtime &rt, double reactTag, double ancestorReactTag, jsi::Function errorCallback, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measureLayout) == 5, - "Expected measureLayout(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::measureLayout, jsInvoker_, instance_, std::move(reactTag), std::move(ancestorReactTag), std::move(errorCallback), std::move(callback)); - } - void measureLayoutRelativeToParent(jsi::Runtime &rt, double reactTag, jsi::Function errorCallback, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measureLayoutRelativeToParent) == 4, - "Expected measureLayoutRelativeToParent(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::measureLayoutRelativeToParent, jsInvoker_, instance_, std::move(reactTag), std::move(errorCallback), std::move(callback)); - } - void setJSResponder(jsi::Runtime &rt, double reactTag, bool blockNativeResponder) override { - static_assert( - bridging::getParameterCount(&T::setJSResponder) == 3, - "Expected setJSResponder(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setJSResponder, jsInvoker_, instance_, std::move(reactTag), std::move(blockNativeResponder)); - } - void clearJSResponder(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::clearJSResponder) == 1, - "Expected clearJSResponder(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::clearJSResponder, jsInvoker_, instance_); - } - void configureNextLayoutAnimation(jsi::Runtime &rt, jsi::Object config, jsi::Function callback, jsi::Function errorCallback) override { - static_assert( - bridging::getParameterCount(&T::configureNextLayoutAnimation) == 4, - "Expected configureNextLayoutAnimation(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::configureNextLayoutAnimation, jsInvoker_, instance_, std::move(config), std::move(callback), std::move(errorCallback)); - } - void setChildren(jsi::Runtime &rt, double containerTag, jsi::Array reactTags) override { - static_assert( - bridging::getParameterCount(&T::setChildren) == 3, - "Expected setChildren(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setChildren, jsInvoker_, instance_, std::move(containerTag), std::move(reactTags)); - } - void manageChildren(jsi::Runtime &rt, double containerTag, jsi::Array moveFromIndices, jsi::Array moveToIndices, jsi::Array addChildReactTags, jsi::Array addAtIndices, jsi::Array removeAtIndices) override { - static_assert( - bridging::getParameterCount(&T::manageChildren) == 7, - "Expected manageChildren(...) to have 7 parameters"); - - return bridging::callFromJs( - rt, &T::manageChildren, jsInvoker_, instance_, std::move(containerTag), std::move(moveFromIndices), std::move(moveToIndices), std::move(addChildReactTags), std::move(addAtIndices), std::move(removeAtIndices)); - } - std::optional getConstantsForViewManager(jsi::Runtime &rt, jsi::String viewManagerName) override { - static_assert( - bridging::getParameterCount(&T::getConstantsForViewManager) == 2, - "Expected getConstantsForViewManager(...) to have 2 parameters"); - - return bridging::callFromJs>( - rt, &T::getConstantsForViewManager, jsInvoker_, instance_, std::move(viewManagerName)); - } - jsi::Array getDefaultEventTypes(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getDefaultEventTypes) == 1, - "Expected getDefaultEventTypes(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getDefaultEventTypes, jsInvoker_, instance_); - } - void setLayoutAnimationEnabledExperimental(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setLayoutAnimationEnabledExperimental) == 2, - "Expected setLayoutAnimationEnabledExperimental(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setLayoutAnimationEnabledExperimental, jsInvoker_, instance_, std::move(enabled)); - } - void sendAccessibilityEvent(jsi::Runtime &rt, double reactTag, double eventType) override { - static_assert( - bridging::getParameterCount(&T::sendAccessibilityEvent) == 3, - "Expected sendAccessibilityEvent(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendAccessibilityEvent, jsInvoker_, instance_, std::move(reactTag), std::move(eventType)); - } - jsi::Object lazilyLoadView(jsi::Runtime &rt, jsi::String name) override { - static_assert( - bridging::getParameterCount(&T::lazilyLoadView) == 2, - "Expected lazilyLoadView(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::lazilyLoadView, jsInvoker_, instance_, std::move(name)); - } - void focus(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::focus) == 2, - "Expected focus(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::focus, jsInvoker_, instance_, std::move(reactTag)); - } - void blur(jsi::Runtime &rt, double reactTag) override { - static_assert( - bridging::getParameterCount(&T::blur) == 2, - "Expected blur(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::blur, jsInvoker_, instance_, std::move(reactTag)); - } - - private: - friend class NativeUIManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeVibrationCxxSpecJSI : public TurboModule { -protected: - NativeVibrationCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Object getConstants(jsi::Runtime &rt) = 0; - virtual void vibrate(jsi::Runtime &rt, double pattern) = 0; - virtual void vibrateByPattern(jsi::Runtime &rt, jsi::Array pattern, double repeat) = 0; - virtual void cancel(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeVibrationCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "Vibration"; - -protected: - NativeVibrationCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeVibrationCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeVibrationCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeVibrationCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Object getConstants(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getConstants) == 1, - "Expected getConstants(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getConstants, jsInvoker_, instance_); - } - void vibrate(jsi::Runtime &rt, double pattern) override { - static_assert( - bridging::getParameterCount(&T::vibrate) == 2, - "Expected vibrate(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::vibrate, jsInvoker_, instance_, std::move(pattern)); - } - void vibrateByPattern(jsi::Runtime &rt, jsi::Array pattern, double repeat) override { - static_assert( - bridging::getParameterCount(&T::vibrateByPattern) == 3, - "Expected vibrateByPattern(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::vibrateByPattern, jsInvoker_, instance_, std::move(pattern), std::move(repeat)); - } - void cancel(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::cancel) == 1, - "Expected cancel(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::cancel, jsInvoker_, instance_); - } - - private: - friend class NativeVibrationCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeWebSocketModuleCxxSpecJSI : public TurboModule { -protected: - NativeWebSocketModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void connect(jsi::Runtime &rt, jsi::String url, std::optional protocols, jsi::Object options, double socketID) = 0; - virtual void send(jsi::Runtime &rt, jsi::String message, double forSocketID) = 0; - virtual void sendBinary(jsi::Runtime &rt, jsi::String base64String, double forSocketID) = 0; - virtual void ping(jsi::Runtime &rt, double socketID) = 0; - virtual void close(jsi::Runtime &rt, double code, jsi::String reason, double socketID) = 0; - virtual void addListener(jsi::Runtime &rt, jsi::String eventName) = 0; - virtual void removeListeners(jsi::Runtime &rt, double count) = 0; - -}; - -template -class JSI_EXPORT NativeWebSocketModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "WebSocketModule"; - -protected: - NativeWebSocketModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeWebSocketModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeWebSocketModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeWebSocketModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void connect(jsi::Runtime &rt, jsi::String url, std::optional protocols, jsi::Object options, double socketID) override { - static_assert( - bridging::getParameterCount(&T::connect) == 5, - "Expected connect(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(url), std::move(protocols), std::move(options), std::move(socketID)); - } - void send(jsi::Runtime &rt, jsi::String message, double forSocketID) override { - static_assert( - bridging::getParameterCount(&T::send) == 3, - "Expected send(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::send, jsInvoker_, instance_, std::move(message), std::move(forSocketID)); - } - void sendBinary(jsi::Runtime &rt, jsi::String base64String, double forSocketID) override { - static_assert( - bridging::getParameterCount(&T::sendBinary) == 3, - "Expected sendBinary(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::sendBinary, jsInvoker_, instance_, std::move(base64String), std::move(forSocketID)); - } - void ping(jsi::Runtime &rt, double socketID) override { - static_assert( - bridging::getParameterCount(&T::ping) == 2, - "Expected ping(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::ping, jsInvoker_, instance_, std::move(socketID)); - } - void close(jsi::Runtime &rt, double code, jsi::String reason, double socketID) override { - static_assert( - bridging::getParameterCount(&T::close) == 4, - "Expected close(...) to have 4 parameters"); - - return bridging::callFromJs( - rt, &T::close, jsInvoker_, instance_, std::move(code), std::move(reason), std::move(socketID)); - } - void addListener(jsi::Runtime &rt, jsi::String eventName) override { - static_assert( - bridging::getParameterCount(&T::addListener) == 2, - "Expected addListener(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::addListener, jsInvoker_, instance_, std::move(eventName)); - } - void removeListeners(jsi::Runtime &rt, double count) override { - static_assert( - bridging::getParameterCount(&T::removeListeners) == 2, - "Expected removeListeners(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::removeListeners, jsInvoker_, instance_, std::move(count)); - } - - private: - friend class NativeWebSocketModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDevMenuCxxSpecJSI : public TurboModule { -protected: - NativeDevMenuCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void show(jsi::Runtime &rt) = 0; - virtual void reload(jsi::Runtime &rt) = 0; - virtual void setProfilingEnabled(jsi::Runtime &rt, bool enabled) = 0; - virtual void setHotLoadingEnabled(jsi::Runtime &rt, bool enabled) = 0; - -}; - -template -class JSI_EXPORT NativeDevMenuCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "DevMenu"; - -protected: - NativeDevMenuCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDevMenuCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDevMenuCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDevMenuCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void show(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::show) == 1, - "Expected show(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::show, jsInvoker_, instance_); - } - void reload(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::reload) == 1, - "Expected reload(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::reload, jsInvoker_, instance_); - } - void setProfilingEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setProfilingEnabled) == 2, - "Expected setProfilingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setProfilingEnabled, jsInvoker_, instance_, std::move(enabled)); - } - void setHotLoadingEnabled(jsi::Runtime &rt, bool enabled) override { - static_assert( - bridging::getParameterCount(&T::setHotLoadingEnabled) == 2, - "Expected setHotLoadingEnabled(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setHotLoadingEnabled, jsInvoker_, instance_, std::move(enabled)); - } - - private: - friend class NativeDevMenuCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfig - -template -struct NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfig { - P0 shouldReloadAndProfile; - P1 recordChangeDescriptions; - bool operator==(const NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfig &other) const { - return shouldReloadAndProfile == other.shouldReloadAndProfile && recordChangeDescriptions == other.recordChangeDescriptions; - } -}; - -template -struct NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfigBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "shouldReloadAndProfile"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "recordChangeDescriptions"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool shouldReloadAndProfileToJs(jsi::Runtime &rt, decltype(types.shouldReloadAndProfile) value) { - return bridging::toJs(rt, value); - } - - static bool recordChangeDescriptionsToJs(jsi::Runtime &rt, decltype(types.recordChangeDescriptions) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.shouldReloadAndProfile) { - result.setProperty(rt, "shouldReloadAndProfile", bridging::toJs(rt, value.shouldReloadAndProfile.value(), jsInvoker)); - } - if (value.recordChangeDescriptions) { - result.setProperty(rt, "recordChangeDescriptions", bridging::toJs(rt, value.recordChangeDescriptions.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativeReactDevToolsRuntimeSettingsModuleReloadAndProfileConfig - -template -struct NativeReactDevToolsRuntimeSettingsModuleReloadAndProfileConfig { - P0 shouldReloadAndProfile; - P1 recordChangeDescriptions; - bool operator==(const NativeReactDevToolsRuntimeSettingsModuleReloadAndProfileConfig &other) const { - return shouldReloadAndProfile == other.shouldReloadAndProfile && recordChangeDescriptions == other.recordChangeDescriptions; - } -}; - -template -struct NativeReactDevToolsRuntimeSettingsModuleReloadAndProfileConfigBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "shouldReloadAndProfile"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "recordChangeDescriptions"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool shouldReloadAndProfileToJs(jsi::Runtime &rt, decltype(types.shouldReloadAndProfile) value) { - return bridging::toJs(rt, value); - } - - static bool recordChangeDescriptionsToJs(jsi::Runtime &rt, decltype(types.recordChangeDescriptions) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "shouldReloadAndProfile", bridging::toJs(rt, value.shouldReloadAndProfile, jsInvoker)); - result.setProperty(rt, "recordChangeDescriptions", bridging::toJs(rt, value.recordChangeDescriptions, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI : public TurboModule { -protected: - NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setReloadAndProfileConfig(jsi::Runtime &rt, jsi::Object config) = 0; - virtual jsi::Object getReloadAndProfileConfig(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeReactDevToolsRuntimeSettingsModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ReactDevToolsRuntimeSettingsModule"; - -protected: - NativeReactDevToolsRuntimeSettingsModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeReactDevToolsRuntimeSettingsModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeReactDevToolsRuntimeSettingsModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void setReloadAndProfileConfig(jsi::Runtime &rt, jsi::Object config) override { - static_assert( - bridging::getParameterCount(&T::setReloadAndProfileConfig) == 2, - "Expected setReloadAndProfileConfig(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setReloadAndProfileConfig, jsInvoker_, instance_, std::move(config)); - } - jsi::Object getReloadAndProfileConfig(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getReloadAndProfileConfig) == 1, - "Expected getReloadAndProfileConfig(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getReloadAndProfileConfig, jsInvoker_, instance_); - } - - private: - friend class NativeReactDevToolsRuntimeSettingsModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeReactDevToolsSettingsManagerCxxSpecJSI : public TurboModule { -protected: - NativeReactDevToolsSettingsManagerCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void setGlobalHookSettings(jsi::Runtime &rt, jsi::String settings) = 0; - virtual std::optional getGlobalHookSettings(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeReactDevToolsSettingsManagerCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "ReactDevToolsSettingsManager"; - -protected: - NativeReactDevToolsSettingsManagerCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeReactDevToolsSettingsManagerCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeReactDevToolsSettingsManagerCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeReactDevToolsSettingsManagerCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void setGlobalHookSettings(jsi::Runtime &rt, jsi::String settings) override { - static_assert( - bridging::getParameterCount(&T::setGlobalHookSettings) == 2, - "Expected setGlobalHookSettings(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setGlobalHookSettings, jsInvoker_, instance_, std::move(settings)); - } - std::optional getGlobalHookSettings(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getGlobalHookSettings) == 1, - "Expected getGlobalHookSettings(...) to have 1 parameters"); - - return bridging::callFromJs>( - rt, &T::getGlobalHookSettings, jsInvoker_, instance_); - } - - private: - friend class NativeReactDevToolsSettingsManagerCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeIdleCallbacksIdleDeadline - -template -struct NativeIdleCallbacksIdleDeadline { - P0 didTimeout; - P1 timeRemaining; - bool operator==(const NativeIdleCallbacksIdleDeadline &other) const { - return didTimeout == other.didTimeout && timeRemaining == other.timeRemaining; - } -}; - -template -struct NativeIdleCallbacksIdleDeadlineBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "didTimeout"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "timeRemaining"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static bool didTimeoutToJs(jsi::Runtime &rt, decltype(types.didTimeout) value) { - return bridging::toJs(rt, value); - } - - static jsi::Function timeRemainingToJs(jsi::Runtime &rt, decltype(types.timeRemaining) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "didTimeout", bridging::toJs(rt, value.didTimeout, jsInvoker)); - result.setProperty(rt, "timeRemaining", bridging::toJs(rt, value.timeRemaining, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeIdleCallbacksRequestIdleCallbackOptions - -template -struct NativeIdleCallbacksRequestIdleCallbackOptions { - P0 timeout; - bool operator==(const NativeIdleCallbacksRequestIdleCallbackOptions &other) const { - return timeout == other.timeout; - } -}; - -template -struct NativeIdleCallbacksRequestIdleCallbackOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "timeout"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double timeoutToJs(jsi::Runtime &rt, decltype(types.timeout) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.timeout) { - result.setProperty(rt, "timeout", bridging::toJs(rt, value.timeout.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeIdleCallbacksCxxSpecJSI : public TurboModule { -protected: - NativeIdleCallbacksCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual jsi::Value requestIdleCallback(jsi::Runtime &rt, jsi::Function callback, std::optional options) = 0; - virtual void cancelIdleCallback(jsi::Runtime &rt, jsi::Value handle) = 0; - -}; - -template -class JSI_EXPORT NativeIdleCallbacksCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeIdleCallbacksCxx"; - -protected: - NativeIdleCallbacksCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeIdleCallbacksCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeIdleCallbacksCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeIdleCallbacksCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - jsi::Value requestIdleCallback(jsi::Runtime &rt, jsi::Function callback, std::optional options) override { - static_assert( - bridging::getParameterCount(&T::requestIdleCallback) == 3, - "Expected requestIdleCallback(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::requestIdleCallback, jsInvoker_, instance_, std::move(callback), std::move(options)); - } - void cancelIdleCallback(jsi::Runtime &rt, jsi::Value handle) override { - static_assert( - bridging::getParameterCount(&T::cancelIdleCallback) == 2, - "Expected cancelIdleCallback(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::cancelIdleCallback, jsInvoker_, instance_, std::move(handle)); - } - - private: - friend class NativeIdleCallbacksCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeIntersectionObserverNativeIntersectionObserverEntry - -template -struct NativeIntersectionObserverNativeIntersectionObserverEntry { - P0 intersectionObserverId; - P1 targetInstanceHandle; - P2 targetRect; - P3 rootRect; - P4 intersectionRect; - P5 isIntersectingAboveThresholds; - P6 time; - bool operator==(const NativeIntersectionObserverNativeIntersectionObserverEntry &other) const { - return intersectionObserverId == other.intersectionObserverId && targetInstanceHandle == other.targetInstanceHandle && targetRect == other.targetRect && rootRect == other.rootRect && intersectionRect == other.intersectionRect && isIntersectingAboveThresholds == other.isIntersectingAboveThresholds && time == other.time; - } -}; - -template -struct NativeIntersectionObserverNativeIntersectionObserverEntryBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "intersectionObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetInstanceHandle"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "intersectionRect"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "isIntersectingAboveThresholds"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "time"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double intersectionObserverIdToJs(jsi::Runtime &rt, decltype(types.intersectionObserverId) value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetInstanceHandleToJs(jsi::Runtime &rt, decltype(types.targetInstanceHandle) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array targetRectToJs(jsi::Runtime &rt, decltype(types.targetRect) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array rootRectToJs(jsi::Runtime &rt, decltype(types.rootRect) value) { - return bridging::toJs(rt, value); - } - - static std::optional intersectionRectToJs(jsi::Runtime &rt, decltype(types.intersectionRect) value) { - return bridging::toJs(rt, value); - } - - static bool isIntersectingAboveThresholdsToJs(jsi::Runtime &rt, decltype(types.isIntersectingAboveThresholds) value) { - return bridging::toJs(rt, value); - } - - static double timeToJs(jsi::Runtime &rt, decltype(types.time) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "intersectionObserverId", bridging::toJs(rt, value.intersectionObserverId, jsInvoker)); - result.setProperty(rt, "targetInstanceHandle", bridging::toJs(rt, value.targetInstanceHandle, jsInvoker)); - result.setProperty(rt, "targetRect", bridging::toJs(rt, value.targetRect, jsInvoker)); - result.setProperty(rt, "rootRect", bridging::toJs(rt, value.rootRect, jsInvoker)); - result.setProperty(rt, "intersectionRect", bridging::toJs(rt, value.intersectionRect, jsInvoker)); - result.setProperty(rt, "isIntersectingAboveThresholds", bridging::toJs(rt, value.isIntersectingAboveThresholds, jsInvoker)); - result.setProperty(rt, "time", bridging::toJs(rt, value.time, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeIntersectionObserverNativeIntersectionObserverObserveOptions - -template -struct NativeIntersectionObserverNativeIntersectionObserverObserveOptions { - P0 intersectionObserverId; - P1 rootShadowNode; - P2 targetShadowNode; - P3 thresholds; - P4 rootThresholds; - bool operator==(const NativeIntersectionObserverNativeIntersectionObserverObserveOptions &other) const { - return intersectionObserverId == other.intersectionObserverId && rootShadowNode == other.rootShadowNode && targetShadowNode == other.targetShadowNode && thresholds == other.thresholds && rootThresholds == other.rootThresholds; - } -}; - -template -struct NativeIntersectionObserverNativeIntersectionObserverObserveOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "intersectionObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootShadowNode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetShadowNode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "thresholds"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "rootThresholds"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double intersectionObserverIdToJs(jsi::Runtime &rt, decltype(types.intersectionObserverId) value) { - return bridging::toJs(rt, value); - } - - static std::optional rootShadowNodeToJs(jsi::Runtime &rt, decltype(types.rootShadowNode) value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetShadowNodeToJs(jsi::Runtime &rt, decltype(types.targetShadowNode) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array thresholdsToJs(jsi::Runtime &rt, decltype(types.thresholds) value) { - return bridging::toJs(rt, value); - } - - static std::optional rootThresholdsToJs(jsi::Runtime &rt, decltype(types.rootThresholds) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "intersectionObserverId", bridging::toJs(rt, value.intersectionObserverId, jsInvoker)); - if (value.rootShadowNode) { - result.setProperty(rt, "rootShadowNode", bridging::toJs(rt, value.rootShadowNode.value(), jsInvoker)); - } - result.setProperty(rt, "targetShadowNode", bridging::toJs(rt, value.targetShadowNode, jsInvoker)); - result.setProperty(rt, "thresholds", bridging::toJs(rt, value.thresholds, jsInvoker)); - if (value.rootThresholds) { - result.setProperty(rt, "rootThresholds", bridging::toJs(rt, value.rootThresholds.value(), jsInvoker)); - } - return result; - } -}; - -class JSI_EXPORT NativeIntersectionObserverCxxSpecJSI : public TurboModule { -protected: - NativeIntersectionObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void observe(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserve(jsi::Runtime &rt, double intersectionObserverId, jsi::Value targetShadowNode) = 0; - virtual jsi::Value observeV2(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserveV2(jsi::Runtime &rt, double intersectionObserverId, jsi::Value token) = 0; - virtual void connect(jsi::Runtime &rt, jsi::Function notifyIntersectionObserversCallback) = 0; - virtual void disconnect(jsi::Runtime &rt) = 0; - virtual jsi::Array takeRecords(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeIntersectionObserverCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeIntersectionObserverCxx"; - -protected: - NativeIntersectionObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeIntersectionObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeIntersectionObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeIntersectionObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void observe(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observe) == 2, - "Expected observe(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::observe, jsInvoker_, instance_, std::move(options)); - } - void unobserve(jsi::Runtime &rt, double intersectionObserverId, jsi::Value targetShadowNode) override { - static_assert( - bridging::getParameterCount(&T::unobserve) == 3, - "Expected unobserve(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::unobserve, jsInvoker_, instance_, std::move(intersectionObserverId), std::move(targetShadowNode)); - } - jsi::Value observeV2(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observeV2) == 2, - "Expected observeV2(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::observeV2, jsInvoker_, instance_, std::move(options)); - } - void unobserveV2(jsi::Runtime &rt, double intersectionObserverId, jsi::Value token) override { - static_assert( - bridging::getParameterCount(&T::unobserveV2) == 3, - "Expected unobserveV2(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::unobserveV2, jsInvoker_, instance_, std::move(intersectionObserverId), std::move(token)); - } - void connect(jsi::Runtime &rt, jsi::Function notifyIntersectionObserversCallback) override { - static_assert( - bridging::getParameterCount(&T::connect) == 2, - "Expected connect(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(notifyIntersectionObserversCallback)); - } - void disconnect(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disconnect) == 1, - "Expected disconnect(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disconnect, jsInvoker_, instance_); - } - jsi::Array takeRecords(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::takeRecords) == 1, - "Expected takeRecords(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::takeRecords, jsInvoker_, instance_); - } - - private: - friend class NativeIntersectionObserverCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeMicrotasksCxxSpecJSI : public TurboModule { -protected: - NativeMicrotasksCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void queueMicrotask(jsi::Runtime &rt, jsi::Function callback) = 0; - -}; - -template -class JSI_EXPORT NativeMicrotasksCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeMicrotasksCxx"; - -protected: - NativeMicrotasksCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeMicrotasksCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeMicrotasksCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeMicrotasksCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void queueMicrotask(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::queueMicrotask) == 2, - "Expected queueMicrotask(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::queueMicrotask, jsInvoker_, instance_, std::move(callback)); - } - - private: - friend class NativeMicrotasksCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - -#pragma mark - NativeMutationObserverNativeMutationObserverObserveOptions - -template -struct NativeMutationObserverNativeMutationObserverObserveOptions { - P0 mutationObserverId; - P1 targetShadowNode; - P2 subtree; - bool operator==(const NativeMutationObserverNativeMutationObserverObserveOptions &other) const { - return mutationObserverId == other.mutationObserverId && targetShadowNode == other.targetShadowNode && subtree == other.subtree; - } -}; - -template -struct NativeMutationObserverNativeMutationObserverObserveOptionsBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "mutationObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "targetShadowNode"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "subtree"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double mutationObserverIdToJs(jsi::Runtime &rt, decltype(types.mutationObserverId) value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetShadowNodeToJs(jsi::Runtime &rt, decltype(types.targetShadowNode) value) { - return bridging::toJs(rt, value); - } - - static bool subtreeToJs(jsi::Runtime &rt, decltype(types.subtree) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "mutationObserverId", bridging::toJs(rt, value.mutationObserverId, jsInvoker)); - result.setProperty(rt, "targetShadowNode", bridging::toJs(rt, value.targetShadowNode, jsInvoker)); - result.setProperty(rt, "subtree", bridging::toJs(rt, value.subtree, jsInvoker)); - return result; - } -}; - - - -#pragma mark - NativeMutationObserverNativeMutationRecord - -template -struct NativeMutationObserverNativeMutationRecord { - P0 mutationObserverId; - P1 target; - P2 addedNodes; - P3 removedNodes; - bool operator==(const NativeMutationObserverNativeMutationRecord &other) const { - return mutationObserverId == other.mutationObserverId && target == other.target && addedNodes == other.addedNodes && removedNodes == other.removedNodes; - } -}; - -template -struct NativeMutationObserverNativeMutationRecordBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "mutationObserverId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "target"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "addedNodes"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "removedNodes"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static double mutationObserverIdToJs(jsi::Runtime &rt, decltype(types.mutationObserverId) value) { - return bridging::toJs(rt, value); - } - - static jsi::Value targetToJs(jsi::Runtime &rt, decltype(types.target) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array addedNodesToJs(jsi::Runtime &rt, decltype(types.addedNodes) value) { - return bridging::toJs(rt, value); - } - - static jsi::Array removedNodesToJs(jsi::Runtime &rt, decltype(types.removedNodes) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "mutationObserverId", bridging::toJs(rt, value.mutationObserverId, jsInvoker)); - result.setProperty(rt, "target", bridging::toJs(rt, value.target, jsInvoker)); - result.setProperty(rt, "addedNodes", bridging::toJs(rt, value.addedNodes, jsInvoker)); - result.setProperty(rt, "removedNodes", bridging::toJs(rt, value.removedNodes, jsInvoker)); - return result; - } -}; - -class JSI_EXPORT NativeMutationObserverCxxSpecJSI : public TurboModule { -protected: - NativeMutationObserverCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual void observe(jsi::Runtime &rt, jsi::Object options) = 0; - virtual void unobserveAll(jsi::Runtime &rt, double mutationObserverId) = 0; - virtual void connect(jsi::Runtime &rt, jsi::Function notifyMutationObservers, jsi::Function getPublicInstanceFromInstanceHandle) = 0; - virtual void disconnect(jsi::Runtime &rt) = 0; - virtual jsi::Array takeRecords(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeMutationObserverCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeMutationObserverCxx"; - -protected: - NativeMutationObserverCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeMutationObserverCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeMutationObserverCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeMutationObserverCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - void observe(jsi::Runtime &rt, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observe) == 2, - "Expected observe(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::observe, jsInvoker_, instance_, std::move(options)); - } - void unobserveAll(jsi::Runtime &rt, double mutationObserverId) override { - static_assert( - bridging::getParameterCount(&T::unobserveAll) == 2, - "Expected unobserveAll(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::unobserveAll, jsInvoker_, instance_, std::move(mutationObserverId)); - } - void connect(jsi::Runtime &rt, jsi::Function notifyMutationObservers, jsi::Function getPublicInstanceFromInstanceHandle) override { - static_assert( - bridging::getParameterCount(&T::connect) == 3, - "Expected connect(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::connect, jsInvoker_, instance_, std::move(notifyMutationObservers), std::move(getPublicInstanceFromInstanceHandle)); - } - void disconnect(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::disconnect) == 1, - "Expected disconnect(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::disconnect, jsInvoker_, instance_); - } - jsi::Array takeRecords(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::takeRecords) == 1, - "Expected takeRecords(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::takeRecords, jsInvoker_, instance_); - } - - private: - friend class NativeMutationObserverCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - - -#pragma mark - NativePerformancePerformanceObserverInit - -template -struct NativePerformancePerformanceObserverInit { - P0 entryTypes; - P1 type; - P2 buffered; - P3 durationThreshold; - bool operator==(const NativePerformancePerformanceObserverInit &other) const { - return entryTypes == other.entryTypes && type == other.type && buffered == other.buffered && durationThreshold == other.durationThreshold; - } -}; - -template -struct NativePerformancePerformanceObserverInitBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "entryTypes"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "type"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "buffered"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "durationThreshold"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::Array entryTypesToJs(jsi::Runtime &rt, decltype(types.entryTypes) value) { - return bridging::toJs(rt, value); - } - - static double typeToJs(jsi::Runtime &rt, decltype(types.type) value) { - return bridging::toJs(rt, value); - } - - static bool bufferedToJs(jsi::Runtime &rt, decltype(types.buffered) value) { - return bridging::toJs(rt, value); - } - - static double durationThresholdToJs(jsi::Runtime &rt, decltype(types.durationThreshold) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - if (value.entryTypes) { - result.setProperty(rt, "entryTypes", bridging::toJs(rt, value.entryTypes.value(), jsInvoker)); - } - if (value.type) { - result.setProperty(rt, "type", bridging::toJs(rt, value.type.value(), jsInvoker)); - } - if (value.buffered) { - result.setProperty(rt, "buffered", bridging::toJs(rt, value.buffered.value(), jsInvoker)); - } - if (value.durationThreshold) { - result.setProperty(rt, "durationThreshold", bridging::toJs(rt, value.durationThreshold.value(), jsInvoker)); - } - return result; - } -}; - - - -#pragma mark - NativePerformanceRawPerformanceEntry - -template -struct NativePerformanceRawPerformanceEntry { - P0 name; - P1 entryType; - P2 startTime; - P3 duration; - P4 processingStart; - P5 processingEnd; - P6 interactionId; - P7 fetchStart; - P8 requestStart; - P9 connectStart; - P10 connectEnd; - P11 responseStart; - P12 responseEnd; - P13 responseStatus; - bool operator==(const NativePerformanceRawPerformanceEntry &other) const { - return name == other.name && entryType == other.entryType && startTime == other.startTime && duration == other.duration && processingStart == other.processingStart && processingEnd == other.processingEnd && interactionId == other.interactionId && fetchStart == other.fetchStart && requestStart == other.requestStart && connectStart == other.connectStart && connectEnd == other.connectEnd && responseStart == other.responseStart && responseEnd == other.responseEnd && responseStatus == other.responseStatus; - } -}; - -template -struct NativePerformanceRawPerformanceEntryBridging { - static T types; - - static T fromJs( - jsi::Runtime &rt, - const jsi::Object &value, - const std::shared_ptr &jsInvoker) { - T result{ - bridging::fromJs(rt, value.getProperty(rt, "name"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "entryType"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "startTime"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "duration"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "processingStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "processingEnd"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "interactionId"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "fetchStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "requestStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "connectStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "connectEnd"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "responseStart"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "responseEnd"), jsInvoker), - bridging::fromJs(rt, value.getProperty(rt, "responseStatus"), jsInvoker)}; - return result; - } - -#ifdef DEBUG - static jsi::String nameToJs(jsi::Runtime &rt, decltype(types.name) value) { - return bridging::toJs(rt, value); - } - - static double entryTypeToJs(jsi::Runtime &rt, decltype(types.entryType) value) { - return bridging::toJs(rt, value); - } - - static double startTimeToJs(jsi::Runtime &rt, decltype(types.startTime) value) { - return bridging::toJs(rt, value); - } - - static double durationToJs(jsi::Runtime &rt, decltype(types.duration) value) { - return bridging::toJs(rt, value); - } - - static double processingStartToJs(jsi::Runtime &rt, decltype(types.processingStart) value) { - return bridging::toJs(rt, value); - } - - static double processingEndToJs(jsi::Runtime &rt, decltype(types.processingEnd) value) { - return bridging::toJs(rt, value); - } - - static double interactionIdToJs(jsi::Runtime &rt, decltype(types.interactionId) value) { - return bridging::toJs(rt, value); - } - - static double fetchStartToJs(jsi::Runtime &rt, decltype(types.fetchStart) value) { - return bridging::toJs(rt, value); - } - - static double requestStartToJs(jsi::Runtime &rt, decltype(types.requestStart) value) { - return bridging::toJs(rt, value); - } - - static double connectStartToJs(jsi::Runtime &rt, decltype(types.connectStart) value) { - return bridging::toJs(rt, value); - } - - static double connectEndToJs(jsi::Runtime &rt, decltype(types.connectEnd) value) { - return bridging::toJs(rt, value); - } - - static double responseStartToJs(jsi::Runtime &rt, decltype(types.responseStart) value) { - return bridging::toJs(rt, value); - } - - static double responseEndToJs(jsi::Runtime &rt, decltype(types.responseEnd) value) { - return bridging::toJs(rt, value); - } - - static double responseStatusToJs(jsi::Runtime &rt, decltype(types.responseStatus) value) { - return bridging::toJs(rt, value); - } -#endif - - static jsi::Object toJs( - jsi::Runtime &rt, - const T &value, - const std::shared_ptr &jsInvoker) { - auto result = facebook::jsi::Object(rt); - result.setProperty(rt, "name", bridging::toJs(rt, value.name, jsInvoker)); - result.setProperty(rt, "entryType", bridging::toJs(rt, value.entryType, jsInvoker)); - result.setProperty(rt, "startTime", bridging::toJs(rt, value.startTime, jsInvoker)); - result.setProperty(rt, "duration", bridging::toJs(rt, value.duration, jsInvoker)); - if (value.processingStart) { - result.setProperty(rt, "processingStart", bridging::toJs(rt, value.processingStart.value(), jsInvoker)); - } - if (value.processingEnd) { - result.setProperty(rt, "processingEnd", bridging::toJs(rt, value.processingEnd.value(), jsInvoker)); - } - if (value.interactionId) { - result.setProperty(rt, "interactionId", bridging::toJs(rt, value.interactionId.value(), jsInvoker)); - } - if (value.fetchStart) { - result.setProperty(rt, "fetchStart", bridging::toJs(rt, value.fetchStart.value(), jsInvoker)); - } - if (value.requestStart) { - result.setProperty(rt, "requestStart", bridging::toJs(rt, value.requestStart.value(), jsInvoker)); - } - if (value.connectStart) { - result.setProperty(rt, "connectStart", bridging::toJs(rt, value.connectStart.value(), jsInvoker)); - } - if (value.connectEnd) { - result.setProperty(rt, "connectEnd", bridging::toJs(rt, value.connectEnd.value(), jsInvoker)); - } - if (value.responseStart) { - result.setProperty(rt, "responseStart", bridging::toJs(rt, value.responseStart.value(), jsInvoker)); - } - if (value.responseEnd) { - result.setProperty(rt, "responseEnd", bridging::toJs(rt, value.responseEnd.value(), jsInvoker)); - } - if (value.responseStatus) { - result.setProperty(rt, "responseStatus", bridging::toJs(rt, value.responseStatus.value(), jsInvoker)); - } - return result; - } -}; - - -class JSI_EXPORT NativePerformanceCxxSpecJSI : public TurboModule { -protected: - NativePerformanceCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual double now(jsi::Runtime &rt) = 0; - virtual double markWithResult(jsi::Runtime &rt, jsi::String name, std::optional startTime) = 0; - virtual jsi::Array measure(jsi::Runtime &rt, jsi::String name, std::optional startTime, std::optional endTime, std::optional duration, std::optional startMark, std::optional endMark) = 0; - virtual jsi::Array measureWithResult(jsi::Runtime &rt, jsi::String name, double startTime, double endTime, std::optional duration, std::optional startMark, std::optional endMark) = 0; - virtual void clearMarks(jsi::Runtime &rt, std::optional entryName) = 0; - virtual void clearMeasures(jsi::Runtime &rt, std::optional entryName) = 0; - virtual jsi::Array getEntries(jsi::Runtime &rt) = 0; - virtual jsi::Array getEntriesByName(jsi::Runtime &rt, jsi::String entryName, std::optional entryType) = 0; - virtual jsi::Array getEntriesByType(jsi::Runtime &rt, double entryType) = 0; - virtual jsi::Array getEventCounts(jsi::Runtime &rt) = 0; - virtual jsi::Object getSimpleMemoryInfo(jsi::Runtime &rt) = 0; - virtual jsi::Object getReactNativeStartupTiming(jsi::Runtime &rt) = 0; - virtual jsi::Value createObserver(jsi::Runtime &rt, jsi::Function callback) = 0; - virtual double getDroppedEntriesCount(jsi::Runtime &rt, jsi::Value observer) = 0; - virtual void observe(jsi::Runtime &rt, jsi::Value observer, jsi::Object options) = 0; - virtual void disconnect(jsi::Runtime &rt, jsi::Value observer) = 0; - virtual jsi::Array takeRecords(jsi::Runtime &rt, jsi::Value observer, bool sort) = 0; - virtual jsi::Array getSupportedPerformanceEntryTypes(jsi::Runtime &rt) = 0; - virtual void setCurrentTimeStampForTesting(jsi::Runtime &rt, double timeStamp) = 0; - virtual void clearEventCountsForTesting(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativePerformanceCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativePerformanceCxx"; - -protected: - NativePerformanceCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativePerformanceCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativePerformanceCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativePerformanceCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - double now(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::now) == 1, - "Expected now(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::now, jsInvoker_, instance_); - } - double markWithResult(jsi::Runtime &rt, jsi::String name, std::optional startTime) override { - static_assert( - bridging::getParameterCount(&T::markWithResult) == 3, - "Expected markWithResult(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::markWithResult, jsInvoker_, instance_, std::move(name), std::move(startTime)); - } - jsi::Array measure(jsi::Runtime &rt, jsi::String name, std::optional startTime, std::optional endTime, std::optional duration, std::optional startMark, std::optional endMark) override { - static_assert( - bridging::getParameterCount(&T::measure) == 7, - "Expected measure(...) to have 7 parameters"); - - return bridging::callFromJs( - rt, &T::measure, jsInvoker_, instance_, std::move(name), std::move(startTime), std::move(endTime), std::move(duration), std::move(startMark), std::move(endMark)); - } - jsi::Array measureWithResult(jsi::Runtime &rt, jsi::String name, double startTime, double endTime, std::optional duration, std::optional startMark, std::optional endMark) override { - static_assert( - bridging::getParameterCount(&T::measureWithResult) == 7, - "Expected measureWithResult(...) to have 7 parameters"); - - return bridging::callFromJs( - rt, &T::measureWithResult, jsInvoker_, instance_, std::move(name), std::move(startTime), std::move(endTime), std::move(duration), std::move(startMark), std::move(endMark)); - } - void clearMarks(jsi::Runtime &rt, std::optional entryName) override { - static_assert( - bridging::getParameterCount(&T::clearMarks) == 2, - "Expected clearMarks(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearMarks, jsInvoker_, instance_, std::move(entryName)); - } - void clearMeasures(jsi::Runtime &rt, std::optional entryName) override { - static_assert( - bridging::getParameterCount(&T::clearMeasures) == 2, - "Expected clearMeasures(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::clearMeasures, jsInvoker_, instance_, std::move(entryName)); - } - jsi::Array getEntries(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getEntries) == 1, - "Expected getEntries(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getEntries, jsInvoker_, instance_); - } - jsi::Array getEntriesByName(jsi::Runtime &rt, jsi::String entryName, std::optional entryType) override { - static_assert( - bridging::getParameterCount(&T::getEntriesByName) == 3, - "Expected getEntriesByName(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getEntriesByName, jsInvoker_, instance_, std::move(entryName), std::move(entryType)); - } - jsi::Array getEntriesByType(jsi::Runtime &rt, double entryType) override { - static_assert( - bridging::getParameterCount(&T::getEntriesByType) == 2, - "Expected getEntriesByType(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getEntriesByType, jsInvoker_, instance_, std::move(entryType)); - } - jsi::Array getEventCounts(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getEventCounts) == 1, - "Expected getEventCounts(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getEventCounts, jsInvoker_, instance_); - } - jsi::Object getSimpleMemoryInfo(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getSimpleMemoryInfo) == 1, - "Expected getSimpleMemoryInfo(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getSimpleMemoryInfo, jsInvoker_, instance_); - } - jsi::Object getReactNativeStartupTiming(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getReactNativeStartupTiming) == 1, - "Expected getReactNativeStartupTiming(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getReactNativeStartupTiming, jsInvoker_, instance_); - } - jsi::Value createObserver(jsi::Runtime &rt, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::createObserver) == 2, - "Expected createObserver(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::createObserver, jsInvoker_, instance_, std::move(callback)); - } - double getDroppedEntriesCount(jsi::Runtime &rt, jsi::Value observer) override { - static_assert( - bridging::getParameterCount(&T::getDroppedEntriesCount) == 2, - "Expected getDroppedEntriesCount(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getDroppedEntriesCount, jsInvoker_, instance_, std::move(observer)); - } - void observe(jsi::Runtime &rt, jsi::Value observer, jsi::Object options) override { - static_assert( - bridging::getParameterCount(&T::observe) == 3, - "Expected observe(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::observe, jsInvoker_, instance_, std::move(observer), std::move(options)); - } - void disconnect(jsi::Runtime &rt, jsi::Value observer) override { - static_assert( - bridging::getParameterCount(&T::disconnect) == 2, - "Expected disconnect(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::disconnect, jsInvoker_, instance_, std::move(observer)); - } - jsi::Array takeRecords(jsi::Runtime &rt, jsi::Value observer, bool sort) override { - static_assert( - bridging::getParameterCount(&T::takeRecords) == 3, - "Expected takeRecords(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::takeRecords, jsInvoker_, instance_, std::move(observer), std::move(sort)); - } - jsi::Array getSupportedPerformanceEntryTypes(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getSupportedPerformanceEntryTypes) == 1, - "Expected getSupportedPerformanceEntryTypes(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getSupportedPerformanceEntryTypes, jsInvoker_, instance_); - } - void setCurrentTimeStampForTesting(jsi::Runtime &rt, double timeStamp) override { - static_assert( - bridging::getParameterCount(&T::setCurrentTimeStampForTesting) == 2, - "Expected setCurrentTimeStampForTesting(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::setCurrentTimeStampForTesting, jsInvoker_, instance_, std::move(timeStamp)); - } - void clearEventCountsForTesting(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::clearEventCountsForTesting) == 1, - "Expected clearEventCountsForTesting(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::clearEventCountsForTesting, jsInvoker_, instance_); - } - - private: - friend class NativePerformanceCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - - - class JSI_EXPORT NativeDOMCxxSpecJSI : public TurboModule { -protected: - NativeDOMCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual double compareDocumentPosition(jsi::Runtime &rt, jsi::Value nativeNodeReference, jsi::Value otherNativeNodeReference) = 0; - virtual jsi::Array getChildNodes(jsi::Runtime &rt, jsi::Value nativeNodeReference) = 0; - virtual jsi::Value getParentNode(jsi::Runtime &rt, jsi::Value nativeNodeReference) = 0; - virtual bool isConnected(jsi::Runtime &rt, jsi::Value nativeNodeReference) = 0; - virtual jsi::Array getBorderWidth(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::Array getBoundingClientRect(jsi::Runtime &rt, jsi::Value nativeElementReference, bool includeTransform) = 0; - virtual jsi::Array getInnerSize(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::Array getScrollPosition(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::Array getScrollSize(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::String getTagName(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::String getTextContent(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual bool hasPointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) = 0; - virtual void releasePointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) = 0; - virtual void setPointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) = 0; - virtual jsi::Array getOffset(jsi::Runtime &rt, jsi::Value nativeElementReference) = 0; - virtual jsi::Value linkRootNode(jsi::Runtime &rt, double rootTag, jsi::Value instanceHandle) = 0; - virtual void measure(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Function callback) = 0; - virtual void measureInWindow(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Function callback) = 0; - virtual void measureLayout(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Value relativeNode, jsi::Function onFail, jsi::Function onSuccess) = 0; - virtual void setNativeProps(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Value updatePayload) = 0; - -}; - -template -class JSI_EXPORT NativeDOMCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - std::vector getPropertyNames(jsi::Runtime& runtime) override { - return delegate_.getPropertyNames(runtime); - } - - static constexpr std::string_view kModuleName = "NativeDOMCxx"; - -protected: - NativeDOMCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeDOMCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeDOMCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeDOMCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - double compareDocumentPosition(jsi::Runtime &rt, jsi::Value nativeNodeReference, jsi::Value otherNativeNodeReference) override { - static_assert( - bridging::getParameterCount(&T::compareDocumentPosition) == 3, - "Expected compareDocumentPosition(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::compareDocumentPosition, jsInvoker_, instance_, std::move(nativeNodeReference), std::move(otherNativeNodeReference)); - } - jsi::Array getChildNodes(jsi::Runtime &rt, jsi::Value nativeNodeReference) override { - static_assert( - bridging::getParameterCount(&T::getChildNodes) == 2, - "Expected getChildNodes(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getChildNodes, jsInvoker_, instance_, std::move(nativeNodeReference)); - } - jsi::Value getParentNode(jsi::Runtime &rt, jsi::Value nativeNodeReference) override { - static_assert( - bridging::getParameterCount(&T::getParentNode) == 2, - "Expected getParentNode(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getParentNode, jsInvoker_, instance_, std::move(nativeNodeReference)); - } - bool isConnected(jsi::Runtime &rt, jsi::Value nativeNodeReference) override { - static_assert( - bridging::getParameterCount(&T::isConnected) == 2, - "Expected isConnected(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::isConnected, jsInvoker_, instance_, std::move(nativeNodeReference)); - } - jsi::Array getBorderWidth(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getBorderWidth) == 2, - "Expected getBorderWidth(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getBorderWidth, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::Array getBoundingClientRect(jsi::Runtime &rt, jsi::Value nativeElementReference, bool includeTransform) override { - static_assert( - bridging::getParameterCount(&T::getBoundingClientRect) == 3, - "Expected getBoundingClientRect(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::getBoundingClientRect, jsInvoker_, instance_, std::move(nativeElementReference), std::move(includeTransform)); - } - jsi::Array getInnerSize(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getInnerSize) == 2, - "Expected getInnerSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getInnerSize, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::Array getScrollPosition(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getScrollPosition) == 2, - "Expected getScrollPosition(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getScrollPosition, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::Array getScrollSize(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getScrollSize) == 2, - "Expected getScrollSize(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getScrollSize, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::String getTagName(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getTagName) == 2, - "Expected getTagName(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getTagName, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::String getTextContent(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getTextContent) == 2, - "Expected getTextContent(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getTextContent, jsInvoker_, instance_, std::move(nativeElementReference)); - } - bool hasPointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) override { - static_assert( - bridging::getParameterCount(&T::hasPointerCapture) == 3, - "Expected hasPointerCapture(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::hasPointerCapture, jsInvoker_, instance_, std::move(nativeElementReference), std::move(pointerId)); - } - void releasePointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) override { - static_assert( - bridging::getParameterCount(&T::releasePointerCapture) == 3, - "Expected releasePointerCapture(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::releasePointerCapture, jsInvoker_, instance_, std::move(nativeElementReference), std::move(pointerId)); - } - void setPointerCapture(jsi::Runtime &rt, jsi::Value nativeElementReference, double pointerId) override { - static_assert( - bridging::getParameterCount(&T::setPointerCapture) == 3, - "Expected setPointerCapture(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setPointerCapture, jsInvoker_, instance_, std::move(nativeElementReference), std::move(pointerId)); - } - jsi::Array getOffset(jsi::Runtime &rt, jsi::Value nativeElementReference) override { - static_assert( - bridging::getParameterCount(&T::getOffset) == 2, - "Expected getOffset(...) to have 2 parameters"); - - return bridging::callFromJs( - rt, &T::getOffset, jsInvoker_, instance_, std::move(nativeElementReference)); - } - jsi::Value linkRootNode(jsi::Runtime &rt, double rootTag, jsi::Value instanceHandle) override { - static_assert( - bridging::getParameterCount(&T::linkRootNode) == 3, - "Expected linkRootNode(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::linkRootNode, jsInvoker_, instance_, std::move(rootTag), std::move(instanceHandle)); - } - void measure(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measure) == 3, - "Expected measure(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::measure, jsInvoker_, instance_, std::move(nativeElementReference), std::move(callback)); - } - void measureInWindow(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Function callback) override { - static_assert( - bridging::getParameterCount(&T::measureInWindow) == 3, - "Expected measureInWindow(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::measureInWindow, jsInvoker_, instance_, std::move(nativeElementReference), std::move(callback)); - } - void measureLayout(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Value relativeNode, jsi::Function onFail, jsi::Function onSuccess) override { - static_assert( - bridging::getParameterCount(&T::measureLayout) == 5, - "Expected measureLayout(...) to have 5 parameters"); - - return bridging::callFromJs( - rt, &T::measureLayout, jsInvoker_, instance_, std::move(nativeElementReference), std::move(relativeNode), std::move(onFail), std::move(onSuccess)); - } - void setNativeProps(jsi::Runtime &rt, jsi::Value nativeElementReference, jsi::Value updatePayload) override { - static_assert( - bridging::getParameterCount(&T::setNativeProps) == 3, - "Expected setNativeProps(...) to have 3 parameters"); - - return bridging::callFromJs( - rt, &T::setNativeProps, jsInvoker_, instance_, std::move(nativeElementReference), std::move(updatePayload)); - } - - private: - friend class NativeDOMCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - -} // namespace facebook::react