react-native-windows 0.82.3 → 0.83.0-preview.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/.flowconfig +2 -7
  2. package/Libraries/Animated/components/AnimatedFlatList.js +5 -3
  3. package/Libraries/Animated/components/AnimatedImage.js +4 -3
  4. package/Libraries/Animated/components/AnimatedSectionList.js +2 -2
  5. package/Libraries/Animated/components/AnimatedText.js +7 -3
  6. package/Libraries/Animated/components/AnimatedView.js +3 -2
  7. package/Libraries/Animated/createAnimatedComponent.js +24 -12
  8. package/Libraries/Animated/nodes/AnimatedColor.js +26 -10
  9. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +43 -15
  10. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +43 -15
  11. package/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +2 -2
  12. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +2 -2
  13. package/Libraries/Components/Glyph/Glyph.js +4 -1
  14. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +2 -2
  15. package/Libraries/Components/RefreshControl/RefreshControl.d.ts +3 -3
  16. package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +2 -2
  17. package/Libraries/Components/ScrollView/ScrollView.js +1 -0
  18. package/Libraries/Components/ScrollView/ScrollView.windows.js +1 -0
  19. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -6
  20. package/Libraries/Components/Switch/Switch.d.ts +2 -2
  21. package/Libraries/Components/Switch/Switch.windows.js +1 -1
  22. package/Libraries/Components/TextInput/TextInput.d.ts +2 -5
  23. package/Libraries/Components/TextInput/TextInput.js +6 -0
  24. package/Libraries/Components/TextInput/TextInput.windows.js +6 -0
  25. package/Libraries/Components/Touchable/TouchableBounce.js +7 -7
  26. package/Libraries/Components/Touchable/TouchableBounce.windows.js +7 -7
  27. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +1 -1
  28. package/Libraries/Components/View/ReactNativeStyleAttributes.js +19 -1
  29. package/Libraries/Components/View/View.d.ts +2 -2
  30. package/Libraries/Components/View/View.windows.js +0 -1
  31. package/Libraries/Components/View/ViewNativeComponent.js +13 -1
  32. package/Libraries/Core/ReactNativeVersion.js +3 -3
  33. package/Libraries/Core/setUpPerformance.js +2 -0
  34. package/Libraries/Debugging/DebuggingOverlay.js +14 -14
  35. package/Libraries/Debugging/DebuggingOverlayRegistry.js +8 -2
  36. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -2
  37. package/Libraries/Image/Image.d.ts +3 -3
  38. package/Libraries/Image/ImageInjection.js +3 -6
  39. package/Libraries/Image/ImageTypes.flow.js +3 -7
  40. package/Libraries/Lists/FlatList.js +8 -8
  41. package/Libraries/Lists/SectionList.d.ts +5 -1
  42. package/Libraries/Lists/ViewabilityHelper.js +1 -1
  43. package/Libraries/Lists/VirtualizedList.js +1 -0
  44. package/Libraries/LogBox/UI/AnsiHighlight.js +4 -1
  45. package/Libraries/NativeComponent/BaseViewConfig.android.js +11 -2
  46. package/Libraries/NativeComponent/NativeComponentRegistry.d.ts +98 -0
  47. package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -0
  48. package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +3 -1
  49. package/Libraries/NativeComponent/ViewConfigIgnore.windows.js +45 -0
  50. package/Libraries/Network/RCTNetworking.android.js +3 -1
  51. package/Libraries/Network/RCTNetworking.ios.js +3 -0
  52. package/Libraries/Network/RCTNetworking.windows.js +3 -0
  53. package/Libraries/Network/XMLHttpRequest.js +1 -41
  54. package/Libraries/Pressability/usePressability.js +14 -3
  55. package/Libraries/ReactNative/PaperUIManager.windows.js +3 -3
  56. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +20 -82
  57. package/Libraries/ReactNative/getNativeComponentAttributes.js +12 -0
  58. package/Libraries/Renderer/implementations/ReactFabric-dev.js +6759 -4478
  59. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3169 -3119
  60. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4732 -3535
  61. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +6646 -4070
  62. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3136 -2825
  63. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4761 -3312
  64. package/Libraries/Renderer/shims/ReactNative.js +3 -1
  65. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  66. package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +2 -1
  67. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
  68. package/Libraries/StyleSheet/StyleSheetTypes.js +44 -0
  69. package/Libraries/StyleSheet/processBackgroundPosition.js +284 -0
  70. package/Libraries/StyleSheet/processBackgroundRepeat.js +105 -0
  71. package/Libraries/StyleSheet/processBackgroundSize.js +104 -0
  72. package/Libraries/Text/Text.d.ts +2 -2
  73. package/Libraries/Text/TextNativeComponent.js +10 -0
  74. package/Libraries/TurboModule/TurboModuleRegistry.js +3 -9
  75. package/Libraries/Utilities/DevLoadingView.js +14 -6
  76. package/Libraries/Utilities/HMRClient.js +13 -5
  77. package/Microsoft.ReactNative/CompositionComponentView.idl +2 -0
  78. package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -0
  79. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +1 -1
  80. package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
  81. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +10 -40
  82. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +3 -80
  83. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +45 -12
  84. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +8 -0
  85. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +61 -74
  86. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +4 -0
  87. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +1 -0
  88. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +4 -3
  89. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +2 -1
  90. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.cpp +245 -0
  91. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.h +80 -0
  92. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +20 -36
  93. package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +5 -0
  94. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +1 -0
  95. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
  96. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +20 -94
  97. package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -3
  98. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +0 -41
  99. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +0 -11
  100. package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -3
  101. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +31 -101
  102. package/Microsoft.ReactNative/ReactNativeWin32App.h +2 -13
  103. package/Microsoft.ReactNative/ReactNativeWindow.idl +44 -0
  104. package/Microsoft.ReactNative.Cxx/AutoDraw.h +9 -1
  105. package/Microsoft.ReactNative.Cxx/ReactCommon/CallInvoker.h +13 -16
  106. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +24 -36
  107. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.h +5 -8
  108. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/AString.h +8 -6
  109. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Array.h +32 -49
  110. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +27 -76
  111. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +4 -2
  112. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/CallbackWrapper.h +19 -18
  113. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +25 -48
  114. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Convert.h +38 -31
  115. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Error.h +11 -6
  116. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/EventEmitter.h +47 -45
  117. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Function.h +69 -89
  118. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/HighResTimeStamp.h +8 -8
  119. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.h +6 -6
  120. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +16 -8
  121. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Object.h +17 -24
  122. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Promise.h +17 -17
  123. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Value.h +20 -29
  124. package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/react_native_assert.h +2 -7
  125. package/Microsoft.ReactNative.Cxx/ReactCommon/react/timing/primitives.h +127 -115
  126. package/PropertySheets/Generated/PackageVersion.g.props +4 -4
  127. package/PropertySheets/Warnings.props +2 -1
  128. package/ReactCommon/ReactCommon.vcxproj +11 -2
  129. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +2 -2
  130. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +4 -2
  131. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +4 -2
  132. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +4 -2
  133. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/MethodCall.cpp +4 -2
  134. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ModuleRegistry.cpp +5 -3
  135. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -4
  136. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/RAMBundleRegistry.cpp +6 -4
  137. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +2 -0
  138. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +25 -35
  139. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +86 -67
  140. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +15 -8
  141. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSINativeModules.cpp +4 -2
  142. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +84 -68
  143. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +31 -35
  144. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +4 -5
  145. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp +2 -1
  146. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +24 -36
  147. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +28 -66
  148. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/webperformance/NativePerformance.cpp +5 -0
  149. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -3
  150. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +8 -4
  151. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +19 -16
  152. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +8 -9
  153. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +25 -95
  154. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/BaseViewProps.cpp +36 -0
  155. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +85 -42
  156. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +2 -0
  157. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +2 -0
  158. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +25 -31
  159. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +19 -5
  160. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +16 -1
  161. package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +1 -15
  162. package/Scripts/creaternwapp.cmd +1 -1
  163. package/Scripts/perf/compare-results.js +357 -0
  164. package/Scripts/perf/create-perf-test.js +343 -0
  165. package/Scripts/perf/post-pr-comment.js +210 -0
  166. package/Shared/Hermes/HermesRuntimeTargetDelegate.cpp +8 -0
  167. package/Shared/Hermes/HermesRuntimeTargetDelegate.h +3 -0
  168. package/Shared/Shared.vcxitems +15 -3
  169. package/Shared/Shared.vcxitems.filters +11 -3
  170. package/codegen/NativeIntersectionObserverSpec.g.h +2 -0
  171. package/codegen/NativeNetworkingIOSSpec.g.h +2 -0
  172. package/codegen/NativePerformanceSpec.g.h +6 -0
  173. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +229 -139
  174. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +2 -1
  175. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +42 -25
  176. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +2 -1
  177. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +2 -1
  178. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +11 -6
  179. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +11 -6
  180. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +1 -0
  181. package/codegen/react/components/rnwcore/InputAccessory.g.h +2 -1
  182. package/codegen/react/components/rnwcore/ModalHostView.g.h +40 -23
  183. package/codegen/react/components/rnwcore/Props.cpp +6 -1
  184. package/codegen/react/components/rnwcore/Props.h +1 -0
  185. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +11 -6
  186. package/codegen/react/components/rnwcore/SafeAreaView.g.h +1 -0
  187. package/codegen/react/components/rnwcore/Switch.g.h +11 -6
  188. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +2 -1
  189. package/codegen/react/components/rnwcore/VirtualView.g.h +41 -8
  190. package/codegen/react/components/rnwcore/VirtualViewExperimental.g.h +45 -8
  191. package/codegen/rnwcoreJSI.h +3973 -6059
  192. package/index.js +6 -0
  193. package/index.windows.js +6 -0
  194. package/jest/mockComponent.js +6 -6
  195. package/jest/setup.js +15 -10
  196. package/package.json +27 -27
  197. package/src/private/components/virtualview/VirtualView.js +22 -27
  198. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +6 -0
  199. package/src/private/featureflags/ReactNativeFeatureFlags.js +100 -19
  200. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +18 -3
  201. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
  202. package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -1
  203. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -0
  204. package/src/private/webapis/dom/nodes/ReactNativeElement.js +12 -2
  205. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +76 -15
  206. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +1 -0
  207. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  208. package/src/private/webapis/performance/ResourceTiming.js +31 -4
  209. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +4 -1
  210. package/src/private/webapis/performance/specs/NativePerformance.js +3 -0
  211. package/stubs/double-conversion/double-conversion.h +5 -0
  212. package/templates/cpp-app/template.config.js +1 -1
  213. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
  214. package/templates/cpp-lib/template.config.js +1 -1
  215. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
  216. package/types/index.d.ts +1 -0
  217. package/types/public/ReactNativeTypes.d.ts +115 -2
  218. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +0 -152
  219. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +0 -1574
  220. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +0 -528
  221. package/Scripts/OpenSSL.nuspec +0 -39
  222. package/Scripts/OpenSSL.targets +0 -36
  223. package/codegen/rnwcoreJSI-generated.cpp +0 -3470
@@ -36,9 +36,7 @@ enum TurboModuleMethodValueKind {
36
36
  /**
37
37
  * Determines TurboModuleMethodValueKind based on the jsi::Value type.
38
38
  */
39
- TurboModuleMethodValueKind getTurboModuleMethodValueKind(
40
- jsi::Runtime& rt,
41
- const jsi::Value* value);
39
+ TurboModuleMethodValueKind getTurboModuleMethodValueKind(jsi::Runtime &rt, const jsi::Value *value);
42
40
 
43
41
  class TurboCxxModule;
44
42
  class TurboModuleBinding;
@@ -55,8 +53,8 @@ class JSI_EXPORT TurboModule : public jsi::HostObject {
55
53
  // JS representation. To customize lookup of properties, override `create`.
56
54
  // Note: keep this method declared inline to avoid conflicts
57
55
  // between RTTI and non-RTTI compilation units
58
- jsi::Value get(jsi::Runtime& runtime, const jsi::PropNameID& propName)
59
- override {
56
+ jsi::Value get(jsi::Runtime &runtime, const jsi::PropNameID &propName) override
57
+ {
60
58
  auto prop = create(runtime, propName);
61
59
  // If we have a JS wrapper, cache the result of this lookup
62
60
  // We don't cache misses, to allow for methodMap_ to dynamically be
@@ -64,15 +62,14 @@ class JSI_EXPORT TurboModule : public jsi::HostObject {
64
62
  // [Windows] Reenable once https://github.com/microsoft/react-native-windows/issues/14128 is fixed
65
63
  #ifndef WINAPI_FAMILY
66
64
  if (jsRepresentation_ && !prop.isUndefined()) {
67
- jsRepresentation_->lock(runtime).asObject(runtime).setProperty(
68
- runtime, propName, prop);
65
+ jsRepresentation_->lock(runtime).asObject(runtime).setProperty(runtime, propName, prop);
69
66
  }
70
67
  #endif
71
68
  return prop;
72
69
  }
73
70
 
74
- std::vector<jsi::PropNameID> getPropertyNames(
75
- jsi::Runtime& runtime) override {
71
+ std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &runtime) override
72
+ {
76
73
  std::vector<jsi::PropNameID> result;
77
74
  result.reserve(methodMap_.size());
78
75
  for (auto it = methodMap_.cbegin(); it != methodMap_.cend(); ++it) {
@@ -87,18 +84,14 @@ class JSI_EXPORT TurboModule : public jsi::HostObject {
87
84
 
88
85
  struct MethodMetadata {
89
86
  size_t argCount;
90
- jsi::Value (*invoker)(
91
- jsi::Runtime& rt,
92
- TurboModule& turboModule,
93
- const jsi::Value* args,
94
- size_t count);
87
+ jsi::Value (*invoker)(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value *args, size_t count);
95
88
  };
96
89
  std::unordered_map<std::string, MethodMetadata> methodMap_;
97
- std::unordered_map<std::string, std::shared_ptr<IAsyncEventEmitter>>
98
- eventEmitterMap_;
99
90
 
100
- using ArgFactory =
101
- std::function<void(jsi::Runtime& runtime, std::vector<jsi::Value>& args)>;
91
+ friend class TurboModuleTestFixtureInternal;
92
+ std::unordered_map<std::string, std::shared_ptr<IAsyncEventEmitter>> eventEmitterMap_;
93
+
94
+ using ArgFactory = std::function<void(jsi::Runtime &runtime, std::vector<jsi::Value> &args)>;
102
95
 
103
96
  /**
104
97
  * Calls RCTDeviceEventEmitter.emit to JavaScript, with given event name and
@@ -112,35 +105,31 @@ class JSI_EXPORT TurboModule : public jsi::HostObject {
112
105
  * args.emplace_back(jsi::Value(42));
113
106
  * });
114
107
  */
115
- void emitDeviceEvent(
116
- const std::string& eventName,
117
- ArgFactory&& argFactory = nullptr);
108
+ void emitDeviceEvent(const std::string &eventName, ArgFactory &&argFactory = nullptr);
118
109
 
119
110
  // Backwards compatibility version
120
111
  void emitDeviceEvent(
121
- jsi::Runtime& /*runtime*/,
112
+ jsi::Runtime & /*runtime*/,
122
113
 
123
- const std::string& eventName,
124
- ArgFactory&& argFactory = nullptr) {
114
+ const std::string &eventName,
115
+ ArgFactory &&argFactory = nullptr)
116
+ {
125
117
  emitDeviceEvent(eventName, std::move(argFactory));
126
118
  }
127
119
 
128
- virtual jsi::Value create(
129
- jsi::Runtime& runtime,
130
- const jsi::PropNameID& propName) {
120
+ virtual jsi::Value create(jsi::Runtime &runtime, const jsi::PropNameID &propName)
121
+ {
131
122
  std::string propNameUtf8 = propName.utf8(runtime);
132
- if (auto methodIter = methodMap_.find(propNameUtf8);
133
- methodIter != methodMap_.end()) {
134
- const MethodMetadata& meta = methodIter->second;
123
+ if (auto methodIter = methodMap_.find(propNameUtf8); methodIter != methodMap_.end()) {
124
+ const MethodMetadata &meta = methodIter->second;
135
125
  return jsi::Function::createFromHostFunction(
136
126
  runtime,
137
127
  propName,
138
128
  static_cast<unsigned int>(meta.argCount),
139
129
  [this, meta](
140
- jsi::Runtime& rt,
141
- [[maybe_unused]] const jsi::Value& thisVal,
142
- const jsi::Value* args,
143
- size_t count) { return meta.invoker(rt, *this, args, count); });
130
+ jsi::Runtime &rt, [[maybe_unused]] const jsi::Value &thisVal, const jsi::Value *args, size_t count) {
131
+ return meta.invoker(rt, *this, args, count);
132
+ });
144
133
  } else if (auto eventEmitterIter = eventEmitterMap_.find(propNameUtf8);
145
134
  eventEmitterIter != eventEmitterMap_.end()) {
146
135
  return eventEmitterIter->second->get(runtime, jsInvoker_);
@@ -159,7 +148,6 @@ class JSI_EXPORT TurboModule : public jsi::HostObject {
159
148
  * An app/platform-specific provider function to get an instance of a module
160
149
  * given a name.
161
150
  */
162
- using TurboModuleProviderFunctionType =
163
- std::function<std::shared_ptr<TurboModule>(const std::string& name)>;
151
+ using TurboModuleProviderFunctionType = std::function<std::shared_ptr<TurboModule>(const std::string &name)>;
164
152
 
165
153
  } // namespace facebook::react
@@ -23,14 +23,11 @@
23
23
 
24
24
  namespace facebook::react {
25
25
 
26
- using MeasureOnSuccessCallback =
27
- SyncCallback<void(double, double, double, double, double, double)>;
26
+ using MeasureOnSuccessCallback = SyncCallback<void(double, double, double, double, double, double)>;
28
27
 
29
- using MeasureInWindowOnSuccessCallback =
30
- SyncCallback<void(double, double, double, double)>;
28
+ using MeasureInWindowOnSuccessCallback = SyncCallback<void(double, double, double, double)>;
31
29
 
32
- using MeasureLayoutOnSuccessCallback =
33
- SyncCallback<void(double, double, double, double)>;
30
+ using MeasureLayoutOnSuccessCallback = SyncCallback<void(double, double, double, double)>;
34
31
 
35
32
  class NativeDOM : public NativeDOMCxxSpec<NativeDOM> {
36
33
  public:
@@ -38,21 +35,15 @@ class NativeDOM : public NativeDOMCxxSpec<NativeDOM> {
38
35
 
39
36
  #pragma mark - Methods from the Node interface (for ReadOnlyNode).
40
37
 
41
- double compareDocumentPosition(
42
- jsi::Runtime& rt,
43
- jsi::Value nativeNodeReference,
44
- jsi::Value otherNativeNodeReference);
38
+ double compareDocumentPosition(jsi::Runtime &rt, jsi::Value nativeNodeReference, jsi::Value otherNativeNodeReference);
45
39
 
46
- std::vector<jsi::Value> getChildNodes(
47
- jsi::Runtime& rt,
48
- jsi::Value nativeNodeReference);
40
+ std::vector<jsi::Value> getChildNodes(jsi::Runtime &rt, jsi::Value nativeNodeReference);
49
41
 
50
- jsi::Value
51
- getElementById(jsi::Runtime& rt, SurfaceId surfaceId, const std::string& id);
42
+ jsi::Value getElementById(jsi::Runtime &rt, SurfaceId surfaceId, const std::string &id);
52
43
 
53
- jsi::Value getParentNode(jsi::Runtime& rt, jsi::Value nativeNodeReference);
44
+ jsi::Value getParentNode(jsi::Runtime &rt, jsi::Value nativeNodeReference);
54
45
 
55
- bool isConnected(jsi::Runtime& rt, jsi::Value nativeNodeReference);
46
+ bool isConnected(jsi::Runtime &rt, jsi::Value nativeNodeReference);
56
47
 
57
48
  #pragma mark - Methods from the Element interface (for ReactNativeElement).
58
49
 
@@ -60,99 +51,70 @@ class NativeDOM : public NativeDOMCxxSpec<NativeDOM> {
60
51
  /* topWidth: */ int,
61
52
  /* rightWidth: */ int,
62
53
  /* bottomWidth: */ int,
63
- /* leftWidth: */ int>
64
- getBorderWidth(
65
- jsi::Runtime& rt,
66
- std::shared_ptr<const ShadowNode> shadowNode);
54
+ /* leftWidth: */ int> getBorderWidth(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode);
67
55
 
68
56
  std::tuple<
69
57
  /* x: */ double,
70
58
  /* y: */ double,
71
59
  /* width: */ double,
72
60
  /* height: */ double>
73
- getBoundingClientRect(
74
- jsi::Runtime& rt,
75
- std::shared_ptr<const ShadowNode> shadowNode,
76
- bool includeTransform);
61
+ getBoundingClientRect(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode, bool includeTransform);
77
62
 
78
63
  std::tuple</* width: */ int, /* height: */ int> getInnerSize(
79
- jsi::Runtime& rt,
64
+ jsi::Runtime &rt,
80
65
  std::shared_ptr<const ShadowNode> shadowNode);
81
66
 
82
- std::tuple</* scrollLeft: */ double, /* scrollTop: */ double>
83
- getScrollPosition(
84
- jsi::Runtime& rt,
67
+ std::tuple</* scrollLeft: */ double, /* scrollTop: */ double> getScrollPosition(
68
+ jsi::Runtime &rt,
85
69
  std::shared_ptr<const ShadowNode> shadowNode);
86
70
 
87
71
  std::tuple</* scrollWidth: */ int, /* scrollHeight */ int> getScrollSize(
88
- jsi::Runtime& rt,
72
+ jsi::Runtime &rt,
89
73
  std::shared_ptr<const ShadowNode> shadowNode);
90
74
 
91
- std::string getTagName(
92
- jsi::Runtime& rt,
93
- std::shared_ptr<const ShadowNode> shadowNode);
75
+ std::string getTagName(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode);
94
76
 
95
- std::string getTextContent(
96
- jsi::Runtime& rt,
97
- std::shared_ptr<const ShadowNode> shadowNode);
77
+ std::string getTextContent(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode);
98
78
 
99
- bool hasPointerCapture(
100
- jsi::Runtime& rt,
101
- std::shared_ptr<const ShadowNode> shadowNode,
102
- double pointerId);
79
+ bool hasPointerCapture(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode, double pointerId);
103
80
 
104
- void releasePointerCapture(
105
- jsi::Runtime& rt,
106
- std::shared_ptr<const ShadowNode> shadowNode,
107
- double pointerId);
81
+ void releasePointerCapture(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode, double pointerId);
108
82
 
109
- void setPointerCapture(
110
- jsi::Runtime& rt,
111
- std::shared_ptr<const ShadowNode> shadowNode,
112
- double pointerId);
83
+ void setPointerCapture(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode, double pointerId);
113
84
 
114
85
  #pragma mark - Methods from the HTMLElement interface (for ReactNativeElement).
115
86
 
116
87
  std::tuple<
117
88
  /* offsetParent: */ jsi::Value,
118
89
  /* top: */ double,
119
- /* left: */ double>
120
- getOffset(jsi::Runtime& rt, std::shared_ptr<const ShadowNode> shadowNode);
90
+ /* left: */ double> getOffset(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode);
121
91
 
122
92
  #pragma mark - Special methods to handle the root node.
123
93
 
124
- jsi::Value linkRootNode(
125
- jsi::Runtime& rt,
126
- SurfaceId surfaceId,
127
- jsi::Value instanceHandle);
94
+ jsi::Value linkRootNode(jsi::Runtime &rt, SurfaceId surfaceId, jsi::Value instanceHandle);
128
95
 
129
96
  #pragma mark - Legacy layout APIs (for ReactNativeElement).
130
97
 
131
- void measure(
132
- jsi::Runtime& rt,
133
- std::shared_ptr<const ShadowNode> shadowNode,
134
- const MeasureOnSuccessCallback& callback);
98
+ void
99
+ measure(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode, const MeasureOnSuccessCallback &callback);
135
100
 
136
101
  void measureInWindow(
137
- jsi::Runtime& rt,
102
+ jsi::Runtime &rt,
138
103
  std::shared_ptr<const ShadowNode> shadowNode,
139
- const MeasureInWindowOnSuccessCallback& callback);
104
+ const MeasureInWindowOnSuccessCallback &callback);
140
105
 
141
106
  void measureLayout(
142
- jsi::Runtime& rt,
107
+ jsi::Runtime &rt,
143
108
  std::shared_ptr<const ShadowNode> shadowNode,
144
109
  std::shared_ptr<const ShadowNode> relativeToShadowNode,
145
110
  jsi::Function onFail,
146
- const MeasureLayoutOnSuccessCallback& onSuccess);
111
+ const MeasureLayoutOnSuccessCallback &onSuccess);
147
112
 
148
113
  // [windows MSVC cant handle backtick character in a preprocessor line
149
114
  #pragma mark - Legacy direct manipulation APIs (for ReactNativeElement).
150
115
  // windows]
151
116
 
152
- void setNativeProps(
153
- jsi::Runtime& rt,
154
- std::shared_ptr<const ShadowNode> shadowNode,
155
- jsi::Value updatePayload);
117
+ void setNativeProps(jsi::Runtime &rt, std::shared_ptr<const ShadowNode> shadowNode, jsi::Value updatePayload);
156
118
  };
157
119
 
158
120
  } // namespace facebook::react
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+
8
9
  #if _MSC_VER
9
10
  #pragma warning(push)
10
11
  #pragma warning(disable : 4996) // deprecated APIs
@@ -79,6 +80,9 @@ NativePerformanceEntry toNativePerformanceEntry(const PerformanceEntry& entry) {
79
80
  nativeEntry.responseStart = resourceEntry.responseStart;
80
81
  nativeEntry.responseEnd = resourceEntry.responseEnd;
81
82
  nativeEntry.responseStatus = resourceEntry.responseStatus;
83
+ nativeEntry.contentType = resourceEntry.contentType;
84
+ nativeEntry.encodedBodySize = resourceEntry.encodedBodySize;
85
+ nativeEntry.decodedBodySize = resourceEntry.decodedBodySize;
82
86
  }
83
87
 
84
88
  return nativeEntry;
@@ -404,6 +408,7 @@ void NativePerformance::clearEventCountsForTesting(jsi::Runtime& /*rt*/) {
404
408
  }
405
409
 
406
410
  } // namespace facebook::react
411
+
407
412
  #if _MSC_VER
408
413
  #pragma warning(pop)
409
414
  #endif
@@ -33,9 +33,9 @@ void ComponentDescriptorRegistry::add(
33
33
  std::unique_lock lock(mutex_);
34
34
 
35
35
  auto componentDescriptor = componentDescriptorProvider.constructor(
36
- {parameters_.eventDispatcher,
37
- parameters_.contextContainer,
38
- componentDescriptorProvider.flavor});
36
+ {.eventDispatcher = parameters_.eventDispatcher,
37
+ .contextContainer = parameters_.contextContainer,
38
+ .flavor = componentDescriptorProvider.flavor});
39
39
  react_native_assert(
40
40
  componentDescriptor->getComponentHandle() ==
41
41
  componentDescriptorProvider.handle);
@@ -18,7 +18,8 @@
18
18
 
19
19
  namespace facebook::react {
20
20
 
21
- inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) {
21
+ inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result)
22
+ {
22
23
  if (value.hasType<std::string>()) {
23
24
  result = {
24
25
  /* .type = */ ImageSource::Type::Remote,
@@ -111,11 +112,13 @@ inline void fromRawValue(const PropsParserContext &context, const RawValue &valu
111
112
  result.type = ImageSource::Type::Invalid;
112
113
  }
113
114
 
114
- inline std::string toString(const ImageSource &value) {
115
+ inline std::string toString(const ImageSource &value)
116
+ {
115
117
  return "{uri: " + value.uri + "}";
116
118
  }
117
119
 
118
- inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageResizeMode &result) {
120
+ inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageResizeMode &result)
121
+ {
119
122
  react_native_expect(value.hasType<std::string>());
120
123
  if (!value.hasType<std::string>()) {
121
124
  LOG(ERROR) << "Unsupported ImageResizeMode type";
@@ -145,7 +148,8 @@ inline void fromRawValue(const PropsParserContext &context, const RawValue &valu
145
148
  }
146
149
  }
147
150
 
148
- inline std::string toString(const ImageResizeMode &value) {
151
+ inline std::string toString(const ImageResizeMode &value)
152
+ {
149
153
  switch (value) {
150
154
  case ImageResizeMode::Cover:
151
155
  return "cover";
@@ -36,7 +36,7 @@
36
36
  namespace facebook::react {
37
37
  using Content = ParagraphShadowNode::Content;
38
38
 
39
- // NOLINTNEXTLINE(facebook-hte-CArray)
39
+ // NOLINTNEXTLINE(facebook-hte-CArray, modernize-avoid-c-arrays)
40
40
  const char ParagraphComponentName[] = "Paragraph";
41
41
 
42
42
  void ParagraphShadowNode::initialize() noexcept {
@@ -158,11 +158,12 @@ void ParagraphShadowNode::updateStateIfNeeded(
158
158
  return;
159
159
  }
160
160
 
161
- setStateData(ParagraphStateT{
162
- content.attributedString,
163
- content.paragraphAttributes,
164
- textLayoutManager_,
165
- layout});
161
+ setStateData(
162
+ ParagraphStateT{
163
+ content.attributedString,
164
+ content.paragraphAttributes,
165
+ textLayoutManager_,
166
+ layout});
166
167
  }
167
168
 
168
169
  void ParagraphShadowNode::updateStateIfNeeded(const Content& content) {
@@ -175,10 +176,11 @@ void ParagraphShadowNode::updateStateIfNeeded(const Content& content) {
175
176
  return;
176
177
  }
177
178
 
178
- setStateData(ParagraphState{
179
- content.attributedString,
180
- content.paragraphAttributes,
181
- textLayoutManager_});
179
+ setStateData(
180
+ ParagraphState{
181
+ content.attributedString,
182
+ content.paragraphAttributes,
183
+ textLayoutManager_});
182
184
  }
183
185
 
184
186
  MeasuredPreparedLayout* ParagraphShadowNode::findUsableLayout() {
@@ -249,12 +251,13 @@ Size ParagraphShadowNode::measureContent(
249
251
  auto measurement = tme.measurePreparedLayout(
250
252
  preparedLayout, textLayoutContext, layoutConstraints);
251
253
 
252
- measuredLayouts_.push_back(MeasuredPreparedLayout{
253
- .layoutConstraints = layoutConstraints,
254
- .measurement = measurement,
255
- // PreparedLayout is not trivially copyable on all platforms
256
- // NOLINTNEXTLINE(performance-move-const-arg)
257
- .preparedLayout = std::move(preparedLayout)});
254
+ measuredLayouts_.push_back(
255
+ MeasuredPreparedLayout{
256
+ .layoutConstraints = layoutConstraints,
257
+ .measurement = measurement,
258
+ // PreparedLayout is not trivially copyable on all platforms
259
+ // NOLINTNEXTLINE(performance-move-const-arg)
260
+ .preparedLayout = std::move(preparedLayout)});
258
261
  assert_valid_size(measurement.size, layoutConstraints);
259
262
  return measurement.size;
260
263
  }
@@ -65,22 +65,21 @@ class ParagraphState final {
65
65
  : attributedString(std::move(attributedString)),
66
66
  paragraphAttributes(std::move(paragraphAttributes)),
67
67
  layoutManager(std::move(layoutManager)),
68
- measuredLayout(std::move(measuredLayout)) {}
68
+ measuredLayout(std::move(measuredLayout))
69
+ {
70
+ }
69
71
 
70
72
  ParagraphState(
71
73
  AttributedString attributedString,
72
74
  ParagraphAttributes paragraphAttributes,
73
75
  std::weak_ptr<const TextLayoutManager> layoutManager)
74
- : ParagraphState(
75
- std::move(attributedString),
76
- std::move(paragraphAttributes),
77
- std::move(layoutManager),
78
- {}) {}
76
+ : ParagraphState(std::move(attributedString), std::move(paragraphAttributes), std::move(layoutManager), {})
77
+ {
78
+ }
79
79
 
80
80
  ParagraphState() = default;
81
- ParagraphState(
82
- const ParagraphState& /*previousState*/,
83
- const folly::dynamic& /*data*/) {
81
+ ParagraphState(const ParagraphState & /*previousState*/, const folly::dynamic & /*data*/)
82
+ {
84
83
  react_native_assert(false && "Not supported");
85
84
  };
86
85
 
@@ -12,8 +12,6 @@
12
12
  #include <string>
13
13
  #include <vector>
14
14
 
15
- #include <react/renderer/debug/DebugStringConvertible.h>
16
-
17
15
  namespace facebook::react {
18
16
 
19
17
  enum class AccessibilityTraits : uint32_t {
@@ -38,15 +36,13 @@ enum class AccessibilityTraits : uint32_t {
38
36
  TabBar = (1 << 17),
39
37
  };
40
38
 
41
- constexpr enum AccessibilityTraits operator|(
42
- const enum AccessibilityTraits lhs,
43
- const enum AccessibilityTraits rhs) {
39
+ constexpr enum AccessibilityTraits operator|(const enum AccessibilityTraits lhs, const enum AccessibilityTraits rhs)
40
+ {
44
41
  return (enum AccessibilityTraits)((uint32_t)lhs | (uint32_t)rhs);
45
42
  }
46
43
 
47
- constexpr enum AccessibilityTraits operator&(
48
- const enum AccessibilityTraits lhs,
49
- const enum AccessibilityTraits rhs) {
44
+ constexpr enum AccessibilityTraits operator&(const enum AccessibilityTraits lhs, const enum AccessibilityTraits rhs)
45
+ {
50
46
  return (enum AccessibilityTraits)((uint32_t)lhs & (uint32_t)rhs);
51
47
  }
52
48
 
@@ -55,36 +51,13 @@ struct AccessibilityAction {
55
51
  std::optional<std::string> label{};
56
52
  };
57
53
 
58
- inline std::string toString(const AccessibilityAction& accessibilityAction) {
59
- std::string result = accessibilityAction.name;
60
- if (accessibilityAction.label.has_value()) {
61
- result += ": '" + accessibilityAction.label.value() + "'";
62
- }
63
- return result;
64
- }
65
-
66
- inline std::string toString(
67
- std::vector<AccessibilityAction> accessibilityActions) {
68
- std::string result = "[";
69
- for (size_t i = 0; i < accessibilityActions.size(); i++) {
70
- result += toString(accessibilityActions[i]);
71
- if (i < accessibilityActions.size() - 1) {
72
- result += ", ";
73
- }
74
- }
75
- result += "]";
76
- return result;
77
- }
78
-
79
- inline static bool operator==(
80
- const AccessibilityAction& lhs,
81
- const AccessibilityAction& rhs) {
54
+ inline static bool operator==(const AccessibilityAction &lhs, const AccessibilityAction &rhs)
55
+ {
82
56
  return lhs.name == rhs.name && lhs.label == rhs.label;
83
57
  }
84
58
 
85
- inline static bool operator!=(
86
- const AccessibilityAction& lhs,
87
- const AccessibilityAction& rhs) {
59
+ inline static bool operator!=(const AccessibilityAction &lhs, const AccessibilityAction &rhs)
60
+ {
88
61
  return !(rhs == lhs);
89
62
  }
90
63
 
@@ -99,56 +72,28 @@ struct AccessibilityState {
99
72
  std::optional<bool> required{std::nullopt}; // [Windows] - Do not remove; required for Windows ISelectionProvider Implementation
100
73
  };
101
74
 
102
- constexpr bool operator==(
103
- const AccessibilityState& lhs,
104
- const AccessibilityState& rhs) {
105
- return lhs.disabled == rhs.disabled && lhs.selected == rhs.selected &&
106
- lhs.checked == rhs.checked && lhs.busy == rhs.busy &&
107
- lhs.expanded == rhs.expanded;
75
+ constexpr bool operator==(const AccessibilityState &lhs, const AccessibilityState &rhs)
76
+ {
77
+ return lhs.disabled == rhs.disabled && lhs.selected == rhs.selected && lhs.checked == rhs.checked &&
78
+ lhs.busy == rhs.busy && lhs.expanded == rhs.expanded;
108
79
  }
109
80
 
110
- constexpr bool operator!=(
111
- const AccessibilityState& lhs,
112
- const AccessibilityState& rhs) {
81
+ constexpr bool operator!=(const AccessibilityState &lhs, const AccessibilityState &rhs)
82
+ {
113
83
  return !(rhs == lhs);
114
84
  }
115
85
 
116
- #if RN_DEBUG_STRING_CONVERTIBLE
117
- inline std::string toString(AccessibilityState::CheckedState state) {
118
- switch (state) {
119
- case AccessibilityState::Unchecked:
120
- return "Unchecked";
121
- case AccessibilityState::Checked:
122
- return "Checked";
123
- case AccessibilityState::Mixed:
124
- return "Mixed";
125
- case AccessibilityState::None:
126
- return "None";
127
- }
128
- }
129
-
130
- inline std::string toString(const AccessibilityState& accessibilityState) {
131
- return "{disabled:" + toString(accessibilityState.disabled) +
132
- ",selected:" + toString(accessibilityState.selected) +
133
- ",checked:" + toString(accessibilityState.checked) +
134
- ",busy:" + toString(accessibilityState.busy) +
135
- ",expanded:" + toString(accessibilityState.expanded) + "}";
136
- }
137
- #endif
138
-
139
86
  struct AccessibilityLabelledBy {
140
87
  std::vector<std::string> value{};
141
88
  };
142
89
 
143
- inline static bool operator==(
144
- const AccessibilityLabelledBy& lhs,
145
- const AccessibilityLabelledBy& rhs) {
90
+ inline static bool operator==(const AccessibilityLabelledBy &lhs, const AccessibilityLabelledBy &rhs)
91
+ {
146
92
  return lhs.value == rhs.value;
147
93
  }
148
94
 
149
- inline static bool operator!=(
150
- const AccessibilityLabelledBy& lhs,
151
- const AccessibilityLabelledBy& rhs) {
95
+ inline static bool operator!=(const AccessibilityLabelledBy &lhs, const AccessibilityLabelledBy &rhs)
96
+ {
152
97
  return !(lhs == rhs);
153
98
  }
154
99
 
@@ -159,16 +104,13 @@ struct AccessibilityValue {
159
104
  std::optional<std::string> text{};
160
105
  };
161
106
 
162
- constexpr bool operator==(
163
- const AccessibilityValue& lhs,
164
- const AccessibilityValue& rhs) {
165
- return lhs.min == rhs.min && lhs.max == rhs.max && lhs.now == rhs.now &&
166
- lhs.text == rhs.text;
107
+ constexpr bool operator==(const AccessibilityValue &lhs, const AccessibilityValue &rhs)
108
+ {
109
+ return lhs.min == rhs.min && lhs.max == rhs.max && lhs.now == rhs.now && lhs.text == rhs.text;
167
110
  }
168
111
 
169
- constexpr bool operator!=(
170
- const AccessibilityValue& lhs,
171
- const AccessibilityValue& rhs) {
112
+ constexpr bool operator!=(const AccessibilityValue &lhs, const AccessibilityValue &rhs)
113
+ {
172
114
  return !(rhs == lhs);
173
115
  }
174
116
 
@@ -185,19 +127,7 @@ enum class AccessibilityLiveRegion : uint8_t {
185
127
  Assertive,
186
128
  };
187
129
 
188
- inline std::string toString(
189
- const AccessibilityLiveRegion& accessibilityLiveRegion) {
190
- switch (accessibilityLiveRegion) {
191
- case AccessibilityLiveRegion::None:
192
- return "none";
193
- case AccessibilityLiveRegion::Polite:
194
- return "polite";
195
- case AccessibilityLiveRegion::Assertive:
196
- return "assertive";
197
- }
198
- }
199
-
200
- enum class AccessibilityRole {
130
+ enum class AccessibilityRole : uint8_t {
201
131
  None,
202
132
  Button,
203
133
  Dropdownlist,
@@ -240,7 +170,7 @@ enum class AccessibilityRole {
240
170
  Iconmenu,
241
171
  };
242
172
 
243
- enum class Role {
173
+ enum class Role : uint8_t {
244
174
  Alert,
245
175
  Alertdialog,
246
176
  Application,