@appsent-co/react-native-watchos 0.1.0

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 (1045) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +94 -0
  3. package/RNWatchConnectivity.podspec +77 -0
  4. package/app.plugin.js +1 -0
  5. package/apple/Package.swift +49 -0
  6. package/apple/Sources/ReactNativeWatchOS/DevSupport/ErrorToast.swift +22 -0
  7. package/apple/Sources/ReactNativeWatchOS/DevSupport/ShakeDetector.swift +42 -0
  8. package/apple/Sources/ReactNativeWatchOS/EventBus.swift +20 -0
  9. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityAction.swift +20 -0
  10. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityActions.swift +17 -0
  11. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityAddTraits.swift +48 -0
  12. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityElement.swift +19 -0
  13. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityHidden.swift +13 -0
  14. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityHint.swift +12 -0
  15. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityIdentifier.swift +12 -0
  16. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityLabel.swift +12 -0
  17. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityRemoveTraits.swift +14 -0
  18. package/apple/Sources/ReactNativeWatchOS/Modifiers/AccessibilityValue.swift +12 -0
  19. package/apple/Sources/ReactNativeWatchOS/Modifiers/Alert.swift +81 -0
  20. package/apple/Sources/ReactNativeWatchOS/Modifiers/AlignmentGuide.swift +53 -0
  21. package/apple/Sources/ReactNativeWatchOS/Modifiers/AllowsHitTesting.swift +13 -0
  22. package/apple/Sources/ReactNativeWatchOS/Modifiers/AllowsTightening.swift +13 -0
  23. package/apple/Sources/ReactNativeWatchOS/Modifiers/Animation.swift +63 -0
  24. package/apple/Sources/ReactNativeWatchOS/Modifiers/Antialiased.swift +12 -0
  25. package/apple/Sources/ReactNativeWatchOS/Modifiers/AspectRatio.swift +21 -0
  26. package/apple/Sources/ReactNativeWatchOS/Modifiers/AutocorrectionDisabled.swift +14 -0
  27. package/apple/Sources/ReactNativeWatchOS/Modifiers/Background.swift +26 -0
  28. package/apple/Sources/ReactNativeWatchOS/Modifiers/BackgroundExtensionEffect.swift +17 -0
  29. package/apple/Sources/ReactNativeWatchOS/Modifiers/BackgroundStyle.swift +17 -0
  30. package/apple/Sources/ReactNativeWatchOS/Modifiers/BaselineOffset.swift +13 -0
  31. package/apple/Sources/ReactNativeWatchOS/Modifiers/BlendMode.swift +35 -0
  32. package/apple/Sources/ReactNativeWatchOS/Modifiers/Blur.swift +14 -0
  33. package/apple/Sources/ReactNativeWatchOS/Modifiers/Bold.swift +12 -0
  34. package/apple/Sources/ReactNativeWatchOS/Modifiers/Border.swift +18 -0
  35. package/apple/Sources/ReactNativeWatchOS/Modifiers/Brightness.swift +12 -0
  36. package/apple/Sources/ReactNativeWatchOS/Modifiers/ButtonBorderShape.swift +27 -0
  37. package/apple/Sources/ReactNativeWatchOS/Modifiers/ButtonRepeatBehavior.swift +19 -0
  38. package/apple/Sources/ReactNativeWatchOS/Modifiers/ButtonSizing.swift +18 -0
  39. package/apple/Sources/ReactNativeWatchOS/Modifiers/ButtonStyle.swift +23 -0
  40. package/apple/Sources/ReactNativeWatchOS/Modifiers/ClipShape.swift +26 -0
  41. package/apple/Sources/ReactNativeWatchOS/Modifiers/Clipped.swift +11 -0
  42. package/apple/Sources/ReactNativeWatchOS/Modifiers/ColorInvert.swift +11 -0
  43. package/apple/Sources/ReactNativeWatchOS/Modifiers/ColorMultiply.swift +17 -0
  44. package/apple/Sources/ReactNativeWatchOS/Modifiers/ColorScheme.swift +21 -0
  45. package/apple/Sources/ReactNativeWatchOS/Modifiers/CompositingGroup.swift +12 -0
  46. package/apple/Sources/ReactNativeWatchOS/Modifiers/ConfirmationDialog.swift +91 -0
  47. package/apple/Sources/ReactNativeWatchOS/Modifiers/ContainerBackground.swift +34 -0
  48. package/apple/Sources/ReactNativeWatchOS/Modifiers/ContainerRelativeFrame.swift +24 -0
  49. package/apple/Sources/ReactNativeWatchOS/Modifiers/ContainerShape.swift +25 -0
  50. package/apple/Sources/ReactNativeWatchOS/Modifiers/ContainerValue.swift +20 -0
  51. package/apple/Sources/ReactNativeWatchOS/Modifiers/ContentMargins.swift +21 -0
  52. package/apple/Sources/ReactNativeWatchOS/Modifiers/ContentShape.swift +26 -0
  53. package/apple/Sources/ReactNativeWatchOS/Modifiers/ContextMenu.swift +14 -0
  54. package/apple/Sources/ReactNativeWatchOS/Modifiers/Contrast.swift +12 -0
  55. package/apple/Sources/ReactNativeWatchOS/Modifiers/ControlSize.swift +27 -0
  56. package/apple/Sources/ReactNativeWatchOS/Modifiers/CoordinateSpace.swift +15 -0
  57. package/apple/Sources/ReactNativeWatchOS/Modifiers/CornerRadius.swift +14 -0
  58. package/apple/Sources/ReactNativeWatchOS/Modifiers/DatePickerStyle.swift +20 -0
  59. package/apple/Sources/ReactNativeWatchOS/Modifiers/DefaultAppStorage.swift +21 -0
  60. package/apple/Sources/ReactNativeWatchOS/Modifiers/DefaultScrollAnchor.swift +20 -0
  61. package/apple/Sources/ReactNativeWatchOS/Modifiers/DeleteDisabled.swift +12 -0
  62. package/apple/Sources/ReactNativeWatchOS/Modifiers/DigitalCrownAccessory.swift +20 -0
  63. package/apple/Sources/ReactNativeWatchOS/Modifiers/DigitalCrownRotation.swift +100 -0
  64. package/apple/Sources/ReactNativeWatchOS/Modifiers/Disabled.swift +12 -0
  65. package/apple/Sources/ReactNativeWatchOS/Modifiers/DrawingGroup.swift +12 -0
  66. package/apple/Sources/ReactNativeWatchOS/Modifiers/DynamicTypeSize.swift +36 -0
  67. package/apple/Sources/ReactNativeWatchOS/Modifiers/Environment.swift +40 -0
  68. package/apple/Sources/ReactNativeWatchOS/Modifiers/EnvironmentObject.swift +20 -0
  69. package/apple/Sources/ReactNativeWatchOS/Modifiers/FixedSize.swift +22 -0
  70. package/apple/Sources/ReactNativeWatchOS/Modifiers/Focusable.swift +14 -0
  71. package/apple/Sources/ReactNativeWatchOS/Modifiers/Focused.swift +52 -0
  72. package/apple/Sources/ReactNativeWatchOS/Modifiers/Font.swift +65 -0
  73. package/apple/Sources/ReactNativeWatchOS/Modifiers/FontDesign.swift +20 -0
  74. package/apple/Sources/ReactNativeWatchOS/Modifiers/FontWeight.swift +15 -0
  75. package/apple/Sources/ReactNativeWatchOS/Modifiers/ForegroundColor.swift +19 -0
  76. package/apple/Sources/ReactNativeWatchOS/Modifiers/ForegroundStyle.swift +17 -0
  77. package/apple/Sources/ReactNativeWatchOS/Modifiers/FormStyle.swift +14 -0
  78. package/apple/Sources/ReactNativeWatchOS/Modifiers/Frame.swift +44 -0
  79. package/apple/Sources/ReactNativeWatchOS/Modifiers/FullScreenCover.swift +68 -0
  80. package/apple/Sources/ReactNativeWatchOS/Modifiers/GaugeStyle.swift +27 -0
  81. package/apple/Sources/ReactNativeWatchOS/Modifiers/GeometryGroup.swift +16 -0
  82. package/apple/Sources/ReactNativeWatchOS/Modifiers/Gesture.swift +68 -0
  83. package/apple/Sources/ReactNativeWatchOS/Modifiers/GlassEffect.swift +49 -0
  84. package/apple/Sources/ReactNativeWatchOS/Modifiers/GlassEffectID.swift +34 -0
  85. package/apple/Sources/ReactNativeWatchOS/Modifiers/GlassEffectTransition.swift +29 -0
  86. package/apple/Sources/ReactNativeWatchOS/Modifiers/GlassEffectUnion.swift +35 -0
  87. package/apple/Sources/ReactNativeWatchOS/Modifiers/Grayscale.swift +12 -0
  88. package/apple/Sources/ReactNativeWatchOS/Modifiers/GridCellAnchor.swift +38 -0
  89. package/apple/Sources/ReactNativeWatchOS/Modifiers/GridCellColumns.swift +13 -0
  90. package/apple/Sources/ReactNativeWatchOS/Modifiers/GridCellUnsizedAxes.swift +21 -0
  91. package/apple/Sources/ReactNativeWatchOS/Modifiers/GridColumnAlignment.swift +13 -0
  92. package/apple/Sources/ReactNativeWatchOS/Modifiers/HandGestureShortcut.swift +18 -0
  93. package/apple/Sources/ReactNativeWatchOS/Modifiers/HeaderProminence.swift +16 -0
  94. package/apple/Sources/ReactNativeWatchOS/Modifiers/Help.swift +15 -0
  95. package/apple/Sources/ReactNativeWatchOS/Modifiers/Hidden.swift +14 -0
  96. package/apple/Sources/ReactNativeWatchOS/Modifiers/HighPriorityGesture.swift +12 -0
  97. package/apple/Sources/ReactNativeWatchOS/Modifiers/HueRotation.swift +12 -0
  98. package/apple/Sources/ReactNativeWatchOS/Modifiers/Id.swift +33 -0
  99. package/apple/Sources/ReactNativeWatchOS/Modifiers/IgnoresSafeArea.swift +16 -0
  100. package/apple/Sources/ReactNativeWatchOS/Modifiers/InteractiveDismissDisabled.swift +13 -0
  101. package/apple/Sources/ReactNativeWatchOS/Modifiers/Interpolation.swift +19 -0
  102. package/apple/Sources/ReactNativeWatchOS/Modifiers/Italic.swift +12 -0
  103. package/apple/Sources/ReactNativeWatchOS/Modifiers/Kerning.swift +14 -0
  104. package/apple/Sources/ReactNativeWatchOS/Modifiers/LabelIconToTitleSpacing.swift +17 -0
  105. package/apple/Sources/ReactNativeWatchOS/Modifiers/LabelReservedIconWidth.swift +17 -0
  106. package/apple/Sources/ReactNativeWatchOS/Modifiers/LabelStyle.swift +21 -0
  107. package/apple/Sources/ReactNativeWatchOS/Modifiers/LabeledContentStyle.swift +14 -0
  108. package/apple/Sources/ReactNativeWatchOS/Modifiers/LabelsHidden.swift +14 -0
  109. package/apple/Sources/ReactNativeWatchOS/Modifiers/LabelsVisibility.swift +18 -0
  110. package/apple/Sources/ReactNativeWatchOS/Modifiers/LayoutPriority.swift +12 -0
  111. package/apple/Sources/ReactNativeWatchOS/Modifiers/LineLimit.swift +13 -0
  112. package/apple/Sources/ReactNativeWatchOS/Modifiers/LineSpacing.swift +13 -0
  113. package/apple/Sources/ReactNativeWatchOS/Modifiers/ListItemTint.swift +17 -0
  114. package/apple/Sources/ReactNativeWatchOS/Modifiers/ListRowBackground.swift +16 -0
  115. package/apple/Sources/ReactNativeWatchOS/Modifiers/ListRowInsets.swift +18 -0
  116. package/apple/Sources/ReactNativeWatchOS/Modifiers/ListSectionSpacing.swift +24 -0
  117. package/apple/Sources/ReactNativeWatchOS/Modifiers/ListStyle.swift +18 -0
  118. package/apple/Sources/ReactNativeWatchOS/Modifiers/LuminanceToAlpha.swift +12 -0
  119. package/apple/Sources/ReactNativeWatchOS/Modifiers/Mask.swift +15 -0
  120. package/apple/Sources/ReactNativeWatchOS/Modifiers/MatchedGeometryEffect.swift +50 -0
  121. package/apple/Sources/ReactNativeWatchOS/Modifiers/MatchedTransitionSource.swift +33 -0
  122. package/apple/Sources/ReactNativeWatchOS/Modifiers/MaterialActiveAppearance.swift +26 -0
  123. package/apple/Sources/ReactNativeWatchOS/Modifiers/MenuActionDismissBehavior.swift +23 -0
  124. package/apple/Sources/ReactNativeWatchOS/Modifiers/MenuOrder.swift +19 -0
  125. package/apple/Sources/ReactNativeWatchOS/Modifiers/MinimumScaleFactor.swift +14 -0
  126. package/apple/Sources/ReactNativeWatchOS/Modifiers/Monospaced.swift +12 -0
  127. package/apple/Sources/ReactNativeWatchOS/Modifiers/MonospacedDigit.swift +13 -0
  128. package/apple/Sources/ReactNativeWatchOS/Modifiers/MoveDisabled.swift +12 -0
  129. package/apple/Sources/ReactNativeWatchOS/Modifiers/MultilineTextAlignment.swift +14 -0
  130. package/apple/Sources/ReactNativeWatchOS/Modifiers/NavigationBarBackButtonHidden.swift +14 -0
  131. package/apple/Sources/ReactNativeWatchOS/Modifiers/NavigationDestination.swift +64 -0
  132. package/apple/Sources/ReactNativeWatchOS/Modifiers/NavigationTitle.swift +14 -0
  133. package/apple/Sources/ReactNativeWatchOS/Modifiers/NavigationTransition.swift +22 -0
  134. package/apple/Sources/ReactNativeWatchOS/Modifiers/Offset.swift +15 -0
  135. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnAppear.swift +11 -0
  136. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnChange.swift +60 -0
  137. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnDisappear.swift +12 -0
  138. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnGeometryChange.swift +25 -0
  139. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnLongPressGesture.swift +17 -0
  140. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnOpenURL.swift +19 -0
  141. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnReceive.swift +24 -0
  142. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnSubmit.swift +24 -0
  143. package/apple/Sources/ReactNativeWatchOS/Modifiers/OnTapGesture.swift +16 -0
  144. package/apple/Sources/ReactNativeWatchOS/Modifiers/Opacity.swift +11 -0
  145. package/apple/Sources/ReactNativeWatchOS/Modifiers/Overlay.swift +15 -0
  146. package/apple/Sources/ReactNativeWatchOS/Modifiers/Padding.swift +30 -0
  147. package/apple/Sources/ReactNativeWatchOS/Modifiers/PickerStyle.swift +21 -0
  148. package/apple/Sources/ReactNativeWatchOS/Modifiers/Position.swift +15 -0
  149. package/apple/Sources/ReactNativeWatchOS/Modifiers/PreferredColorScheme.swift +15 -0
  150. package/apple/Sources/ReactNativeWatchOS/Modifiers/PresentationBackground.swift +23 -0
  151. package/apple/Sources/ReactNativeWatchOS/Modifiers/PresentationCompactAdaptation.swift +20 -0
  152. package/apple/Sources/ReactNativeWatchOS/Modifiers/PresentationCornerRadius.swift +19 -0
  153. package/apple/Sources/ReactNativeWatchOS/Modifiers/PresentationDetents.swift +19 -0
  154. package/apple/Sources/ReactNativeWatchOS/Modifiers/PresentationDragIndicator.swift +17 -0
  155. package/apple/Sources/ReactNativeWatchOS/Modifiers/PrivacySensitive.swift +13 -0
  156. package/apple/Sources/ReactNativeWatchOS/Modifiers/ProgressViewStyle.swift +19 -0
  157. package/apple/Sources/ReactNativeWatchOS/Modifiers/ProjectionEffect.swift +17 -0
  158. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWAccessibilityModifiers.swift +23 -0
  159. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWComponentStylesModifiers.swift +23 -0
  160. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWContainerGridModifiers.swift +19 -0
  161. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWControlsPolishModifiers.swift +20 -0
  162. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWEnvironmentModifiers.swift +15 -0
  163. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWFiltersModifiers.swift +28 -0
  164. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWGeometryModifiers.swift +16 -0
  165. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWGesturesModifiers.swift +17 -0
  166. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWGlassModifiers.swift +17 -0
  167. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWImageScaleModifier.swift +18 -0
  168. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWImageSymbolModifiers.swift +15 -0
  169. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWInputModifiers.swift +16 -0
  170. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWInteractionModifiers.swift +23 -0
  171. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWLayoutModifiers.swift +20 -0
  172. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWListsModifiers.swift +19 -0
  173. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWNavigationModifiers.swift +19 -0
  174. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWPresentationModifiers.swift +17 -0
  175. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWScrollModifiers.swift +24 -0
  176. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWSearchModifiers.swift +15 -0
  177. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWStylingModifiers.swift +25 -0
  178. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWSymbolEffectModifier.swift +46 -0
  179. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWSymbolRenderingModeModifier.swift +19 -0
  180. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWSymbolVariantModifier.swift +21 -0
  181. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWTextModifiers.swift +25 -0
  182. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWTextPolishModifiers.swift +16 -0
  183. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWThemeModifiers.swift +18 -0
  184. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWToolbarModifiers.swift +24 -0
  185. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWTransformsModifiers.swift +16 -0
  186. package/apple/Sources/ReactNativeWatchOS/Modifiers/RNWWatchModifiers.swift +15 -0
  187. package/apple/Sources/ReactNativeWatchOS/Modifiers/Redacted.swift +13 -0
  188. package/apple/Sources/ReactNativeWatchOS/Modifiers/Refreshable.swift +18 -0
  189. package/apple/Sources/ReactNativeWatchOS/Modifiers/RenderingMode.swift +17 -0
  190. package/apple/Sources/ReactNativeWatchOS/Modifiers/Resizable.swift +13 -0
  191. package/apple/Sources/ReactNativeWatchOS/Modifiers/Rotation3DEffect.swift +30 -0
  192. package/apple/Sources/ReactNativeWatchOS/Modifiers/RotationEffect.swift +33 -0
  193. package/apple/Sources/ReactNativeWatchOS/Modifiers/SafeAreaInset.swift +49 -0
  194. package/apple/Sources/ReactNativeWatchOS/Modifiers/Saturation.swift +12 -0
  195. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScaleEffect.swift +17 -0
  196. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollBounceBehavior.swift +53 -0
  197. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollClipDisabled.swift +17 -0
  198. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollContentBackground.swift +15 -0
  199. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollDisabled.swift +12 -0
  200. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollDismissesKeyboard.swift +29 -0
  201. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollIndicators.swift +26 -0
  202. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollPosition.swift +67 -0
  203. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollTargetBehavior.swift +26 -0
  204. package/apple/Sources/ReactNativeWatchOS/Modifiers/ScrollTargetLayout.swift +18 -0
  205. package/apple/Sources/ReactNativeWatchOS/Modifiers/SearchCompletion.swift +21 -0
  206. package/apple/Sources/ReactNativeWatchOS/Modifiers/SearchPresentationToolbarBehavior.swift +19 -0
  207. package/apple/Sources/ReactNativeWatchOS/Modifiers/SearchSuggestions.swift +22 -0
  208. package/apple/Sources/ReactNativeWatchOS/Modifiers/SearchToolbarBehavior.swift +19 -0
  209. package/apple/Sources/ReactNativeWatchOS/Modifiers/Searchable.swift +26 -0
  210. package/apple/Sources/ReactNativeWatchOS/Modifiers/SelectionDisabled.swift +16 -0
  211. package/apple/Sources/ReactNativeWatchOS/Modifiers/SensoryFeedback.swift +74 -0
  212. package/apple/Sources/ReactNativeWatchOS/Modifiers/Shadow.swift +20 -0
  213. package/apple/Sources/ReactNativeWatchOS/Modifiers/Sheet.swift +64 -0
  214. package/apple/Sources/ReactNativeWatchOS/Modifiers/SimultaneousGesture.swift +12 -0
  215. package/apple/Sources/ReactNativeWatchOS/Modifiers/SpringLoadingBehavior.swift +20 -0
  216. package/apple/Sources/ReactNativeWatchOS/Modifiers/Strikethrough.swift +15 -0
  217. package/apple/Sources/ReactNativeWatchOS/Modifiers/SubmitLabel.swift +29 -0
  218. package/apple/Sources/ReactNativeWatchOS/Modifiers/SwipeActions.swift +19 -0
  219. package/apple/Sources/ReactNativeWatchOS/Modifiers/TabItem.swift +16 -0
  220. package/apple/Sources/ReactNativeWatchOS/Modifiers/TabViewStyle.swift +28 -0
  221. package/apple/Sources/ReactNativeWatchOS/Modifiers/Tag.swift +13 -0
  222. package/apple/Sources/ReactNativeWatchOS/Modifiers/Task.swift +15 -0
  223. package/apple/Sources/ReactNativeWatchOS/Modifiers/TextCase.swift +20 -0
  224. package/apple/Sources/ReactNativeWatchOS/Modifiers/TextContentType.swift +35 -0
  225. package/apple/Sources/ReactNativeWatchOS/Modifiers/TextFieldStyle.swift +14 -0
  226. package/apple/Sources/ReactNativeWatchOS/Modifiers/TextInputAutocapitalization.swift +25 -0
  227. package/apple/Sources/ReactNativeWatchOS/Modifiers/TextScale.swift +19 -0
  228. package/apple/Sources/ReactNativeWatchOS/Modifiers/Tint.swift +17 -0
  229. package/apple/Sources/ReactNativeWatchOS/Modifiers/ToggleStyle.swift +19 -0
  230. package/apple/Sources/ReactNativeWatchOS/Modifiers/Toolbar.swift +22 -0
  231. package/apple/Sources/ReactNativeWatchOS/Modifiers/ToolbarBackground.swift +37 -0
  232. package/apple/Sources/ReactNativeWatchOS/Modifiers/ToolbarColorScheme.swift +25 -0
  233. package/apple/Sources/ReactNativeWatchOS/Modifiers/ToolbarTitleDisplayMode.swift +22 -0
  234. package/apple/Sources/ReactNativeWatchOS/Modifiers/ToolbarTitleMenu.swift +16 -0
  235. package/apple/Sources/ReactNativeWatchOS/Modifiers/ToolbarVisibility.swift +18 -0
  236. package/apple/Sources/ReactNativeWatchOS/Modifiers/Tracking.swift +13 -0
  237. package/apple/Sources/ReactNativeWatchOS/Modifiers/TransformEffect.swift +28 -0
  238. package/apple/Sources/ReactNativeWatchOS/Modifiers/Transition.swift +33 -0
  239. package/apple/Sources/ReactNativeWatchOS/Modifiers/TruncationMode.swift +19 -0
  240. package/apple/Sources/ReactNativeWatchOS/Modifiers/Underline.swift +15 -0
  241. package/apple/Sources/ReactNativeWatchOS/Modifiers/Unredacted.swift +12 -0
  242. package/apple/Sources/ReactNativeWatchOS/Modifiers/ZIndex.swift +12 -0
  243. package/apple/Sources/ReactNativeWatchOS/RNWRootView.swift +141 -0
  244. package/apple/Sources/ReactNativeWatchOS/ReactNativeWatchOS.swift +290 -0
  245. package/apple/Sources/ReactNativeWatchOS/ReactNativeWatchOSView.swift +100 -0
  246. package/apple/Sources/ReactNativeWatchOS/Registry/ColorParser.swift +51 -0
  247. package/apple/Sources/ReactNativeWatchOS/Registry/ImageModifierRegistry.swift +31 -0
  248. package/apple/Sources/ReactNativeWatchOS/Registry/ModifierRegistry.swift +38 -0
  249. package/apple/Sources/ReactNativeWatchOS/Registry/ParamCoercion.swift +25 -0
  250. package/apple/Sources/ReactNativeWatchOS/Registry/ParsersShared.swift +166 -0
  251. package/apple/Sources/ReactNativeWatchOS/Registry/RNWModifierContext.swift +37 -0
  252. package/apple/Sources/ReactNativeWatchOS/Registry/RNWNodeRenderer.swift +56 -0
  253. package/apple/Sources/ReactNativeWatchOS/Registry/ShadowNodeSnapshot+Children.swift +11 -0
  254. package/apple/Sources/ReactNativeWatchOS/Registry/TextModifierRegistry.swift +30 -0
  255. package/apple/Sources/ReactNativeWatchOS/Registry/ViewRegistry.swift +30 -0
  256. package/apple/Sources/ReactNativeWatchOS/Views/AngularGradientView.swift +41 -0
  257. package/apple/Sources/ReactNativeWatchOS/Views/AsyncImageView.swift +168 -0
  258. package/apple/Sources/ReactNativeWatchOS/Views/ButtonView.swift +23 -0
  259. package/apple/Sources/ReactNativeWatchOS/Views/CapsuleView.swift +11 -0
  260. package/apple/Sources/ReactNativeWatchOS/Views/CircleView.swift +11 -0
  261. package/apple/Sources/ReactNativeWatchOS/Views/ColorView.swift +22 -0
  262. package/apple/Sources/ReactNativeWatchOS/Views/ContentUnavailableViewView.swift +87 -0
  263. package/apple/Sources/ReactNativeWatchOS/Views/DatePickerView.swift +90 -0
  264. package/apple/Sources/ReactNativeWatchOS/Views/DividerView.swift +11 -0
  265. package/apple/Sources/ReactNativeWatchOS/Views/EllipseView.swift +11 -0
  266. package/apple/Sources/ReactNativeWatchOS/Views/EmptyViewView.swift +11 -0
  267. package/apple/Sources/ReactNativeWatchOS/Views/FormView.swift +14 -0
  268. package/apple/Sources/ReactNativeWatchOS/Views/GaugeView.swift +35 -0
  269. package/apple/Sources/ReactNativeWatchOS/Views/GeometryReaderView.swift +14 -0
  270. package/apple/Sources/ReactNativeWatchOS/Views/GridRowView.swift +27 -0
  271. package/apple/Sources/ReactNativeWatchOS/Views/GridView.swift +37 -0
  272. package/apple/Sources/ReactNativeWatchOS/Views/GroupView.swift +15 -0
  273. package/apple/Sources/ReactNativeWatchOS/Views/HStackView.swift +27 -0
  274. package/apple/Sources/ReactNativeWatchOS/Views/ImageView.swift +31 -0
  275. package/apple/Sources/ReactNativeWatchOS/Views/LabelView.swift +18 -0
  276. package/apple/Sources/ReactNativeWatchOS/Views/LabeledContentView.swift +55 -0
  277. package/apple/Sources/ReactNativeWatchOS/Views/LazyHGridView.swift +33 -0
  278. package/apple/Sources/ReactNativeWatchOS/Views/LazyHStackView.swift +41 -0
  279. package/apple/Sources/ReactNativeWatchOS/Views/LazyVGridView.swift +97 -0
  280. package/apple/Sources/ReactNativeWatchOS/Views/LazyVStackView.swift +39 -0
  281. package/apple/Sources/ReactNativeWatchOS/Views/LinearGradientView.swift +44 -0
  282. package/apple/Sources/ReactNativeWatchOS/Views/LinkView.swift +20 -0
  283. package/apple/Sources/ReactNativeWatchOS/Views/ListView.swift +27 -0
  284. package/apple/Sources/ReactNativeWatchOS/Views/ModifierContentView.swift +16 -0
  285. package/apple/Sources/ReactNativeWatchOS/Views/NavigationLinkDestinationView.swift +14 -0
  286. package/apple/Sources/ReactNativeWatchOS/Views/NavigationLinkLabelView.swift +15 -0
  287. package/apple/Sources/ReactNativeWatchOS/Views/NavigationLinkView.swift +40 -0
  288. package/apple/Sources/ReactNativeWatchOS/Views/NavigationStackView.swift +15 -0
  289. package/apple/Sources/ReactNativeWatchOS/Views/PickerView.swift +69 -0
  290. package/apple/Sources/ReactNativeWatchOS/Views/ProgressViewView.swift +44 -0
  291. package/apple/Sources/ReactNativeWatchOS/Views/RadialGradientView.swift +22 -0
  292. package/apple/Sources/ReactNativeWatchOS/Views/RectangleView.swift +11 -0
  293. package/apple/Sources/ReactNativeWatchOS/Views/RoundedRectangleView.swift +15 -0
  294. package/apple/Sources/ReactNativeWatchOS/Views/ScrollViewReaderView.swift +14 -0
  295. package/apple/Sources/ReactNativeWatchOS/Views/ScrollViewView.swift +25 -0
  296. package/apple/Sources/ReactNativeWatchOS/Views/SectionFooterView.swift +15 -0
  297. package/apple/Sources/ReactNativeWatchOS/Views/SectionHeaderView.swift +15 -0
  298. package/apple/Sources/ReactNativeWatchOS/Views/SectionView.swift +45 -0
  299. package/apple/Sources/ReactNativeWatchOS/Views/SecureFieldView.swift +49 -0
  300. package/apple/Sources/ReactNativeWatchOS/Views/ShareLinkView.swift +27 -0
  301. package/apple/Sources/ReactNativeWatchOS/Views/SliderView.swift +60 -0
  302. package/apple/Sources/ReactNativeWatchOS/Views/SpacerView.swift +13 -0
  303. package/apple/Sources/ReactNativeWatchOS/Views/StepperView.swift +61 -0
  304. package/apple/Sources/ReactNativeWatchOS/Views/TabViewView.swift +88 -0
  305. package/apple/Sources/ReactNativeWatchOS/Views/TextFieldView.swift +50 -0
  306. package/apple/Sources/ReactNativeWatchOS/Views/TextView.swift +37 -0
  307. package/apple/Sources/ReactNativeWatchOS/Views/TimelineViewView.swift +42 -0
  308. package/apple/Sources/ReactNativeWatchOS/Views/ToggleView.swift +58 -0
  309. package/apple/Sources/ReactNativeWatchOS/Views/VStackView.swift +25 -0
  310. package/apple/Sources/ReactNativeWatchOS/Views/ViewThatFitsView.swift +20 -0
  311. package/apple/Sources/ReactNativeWatchOS/Views/ZStackView.swift +30 -0
  312. package/apple/Sources/ReactNativeWatchOSCxx/RNWCallInvoker.h +175 -0
  313. package/apple/Sources/ReactNativeWatchOSCxx/RNWHermesHost.mm +485 -0
  314. package/apple/Sources/ReactNativeWatchOSCxx/RNWRCTEventEmitter.mm +32 -0
  315. package/apple/Sources/ReactNativeWatchOSCxx/RNWShadowNode.mm +24 -0
  316. package/apple/Sources/ReactNativeWatchOSCxx/RNWTurboModule.mm +706 -0
  317. package/apple/Sources/ReactNativeWatchOSCxx/RNWTurboModuleRegistry.mm +137 -0
  318. package/apple/Sources/ReactNativeWatchOSCxx/RNWUIManager.h +19 -0
  319. package/apple/Sources/ReactNativeWatchOSCxx/RNWUIManager.mm +383 -0
  320. package/apple/Sources/ReactNativeWatchOSCxx/RNWWebSocket.h +20 -0
  321. package/apple/Sources/ReactNativeWatchOSCxx/RNWWebSocket.mm +328 -0
  322. package/apple/Sources/ReactNativeWatchOSCxx/RNWXHR.h +22 -0
  323. package/apple/Sources/ReactNativeWatchOSCxx/RNWXHR.mm +597 -0
  324. package/apple/Sources/ReactNativeWatchOSCxx/include/RCTRequired/RCTRequired.h +13 -0
  325. package/apple/Sources/ReactNativeWatchOSCxx/include/RCTTypeSafety/RCTConvertHelpers.h +7 -0
  326. package/apple/Sources/ReactNativeWatchOSCxx/include/RCTTypeSafety/RCTTypedModuleConstants.h +7 -0
  327. package/apple/Sources/ReactNativeWatchOSCxx/include/React/RCTBridgeModule.h +88 -0
  328. package/apple/Sources/ReactNativeWatchOSCxx/include/React/RCTCxxConvert.h +7 -0
  329. package/apple/Sources/ReactNativeWatchOSCxx/include/React/RCTEventEmitter.h +71 -0
  330. package/apple/Sources/ReactNativeWatchOSCxx/include/React/RCTManagedPointer.h +7 -0
  331. package/apple/Sources/ReactNativeWatchOSCxx/include/ReactCommon/RCTTurboModule.h +187 -0
  332. package/apple/Sources/ReactNativeWatchOSCxx/include/ReactNativeWatchOSCxx/RNWHermesHost.h +58 -0
  333. package/apple/Sources/ReactNativeWatchOSCxx/include/ReactNativeWatchOSCxx/RNWShadowNode.h +49 -0
  334. package/apple/Sources/ReactNativeWatchOSCxx/include/ReactNativeWatchOSCxx/RNWTurboModuleRegistry+Cxx.h +64 -0
  335. package/apple/Sources/ReactNativeWatchOSCxx/include/ReactNativeWatchOSCxx/RNWTurboModuleRegistry.h +24 -0
  336. package/apple/Sources/ReactNativeWatchOSCxx/include/ReactNativeWatchOSCxx/module.modulemap +25 -0
  337. package/apple/Sources/WatchConnectivity/RNWWatchConnectivity.h +23 -0
  338. package/apple/Sources/WatchConnectivity/RNWWatchConnectivity.mm +406 -0
  339. package/build/xcframework/Hermes.xcframework/Info.plist +43 -0
  340. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/AsyncDebuggerAPI.h +304 -0
  341. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/CompileJS.h +73 -0
  342. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/DebuggerAPI.h +505 -0
  343. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/Buffer.h +42 -0
  344. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/CrashManager.h +107 -0
  345. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/CtorConfig.h +148 -0
  346. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/DebuggerTypes.h +200 -0
  347. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/GCConfig.h +231 -0
  348. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/GCTripwireContext.h +43 -0
  349. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/HermesExport.h +14 -0
  350. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/JSOutOfMemoryError.h +30 -0
  351. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/RuntimeConfig.h +135 -0
  352. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/Public/SamplingProfiler.h +273 -0
  353. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/RuntimeTaskRunner.h +67 -0
  354. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/SynthTrace.h +1527 -0
  355. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/SynthTraceParser.h +40 -0
  356. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/ThreadSafetyAnalysis.h +78 -0
  357. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/TimerStats.h +23 -0
  358. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/TraceInterpreter.h +284 -0
  359. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/TracingRuntime.h +315 -0
  360. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/hermes.h +211 -0
  361. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Headers/hermes_tracing.h +55 -0
  362. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/Info.plist +28 -0
  363. package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/hermes +0 -0
  364. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/AsyncDebuggerAPI.h +304 -0
  365. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/CompileJS.h +73 -0
  366. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/DebuggerAPI.h +505 -0
  367. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/Buffer.h +42 -0
  368. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/CrashManager.h +107 -0
  369. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/CtorConfig.h +148 -0
  370. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/DebuggerTypes.h +200 -0
  371. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/GCConfig.h +231 -0
  372. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/GCTripwireContext.h +43 -0
  373. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/HermesExport.h +14 -0
  374. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/JSOutOfMemoryError.h +30 -0
  375. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/RuntimeConfig.h +135 -0
  376. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/Public/SamplingProfiler.h +273 -0
  377. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/RuntimeTaskRunner.h +67 -0
  378. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/SynthTrace.h +1527 -0
  379. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/SynthTraceParser.h +40 -0
  380. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/ThreadSafetyAnalysis.h +78 -0
  381. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/TimerStats.h +23 -0
  382. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/TraceInterpreter.h +284 -0
  383. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/TracingRuntime.h +315 -0
  384. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/hermes.h +211 -0
  385. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Headers/hermes_tracing.h +55 -0
  386. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/Info.plist +28 -0
  387. package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/hermes +0 -0
  388. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/Info.plist +47 -0
  389. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/RCTRequired/RCTRequired.h +13 -0
  390. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/RCTTypeSafety/RCTConvertHelpers.h +7 -0
  391. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/RCTTypeSafety/RCTTypedModuleConstants.h +7 -0
  392. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/CallInvoker.h +64 -0
  393. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/CallbackWrapper.h +11 -0
  394. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/CxxTurboModuleUtils.h +35 -0
  395. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/LongLivedObject.h +11 -0
  396. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/RCTTurboModule.h +187 -0
  397. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/RuntimeExecutor.h +25 -0
  398. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/SchedulerPriority.h +20 -0
  399. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/TurboCxxModule.h +49 -0
  400. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/TurboModule.h +162 -0
  401. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/TurboModuleBinding.h +59 -0
  402. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/TurboModulePerfLogger.h +108 -0
  403. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/TurboModuleUtils.h +38 -0
  404. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactCommon/TurboModuleWithJSIBindings.h +29 -0
  405. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactNativeWatchOSCxx/RNWHermesHost.h +58 -0
  406. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactNativeWatchOSCxx/RNWShadowNode.h +49 -0
  407. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactNativeWatchOSCxx/RNWTurboModuleRegistry+Cxx.h +64 -0
  408. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/ReactNativeWatchOSCxx/RNWTurboModuleRegistry.h +24 -0
  409. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/jsi/decorator.h +1064 -0
  410. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/jsi/hermes-interfaces.h +189 -0
  411. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/jsi/instrumentation.h +132 -0
  412. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/jsi/jsi-inl.h +405 -0
  413. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/jsi/jsi.h +1937 -0
  414. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/jsi/jsilib.h +59 -0
  415. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/jsi/test/testlib.h +49 -0
  416. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/jsi/threadsafe.h +79 -0
  417. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/module.modulemap +25 -0
  418. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/RCTBridgeModule.h +88 -0
  419. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/RCTCxxConvert.h +7 -0
  420. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/RCTEventEmitter.h +71 -0
  421. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/RCTManagedPointer.h +7 -0
  422. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/AString.h +42 -0
  423. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Array.h +151 -0
  424. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Base.h +188 -0
  425. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Bool.h +25 -0
  426. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Bridging.h +22 -0
  427. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/CallbackWrapper.h +67 -0
  428. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Class.h +93 -0
  429. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Convert.h +170 -0
  430. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Dynamic.h +26 -0
  431. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Error.h +51 -0
  432. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/EventEmitter.h +134 -0
  433. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Function.h +283 -0
  434. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/HighResTimeStamp.h +41 -0
  435. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/LongLivedObject.h +61 -0
  436. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Number.h +58 -0
  437. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Object.h +93 -0
  438. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Promise.h +110 -0
  439. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/Value.h +107 -0
  440. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/bridging/tests/BridgingTest.h +77 -0
  441. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/debug/flags.h +22 -0
  442. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/debug/react_native_assert.h +72 -0
  443. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/debug/react_native_expect.h +43 -0
  444. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/featureflags/ReactNativeFeatureFlags.h +402 -0
  445. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/featureflags/ReactNativeFeatureFlagsAccessor.h +172 -0
  446. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/featureflags/ReactNativeFeatureFlagsDefaults.h +275 -0
  447. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +598 -0
  448. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +51 -0
  449. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +43 -0
  450. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +33 -0
  451. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/featureflags/ReactNativeFeatureFlagsProvider.h +91 -0
  452. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/ContextContainer.h +110 -0
  453. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/FloatComparison.h +23 -0
  454. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/ManagedObjectWrapper.h +80 -0
  455. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/OnScopeExit.h +36 -0
  456. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/PackTraits.h +29 -0
  457. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/RunLoopObserver.h +125 -0
  458. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/SharedFunction.h +63 -0
  459. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/SimpleThreadSafeCache.h +88 -0
  460. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/Telemetry.h +113 -0
  461. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/TemplateStringLiteral.h +35 -0
  462. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/fnv1a.h +53 -0
  463. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/hash_combine.h +33 -0
  464. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/iequals.h +32 -0
  465. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/jsi-utils.h +31 -0
  466. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/platform/android/react/utils/LowPriorityExecutor.h +14 -0
  467. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/platform/cxx/react/utils/LowPriorityExecutor.h +18 -0
  468. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/platform/ios/react/utils/FollyConvert.h +18 -0
  469. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/platform/ios/react/utils/LowPriorityExecutor.h +16 -0
  470. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/toLower.h +22 -0
  471. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/Headers/react/utils/to_underlying.h +22 -0
  472. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/libReactNativeWatchOSCxx.a +0 -0
  473. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/RCTRequired/RCTRequired.h +13 -0
  474. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/RCTTypeSafety/RCTConvertHelpers.h +7 -0
  475. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/RCTTypeSafety/RCTTypedModuleConstants.h +7 -0
  476. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/CallInvoker.h +64 -0
  477. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/CallbackWrapper.h +11 -0
  478. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/CxxTurboModuleUtils.h +35 -0
  479. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/LongLivedObject.h +11 -0
  480. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/RCTTurboModule.h +187 -0
  481. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/RuntimeExecutor.h +25 -0
  482. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/SchedulerPriority.h +20 -0
  483. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/TurboCxxModule.h +49 -0
  484. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/TurboModule.h +162 -0
  485. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/TurboModuleBinding.h +59 -0
  486. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/TurboModulePerfLogger.h +108 -0
  487. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/TurboModuleUtils.h +38 -0
  488. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactCommon/TurboModuleWithJSIBindings.h +29 -0
  489. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactNativeWatchOSCxx/RNWHermesHost.h +58 -0
  490. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactNativeWatchOSCxx/RNWShadowNode.h +49 -0
  491. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactNativeWatchOSCxx/RNWTurboModuleRegistry+Cxx.h +64 -0
  492. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/ReactNativeWatchOSCxx/RNWTurboModuleRegistry.h +24 -0
  493. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/jsi/decorator.h +1064 -0
  494. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/jsi/hermes-interfaces.h +189 -0
  495. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/jsi/instrumentation.h +132 -0
  496. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/jsi/jsi-inl.h +405 -0
  497. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/jsi/jsi.h +1937 -0
  498. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/jsi/jsilib.h +59 -0
  499. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/jsi/test/testlib.h +49 -0
  500. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/jsi/threadsafe.h +79 -0
  501. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/module.modulemap +25 -0
  502. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/RCTBridgeModule.h +88 -0
  503. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/RCTCxxConvert.h +7 -0
  504. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/RCTEventEmitter.h +71 -0
  505. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/RCTManagedPointer.h +7 -0
  506. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/AString.h +42 -0
  507. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Array.h +151 -0
  508. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Base.h +188 -0
  509. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Bool.h +25 -0
  510. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Bridging.h +22 -0
  511. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/CallbackWrapper.h +67 -0
  512. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Class.h +93 -0
  513. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Convert.h +170 -0
  514. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Dynamic.h +26 -0
  515. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Error.h +51 -0
  516. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/EventEmitter.h +134 -0
  517. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Function.h +283 -0
  518. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/HighResTimeStamp.h +41 -0
  519. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/LongLivedObject.h +61 -0
  520. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Number.h +58 -0
  521. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Object.h +93 -0
  522. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Promise.h +110 -0
  523. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/Value.h +107 -0
  524. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/bridging/tests/BridgingTest.h +77 -0
  525. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/debug/flags.h +22 -0
  526. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/debug/react_native_assert.h +72 -0
  527. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/debug/react_native_expect.h +43 -0
  528. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/featureflags/ReactNativeFeatureFlags.h +402 -0
  529. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/featureflags/ReactNativeFeatureFlagsAccessor.h +172 -0
  530. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/featureflags/ReactNativeFeatureFlagsDefaults.h +275 -0
  531. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +598 -0
  532. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +51 -0
  533. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +43 -0
  534. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +33 -0
  535. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/featureflags/ReactNativeFeatureFlagsProvider.h +91 -0
  536. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/ContextContainer.h +110 -0
  537. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/FloatComparison.h +23 -0
  538. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/ManagedObjectWrapper.h +80 -0
  539. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/OnScopeExit.h +36 -0
  540. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/PackTraits.h +29 -0
  541. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/RunLoopObserver.h +125 -0
  542. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/SharedFunction.h +63 -0
  543. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/SimpleThreadSafeCache.h +88 -0
  544. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/Telemetry.h +113 -0
  545. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/TemplateStringLiteral.h +35 -0
  546. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/fnv1a.h +53 -0
  547. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/hash_combine.h +33 -0
  548. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/iequals.h +32 -0
  549. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/jsi-utils.h +31 -0
  550. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/platform/android/react/utils/LowPriorityExecutor.h +14 -0
  551. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/platform/cxx/react/utils/LowPriorityExecutor.h +18 -0
  552. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/platform/ios/react/utils/FollyConvert.h +18 -0
  553. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/platform/ios/react/utils/LowPriorityExecutor.h +16 -0
  554. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/toLower.h +22 -0
  555. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/Headers/react/utils/to_underlying.h +22 -0
  556. package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/libReactNativeWatchOSCxx.a +0 -0
  557. package/build/xcframework/device/Headers/RCTRequired/RCTRequired.h +13 -0
  558. package/build/xcframework/device/Headers/RCTTypeSafety/RCTConvertHelpers.h +7 -0
  559. package/build/xcframework/device/Headers/RCTTypeSafety/RCTTypedModuleConstants.h +7 -0
  560. package/build/xcframework/device/Headers/ReactCommon/CallInvoker.h +64 -0
  561. package/build/xcframework/device/Headers/ReactCommon/CallbackWrapper.h +11 -0
  562. package/build/xcframework/device/Headers/ReactCommon/CxxTurboModuleUtils.h +35 -0
  563. package/build/xcframework/device/Headers/ReactCommon/LongLivedObject.h +11 -0
  564. package/build/xcframework/device/Headers/ReactCommon/RCTTurboModule.h +187 -0
  565. package/build/xcframework/device/Headers/ReactCommon/RuntimeExecutor.h +25 -0
  566. package/build/xcframework/device/Headers/ReactCommon/SchedulerPriority.h +20 -0
  567. package/build/xcframework/device/Headers/ReactCommon/TurboCxxModule.h +49 -0
  568. package/build/xcframework/device/Headers/ReactCommon/TurboModule.h +162 -0
  569. package/build/xcframework/device/Headers/ReactCommon/TurboModuleBinding.h +59 -0
  570. package/build/xcframework/device/Headers/ReactCommon/TurboModulePerfLogger.h +108 -0
  571. package/build/xcframework/device/Headers/ReactCommon/TurboModuleUtils.h +38 -0
  572. package/build/xcframework/device/Headers/ReactCommon/TurboModuleWithJSIBindings.h +29 -0
  573. package/build/xcframework/device/Headers/ReactNativeWatchOSCxx/RNWHermesHost.h +58 -0
  574. package/build/xcframework/device/Headers/ReactNativeWatchOSCxx/RNWShadowNode.h +49 -0
  575. package/build/xcframework/device/Headers/ReactNativeWatchOSCxx/RNWTurboModuleRegistry+Cxx.h +64 -0
  576. package/build/xcframework/device/Headers/ReactNativeWatchOSCxx/RNWTurboModuleRegistry.h +24 -0
  577. package/build/xcframework/device/Headers/jsi/decorator.h +1064 -0
  578. package/build/xcframework/device/Headers/jsi/hermes-interfaces.h +189 -0
  579. package/build/xcframework/device/Headers/jsi/instrumentation.h +132 -0
  580. package/build/xcframework/device/Headers/jsi/jsi-inl.h +405 -0
  581. package/build/xcframework/device/Headers/jsi/jsi.h +1937 -0
  582. package/build/xcframework/device/Headers/jsi/jsilib.h +59 -0
  583. package/build/xcframework/device/Headers/jsi/test/testlib.h +49 -0
  584. package/build/xcframework/device/Headers/jsi/threadsafe.h +79 -0
  585. package/build/xcframework/device/Headers/module.modulemap +25 -0
  586. package/build/xcframework/device/Headers/react/RCTBridgeModule.h +88 -0
  587. package/build/xcframework/device/Headers/react/RCTCxxConvert.h +7 -0
  588. package/build/xcframework/device/Headers/react/RCTEventEmitter.h +71 -0
  589. package/build/xcframework/device/Headers/react/RCTManagedPointer.h +7 -0
  590. package/build/xcframework/device/Headers/react/bridging/AString.h +42 -0
  591. package/build/xcframework/device/Headers/react/bridging/Array.h +151 -0
  592. package/build/xcframework/device/Headers/react/bridging/Base.h +188 -0
  593. package/build/xcframework/device/Headers/react/bridging/Bool.h +25 -0
  594. package/build/xcframework/device/Headers/react/bridging/Bridging.h +22 -0
  595. package/build/xcframework/device/Headers/react/bridging/CallbackWrapper.h +67 -0
  596. package/build/xcframework/device/Headers/react/bridging/Class.h +93 -0
  597. package/build/xcframework/device/Headers/react/bridging/Convert.h +170 -0
  598. package/build/xcframework/device/Headers/react/bridging/Dynamic.h +26 -0
  599. package/build/xcframework/device/Headers/react/bridging/Error.h +51 -0
  600. package/build/xcframework/device/Headers/react/bridging/EventEmitter.h +134 -0
  601. package/build/xcframework/device/Headers/react/bridging/Function.h +283 -0
  602. package/build/xcframework/device/Headers/react/bridging/HighResTimeStamp.h +41 -0
  603. package/build/xcframework/device/Headers/react/bridging/LongLivedObject.h +61 -0
  604. package/build/xcframework/device/Headers/react/bridging/Number.h +58 -0
  605. package/build/xcframework/device/Headers/react/bridging/Object.h +93 -0
  606. package/build/xcframework/device/Headers/react/bridging/Promise.h +110 -0
  607. package/build/xcframework/device/Headers/react/bridging/Value.h +107 -0
  608. package/build/xcframework/device/Headers/react/bridging/tests/BridgingTest.h +77 -0
  609. package/build/xcframework/device/Headers/react/debug/flags.h +22 -0
  610. package/build/xcframework/device/Headers/react/debug/react_native_assert.h +72 -0
  611. package/build/xcframework/device/Headers/react/debug/react_native_expect.h +43 -0
  612. package/build/xcframework/device/Headers/react/featureflags/ReactNativeFeatureFlags.h +402 -0
  613. package/build/xcframework/device/Headers/react/featureflags/ReactNativeFeatureFlagsAccessor.h +172 -0
  614. package/build/xcframework/device/Headers/react/featureflags/ReactNativeFeatureFlagsDefaults.h +275 -0
  615. package/build/xcframework/device/Headers/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +598 -0
  616. package/build/xcframework/device/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +51 -0
  617. package/build/xcframework/device/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +43 -0
  618. package/build/xcframework/device/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +33 -0
  619. package/build/xcframework/device/Headers/react/featureflags/ReactNativeFeatureFlagsProvider.h +91 -0
  620. package/build/xcframework/device/Headers/react/utils/ContextContainer.h +110 -0
  621. package/build/xcframework/device/Headers/react/utils/FloatComparison.h +23 -0
  622. package/build/xcframework/device/Headers/react/utils/ManagedObjectWrapper.h +80 -0
  623. package/build/xcframework/device/Headers/react/utils/OnScopeExit.h +36 -0
  624. package/build/xcframework/device/Headers/react/utils/PackTraits.h +29 -0
  625. package/build/xcframework/device/Headers/react/utils/RunLoopObserver.h +125 -0
  626. package/build/xcframework/device/Headers/react/utils/SharedFunction.h +63 -0
  627. package/build/xcframework/device/Headers/react/utils/SimpleThreadSafeCache.h +88 -0
  628. package/build/xcframework/device/Headers/react/utils/Telemetry.h +113 -0
  629. package/build/xcframework/device/Headers/react/utils/TemplateStringLiteral.h +35 -0
  630. package/build/xcframework/device/Headers/react/utils/fnv1a.h +53 -0
  631. package/build/xcframework/device/Headers/react/utils/hash_combine.h +33 -0
  632. package/build/xcframework/device/Headers/react/utils/iequals.h +32 -0
  633. package/build/xcframework/device/Headers/react/utils/jsi-utils.h +31 -0
  634. package/build/xcframework/device/Headers/react/utils/platform/android/react/utils/LowPriorityExecutor.h +14 -0
  635. package/build/xcframework/device/Headers/react/utils/platform/cxx/react/utils/LowPriorityExecutor.h +18 -0
  636. package/build/xcframework/device/Headers/react/utils/platform/ios/react/utils/FollyConvert.h +18 -0
  637. package/build/xcframework/device/Headers/react/utils/platform/ios/react/utils/LowPriorityExecutor.h +16 -0
  638. package/build/xcframework/device/Headers/react/utils/toLower.h +22 -0
  639. package/build/xcframework/device/Headers/react/utils/to_underlying.h +22 -0
  640. package/build/xcframework/device/libReactNativeWatchOSCxx.a +0 -0
  641. package/build/xcframework/simulator/Headers/RCTRequired/RCTRequired.h +13 -0
  642. package/build/xcframework/simulator/Headers/RCTTypeSafety/RCTConvertHelpers.h +7 -0
  643. package/build/xcframework/simulator/Headers/RCTTypeSafety/RCTTypedModuleConstants.h +7 -0
  644. package/build/xcframework/simulator/Headers/ReactCommon/CallInvoker.h +64 -0
  645. package/build/xcframework/simulator/Headers/ReactCommon/CallbackWrapper.h +11 -0
  646. package/build/xcframework/simulator/Headers/ReactCommon/CxxTurboModuleUtils.h +35 -0
  647. package/build/xcframework/simulator/Headers/ReactCommon/LongLivedObject.h +11 -0
  648. package/build/xcframework/simulator/Headers/ReactCommon/RCTTurboModule.h +187 -0
  649. package/build/xcframework/simulator/Headers/ReactCommon/RuntimeExecutor.h +25 -0
  650. package/build/xcframework/simulator/Headers/ReactCommon/SchedulerPriority.h +20 -0
  651. package/build/xcframework/simulator/Headers/ReactCommon/TurboCxxModule.h +49 -0
  652. package/build/xcframework/simulator/Headers/ReactCommon/TurboModule.h +162 -0
  653. package/build/xcframework/simulator/Headers/ReactCommon/TurboModuleBinding.h +59 -0
  654. package/build/xcframework/simulator/Headers/ReactCommon/TurboModulePerfLogger.h +108 -0
  655. package/build/xcframework/simulator/Headers/ReactCommon/TurboModuleUtils.h +38 -0
  656. package/build/xcframework/simulator/Headers/ReactCommon/TurboModuleWithJSIBindings.h +29 -0
  657. package/build/xcframework/simulator/Headers/ReactNativeWatchOSCxx/RNWHermesHost.h +58 -0
  658. package/build/xcframework/simulator/Headers/ReactNativeWatchOSCxx/RNWShadowNode.h +49 -0
  659. package/build/xcframework/simulator/Headers/ReactNativeWatchOSCxx/RNWTurboModuleRegistry+Cxx.h +64 -0
  660. package/build/xcframework/simulator/Headers/ReactNativeWatchOSCxx/RNWTurboModuleRegistry.h +24 -0
  661. package/build/xcframework/simulator/Headers/jsi/decorator.h +1064 -0
  662. package/build/xcframework/simulator/Headers/jsi/hermes-interfaces.h +189 -0
  663. package/build/xcframework/simulator/Headers/jsi/instrumentation.h +132 -0
  664. package/build/xcframework/simulator/Headers/jsi/jsi-inl.h +405 -0
  665. package/build/xcframework/simulator/Headers/jsi/jsi.h +1937 -0
  666. package/build/xcframework/simulator/Headers/jsi/jsilib.h +59 -0
  667. package/build/xcframework/simulator/Headers/jsi/test/testlib.h +49 -0
  668. package/build/xcframework/simulator/Headers/jsi/threadsafe.h +79 -0
  669. package/build/xcframework/simulator/Headers/module.modulemap +25 -0
  670. package/build/xcframework/simulator/Headers/react/RCTBridgeModule.h +88 -0
  671. package/build/xcframework/simulator/Headers/react/RCTCxxConvert.h +7 -0
  672. package/build/xcframework/simulator/Headers/react/RCTEventEmitter.h +71 -0
  673. package/build/xcframework/simulator/Headers/react/RCTManagedPointer.h +7 -0
  674. package/build/xcframework/simulator/Headers/react/bridging/AString.h +42 -0
  675. package/build/xcframework/simulator/Headers/react/bridging/Array.h +151 -0
  676. package/build/xcframework/simulator/Headers/react/bridging/Base.h +188 -0
  677. package/build/xcframework/simulator/Headers/react/bridging/Bool.h +25 -0
  678. package/build/xcframework/simulator/Headers/react/bridging/Bridging.h +22 -0
  679. package/build/xcframework/simulator/Headers/react/bridging/CallbackWrapper.h +67 -0
  680. package/build/xcframework/simulator/Headers/react/bridging/Class.h +93 -0
  681. package/build/xcframework/simulator/Headers/react/bridging/Convert.h +170 -0
  682. package/build/xcframework/simulator/Headers/react/bridging/Dynamic.h +26 -0
  683. package/build/xcframework/simulator/Headers/react/bridging/Error.h +51 -0
  684. package/build/xcframework/simulator/Headers/react/bridging/EventEmitter.h +134 -0
  685. package/build/xcframework/simulator/Headers/react/bridging/Function.h +283 -0
  686. package/build/xcframework/simulator/Headers/react/bridging/HighResTimeStamp.h +41 -0
  687. package/build/xcframework/simulator/Headers/react/bridging/LongLivedObject.h +61 -0
  688. package/build/xcframework/simulator/Headers/react/bridging/Number.h +58 -0
  689. package/build/xcframework/simulator/Headers/react/bridging/Object.h +93 -0
  690. package/build/xcframework/simulator/Headers/react/bridging/Promise.h +110 -0
  691. package/build/xcframework/simulator/Headers/react/bridging/Value.h +107 -0
  692. package/build/xcframework/simulator/Headers/react/bridging/tests/BridgingTest.h +77 -0
  693. package/build/xcframework/simulator/Headers/react/debug/flags.h +22 -0
  694. package/build/xcframework/simulator/Headers/react/debug/react_native_assert.h +72 -0
  695. package/build/xcframework/simulator/Headers/react/debug/react_native_expect.h +43 -0
  696. package/build/xcframework/simulator/Headers/react/featureflags/ReactNativeFeatureFlags.h +402 -0
  697. package/build/xcframework/simulator/Headers/react/featureflags/ReactNativeFeatureFlagsAccessor.h +172 -0
  698. package/build/xcframework/simulator/Headers/react/featureflags/ReactNativeFeatureFlagsDefaults.h +275 -0
  699. package/build/xcframework/simulator/Headers/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +598 -0
  700. package/build/xcframework/simulator/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +51 -0
  701. package/build/xcframework/simulator/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +43 -0
  702. package/build/xcframework/simulator/Headers/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +33 -0
  703. package/build/xcframework/simulator/Headers/react/featureflags/ReactNativeFeatureFlagsProvider.h +91 -0
  704. package/build/xcframework/simulator/Headers/react/utils/ContextContainer.h +110 -0
  705. package/build/xcframework/simulator/Headers/react/utils/FloatComparison.h +23 -0
  706. package/build/xcframework/simulator/Headers/react/utils/ManagedObjectWrapper.h +80 -0
  707. package/build/xcframework/simulator/Headers/react/utils/OnScopeExit.h +36 -0
  708. package/build/xcframework/simulator/Headers/react/utils/PackTraits.h +29 -0
  709. package/build/xcframework/simulator/Headers/react/utils/RunLoopObserver.h +125 -0
  710. package/build/xcframework/simulator/Headers/react/utils/SharedFunction.h +63 -0
  711. package/build/xcframework/simulator/Headers/react/utils/SimpleThreadSafeCache.h +88 -0
  712. package/build/xcframework/simulator/Headers/react/utils/Telemetry.h +113 -0
  713. package/build/xcframework/simulator/Headers/react/utils/TemplateStringLiteral.h +35 -0
  714. package/build/xcframework/simulator/Headers/react/utils/fnv1a.h +53 -0
  715. package/build/xcframework/simulator/Headers/react/utils/hash_combine.h +33 -0
  716. package/build/xcframework/simulator/Headers/react/utils/iequals.h +32 -0
  717. package/build/xcframework/simulator/Headers/react/utils/jsi-utils.h +31 -0
  718. package/build/xcframework/simulator/Headers/react/utils/platform/android/react/utils/LowPriorityExecutor.h +14 -0
  719. package/build/xcframework/simulator/Headers/react/utils/platform/cxx/react/utils/LowPriorityExecutor.h +18 -0
  720. package/build/xcframework/simulator/Headers/react/utils/platform/ios/react/utils/FollyConvert.h +18 -0
  721. package/build/xcframework/simulator/Headers/react/utils/platform/ios/react/utils/LowPriorityExecutor.h +16 -0
  722. package/build/xcframework/simulator/Headers/react/utils/toLower.h +22 -0
  723. package/build/xcframework/simulator/Headers/react/utils/to_underlying.h +22 -0
  724. package/build/xcframework/simulator/libReactNativeWatchOSCxx.a +0 -0
  725. package/cli/init.js +155 -0
  726. package/cocoapods/autolink.rb +76 -0
  727. package/metro-config.d.ts +23 -0
  728. package/metro-config.js +1 -0
  729. package/package.json +131 -0
  730. package/plugin/README.md +113 -0
  731. package/plugin/src/index.js +69 -0
  732. package/plugin/src/withSPMPackage.js +287 -0
  733. package/plugin/src/withWatchAutolinking.js +106 -0
  734. package/plugin/src/withWatchBundleScript.js +216 -0
  735. package/plugin/src/withWatchTurboModuleCodegen.js +469 -0
  736. package/plugin/src/withWatchosMetro.js +163 -0
  737. package/plugin/templates/ContentView.swift +29 -0
  738. package/plugin/templates/index.watchos.tsx +16 -0
  739. package/react-native.config.js +21 -0
  740. package/src/components/AngularGradient.tsx +15 -0
  741. package/src/components/AsyncImage.tsx +82 -0
  742. package/src/components/Button.tsx +25 -0
  743. package/src/components/Capsule.tsx +3 -0
  744. package/src/components/Circle.tsx +3 -0
  745. package/src/components/Color.tsx +57 -0
  746. package/src/components/ContentUnavailableView.tsx +47 -0
  747. package/src/components/DatePicker.tsx +40 -0
  748. package/src/components/Divider.tsx +3 -0
  749. package/src/components/Ellipse.tsx +3 -0
  750. package/src/components/EmptyView.tsx +3 -0
  751. package/src/components/Form.tsx +8 -0
  752. package/src/components/Gauge.tsx +21 -0
  753. package/src/components/GeometryReader.tsx +3 -0
  754. package/src/components/Grid.tsx +21 -0
  755. package/src/components/GridRow.tsx +9 -0
  756. package/src/components/Group.tsx +5 -0
  757. package/src/components/HStack.tsx +15 -0
  758. package/src/components/Image.tsx +10 -0
  759. package/src/components/Label.tsx +13 -0
  760. package/src/components/LabeledContent.tsx +39 -0
  761. package/src/components/LazyHGrid.tsx +16 -0
  762. package/src/components/LazyHStack.tsx +17 -0
  763. package/src/components/LazyVGrid.tsx +16 -0
  764. package/src/components/LazyVStack.tsx +12 -0
  765. package/src/components/LinearGradient.tsx +23 -0
  766. package/src/components/Link.tsx +8 -0
  767. package/src/components/List.tsx +14 -0
  768. package/src/components/NavigationLink.tsx +48 -0
  769. package/src/components/NavigationStack.tsx +9 -0
  770. package/src/components/Picker.tsx +39 -0
  771. package/src/components/ProgressView.tsx +19 -0
  772. package/src/components/RadialGradient.tsx +12 -0
  773. package/src/components/Rectangle.tsx +3 -0
  774. package/src/components/RoundedRectangle.tsx +11 -0
  775. package/src/components/ScrollView.tsx +10 -0
  776. package/src/components/ScrollViewReader.tsx +3 -0
  777. package/src/components/Section.tsx +37 -0
  778. package/src/components/SecureField.tsx +30 -0
  779. package/src/components/ShareLink.tsx +18 -0
  780. package/src/components/Slider.tsx +32 -0
  781. package/src/components/Spacer.tsx +8 -0
  782. package/src/components/Stepper.tsx +35 -0
  783. package/src/components/TabView.tsx +39 -0
  784. package/src/components/Text.tsx +16 -0
  785. package/src/components/TextField.tsx +30 -0
  786. package/src/components/TimelineView.tsx +13 -0
  787. package/src/components/Toggle.tsx +26 -0
  788. package/src/components/VStack.tsx +10 -0
  789. package/src/components/ViewThatFits.tsx +7 -0
  790. package/src/components/ZStack.tsx +18 -0
  791. package/src/createHostConfig.ts +223 -0
  792. package/src/createNativeView.ts +28 -0
  793. package/src/devSupport/index.ts +287 -0
  794. package/src/eventRegistry.ts +110 -0
  795. package/src/index.ts +160 -0
  796. package/src/modifiers/accessibility.ts +27 -0
  797. package/src/modifiers/accessibilityAction.ts +22 -0
  798. package/src/modifiers/accessibilityActions.ts +15 -0
  799. package/src/modifiers/accessibilityAddTraits.ts +23 -0
  800. package/src/modifiers/accessibilityElement.ts +16 -0
  801. package/src/modifiers/accessibilityHidden.ts +7 -0
  802. package/src/modifiers/accessibilityHint.ts +7 -0
  803. package/src/modifiers/accessibilityIdentifier.ts +7 -0
  804. package/src/modifiers/accessibilityLabel.ts +7 -0
  805. package/src/modifiers/accessibilityRemoveTraits.ts +11 -0
  806. package/src/modifiers/accessibilityValue.ts +7 -0
  807. package/src/modifiers/alert.ts +32 -0
  808. package/src/modifiers/alignmentGuide.ts +33 -0
  809. package/src/modifiers/allowsHitTesting.ts +8 -0
  810. package/src/modifiers/allowsTightening.ts +8 -0
  811. package/src/modifiers/animation.ts +38 -0
  812. package/src/modifiers/antialiased.ts +7 -0
  813. package/src/modifiers/aspectRatio.ts +19 -0
  814. package/src/modifiers/autocorrectionDisabled.ts +26 -0
  815. package/src/modifiers/background.ts +37 -0
  816. package/src/modifiers/backgroundExtensionEffect.ts +9 -0
  817. package/src/modifiers/backgroundStyle.ts +10 -0
  818. package/src/modifiers/baselineOffset.ts +8 -0
  819. package/src/modifiers/blendMode.ts +29 -0
  820. package/src/modifiers/blur.ts +17 -0
  821. package/src/modifiers/bold.ts +15 -0
  822. package/src/modifiers/border.ts +21 -0
  823. package/src/modifiers/brightness.ts +7 -0
  824. package/src/modifiers/buttonBorderShape.ts +16 -0
  825. package/src/modifiers/buttonRepeatBehavior.ts +15 -0
  826. package/src/modifiers/buttonSizing.ts +17 -0
  827. package/src/modifiers/buttonStyle.ts +14 -0
  828. package/src/modifiers/clipShape.ts +24 -0
  829. package/src/modifiers/clipped.ts +7 -0
  830. package/src/modifiers/colorInvert.ts +6 -0
  831. package/src/modifiers/colorMultiply.ts +9 -0
  832. package/src/modifiers/colorScheme.ts +10 -0
  833. package/src/modifiers/componentStyles.ts +19 -0
  834. package/src/modifiers/compositingGroup.ts +8 -0
  835. package/src/modifiers/confirmationDialog.ts +38 -0
  836. package/src/modifiers/containerBackground.ts +39 -0
  837. package/src/modifiers/containerGrid.ts +40 -0
  838. package/src/modifiers/containerRelativeFrame.ts +32 -0
  839. package/src/modifiers/containerShape.ts +35 -0
  840. package/src/modifiers/containerValue.ts +22 -0
  841. package/src/modifiers/contentMargins.ts +36 -0
  842. package/src/modifiers/contentShape.ts +27 -0
  843. package/src/modifiers/contextMenu.ts +26 -0
  844. package/src/modifiers/contrast.ts +8 -0
  845. package/src/modifiers/controlSize.ts +15 -0
  846. package/src/modifiers/controlsPolish.ts +23 -0
  847. package/src/modifiers/coordinateSpace.ts +21 -0
  848. package/src/modifiers/cornerRadius.ts +16 -0
  849. package/src/modifiers/createModifier.ts +13 -0
  850. package/src/modifiers/datePickerStyle.ts +10 -0
  851. package/src/modifiers/defaultAppStorage.ts +22 -0
  852. package/src/modifiers/defaultScrollAnchor.ts +26 -0
  853. package/src/modifiers/deleteDisabled.ts +7 -0
  854. package/src/modifiers/digitalCrownAccessory.ts +27 -0
  855. package/src/modifiers/digitalCrownRotation.ts +29 -0
  856. package/src/modifiers/disabled.ts +20 -0
  857. package/src/modifiers/drawingGroup.ts +14 -0
  858. package/src/modifiers/dynamicTypeSize.ts +24 -0
  859. package/src/modifiers/environment.modifier.ts +38 -0
  860. package/src/modifiers/environment.ts +17 -0
  861. package/src/modifiers/environmentObject.ts +21 -0
  862. package/src/modifiers/filters.ts +19 -0
  863. package/src/modifiers/fixedSize.ts +17 -0
  864. package/src/modifiers/focusable.ts +20 -0
  865. package/src/modifiers/focused.ts +17 -0
  866. package/src/modifiers/font.ts +48 -0
  867. package/src/modifiers/fontDesign.ts +18 -0
  868. package/src/modifiers/fontWeight.ts +15 -0
  869. package/src/modifiers/foregroundColor.ts +9 -0
  870. package/src/modifiers/foregroundStyle.ts +11 -0
  871. package/src/modifiers/formStyle.ts +10 -0
  872. package/src/modifiers/frame.ts +34 -0
  873. package/src/modifiers/fullScreenCover.ts +29 -0
  874. package/src/modifiers/gaugeStyle.ts +17 -0
  875. package/src/modifiers/geometry.ts +17 -0
  876. package/src/modifiers/geometryGroup.ts +8 -0
  877. package/src/modifiers/gesture.ts +30 -0
  878. package/src/modifiers/gestures.ts +14 -0
  879. package/src/modifiers/glass.ts +25 -0
  880. package/src/modifiers/glassEffect.ts +26 -0
  881. package/src/modifiers/glassEffectID.ts +19 -0
  882. package/src/modifiers/glassEffectTransition.ts +24 -0
  883. package/src/modifiers/glassEffectUnion.ts +19 -0
  884. package/src/modifiers/grayscale.ts +7 -0
  885. package/src/modifiers/gridCellAnchor.ts +36 -0
  886. package/src/modifiers/gridCellColumns.ts +21 -0
  887. package/src/modifiers/gridCellUnsizedAxes.ts +27 -0
  888. package/src/modifiers/gridColumnAlignment.ts +27 -0
  889. package/src/modifiers/handGestureShortcut.ts +30 -0
  890. package/src/modifiers/headerProminence.ts +11 -0
  891. package/src/modifiers/help.ts +17 -0
  892. package/src/modifiers/hidden.ts +22 -0
  893. package/src/modifiers/highPriorityGesture.ts +12 -0
  894. package/src/modifiers/hueRotation.ts +19 -0
  895. package/src/modifiers/id.ts +8 -0
  896. package/src/modifiers/ignoresSafeArea.ts +23 -0
  897. package/src/modifiers/imageScale.ts +9 -0
  898. package/src/modifiers/imageSymbol.ts +8 -0
  899. package/src/modifiers/input.ts +22 -0
  900. package/src/modifiers/interaction.ts +27 -0
  901. package/src/modifiers/interactiveDismissDisabled.ts +9 -0
  902. package/src/modifiers/interpolation.ts +10 -0
  903. package/src/modifiers/italic.ts +15 -0
  904. package/src/modifiers/kerning.ts +9 -0
  905. package/src/modifiers/labelIconToTitleSpacing.ts +13 -0
  906. package/src/modifiers/labelReservedIconWidth.ts +13 -0
  907. package/src/modifiers/labelStyle.ts +13 -0
  908. package/src/modifiers/labeledContentStyle.ts +10 -0
  909. package/src/modifiers/labelsHidden.ts +7 -0
  910. package/src/modifiers/labelsVisibility.ts +17 -0
  911. package/src/modifiers/layout.ts +23 -0
  912. package/src/modifiers/layoutPriority.ts +22 -0
  913. package/src/modifiers/lineLimit.ts +15 -0
  914. package/src/modifiers/lineSpacing.ts +15 -0
  915. package/src/modifiers/listItemTint.ts +9 -0
  916. package/src/modifiers/listRowBackground.ts +15 -0
  917. package/src/modifiers/listRowInsets.ts +15 -0
  918. package/src/modifiers/listSectionSpacing.ts +26 -0
  919. package/src/modifiers/listStyle.ts +11 -0
  920. package/src/modifiers/lists.ts +16 -0
  921. package/src/modifiers/luminanceToAlpha.ts +7 -0
  922. package/src/modifiers/mask.ts +30 -0
  923. package/src/modifiers/matchedGeometryEffect.ts +28 -0
  924. package/src/modifiers/matchedTransitionSource.ts +21 -0
  925. package/src/modifiers/materialActiveAppearance.ts +19 -0
  926. package/src/modifiers/menuActionDismissBehavior.ts +18 -0
  927. package/src/modifiers/menuOrder.ts +12 -0
  928. package/src/modifiers/minimumScaleFactor.ts +17 -0
  929. package/src/modifiers/monospaced.ts +15 -0
  930. package/src/modifiers/monospacedDigit.ts +8 -0
  931. package/src/modifiers/moveDisabled.ts +7 -0
  932. package/src/modifiers/multilineTextAlignment.ts +19 -0
  933. package/src/modifiers/navigation.ts +17 -0
  934. package/src/modifiers/navigationBarBackButtonHidden.ts +8 -0
  935. package/src/modifiers/navigationDestination.ts +26 -0
  936. package/src/modifiers/navigationTitle.ts +8 -0
  937. package/src/modifiers/navigationTransition.ts +28 -0
  938. package/src/modifiers/offset.ts +22 -0
  939. package/src/modifiers/onAppear.ts +10 -0
  940. package/src/modifiers/onChange.ts +15 -0
  941. package/src/modifiers/onDisappear.ts +10 -0
  942. package/src/modifiers/onGeometryChange.ts +21 -0
  943. package/src/modifiers/onLongPressGesture.ts +30 -0
  944. package/src/modifiers/onOpenURL.ts +12 -0
  945. package/src/modifiers/onReceive.ts +34 -0
  946. package/src/modifiers/onSubmit.ts +25 -0
  947. package/src/modifiers/onTapGesture.ts +27 -0
  948. package/src/modifiers/opacity.ts +14 -0
  949. package/src/modifiers/overlay.ts +29 -0
  950. package/src/modifiers/padding.ts +24 -0
  951. package/src/modifiers/pickerStyle.ts +9 -0
  952. package/src/modifiers/position.ts +24 -0
  953. package/src/modifiers/preferredColorScheme.ts +9 -0
  954. package/src/modifiers/presentation.ts +21 -0
  955. package/src/modifiers/presentationBackground.ts +35 -0
  956. package/src/modifiers/presentationCompactAdaptation.ts +24 -0
  957. package/src/modifiers/presentationCornerRadius.ts +13 -0
  958. package/src/modifiers/presentationDetents.ts +37 -0
  959. package/src/modifiers/presentationDragIndicator.ts +14 -0
  960. package/src/modifiers/privacySensitive.ts +8 -0
  961. package/src/modifiers/progressViewStyle.ts +10 -0
  962. package/src/modifiers/projectionEffect.ts +13 -0
  963. package/src/modifiers/redacted.ts +12 -0
  964. package/src/modifiers/refreshable.ts +10 -0
  965. package/src/modifiers/renderingMode.ts +11 -0
  966. package/src/modifiers/resizable.ts +9 -0
  967. package/src/modifiers/rotation3DEffect.ts +22 -0
  968. package/src/modifiers/rotationEffect.ts +39 -0
  969. package/src/modifiers/safeAreaInset.ts +24 -0
  970. package/src/modifiers/saturation.ts +7 -0
  971. package/src/modifiers/scaleEffect.ts +33 -0
  972. package/src/modifiers/scaledTo.ts +15 -0
  973. package/src/modifiers/scroll.ts +45 -0
  974. package/src/modifiers/scrollBounceBehavior.ts +32 -0
  975. package/src/modifiers/scrollClipDisabled.ts +8 -0
  976. package/src/modifiers/scrollContentBackground.ts +29 -0
  977. package/src/modifiers/scrollDisabled.ts +7 -0
  978. package/src/modifiers/scrollDismissesKeyboard.ts +30 -0
  979. package/src/modifiers/scrollIndicators.ts +30 -0
  980. package/src/modifiers/scrollPosition.ts +19 -0
  981. package/src/modifiers/scrollTargetBehavior.ts +27 -0
  982. package/src/modifiers/scrollTargetLayout.ts +9 -0
  983. package/src/modifiers/search.ts +21 -0
  984. package/src/modifiers/searchCompletion.ts +30 -0
  985. package/src/modifiers/searchPresentationToolbarBehavior.ts +31 -0
  986. package/src/modifiers/searchSuggestions.ts +21 -0
  987. package/src/modifiers/searchToolbarBehavior.ts +27 -0
  988. package/src/modifiers/searchable.ts +25 -0
  989. package/src/modifiers/selectionDisabled.ts +7 -0
  990. package/src/modifiers/sensoryFeedback.ts +32 -0
  991. package/src/modifiers/shadow.ts +18 -0
  992. package/src/modifiers/sheet.ts +22 -0
  993. package/src/modifiers/simultaneousGesture.ts +15 -0
  994. package/src/modifiers/springLoadingBehavior.ts +13 -0
  995. package/src/modifiers/strikethrough.ts +19 -0
  996. package/src/modifiers/styling.ts +22 -0
  997. package/src/modifiers/submitLabel.ts +32 -0
  998. package/src/modifiers/swipeActions.ts +36 -0
  999. package/src/modifiers/symbolEffect.ts +20 -0
  1000. package/src/modifiers/symbolRenderingMode.ts +13 -0
  1001. package/src/modifiers/symbolVariant.ts +15 -0
  1002. package/src/modifiers/tabItem.ts +19 -0
  1003. package/src/modifiers/tabViewStyle.ts +14 -0
  1004. package/src/modifiers/tag.ts +7 -0
  1005. package/src/modifiers/task.ts +12 -0
  1006. package/src/modifiers/text.ts +31 -0
  1007. package/src/modifiers/textCase.ts +19 -0
  1008. package/src/modifiers/textContentType.ts +36 -0
  1009. package/src/modifiers/textFieldStyle.ts +10 -0
  1010. package/src/modifiers/textInputAutocapitalization.ts +30 -0
  1011. package/src/modifiers/textPolish.ts +7 -0
  1012. package/src/modifiers/textScale.ts +14 -0
  1013. package/src/modifiers/theme.ts +8 -0
  1014. package/src/modifiers/tint.ts +9 -0
  1015. package/src/modifiers/toggleStyle.ts +9 -0
  1016. package/src/modifiers/toolbar.ts +27 -0
  1017. package/src/modifiers/toolbarBackground.ts +34 -0
  1018. package/src/modifiers/toolbarColorScheme.ts +32 -0
  1019. package/src/modifiers/toolbarItems.ts +23 -0
  1020. package/src/modifiers/toolbarTitleDisplayMode.ts +26 -0
  1021. package/src/modifiers/toolbarTitleMenu.ts +21 -0
  1022. package/src/modifiers/toolbarVisibility.ts +31 -0
  1023. package/src/modifiers/tracking.ts +9 -0
  1024. package/src/modifiers/transformEffect.ts +31 -0
  1025. package/src/modifiers/transforms.ts +17 -0
  1026. package/src/modifiers/transition.ts +35 -0
  1027. package/src/modifiers/truncationMode.ts +18 -0
  1028. package/src/modifiers/underline.ts +18 -0
  1029. package/src/modifiers/unredacted.ts +7 -0
  1030. package/src/modifiers/watch.ts +21 -0
  1031. package/src/modifiers/zIndex.ts +20 -0
  1032. package/src/polyfills.ts +206 -0
  1033. package/src/reactNativeShim.ts +113 -0
  1034. package/src/render.ts +78 -0
  1035. package/src/setupConsole.ts +78 -0
  1036. package/src/setupSelfGlobal.ts +12 -0
  1037. package/src/types/GridItem.ts +39 -0
  1038. package/src/types.ts +24 -0
  1039. package/src/useEventHandler.ts +31 -0
  1040. package/src/useModifiers.ts +126 -0
  1041. package/src/watchConnectivity/eventBridge.ts +32 -0
  1042. package/src/watchConnectivity/index.ts +195 -0
  1043. package/src/watchConnectivity/specs/NativeWatchConnectivity.ts +56 -0
  1044. package/src/watchConnectivity/types.ts +64 -0
  1045. package/src/whatwg-fetch.d.ts +5 -0
@@ -0,0 +1,1937 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include <cassert>
11
+ #include <cstdint>
12
+ #include <cstring>
13
+ #include <exception>
14
+ #include <functional>
15
+ #include <memory>
16
+ #include <string>
17
+ #include <vector>
18
+
19
+ #ifndef JSI_EXPORT
20
+ #ifdef _MSC_VER
21
+ #ifdef CREATE_SHARED_LIBRARY
22
+ #define JSI_EXPORT __declspec(dllexport)
23
+ #else
24
+ #define JSI_EXPORT
25
+ #endif // CREATE_SHARED_LIBRARY
26
+ #else // _MSC_VER
27
+ #define JSI_EXPORT __attribute__((visibility("default")))
28
+ #endif // _MSC_VER
29
+ #endif // !defined(JSI_EXPORT)
30
+
31
+ class FBJSRuntime;
32
+ namespace facebook {
33
+ namespace jsi {
34
+
35
+ /// UUID version 1 implementation. This should be constructed with constant
36
+ /// arguments to identify fixed UUIDs.
37
+ class JSI_EXPORT UUID {
38
+ public:
39
+ // Construct from raw parts
40
+ constexpr UUID(
41
+ uint32_t timeLow,
42
+ uint16_t timeMid,
43
+ uint16_t timeHighAndVersion,
44
+ uint16_t variantAndClockSeq,
45
+ uint64_t node)
46
+ : high(
47
+ ((uint64_t)(timeLow) << 32) | ((uint64_t)(timeMid) << 16) |
48
+ ((uint64_t)(timeHighAndVersion))),
49
+ low(((uint64_t)(variantAndClockSeq) << 48) | node) {}
50
+
51
+ // Default constructor (zero UUID)
52
+ constexpr UUID() : high(0), low(0) {}
53
+
54
+ constexpr UUID(const UUID&) = default;
55
+ constexpr UUID& operator=(const UUID&) = default;
56
+
57
+ constexpr bool operator==(const UUID& other) const {
58
+ return high == other.high && low == other.low;
59
+ }
60
+ constexpr bool operator!=(const UUID& other) const {
61
+ return !(*this == other);
62
+ }
63
+
64
+ // Ordering (for std::map, sorting, etc.)
65
+ constexpr bool operator<(const UUID& other) const {
66
+ return (high < other.high) || (high == other.high && low < other.low);
67
+ }
68
+
69
+ // Hash support for UUID (for unordered_map compatibility)
70
+ struct Hash {
71
+ std::size_t operator()(const UUID& uuid) const noexcept {
72
+ return std::hash<uint64_t>{}(uuid.high) ^
73
+ (std::hash<uint64_t>{}(uuid.low) << 1);
74
+ }
75
+ };
76
+
77
+ // UUID format: 8-4-4-4-12
78
+ std::string toString() const {
79
+ std::string buffer(36, ' ');
80
+ std::snprintf(
81
+ buffer.data(),
82
+ buffer.size() + 1,
83
+ "%08x-%04x-%04x-%04x-%012llx",
84
+ getTimeLow(),
85
+ getTimeMid(),
86
+ getTimeHighAndVersion(),
87
+ getVariantAndClockSeq(),
88
+ (unsigned long long)getNode());
89
+ return buffer;
90
+ }
91
+
92
+ constexpr uint32_t getTimeLow() const {
93
+ return (uint32_t)(high >> 32);
94
+ }
95
+
96
+ constexpr uint16_t getTimeMid() const {
97
+ return (uint16_t)(high >> 16);
98
+ }
99
+
100
+ constexpr uint16_t getTimeHighAndVersion() const {
101
+ return (uint16_t)high;
102
+ }
103
+
104
+ constexpr uint16_t getVariantAndClockSeq() const {
105
+ return (uint16_t)(low >> 48);
106
+ }
107
+
108
+ constexpr uint64_t getNode() const {
109
+ return low & 0xFFFFFFFFFFFF;
110
+ }
111
+
112
+ private:
113
+ uint64_t high;
114
+ uint64_t low;
115
+ };
116
+
117
+ /// Base interface that all JSI interfaces inherit from. Users should not try to
118
+ /// manipulate this base type directly, and should use castInterface to get the
119
+ /// appropriate subtype.
120
+ struct JSI_EXPORT ICast {
121
+ /// If the current object can be cast into the interface specified by \p
122
+ /// interfaceUUID, return a pointer to the object. Otherwise, return a null
123
+ /// pointer.
124
+ /// The returned interface has the same lifetime as the underlying object. It
125
+ /// does not need to be released when not needed.
126
+ virtual ICast* castInterface(const UUID& interfaceUUID) = 0;
127
+
128
+ protected:
129
+ /// Interfaces are not destructible, thus the destructor is intentionally
130
+ /// protected to prevent delete calls on the interface.
131
+ /// Additionally, the destructor is non-virtual to reduce the vtable
132
+ /// complexity from inheritance.
133
+ ~ICast() = default;
134
+ };
135
+
136
+ /// Base class for buffers of data or bytecode that need to be passed to the
137
+ /// runtime. The buffer is expected to be fully immutable, so the result of
138
+ /// size(), data(), and the contents of the pointer returned by data() must not
139
+ /// change after construction.
140
+ class JSI_EXPORT Buffer {
141
+ public:
142
+ virtual ~Buffer();
143
+ virtual size_t size() const = 0;
144
+ virtual const uint8_t* data() const = 0;
145
+ };
146
+
147
+ class JSI_EXPORT StringBuffer : public Buffer {
148
+ public:
149
+ StringBuffer(std::string s) : s_(std::move(s)) {}
150
+ size_t size() const override {
151
+ return s_.size();
152
+ }
153
+ const uint8_t* data() const override {
154
+ return reinterpret_cast<const uint8_t*>(s_.data());
155
+ }
156
+
157
+ private:
158
+ std::string s_;
159
+ };
160
+
161
+ /// Base class for buffers of data that need to be passed to the runtime. The
162
+ /// result of size() and data() must not change after construction. However, the
163
+ /// region pointed to by data() may be modified by the user or the runtime. The
164
+ /// user must ensure that access to the contents of the buffer is properly
165
+ /// synchronised.
166
+ class JSI_EXPORT MutableBuffer {
167
+ public:
168
+ virtual ~MutableBuffer();
169
+ virtual size_t size() const = 0;
170
+ virtual uint8_t* data() = 0;
171
+ };
172
+
173
+ /// PreparedJavaScript is a base class representing JavaScript which is in a
174
+ /// form optimized for execution, in a runtime-specific way. Construct one via
175
+ /// jsi::Runtime::prepareJavaScript().
176
+ /// ** This is an experimental API that is subject to change. **
177
+ class JSI_EXPORT PreparedJavaScript {
178
+ protected:
179
+ PreparedJavaScript() = default;
180
+
181
+ public:
182
+ virtual ~PreparedJavaScript() = 0;
183
+ };
184
+
185
+ class Runtime;
186
+ class Pointer;
187
+ class PropNameID;
188
+ class Symbol;
189
+ class BigInt;
190
+ class String;
191
+ class Object;
192
+ class WeakObject;
193
+ class Array;
194
+ class ArrayBuffer;
195
+ class Function;
196
+ class Value;
197
+ class Instrumentation;
198
+ class Scope;
199
+ class JSIException;
200
+ class JSError;
201
+
202
+ /// A function which has this type can be registered as a function
203
+ /// callable from JavaScript using Function::createFromHostFunction().
204
+ /// When the function is called, args will point to the arguments, and
205
+ /// count will indicate how many arguments are passed. The function
206
+ /// can return a Value to the caller, or throw an exception. If a C++
207
+ /// exception is thrown, a JS Error will be created and thrown into
208
+ /// JS; if the C++ exception extends std::exception, the Error's
209
+ /// message will be whatever what() returns. Note that it is undefined whether
210
+ /// HostFunctions may or may not be called in strict mode; that is `thisVal`
211
+ /// can be any value - it will not necessarily be coerced to an object or
212
+ /// or set to the global object.
213
+ using HostFunctionType = std::function<
214
+ Value(Runtime& rt, const Value& thisVal, const Value* args, size_t count)>;
215
+
216
+ /// An object which implements this interface can be registered as an
217
+ /// Object with the JS runtime.
218
+ class JSI_EXPORT HostObject {
219
+ public:
220
+ // The C++ object's dtor will be called when the GC finalizes this
221
+ // object. (This may be as late as when the Runtime is shut down.)
222
+ // You have no control over which thread it is called on. This will
223
+ // be called from inside the GC, so it is unsafe to do any VM
224
+ // operations which require a Runtime&. Derived classes' dtors
225
+ // should also avoid doing anything expensive. Calling the dtor on
226
+ // a jsi object is explicitly ok. If you want to do JS operations,
227
+ // or any nontrivial work, you should add it to a work queue, and
228
+ // manage it externally.
229
+ virtual ~HostObject();
230
+
231
+ // When JS wants a property with a given name from the HostObject,
232
+ // it will call this method. If it throws an exception, the call
233
+ // will throw a JS \c Error object. By default this returns undefined.
234
+ // \return the value for the property.
235
+ virtual Value get(Runtime&, const PropNameID& name);
236
+
237
+ // When JS wants to set a property with a given name on the HostObject,
238
+ // it will call this method. If it throws an exception, the call will
239
+ // throw a JS \c Error object. By default this throws a type error exception
240
+ // mimicking the behavior of a frozen object in strict mode.
241
+ virtual void set(Runtime&, const PropNameID& name, const Value& value);
242
+
243
+ // When JS wants a list of property names for the HostObject, it will
244
+ // call this method. If it throws an exception, the call will throw a
245
+ // JS \c Error object. The default implementation returns empty vector.
246
+ virtual std::vector<PropNameID> getPropertyNames(Runtime& rt);
247
+ };
248
+
249
+ /// Native state (and destructor) that can be attached to any JS object
250
+ /// using setNativeState.
251
+ class JSI_EXPORT NativeState {
252
+ public:
253
+ virtual ~NativeState();
254
+ };
255
+
256
+ // JSI_UNSTABLE gates features that will be released with a Hermes version in
257
+ // the future. Until released, these features may be subject to change. After
258
+ // release, these features will be moved out of JSI_UNSTABLE and become frozen.
259
+ #ifdef JSI_UNSTABLE
260
+ /// Opaque class that is used to store serialized object from a runtime. The
261
+ /// lifetime of this object is orthogonal to the original runtime object, and
262
+ /// may outlive the original object.
263
+ class JSI_EXPORT Serialized {
264
+ public:
265
+ /// Uses \p secretAddr to validate if the Serialized data is supported. If so,
266
+ /// return the pointer to the underlying serialized data. Otherwise, return a
267
+ /// nullptr. This should be used by the runtime to deserialize the data.
268
+ virtual void* getPrivate(const void* secretAddr) = 0;
269
+ virtual ~Serialized();
270
+ };
271
+
272
+ /// Provides a set of APIs that allows copying objects between different
273
+ /// runtime instances. The runtimes instances must be of the same type. As an
274
+ /// example, a serialized object from Hermes runtime may only be deserialized by
275
+ /// another Hermes runtime.
276
+ class JSI_EXPORT ISerialization : public ICast {
277
+ public:
278
+ static constexpr jsi::UUID uuid{
279
+ 0xd40fe0ec,
280
+ 0xa47c,
281
+ 0x42c9,
282
+ 0x8c09,
283
+ 0x661aeab832d8};
284
+
285
+ /// Serializes the given Value \p value using the structured clone algorithm.
286
+ /// It returns a shared pointer of an opaque Serialized object that can be
287
+ /// deserialized multiple times. The lifetime of the Serialized object is not
288
+ /// tied to the lifetime of the original object.
289
+ virtual std::shared_ptr<Serialized> serialize(Value& value) = 0;
290
+
291
+ /// Given a Serialized object provided by \p serialized, deserialize it using
292
+ /// the structured clone algorithm into a JS value in the current runtime.
293
+ /// Returns the deserialized JS value.
294
+ virtual Value deserialize(const std::shared_ptr<Serialized>& serialized) = 0;
295
+
296
+ /// Serializes the given jsi::Value \p value using the structured clone
297
+ /// algorithm. \p transferList must be a JS Array. Given the length property
298
+ /// of \p transferList, this API will transfer everything at index [0, length
299
+ /// - 1] to the serialized object. The transferred values will no longer be
300
+ /// usable in the original runtime. It returns a unique pointer of an opaque
301
+ /// Serialized object that can be deserialized once only by
302
+ /// deserializeWithTransfer. The lifetime of the Serialized object is not tied
303
+ /// to the lifetime of the original object.
304
+ virtual std::unique_ptr<Serialized> serializeWithTransfer(
305
+ Value& value,
306
+ const Array& transferList) = 0;
307
+
308
+ /// Using the structure clone algorithm, deserialize the object provided by \p
309
+ /// serialized into a JS value in the current runtime. \p serialized must be
310
+ /// created by serializeWithTransfer. If the current runtime does not support
311
+ /// the serialization scheme in \p serialized, then this method will throw and
312
+ /// \p serialized will remain unmodified. Otherwise, this will consume the
313
+ /// serialized data entirely and make the serialized objects in the current
314
+ /// runtime. Any transferred values in the serialized object will be owned by
315
+ /// the current runtime.
316
+ // This method returns an Array containing the deserialized values, where the
317
+ // first element is the value passed into serializeWithTransfer,
318
+ /// followed by all transferred values.
319
+ virtual Array deserializeWithTransfer(
320
+ std::unique_ptr<Serialized>& serialized) = 0;
321
+
322
+ protected:
323
+ ~ISerialization() = default;
324
+ };
325
+
326
+ #endif // JSI_UNSTABLE
327
+
328
+ /// Represents a JS runtime. Movable, but not copyable. Note that
329
+ /// this object may not be thread-aware, but cannot be used safely from
330
+ /// multiple threads at once. The application is responsible for
331
+ /// ensuring that it is used safely. This could mean using the
332
+ /// Runtime from a single thread, using a mutex, doing all work on a
333
+ /// serial queue, etc. This restriction applies to the methods of
334
+ /// this class, and any method in the API which take a Runtime& as an
335
+ /// argument. Destructors (all but ~Scope), operators, or other methods
336
+ /// which do not take Runtime& as an argument are safe to call from any
337
+ /// thread, but it is still forbidden to make write operations on a single
338
+ /// instance of any class from more than one thread. In addition, to
339
+ /// make shutdown safe, destruction of objects associated with the Runtime
340
+ /// must be destroyed before the Runtime is destroyed, or from the
341
+ /// destructor of a managed HostObject or HostFunction. Informally, this
342
+ /// means that the main source of unsafe behavior is to hold a jsi object
343
+ /// in a non-Runtime-managed object, and not clean it up before the Runtime
344
+ /// is shut down. If your lifecycle is such that avoiding this is hard,
345
+ /// you will probably need to do use your own locks.
346
+ class JSI_EXPORT Runtime : public ICast {
347
+ public:
348
+ virtual ~Runtime();
349
+
350
+ ICast* castInterface(const UUID& interfaceUUID) override;
351
+
352
+ /// Evaluates the given JavaScript \c buffer. \c sourceURL is used
353
+ /// to annotate the stack trace if there is an exception. The
354
+ /// contents may be utf8-encoded JS source code, or binary bytecode
355
+ /// whose format is specific to the implementation. If the input
356
+ /// format is unknown, or evaluation causes an error, a JSIException
357
+ /// will be thrown.
358
+ /// Note this function should ONLY be used when there isn't another means
359
+ /// through the JSI API. For example, it will be much slower to use this to
360
+ /// call a global function than using the JSI APIs to read the function
361
+ /// property from the global object and then calling it explicitly.
362
+ virtual Value evaluateJavaScript(
363
+ const std::shared_ptr<const Buffer>& buffer,
364
+ const std::string& sourceURL) = 0;
365
+
366
+ /// Prepares to evaluate the given JavaScript \c buffer by processing it into
367
+ /// a form optimized for execution. This may include pre-parsing, compiling,
368
+ /// etc. If the input is invalid (for example, cannot be parsed), a
369
+ /// JSIException will be thrown. The resulting object is tied to the
370
+ /// particular concrete type of Runtime from which it was created. It may be
371
+ /// used (via evaluatePreparedJavaScript) in any Runtime of the same concrete
372
+ /// type.
373
+ /// The PreparedJavaScript object may be passed to multiple VM instances, so
374
+ /// they can all share and benefit from the prepared script.
375
+ /// As with evaluateJavaScript(), using JavaScript code should be avoided
376
+ /// when the JSI API is sufficient.
377
+ virtual std::shared_ptr<const PreparedJavaScript> prepareJavaScript(
378
+ const std::shared_ptr<const Buffer>& buffer,
379
+ std::string sourceURL) = 0;
380
+
381
+ /// Evaluates a PreparedJavaScript. If evaluation causes an error, a
382
+ /// JSIException will be thrown.
383
+ /// As with evaluateJavaScript(), using JavaScript code should be avoided
384
+ /// when the JSI API is sufficient.
385
+ virtual Value evaluatePreparedJavaScript(
386
+ const std::shared_ptr<const PreparedJavaScript>& js) = 0;
387
+
388
+ /// Queues a microtask in the JavaScript VM internal Microtask (a.k.a. Job in
389
+ /// ECMA262) queue, to be executed when the host drains microtasks in
390
+ /// its event loop implementation.
391
+ ///
392
+ /// \param callback a function to be executed as a microtask.
393
+ virtual void queueMicrotask(const jsi::Function& callback) = 0;
394
+
395
+ /// Drain the JavaScript VM internal Microtask (a.k.a. Job in ECMA262) queue.
396
+ ///
397
+ /// \param maxMicrotasksHint a hint to tell an implementation that it should
398
+ /// make a best effort not execute more than the given number. It's default
399
+ /// to -1 for infinity (unbounded execution).
400
+ /// \return true if the queue is drained or false if there is more work to do.
401
+ ///
402
+ /// When there were exceptions thrown from the execution of microtasks,
403
+ /// implementations shall discard the exceptional jobs. An implementation may
404
+ /// \throw a \c JSError object to signal the hosts to handle. In that case, an
405
+ /// implementation may or may not suspend the draining.
406
+ ///
407
+ /// Hosts may call this function again to resume the draining if it was
408
+ /// suspended due to either exceptions or the \p maxMicrotasksHint bound.
409
+ /// E.g. a host may repetitively invoke this function until the queue is
410
+ /// drained to implement the "microtask checkpoint" defined in WHATWG HTML
411
+ /// event loop: https://html.spec.whatwg.org/C#perform-a-microtask-checkpoint.
412
+ ///
413
+ /// Note that error propagation is only a concern if a host needs to implement
414
+ /// `queueMicrotask`, a recent API that allows enqueueing arbitrary functions
415
+ /// (hence may throw) as microtasks. Exceptions from ECMA-262 Promise Jobs are
416
+ /// handled internally to VMs and are never propagated to hosts.
417
+ ///
418
+ /// This API offers some queue management to hosts at its best effort due to
419
+ /// different behaviors and limitations imposed by different VMs and APIs. By
420
+ /// the time this is written, An implementation may swallow exceptions (JSC),
421
+ /// may not pause (V8), and may not support bounded executions.
422
+ virtual bool drainMicrotasks(int maxMicrotasksHint = -1) = 0;
423
+
424
+ /// \return the global object
425
+ virtual Object global() = 0;
426
+
427
+ /// \return a short printable description of the instance. It should
428
+ /// at least include some human-readable indication of the runtime
429
+ /// implementation. This should only be used by logging, debugging,
430
+ /// and other developer-facing callers.
431
+ virtual std::string description() = 0;
432
+
433
+ /// \return whether or not the underlying runtime supports debugging via the
434
+ /// Chrome remote debugging protocol.
435
+ ///
436
+ /// NOTE: the API for determining whether a runtime is debuggable and
437
+ /// registering a runtime with the debugger is still in flux, so please don't
438
+ /// use this API unless you know what you're doing.
439
+ virtual bool isInspectable() = 0;
440
+
441
+ /// \return an interface to extract metrics from this \c Runtime. The default
442
+ /// implementation of this function returns an \c Instrumentation instance
443
+ /// which returns no metrics.
444
+ virtual Instrumentation& instrumentation();
445
+
446
+ /// Stores the pointer \p data with the \p uuid in the runtime. This can be
447
+ /// used to store some custom data within the runtime. When the runtime is
448
+ /// destroyed, or if an entry at an existing key is overwritten, the runtime
449
+ /// will release its ownership of the held object.
450
+ void setRuntimeData(const UUID& uuid, const std::shared_ptr<void>& data);
451
+
452
+ /// Returns the data associated with the \p uuid in the runtime. If there's no
453
+ /// data associated with the uuid, return a null pointer.
454
+ std::shared_ptr<void> getRuntimeData(const UUID& uuid);
455
+
456
+ protected:
457
+ friend class Pointer;
458
+ friend class PropNameID;
459
+ friend class Symbol;
460
+ friend class BigInt;
461
+ friend class String;
462
+ friend class Object;
463
+ friend class WeakObject;
464
+ friend class Array;
465
+ friend class ArrayBuffer;
466
+ friend class Function;
467
+ friend class Value;
468
+ friend class Scope;
469
+ friend class JSError;
470
+
471
+ /// Stores the pointer \p data with the \p uuid in the runtime. This can be
472
+ /// used to store some custom data within the runtime. When the runtime is
473
+ /// destroyed, or if an entry at an existing key is overwritten, the runtime
474
+ /// will release its ownership by calling \p deleter.
475
+ virtual void setRuntimeDataImpl(
476
+ const UUID& uuid,
477
+ const void* data,
478
+ void (*deleter)(const void* data));
479
+
480
+ /// Returns the data associated with the \p uuid in the runtime. If there's no
481
+ /// data associated with the uuid, return a null pointer.
482
+ virtual const void* getRuntimeDataImpl(const UUID& uuid);
483
+
484
+ // Potential optimization: avoid the cloneFoo() virtual dispatch,
485
+ // and instead just fix the number of fields, and copy them, since
486
+ // in practice they are trivially copyable. Sufficient use of
487
+ // rvalue arguments/methods would also reduce the number of clones.
488
+
489
+ struct PointerValue {
490
+ virtual void invalidate() noexcept = 0;
491
+
492
+ protected:
493
+ virtual ~PointerValue() = default;
494
+ };
495
+
496
+ virtual PointerValue* cloneSymbol(const Runtime::PointerValue* pv) = 0;
497
+ virtual PointerValue* cloneBigInt(const Runtime::PointerValue* pv) = 0;
498
+ virtual PointerValue* cloneString(const Runtime::PointerValue* pv) = 0;
499
+ virtual PointerValue* cloneObject(const Runtime::PointerValue* pv) = 0;
500
+ virtual PointerValue* clonePropNameID(const Runtime::PointerValue* pv) = 0;
501
+
502
+ virtual PropNameID createPropNameIDFromAscii(
503
+ const char* str,
504
+ size_t length) = 0;
505
+ virtual PropNameID createPropNameIDFromUtf8(
506
+ const uint8_t* utf8,
507
+ size_t length) = 0;
508
+ virtual PropNameID createPropNameIDFromUtf16(
509
+ const char16_t* utf16,
510
+ size_t length);
511
+ virtual PropNameID createPropNameIDFromString(const String& str) = 0;
512
+ virtual PropNameID createPropNameIDFromSymbol(const Symbol& sym) = 0;
513
+ virtual std::string utf8(const PropNameID&) = 0;
514
+ virtual bool compare(const PropNameID&, const PropNameID&) = 0;
515
+
516
+ virtual std::string symbolToString(const Symbol&) = 0;
517
+
518
+ virtual BigInt createBigIntFromInt64(int64_t) = 0;
519
+ virtual BigInt createBigIntFromUint64(uint64_t) = 0;
520
+ virtual bool bigintIsInt64(const BigInt&) = 0;
521
+ virtual bool bigintIsUint64(const BigInt&) = 0;
522
+ virtual uint64_t truncate(const BigInt&) = 0;
523
+ virtual String bigintToString(const BigInt&, int) = 0;
524
+
525
+ virtual String createStringFromAscii(const char* str, size_t length) = 0;
526
+ virtual String createStringFromUtf8(const uint8_t* utf8, size_t length) = 0;
527
+ virtual String createStringFromUtf16(const char16_t* utf16, size_t length);
528
+ virtual std::string utf8(const String&) = 0;
529
+
530
+ // \return a \c Value created from a utf8-encoded JSON string. The default
531
+ // implementation creates a \c String and invokes JSON.parse.
532
+ virtual Value createValueFromJsonUtf8(const uint8_t* json, size_t length);
533
+
534
+ virtual Object createObject() = 0;
535
+ virtual Object createObject(std::shared_ptr<HostObject> ho) = 0;
536
+ virtual std::shared_ptr<HostObject> getHostObject(const jsi::Object&) = 0;
537
+ virtual HostFunctionType& getHostFunction(const jsi::Function&) = 0;
538
+
539
+ // Creates a new Object with the custom prototype
540
+ virtual Object createObjectWithPrototype(const Value& prototype);
541
+
542
+ virtual bool hasNativeState(const jsi::Object&) = 0;
543
+ virtual std::shared_ptr<NativeState> getNativeState(const jsi::Object&) = 0;
544
+ virtual void setNativeState(
545
+ const jsi::Object&,
546
+ std::shared_ptr<NativeState> state) = 0;
547
+
548
+ virtual void setPrototypeOf(const Object& object, const Value& prototype);
549
+ virtual Value getPrototypeOf(const Object& object);
550
+
551
+ virtual Value getProperty(const Object&, const PropNameID& name) = 0;
552
+ virtual Value getProperty(const Object&, const String& name) = 0;
553
+ virtual Value getProperty(const Object&, const Value& name);
554
+ virtual bool hasProperty(const Object&, const PropNameID& name) = 0;
555
+ virtual bool hasProperty(const Object&, const String& name) = 0;
556
+ virtual bool hasProperty(const Object&, const Value& name);
557
+ virtual void setPropertyValue(
558
+ const Object&,
559
+ const PropNameID& name,
560
+ const Value& value) = 0;
561
+ virtual void
562
+ setPropertyValue(const Object&, const String& name, const Value& value) = 0;
563
+ virtual void
564
+ setPropertyValue(const Object&, const Value& name, const Value& value);
565
+
566
+ virtual void deleteProperty(const Object&, const PropNameID& name);
567
+ virtual void deleteProperty(const Object&, const String& name);
568
+ virtual void deleteProperty(const Object&, const Value& name);
569
+
570
+ virtual bool isArray(const Object&) const = 0;
571
+ virtual bool isArrayBuffer(const Object&) const = 0;
572
+ virtual bool isFunction(const Object&) const = 0;
573
+ virtual bool isHostObject(const jsi::Object&) const = 0;
574
+ virtual bool isHostFunction(const jsi::Function&) const = 0;
575
+ virtual Array getPropertyNames(const Object&) = 0;
576
+
577
+ virtual WeakObject createWeakObject(const Object&) = 0;
578
+ virtual Value lockWeakObject(const WeakObject&) = 0;
579
+
580
+ virtual Array createArray(size_t length) = 0;
581
+ virtual ArrayBuffer createArrayBuffer(
582
+ std::shared_ptr<MutableBuffer> buffer) = 0;
583
+ virtual size_t size(const Array&) = 0;
584
+ virtual size_t size(const ArrayBuffer&) = 0;
585
+ virtual uint8_t* data(const ArrayBuffer&) = 0;
586
+ virtual Value getValueAtIndex(const Array&, size_t i) = 0;
587
+ virtual void
588
+ setValueAtIndexImpl(const Array&, size_t i, const Value& value) = 0;
589
+
590
+ virtual Function createFunctionFromHostFunction(
591
+ const PropNameID& name,
592
+ unsigned int paramCount,
593
+ HostFunctionType func) = 0;
594
+ virtual Value call(
595
+ const Function&,
596
+ const Value& jsThis,
597
+ const Value* args,
598
+ size_t count) = 0;
599
+ virtual Value
600
+ callAsConstructor(const Function&, const Value* args, size_t count) = 0;
601
+
602
+ // Private data for managing scopes.
603
+ struct ScopeState;
604
+ virtual ScopeState* pushScope();
605
+ virtual void popScope(ScopeState*);
606
+
607
+ virtual bool strictEquals(const Symbol& a, const Symbol& b) const = 0;
608
+ virtual bool strictEquals(const BigInt& a, const BigInt& b) const = 0;
609
+ virtual bool strictEquals(const String& a, const String& b) const = 0;
610
+ virtual bool strictEquals(const Object& a, const Object& b) const = 0;
611
+
612
+ virtual bool instanceOf(const Object& o, const Function& f) = 0;
613
+
614
+ /// See Object::setExternalMemoryPressure.
615
+ virtual void setExternalMemoryPressure(
616
+ const jsi::Object& obj,
617
+ size_t amount) = 0;
618
+
619
+ virtual std::u16string utf16(const String& str);
620
+ virtual std::u16string utf16(const PropNameID& sym);
621
+
622
+ /// Invokes the provided callback \p cb with the String content in \p str.
623
+ /// The callback must take in three arguments: bool ascii, const void* data,
624
+ /// and size_t num, respectively. \p ascii indicates whether the \p data
625
+ /// passed to the callback should be interpreted as a pointer to a sequence of
626
+ /// \p num ASCII characters or UTF16 characters. Depending on the internal
627
+ /// representation of the string, the function may invoke the callback
628
+ /// multiple times, with a different format on each invocation. The callback
629
+ /// must not access runtime functionality, as any operation on the runtime may
630
+ /// invalidate the data pointers.
631
+ virtual void getStringData(
632
+ const jsi::String& str,
633
+ void* ctx,
634
+ void (*cb)(void* ctx, bool ascii, const void* data, size_t num));
635
+
636
+ /// Invokes the provided callback \p cb with the PropNameID content in \p sym.
637
+ /// The callback must take in three arguments: bool ascii, const void* data,
638
+ /// and size_t num, respectively. \p ascii indicates whether the \p data
639
+ /// passed to the callback should be interpreted as a pointer to a sequence of
640
+ /// \p num ASCII characters or UTF16 characters. Depending on the internal
641
+ /// representation of the string, the function may invoke the callback
642
+ /// multiple times, with a different format on each invocation. The callback
643
+ /// must not access runtime functionality, as any operation on the runtime may
644
+ /// invalidate the data pointers.
645
+ virtual void getPropNameIdData(
646
+ const jsi::PropNameID& sym,
647
+ void* ctx,
648
+ void (*cb)(void* ctx, bool ascii, const void* data, size_t num));
649
+
650
+ // These exist so derived classes can access the private parts of
651
+ // Value, Symbol, String, and Object, which are all friends of Runtime.
652
+ template <typename T>
653
+ static T make(PointerValue* pv);
654
+ static PointerValue* getPointerValue(Pointer& pointer);
655
+ static const PointerValue* getPointerValue(const Pointer& pointer);
656
+ static const PointerValue* getPointerValue(const Value& value);
657
+
658
+ friend class ::FBJSRuntime;
659
+ template <typename Plain, typename Base>
660
+ friend class RuntimeDecorator;
661
+ };
662
+
663
+ // Base class for pointer-storing types.
664
+ class JSI_EXPORT Pointer {
665
+ protected:
666
+ explicit Pointer(Pointer&& other) noexcept : ptr_(other.ptr_) {
667
+ other.ptr_ = nullptr;
668
+ }
669
+
670
+ ~Pointer() {
671
+ if (ptr_) {
672
+ ptr_->invalidate();
673
+ }
674
+ }
675
+
676
+ Pointer& operator=(Pointer&& other) noexcept;
677
+
678
+ friend class Runtime;
679
+ friend class Value;
680
+
681
+ explicit Pointer(Runtime::PointerValue* ptr) : ptr_(ptr) {}
682
+
683
+ typename Runtime::PointerValue* ptr_;
684
+ };
685
+
686
+ /// Represents something that can be a JS property key. Movable, not copyable.
687
+ class JSI_EXPORT PropNameID : public Pointer {
688
+ public:
689
+ using Pointer::Pointer;
690
+
691
+ PropNameID(Runtime& runtime, const PropNameID& other)
692
+ : Pointer(runtime.clonePropNameID(other.ptr_)) {}
693
+
694
+ PropNameID(PropNameID&& other) = default;
695
+ PropNameID& operator=(PropNameID&& other) = default;
696
+
697
+ /// Create a JS property name id from ascii values. The data is
698
+ /// copied.
699
+ static PropNameID forAscii(Runtime& runtime, const char* str, size_t length) {
700
+ return runtime.createPropNameIDFromAscii(str, length);
701
+ }
702
+
703
+ /// Create a property name id from a nul-terminated C ascii name. The data is
704
+ /// copied.
705
+ static PropNameID forAscii(Runtime& runtime, const char* str) {
706
+ return forAscii(runtime, str, strlen(str));
707
+ }
708
+
709
+ /// Create a PropNameID from a C++ string. The string is copied.
710
+ static PropNameID forAscii(Runtime& runtime, const std::string& str) {
711
+ return forAscii(runtime, str.c_str(), str.size());
712
+ }
713
+
714
+ /// Create a PropNameID from utf8 values. The data is copied.
715
+ /// Results are undefined if \p utf8 contains invalid code points.
716
+ static PropNameID
717
+ forUtf8(Runtime& runtime, const uint8_t* utf8, size_t length) {
718
+ return runtime.createPropNameIDFromUtf8(utf8, length);
719
+ }
720
+
721
+ /// Create a PropNameID from utf8-encoded octets stored in a
722
+ /// std::string. The string data is transformed and copied.
723
+ /// Results are undefined if \p utf8 contains invalid code points.
724
+ static PropNameID forUtf8(Runtime& runtime, const std::string& utf8) {
725
+ return runtime.createPropNameIDFromUtf8(
726
+ reinterpret_cast<const uint8_t*>(utf8.data()), utf8.size());
727
+ }
728
+
729
+ /// Given a series of UTF-16 encoded code units, create a PropNameId. The
730
+ /// input may contain unpaired surrogates, which will be interpreted as a code
731
+ /// point of the same value.
732
+ static PropNameID
733
+ forUtf16(Runtime& runtime, const char16_t* utf16, size_t length) {
734
+ return runtime.createPropNameIDFromUtf16(utf16, length);
735
+ }
736
+
737
+ /// Given a series of UTF-16 encoded code units stored inside std::u16string,
738
+ /// create a PropNameId. The input may contain unpaired surrogates, which
739
+ /// will be interpreted as a code point of the same value.
740
+ static PropNameID forUtf16(Runtime& runtime, const std::u16string& str) {
741
+ return runtime.createPropNameIDFromUtf16(str.data(), str.size());
742
+ }
743
+
744
+ /// Create a PropNameID from a JS string.
745
+ static PropNameID forString(Runtime& runtime, const jsi::String& str) {
746
+ return runtime.createPropNameIDFromString(str);
747
+ }
748
+
749
+ /// Create a PropNameID from a JS symbol.
750
+ static PropNameID forSymbol(Runtime& runtime, const jsi::Symbol& sym) {
751
+ return runtime.createPropNameIDFromSymbol(sym);
752
+ }
753
+
754
+ // Creates a vector of PropNameIDs constructed from given arguments.
755
+ template <typename... Args>
756
+ static std::vector<PropNameID> names(Runtime& runtime, Args&&... args);
757
+
758
+ // Creates a vector of given PropNameIDs.
759
+ template <size_t N>
760
+ static std::vector<PropNameID> names(PropNameID (&&propertyNames)[N]);
761
+
762
+ /// Copies the data in a PropNameID as utf8 into a C++ string.
763
+ std::string utf8(Runtime& runtime) const {
764
+ return runtime.utf8(*this);
765
+ }
766
+
767
+ /// Copies the data in a PropNameID as utf16 into a C++ string.
768
+ std::u16string utf16(Runtime& runtime) const {
769
+ return runtime.utf16(*this);
770
+ }
771
+
772
+ /// Invokes the user provided callback to process the content in PropNameId.
773
+ /// The callback must take in three arguments: bool ascii, const void* data,
774
+ /// and size_t num, respectively. \p ascii indicates whether the \p data
775
+ /// passed to the callback should be interpreted as a pointer to a sequence of
776
+ /// \p num ASCII characters or UTF16 characters. The function may invoke the
777
+ /// callback multiple times, with a different format on each invocation. The
778
+ /// callback must not access runtime functionality, as any operation on the
779
+ /// runtime may invalidate the data pointers.
780
+ template <typename CB>
781
+ void getPropNameIdData(Runtime& runtime, CB& cb) const {
782
+ runtime.getPropNameIdData(
783
+ *this, &cb, [](void* ctx, bool ascii, const void* data, size_t num) {
784
+ (*((CB*)ctx))(ascii, data, num);
785
+ });
786
+ }
787
+
788
+ static bool compare(
789
+ Runtime& runtime,
790
+ const jsi::PropNameID& a,
791
+ const jsi::PropNameID& b) {
792
+ return runtime.compare(a, b);
793
+ }
794
+
795
+ friend class Runtime;
796
+ friend class Value;
797
+ };
798
+
799
+ /// Represents a JS Symbol (es6). Movable, not copyable.
800
+ /// TODO T40778724: this is a limited implementation sufficient for
801
+ /// the debugger not to crash when a Symbol is a property in an Object
802
+ /// or element in an array. Complete support for creating will come
803
+ /// later.
804
+ class JSI_EXPORT Symbol : public Pointer {
805
+ public:
806
+ using Pointer::Pointer;
807
+
808
+ Symbol(Symbol&& other) = default;
809
+ Symbol& operator=(Symbol&& other) = default;
810
+
811
+ /// \return whether a and b refer to the same symbol.
812
+ static bool strictEquals(Runtime& runtime, const Symbol& a, const Symbol& b) {
813
+ return runtime.strictEquals(a, b);
814
+ }
815
+
816
+ /// Converts a Symbol into a C++ string as JS .toString would. The output
817
+ /// will look like \c Symbol(description) .
818
+ std::string toString(Runtime& runtime) const {
819
+ return runtime.symbolToString(*this);
820
+ }
821
+
822
+ friend class Runtime;
823
+ friend class Value;
824
+ };
825
+
826
+ /// Represents a JS BigInt. Movable, not copyable.
827
+ class JSI_EXPORT BigInt : public Pointer {
828
+ public:
829
+ using Pointer::Pointer;
830
+
831
+ BigInt(BigInt&& other) = default;
832
+ BigInt& operator=(BigInt&& other) = default;
833
+
834
+ /// Create a BigInt representing the signed 64-bit \p value.
835
+ static BigInt fromInt64(Runtime& runtime, int64_t value) {
836
+ return runtime.createBigIntFromInt64(value);
837
+ }
838
+
839
+ /// Create a BigInt representing the unsigned 64-bit \p value.
840
+ static BigInt fromUint64(Runtime& runtime, uint64_t value) {
841
+ return runtime.createBigIntFromUint64(value);
842
+ }
843
+
844
+ /// \return whether a === b.
845
+ static bool strictEquals(Runtime& runtime, const BigInt& a, const BigInt& b) {
846
+ return runtime.strictEquals(a, b);
847
+ }
848
+
849
+ /// \returns This bigint truncated to a signed 64-bit integer.
850
+ int64_t getInt64(Runtime& runtime) const {
851
+ return runtime.truncate(*this);
852
+ }
853
+
854
+ /// \returns Whether this bigint can be losslessly converted to int64_t.
855
+ bool isInt64(Runtime& runtime) const {
856
+ return runtime.bigintIsInt64(*this);
857
+ }
858
+
859
+ /// \returns This bigint truncated to a signed 64-bit integer. Throws a
860
+ /// JSIException if the truncation is lossy.
861
+ int64_t asInt64(Runtime& runtime) const;
862
+
863
+ /// \returns This bigint truncated to an unsigned 64-bit integer.
864
+ uint64_t getUint64(Runtime& runtime) const {
865
+ return runtime.truncate(*this);
866
+ }
867
+
868
+ /// \returns Whether this bigint can be losslessly converted to uint64_t.
869
+ bool isUint64(Runtime& runtime) const {
870
+ return runtime.bigintIsUint64(*this);
871
+ }
872
+
873
+ /// \returns This bigint truncated to an unsigned 64-bit integer. Throws a
874
+ /// JSIException if the truncation is lossy.
875
+ uint64_t asUint64(Runtime& runtime) const;
876
+
877
+ /// \returns this BigInt converted to a String in base \p radix. Throws a
878
+ /// JSIException if radix is not in the [2, 36] range.
879
+ inline String toString(Runtime& runtime, int radix = 10) const;
880
+
881
+ friend class Runtime;
882
+ friend class Value;
883
+ };
884
+
885
+ /// Represents a JS String. Movable, not copyable.
886
+ class JSI_EXPORT String : public Pointer {
887
+ public:
888
+ using Pointer::Pointer;
889
+
890
+ String(String&& other) = default;
891
+ String& operator=(String&& other) = default;
892
+
893
+ /// Create a JS string from ascii values. The string data is
894
+ /// copied.
895
+ static String
896
+ createFromAscii(Runtime& runtime, const char* str, size_t length) {
897
+ return runtime.createStringFromAscii(str, length);
898
+ }
899
+
900
+ /// Create a JS string from a nul-terminated C ascii string. The
901
+ /// string data is copied.
902
+ static String createFromAscii(Runtime& runtime, const char* str) {
903
+ return createFromAscii(runtime, str, strlen(str));
904
+ }
905
+
906
+ /// Create a JS string from a C++ string. The string data is
907
+ /// copied.
908
+ static String createFromAscii(Runtime& runtime, const std::string& str) {
909
+ return createFromAscii(runtime, str.c_str(), str.size());
910
+ }
911
+
912
+ /// Create a JS string from utf8-encoded octets. The string data is
913
+ /// transformed and copied. Results are undefined if \p utf8 contains invalid
914
+ /// code points.
915
+ static String
916
+ createFromUtf8(Runtime& runtime, const uint8_t* utf8, size_t length) {
917
+ return runtime.createStringFromUtf8(utf8, length);
918
+ }
919
+
920
+ /// Create a JS string from utf8-encoded octets stored in a
921
+ /// std::string. The string data is transformed and copied. Results are
922
+ /// undefined if \p utf8 contains invalid code points.
923
+ static String createFromUtf8(Runtime& runtime, const std::string& utf8) {
924
+ return runtime.createStringFromUtf8(
925
+ reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length());
926
+ }
927
+
928
+ /// Given a series of UTF-16 encoded code units, create a JS String. The input
929
+ /// may contain unpaired surrogates, which will be interpreted as a code point
930
+ /// of the same value.
931
+ static String
932
+ createFromUtf16(Runtime& runtime, const char16_t* utf16, size_t length) {
933
+ return runtime.createStringFromUtf16(utf16, length);
934
+ }
935
+
936
+ /// Given a series of UTF-16 encoded code units stored inside std::u16string,
937
+ /// create a JS String. The input may contain unpaired surrogates, which will
938
+ /// be interpreted as a code point of the same value.
939
+ static String createFromUtf16(Runtime& runtime, const std::u16string& utf16) {
940
+ return runtime.createStringFromUtf16(utf16.data(), utf16.length());
941
+ }
942
+
943
+ /// \return whether a and b contain the same characters.
944
+ static bool strictEquals(Runtime& runtime, const String& a, const String& b) {
945
+ return runtime.strictEquals(a, b);
946
+ }
947
+
948
+ /// Copies the data in a JS string as utf8 into a C++ string.
949
+ std::string utf8(Runtime& runtime) const {
950
+ return runtime.utf8(*this);
951
+ }
952
+
953
+ /// Copies the data in a JS string as utf16 into a C++ string.
954
+ std::u16string utf16(Runtime& runtime) const {
955
+ return runtime.utf16(*this);
956
+ }
957
+
958
+ /// Invokes the user provided callback to process content in String. The
959
+ /// callback must take in three arguments: bool ascii, const void* data, and
960
+ /// size_t num, respectively. \p ascii indicates whether the \p data passed to
961
+ /// the callback should be interpreted as a pointer to a sequence of \p num
962
+ /// ASCII characters or UTF16 characters. The function may invoke the callback
963
+ /// multiple times, with a different format on each invocation. The callback
964
+ /// must not access runtime functionality, as any operation on the runtime may
965
+ /// invalidate the data pointers.
966
+ template <typename CB>
967
+ void getStringData(Runtime& runtime, CB& cb) const {
968
+ runtime.getStringData(
969
+ *this, &cb, [](void* ctx, bool ascii, const void* data, size_t num) {
970
+ (*((CB*)ctx))(ascii, data, num);
971
+ });
972
+ }
973
+
974
+ friend class Runtime;
975
+ friend class Value;
976
+ };
977
+
978
+ class Array;
979
+ class Function;
980
+
981
+ /// Represents a JS Object. Movable, not copyable.
982
+ class JSI_EXPORT Object : public Pointer {
983
+ public:
984
+ using Pointer::Pointer;
985
+
986
+ Object(Object&& other) = default;
987
+ Object& operator=(Object&& other) = default;
988
+
989
+ /// Creates a new Object instance, like '{}' in JS.
990
+ explicit Object(Runtime& runtime) : Object(runtime.createObject()) {}
991
+
992
+ static Object createFromHostObject(
993
+ Runtime& runtime,
994
+ std::shared_ptr<HostObject> ho) {
995
+ return runtime.createObject(ho);
996
+ }
997
+
998
+ /// Creates a new Object with the custom prototype
999
+ static Object create(Runtime& runtime, const Value& prototype) {
1000
+ return runtime.createObjectWithPrototype(prototype);
1001
+ }
1002
+
1003
+ /// \return whether this and \c obj are the same JSObject or not.
1004
+ static bool strictEquals(Runtime& runtime, const Object& a, const Object& b) {
1005
+ return runtime.strictEquals(a, b);
1006
+ }
1007
+
1008
+ /// \return the result of `this instanceOf ctor` in JS.
1009
+ bool instanceOf(Runtime& rt, const Function& ctor) const {
1010
+ return rt.instanceOf(*this, ctor);
1011
+ }
1012
+
1013
+ /// Sets \p prototype as the prototype of the object. The prototype must be
1014
+ /// either an Object or null. If the prototype was not set successfully, this
1015
+ /// method will throw.
1016
+ void setPrototype(Runtime& runtime, const Value& prototype) const {
1017
+ return runtime.setPrototypeOf(*this, prototype);
1018
+ }
1019
+
1020
+ /// \return the prototype of the object
1021
+ inline Value getPrototype(Runtime& runtime) const;
1022
+
1023
+ /// \return the property of the object with the given ascii name.
1024
+ /// If the name isn't a property on the object, returns the
1025
+ /// undefined value.
1026
+ Value getProperty(Runtime& runtime, const char* name) const;
1027
+
1028
+ /// \return the property of the object with the String name.
1029
+ /// If the name isn't a property on the object, returns the
1030
+ /// undefined value.
1031
+ Value getProperty(Runtime& runtime, const String& name) const;
1032
+
1033
+ /// \return the property of the object with the given JS PropNameID
1034
+ /// name. If the name isn't a property on the object, returns the
1035
+ /// undefined value.
1036
+ Value getProperty(Runtime& runtime, const PropNameID& name) const;
1037
+
1038
+ /// \return the Property of the object with the given JS Value name. If the
1039
+ /// name isn't a property on the object, returns the undefined value.This
1040
+ /// attempts to convert the JS Value to convert to a property key. If the
1041
+ /// conversion fails, this method may throw.
1042
+ Value getProperty(Runtime& runtime, const Value& name) const;
1043
+
1044
+ /// \return true if and only if the object has a property with the
1045
+ /// given ascii name.
1046
+ bool hasProperty(Runtime& runtime, const char* name) const;
1047
+
1048
+ /// \return true if and only if the object has a property with the
1049
+ /// given String name.
1050
+ bool hasProperty(Runtime& runtime, const String& name) const;
1051
+
1052
+ /// \return true if and only if the object has a property with the
1053
+ /// given PropNameID name.
1054
+ bool hasProperty(Runtime& runtime, const PropNameID& name) const;
1055
+
1056
+ /// \return true if and only if the object has a property with the given
1057
+ /// JS Value name. This attempts to convert the JS Value to convert to a
1058
+ /// property key. If the conversion fails, this method may throw.
1059
+ bool hasProperty(Runtime& runtime, const Value& name) const;
1060
+
1061
+ /// Sets the property value from a Value or anything which can be
1062
+ /// used to make one: nullptr_t, bool, double, int, const char*,
1063
+ /// String, or Object.
1064
+ template <typename T>
1065
+ void setProperty(Runtime& runtime, const char* name, T&& value) const;
1066
+
1067
+ /// Sets the property value from a Value or anything which can be
1068
+ /// used to make one: nullptr_t, bool, double, int, const char*,
1069
+ /// String, or Object.
1070
+ template <typename T>
1071
+ void setProperty(Runtime& runtime, const String& name, T&& value) const;
1072
+
1073
+ /// Sets the property value from a Value or anything which can be
1074
+ /// used to make one: nullptr_t, bool, double, int, const char*,
1075
+ /// String, or Object.
1076
+ template <typename T>
1077
+ void setProperty(Runtime& runtime, const PropNameID& name, T&& value) const;
1078
+
1079
+ /// Sets the property value from a Value or anything which can be
1080
+ /// used to make one: nullptr_t, bool, double, int, const char*,
1081
+ /// String, or Object. This takes a JS Value as the property name, and
1082
+ /// attempts to convert to a property key. If the conversion fails, this
1083
+ /// method may throw.
1084
+ template <typename T>
1085
+ void setProperty(Runtime& runtime, const Value& name, T&& value) const;
1086
+
1087
+ /// Delete the property with the given ascii name. Throws if the deletion
1088
+ /// failed.
1089
+ void deleteProperty(Runtime& runtime, const char* name) const;
1090
+
1091
+ /// Delete the property with the given String name. Throws if the deletion
1092
+ /// failed.
1093
+ void deleteProperty(Runtime& runtime, const String& name) const;
1094
+
1095
+ /// Delete the property with the given PropNameID name. Throws if the deletion
1096
+ /// failed.
1097
+ void deleteProperty(Runtime& runtime, const PropNameID& name) const;
1098
+
1099
+ /// Delete the property with the given Value name. Throws if the deletion
1100
+ /// failed.
1101
+ void deleteProperty(Runtime& runtime, const Value& name) const;
1102
+
1103
+ /// \return true iff JS \c Array.isArray() would return \c true. If
1104
+ /// so, then \c getArray() will succeed.
1105
+ bool isArray(Runtime& runtime) const {
1106
+ return runtime.isArray(*this);
1107
+ }
1108
+
1109
+ /// \return true iff the Object is an ArrayBuffer. If so, then \c
1110
+ /// getArrayBuffer() will succeed.
1111
+ bool isArrayBuffer(Runtime& runtime) const {
1112
+ return runtime.isArrayBuffer(*this);
1113
+ }
1114
+
1115
+ /// \return true iff the Object is callable. If so, then \c
1116
+ /// getFunction will succeed.
1117
+ bool isFunction(Runtime& runtime) const {
1118
+ return runtime.isFunction(*this);
1119
+ }
1120
+
1121
+ /// \return true iff the Object was initialized with \c createFromHostObject
1122
+ /// and the HostObject passed is of type \c T. If returns \c true then
1123
+ /// \c getHostObject<T> will succeed.
1124
+ template <typename T = HostObject>
1125
+ bool isHostObject(Runtime& runtime) const;
1126
+
1127
+ /// \return an Array instance which refers to the same underlying
1128
+ /// object. If \c isArray() would return false, this will assert.
1129
+ Array getArray(Runtime& runtime) const&;
1130
+
1131
+ /// \return an Array instance which refers to the same underlying
1132
+ /// object. If \c isArray() would return false, this will assert.
1133
+ Array getArray(Runtime& runtime) &&;
1134
+
1135
+ /// \return an Array instance which refers to the same underlying
1136
+ /// object. If \c isArray() would return false, this will throw
1137
+ /// JSIException.
1138
+ Array asArray(Runtime& runtime) const&;
1139
+
1140
+ /// \return an Array instance which refers to the same underlying
1141
+ /// object. If \c isArray() would return false, this will throw
1142
+ /// JSIException.
1143
+ Array asArray(Runtime& runtime) &&;
1144
+
1145
+ /// \return an ArrayBuffer instance which refers to the same underlying
1146
+ /// object. If \c isArrayBuffer() would return false, this will assert.
1147
+ ArrayBuffer getArrayBuffer(Runtime& runtime) const&;
1148
+
1149
+ /// \return an ArrayBuffer instance which refers to the same underlying
1150
+ /// object. If \c isArrayBuffer() would return false, this will assert.
1151
+ ArrayBuffer getArrayBuffer(Runtime& runtime) &&;
1152
+
1153
+ /// \return a Function instance which refers to the same underlying
1154
+ /// object. If \c isFunction() would return false, this will assert.
1155
+ Function getFunction(Runtime& runtime) const&;
1156
+
1157
+ /// \return a Function instance which refers to the same underlying
1158
+ /// object. If \c isFunction() would return false, this will assert.
1159
+ Function getFunction(Runtime& runtime) &&;
1160
+
1161
+ /// \return a Function instance which refers to the same underlying
1162
+ /// object. If \c isFunction() would return false, this will throw
1163
+ /// JSIException.
1164
+ Function asFunction(Runtime& runtime) const&;
1165
+
1166
+ /// \return a Function instance which refers to the same underlying
1167
+ /// object. If \c isFunction() would return false, this will throw
1168
+ /// JSIException.
1169
+ Function asFunction(Runtime& runtime) &&;
1170
+
1171
+ /// \return a shared_ptr<T> which refers to the same underlying
1172
+ /// \c HostObject that was used to create this object. If \c isHostObject<T>
1173
+ /// is false, this will assert. Note that this does a type check and will
1174
+ /// assert if the underlying HostObject isn't of type \c T
1175
+ template <typename T = HostObject>
1176
+ std::shared_ptr<T> getHostObject(Runtime& runtime) const;
1177
+
1178
+ /// \return a shared_ptr<T> which refers to the same underlying
1179
+ /// \c HostObject that was used to create this object. If \c isHostObject<T>
1180
+ /// is false, this will throw.
1181
+ template <typename T = HostObject>
1182
+ std::shared_ptr<T> asHostObject(Runtime& runtime) const;
1183
+
1184
+ /// \return whether this object has native state of type T previously set by
1185
+ /// \c setNativeState.
1186
+ template <typename T = NativeState>
1187
+ bool hasNativeState(Runtime& runtime) const;
1188
+
1189
+ /// \return a shared_ptr to the state previously set by \c setNativeState.
1190
+ /// If \c hasNativeState<T> is false, this will assert. Note that this does a
1191
+ /// type check and will assert if the native state isn't of type \c T
1192
+ template <typename T = NativeState>
1193
+ std::shared_ptr<T> getNativeState(Runtime& runtime) const;
1194
+
1195
+ /// Set the internal native state property of this object, overwriting any old
1196
+ /// value. Creates a new shared_ptr to the object managed by \p state, which
1197
+ /// will live until the value at this property becomes unreachable.
1198
+ ///
1199
+ /// Throws a type error if this object is a proxy or host object.
1200
+ void setNativeState(Runtime& runtime, std::shared_ptr<NativeState> state)
1201
+ const;
1202
+
1203
+ /// \return same as \c getProperty(name).asObject(), except with
1204
+ /// a better exception message.
1205
+ Object getPropertyAsObject(Runtime& runtime, const char* name) const;
1206
+
1207
+ /// \return similar to \c
1208
+ /// getProperty(name).getObject().getFunction(), except it will
1209
+ /// throw JSIException instead of asserting if the property is
1210
+ /// not an object, or the object is not callable.
1211
+ Function getPropertyAsFunction(Runtime& runtime, const char* name) const;
1212
+
1213
+ /// \return an Array consisting of all enumerable property names in
1214
+ /// the object and its prototype chain. All values in the return
1215
+ /// will be isString(). (This is probably not optimal, but it
1216
+ /// works. I only need it in one place.)
1217
+ Array getPropertyNames(Runtime& runtime) const;
1218
+
1219
+ /// Inform the runtime that there is additional memory associated with a given
1220
+ /// JavaScript object that is not visible to the GC. This can be used if an
1221
+ /// object is known to retain some native memory, and may be used to guide
1222
+ /// decisions about when to run garbage collection.
1223
+ /// This method may be invoked multiple times on an object, and subsequent
1224
+ /// calls will overwrite any previously set value. Once the object is garbage
1225
+ /// collected, the associated external memory will be considered freed and may
1226
+ /// no longer factor into GC decisions.
1227
+ void setExternalMemoryPressure(Runtime& runtime, size_t amt) const;
1228
+
1229
+ protected:
1230
+ void setPropertyValue(
1231
+ Runtime& runtime,
1232
+ const String& name,
1233
+ const Value& value) const {
1234
+ return runtime.setPropertyValue(*this, name, value);
1235
+ }
1236
+
1237
+ void setPropertyValue(
1238
+ Runtime& runtime,
1239
+ const PropNameID& name,
1240
+ const Value& value) const {
1241
+ return runtime.setPropertyValue(*this, name, value);
1242
+ }
1243
+
1244
+ void setPropertyValue(Runtime& runtime, const Value& name, const Value& value)
1245
+ const {
1246
+ return runtime.setPropertyValue(*this, name, value);
1247
+ }
1248
+
1249
+ friend class Runtime;
1250
+ friend class Value;
1251
+ };
1252
+
1253
+ /// Represents a weak reference to a JS Object. If the only reference
1254
+ /// to an Object are these, the object is eligible for GC. Method
1255
+ /// names are inspired by C++ weak_ptr. Movable, not copyable.
1256
+ class JSI_EXPORT WeakObject : public Pointer {
1257
+ public:
1258
+ using Pointer::Pointer;
1259
+
1260
+ WeakObject(WeakObject&& other) = default;
1261
+ WeakObject& operator=(WeakObject&& other) = default;
1262
+
1263
+ /// Create a WeakObject from an Object.
1264
+ WeakObject(Runtime& runtime, const Object& o)
1265
+ : WeakObject(runtime.createWeakObject(o)) {}
1266
+
1267
+ /// \return a Value representing the underlying Object if it is still valid;
1268
+ /// otherwise returns \c undefined. Note that this method has nothing to do
1269
+ /// with threads or concurrency. The name is based on std::weak_ptr::lock()
1270
+ /// which serves a similar purpose.
1271
+ Value lock(Runtime& runtime) const;
1272
+
1273
+ friend class Runtime;
1274
+ };
1275
+
1276
+ /// Represents a JS Object which can be efficiently used as an array
1277
+ /// with integral indices.
1278
+ class JSI_EXPORT Array : public Object {
1279
+ public:
1280
+ Array(Array&&) = default;
1281
+ /// Creates a new Array instance, with \c length undefined elements.
1282
+ Array(Runtime& runtime, size_t length) : Array(runtime.createArray(length)) {}
1283
+
1284
+ Array& operator=(Array&&) = default;
1285
+
1286
+ /// \return the size of the Array, according to its length property.
1287
+ /// (C++ naming convention)
1288
+ size_t size(Runtime& runtime) const {
1289
+ return runtime.size(*this);
1290
+ }
1291
+
1292
+ /// \return the size of the Array, according to its length property.
1293
+ /// (JS naming convention)
1294
+ size_t length(Runtime& runtime) const {
1295
+ return size(runtime);
1296
+ }
1297
+
1298
+ /// \return the property of the array at index \c i. If there is no
1299
+ /// such property, returns the undefined value. If \c i is out of
1300
+ /// range [ 0..\c length ] throws a JSIException.
1301
+ Value getValueAtIndex(Runtime& runtime, size_t i) const;
1302
+
1303
+ /// Sets the property of the array at index \c i. The argument
1304
+ /// value behaves as with Object::setProperty(). If \c i is out of
1305
+ /// range [ 0..\c length ] throws a JSIException.
1306
+ template <typename T>
1307
+ void setValueAtIndex(Runtime& runtime, size_t i, T&& value) const;
1308
+
1309
+ /// There is no current API for changing the size of an array once
1310
+ /// created. We'll probably need that eventually.
1311
+
1312
+ /// Creates a new Array instance from provided values
1313
+ template <typename... Args>
1314
+ static Array createWithElements(Runtime&, Args&&... args);
1315
+
1316
+ /// Creates a new Array instance from initializer list.
1317
+ static Array createWithElements(
1318
+ Runtime& runtime,
1319
+ std::initializer_list<Value> elements);
1320
+
1321
+ private:
1322
+ friend class Object;
1323
+ friend class Value;
1324
+ friend class Runtime;
1325
+
1326
+ void setValueAtIndexImpl(Runtime& runtime, size_t i, const Value& value)
1327
+ const {
1328
+ return runtime.setValueAtIndexImpl(*this, i, value);
1329
+ }
1330
+
1331
+ Array(Runtime::PointerValue* value) : Object(value) {}
1332
+ };
1333
+
1334
+ /// Represents a JSArrayBuffer
1335
+ class JSI_EXPORT ArrayBuffer : public Object {
1336
+ public:
1337
+ ArrayBuffer(ArrayBuffer&&) = default;
1338
+ ArrayBuffer& operator=(ArrayBuffer&&) = default;
1339
+
1340
+ ArrayBuffer(Runtime& runtime, std::shared_ptr<MutableBuffer> buffer)
1341
+ : ArrayBuffer(runtime.createArrayBuffer(std::move(buffer))) {}
1342
+
1343
+ /// \return the size of the ArrayBuffer storage. This is not affected by
1344
+ /// overriding the byteLength property.
1345
+ /// (C++ naming convention)
1346
+ size_t size(Runtime& runtime) const {
1347
+ return runtime.size(*this);
1348
+ }
1349
+
1350
+ size_t length(Runtime& runtime) const {
1351
+ return runtime.size(*this);
1352
+ }
1353
+
1354
+ uint8_t* data(Runtime& runtime) const {
1355
+ return runtime.data(*this);
1356
+ }
1357
+
1358
+ private:
1359
+ friend class Object;
1360
+ friend class Value;
1361
+ friend class Runtime;
1362
+
1363
+ ArrayBuffer(Runtime::PointerValue* value) : Object(value) {}
1364
+ };
1365
+
1366
+ /// Represents a JS Object which is guaranteed to be Callable.
1367
+ class JSI_EXPORT Function : public Object {
1368
+ public:
1369
+ Function(Function&&) = default;
1370
+ Function& operator=(Function&&) = default;
1371
+
1372
+ /// Create a function which, when invoked, calls C++ code. If the
1373
+ /// function throws an exception, a JS Error will be created and
1374
+ /// thrown.
1375
+ /// \param name the name property for the function.
1376
+ /// \param paramCount the length property for the function, which
1377
+ /// may not be the number of arguments the function is passed.
1378
+ /// \note The std::function's dtor will be called when the GC finalizes this
1379
+ /// function. As with HostObject, this may be as late as when the Runtime is
1380
+ /// shut down, and may occur on an arbitrary thread. If the function contains
1381
+ /// any captured values, you are responsible for ensuring that their
1382
+ /// destructors are safe to call on any thread.
1383
+ static Function createFromHostFunction(
1384
+ Runtime& runtime,
1385
+ const jsi::PropNameID& name,
1386
+ unsigned int paramCount,
1387
+ jsi::HostFunctionType func);
1388
+
1389
+ /// Calls the function with \c count \c args. The \c this value of the JS
1390
+ /// function will not be set by the C++ caller, similar to calling
1391
+ /// Function.prototype.apply(undefined, args) in JS.
1392
+ /// \b Note: as with Function.prototype.apply, \c this may not always be
1393
+ /// \c undefined in the function itself. If the function is non-strict,
1394
+ /// \c this will be set to the global object.
1395
+ Value call(Runtime& runtime, const Value* args, size_t count) const;
1396
+
1397
+ /// Calls the function with a \c std::initializer_list of Value
1398
+ /// arguments. The \c this value of the JS function will not be set by the
1399
+ /// C++ caller, similar to calling Function.prototype.apply(undefined, args)
1400
+ /// in JS.
1401
+ /// \b Note: as with Function.prototype.apply, \c this may not always be
1402
+ /// \c undefined in the function itself. If the function is non-strict,
1403
+ /// \c this will be set to the global object.
1404
+ Value call(Runtime& runtime, std::initializer_list<Value> args) const;
1405
+
1406
+ /// Calls the function with any number of arguments similarly to
1407
+ /// Object::setProperty(). The \c this value of the JS function will not be
1408
+ /// set by the C++ caller, similar to calling
1409
+ /// Function.prototype.call(undefined, ...args) in JS.
1410
+ /// \b Note: as with Function.prototype.call, \c this may not always be
1411
+ /// \c undefined in the function itself. If the function is non-strict,
1412
+ /// \c this will be set to the global object.
1413
+ template <typename... Args>
1414
+ Value call(Runtime& runtime, Args&&... args) const;
1415
+
1416
+ /// Calls the function with \c count \c args and \c jsThis value passed
1417
+ /// as the \c this value.
1418
+ Value callWithThis(
1419
+ Runtime& Runtime,
1420
+ const Object& jsThis,
1421
+ const Value* args,
1422
+ size_t count) const;
1423
+
1424
+ /// Calls the function with a \c std::initializer_list of Value
1425
+ /// arguments and \c jsThis passed as the \c this value.
1426
+ Value callWithThis(
1427
+ Runtime& runtime,
1428
+ const Object& jsThis,
1429
+ std::initializer_list<Value> args) const;
1430
+
1431
+ /// Calls the function with any number of arguments similarly to
1432
+ /// Object::setProperty(), and with \c jsThis passed as the \c this value.
1433
+ template <typename... Args>
1434
+ Value callWithThis(Runtime& runtime, const Object& jsThis, Args&&... args)
1435
+ const;
1436
+
1437
+ /// Calls the function as a constructor with \c count \c args. Equivalent
1438
+ /// to calling `new Func` where `Func` is the js function reqresented by
1439
+ /// this.
1440
+ Value callAsConstructor(Runtime& runtime, const Value* args, size_t count)
1441
+ const;
1442
+
1443
+ /// Same as above `callAsConstructor`, except use an initializer_list to
1444
+ /// supply the arguments.
1445
+ Value callAsConstructor(Runtime& runtime, std::initializer_list<Value> args)
1446
+ const;
1447
+
1448
+ /// Same as above `callAsConstructor`, but automatically converts/wraps
1449
+ /// any argument with a jsi Value.
1450
+ template <typename... Args>
1451
+ Value callAsConstructor(Runtime& runtime, Args&&... args) const;
1452
+
1453
+ /// Returns whether this was created with Function::createFromHostFunction.
1454
+ /// If true then you can use getHostFunction to get the underlying
1455
+ /// HostFunctionType.
1456
+ bool isHostFunction(Runtime& runtime) const {
1457
+ return runtime.isHostFunction(*this);
1458
+ }
1459
+
1460
+ /// Returns the underlying HostFunctionType iff isHostFunction returns true
1461
+ /// and asserts otherwise. You can use this to use std::function<>::target
1462
+ /// to get the object that was passed to create the HostFunctionType.
1463
+ ///
1464
+ /// Note: The reference returned is borrowed from the JS object underlying
1465
+ /// \c this, and thus only lasts as long as the object underlying
1466
+ /// \c this does.
1467
+ HostFunctionType& getHostFunction(Runtime& runtime) const {
1468
+ assert(isHostFunction(runtime));
1469
+ return runtime.getHostFunction(*this);
1470
+ }
1471
+
1472
+ private:
1473
+ friend class Object;
1474
+ friend class Value;
1475
+ friend class Runtime;
1476
+
1477
+ Function(Runtime::PointerValue* value) : Object(value) {}
1478
+ };
1479
+
1480
+ /// Represents any JS Value (undefined, null, boolean, number, symbol,
1481
+ /// string, or object). Movable, or explicitly copyable (has no copy
1482
+ /// ctor).
1483
+ class JSI_EXPORT Value {
1484
+ public:
1485
+ /// Default ctor creates an \c undefined JS value.
1486
+ Value() noexcept : Value(UndefinedKind) {}
1487
+
1488
+ /// Creates a \c null JS value.
1489
+ /* implicit */ Value(std::nullptr_t) : kind_(NullKind) {}
1490
+
1491
+ /// Creates a boolean JS value.
1492
+ /* implicit */ Value(bool b) : Value(BooleanKind) {
1493
+ data_.boolean = b;
1494
+ }
1495
+
1496
+ /// Creates a number JS value.
1497
+ /* implicit */ Value(double d) : Value(NumberKind) {
1498
+ data_.number = d;
1499
+ }
1500
+
1501
+ /// Creates a number JS value.
1502
+ /* implicit */ Value(int i) : Value(NumberKind) {
1503
+ data_.number = i;
1504
+ }
1505
+
1506
+ /// Moves a Symbol, String, or Object rvalue into a new JS value.
1507
+ template <
1508
+ typename T,
1509
+ typename = std::enable_if_t<
1510
+ std::is_base_of<Symbol, T>::value ||
1511
+ std::is_base_of<BigInt, T>::value ||
1512
+ std::is_base_of<String, T>::value ||
1513
+ std::is_base_of<Object, T>::value>>
1514
+ /* implicit */ Value(T&& other) : Value(kindOf(other)) {
1515
+ new (&data_.pointer) T(std::move(other));
1516
+ }
1517
+
1518
+ /// Value("foo") will treat foo as a bool. This makes doing that a
1519
+ /// compile error.
1520
+ template <typename T = void>
1521
+ Value(const char*) {
1522
+ static_assert(
1523
+ !std::is_same<void, T>::value,
1524
+ "Value cannot be constructed directly from const char*");
1525
+ }
1526
+
1527
+ Value(Value&& other) noexcept;
1528
+
1529
+ /// Copies a Symbol lvalue into a new JS value.
1530
+ Value(Runtime& runtime, const Symbol& sym) : Value(SymbolKind) {
1531
+ new (&data_.pointer) Symbol(runtime.cloneSymbol(sym.ptr_));
1532
+ }
1533
+
1534
+ /// Copies a BigInt lvalue into a new JS value.
1535
+ Value(Runtime& runtime, const BigInt& bigint) : Value(BigIntKind) {
1536
+ new (&data_.pointer) BigInt(runtime.cloneBigInt(bigint.ptr_));
1537
+ }
1538
+
1539
+ /// Copies a String lvalue into a new JS value.
1540
+ Value(Runtime& runtime, const String& str) : Value(StringKind) {
1541
+ new (&data_.pointer) String(runtime.cloneString(str.ptr_));
1542
+ }
1543
+
1544
+ /// Copies a Object lvalue into a new JS value.
1545
+ Value(Runtime& runtime, const Object& obj) : Value(ObjectKind) {
1546
+ new (&data_.pointer) Object(runtime.cloneObject(obj.ptr_));
1547
+ }
1548
+
1549
+ /// Creates a JS value from another Value lvalue.
1550
+ Value(Runtime& runtime, const Value& value);
1551
+
1552
+ /// Value(rt, "foo") will treat foo as a bool. This makes doing
1553
+ /// that a compile error.
1554
+ template <typename T = void>
1555
+ Value(Runtime&, const char*) {
1556
+ static_assert(
1557
+ !std::is_same<T, void>::value,
1558
+ "Value cannot be constructed directly from const char*");
1559
+ }
1560
+
1561
+ ~Value();
1562
+ // \return the undefined \c Value.
1563
+ static Value undefined() {
1564
+ return Value();
1565
+ }
1566
+
1567
+ // \return the null \c Value.
1568
+ static Value null() {
1569
+ return Value(nullptr);
1570
+ }
1571
+
1572
+ // \return a \c Value created from a utf8-encoded JSON string.
1573
+ static Value
1574
+ createFromJsonUtf8(Runtime& runtime, const uint8_t* json, size_t length) {
1575
+ return runtime.createValueFromJsonUtf8(json, length);
1576
+ }
1577
+
1578
+ /// \return according to the Strict Equality Comparison algorithm, see:
1579
+ /// https://262.ecma-international.org/11.0/#sec-strict-equality-comparison
1580
+ static bool strictEquals(Runtime& runtime, const Value& a, const Value& b);
1581
+
1582
+ Value& operator=(Value&& other) noexcept {
1583
+ this->~Value();
1584
+ new (this) Value(std::move(other));
1585
+ return *this;
1586
+ }
1587
+
1588
+ bool isUndefined() const {
1589
+ return kind_ == UndefinedKind;
1590
+ }
1591
+
1592
+ bool isNull() const {
1593
+ return kind_ == NullKind;
1594
+ }
1595
+
1596
+ bool isBool() const {
1597
+ return kind_ == BooleanKind;
1598
+ }
1599
+
1600
+ bool isNumber() const {
1601
+ return kind_ == NumberKind;
1602
+ }
1603
+
1604
+ bool isString() const {
1605
+ return kind_ == StringKind;
1606
+ }
1607
+
1608
+ bool isBigInt() const {
1609
+ return kind_ == BigIntKind;
1610
+ }
1611
+
1612
+ bool isSymbol() const {
1613
+ return kind_ == SymbolKind;
1614
+ }
1615
+
1616
+ bool isObject() const {
1617
+ return kind_ == ObjectKind;
1618
+ }
1619
+
1620
+ /// \return the boolean value, or asserts if not a boolean.
1621
+ bool getBool() const {
1622
+ assert(isBool());
1623
+ return data_.boolean;
1624
+ }
1625
+
1626
+ /// \return the boolean value, or throws JSIException if not a
1627
+ /// boolean.
1628
+ bool asBool() const;
1629
+
1630
+ /// \return the number value, or asserts if not a number.
1631
+ double getNumber() const {
1632
+ assert(isNumber());
1633
+ return data_.number;
1634
+ }
1635
+
1636
+ /// \return the number value, or throws JSIException if not a
1637
+ /// number.
1638
+ double asNumber() const;
1639
+
1640
+ /// \return the Symbol value, or asserts if not a symbol.
1641
+ Symbol getSymbol(Runtime& runtime) const& {
1642
+ assert(isSymbol());
1643
+ return Symbol(runtime.cloneSymbol(data_.pointer.ptr_));
1644
+ }
1645
+
1646
+ /// \return the Symbol value, or asserts if not a symbol.
1647
+ /// Can be used on rvalue references to avoid cloning more symbols.
1648
+ Symbol getSymbol(Runtime&) && {
1649
+ assert(isSymbol());
1650
+ auto ptr = data_.pointer.ptr_;
1651
+ data_.pointer.ptr_ = nullptr;
1652
+ return static_cast<Symbol>(ptr);
1653
+ }
1654
+
1655
+ /// \return the Symbol value, or throws JSIException if not a
1656
+ /// symbol
1657
+ Symbol asSymbol(Runtime& runtime) const&;
1658
+ Symbol asSymbol(Runtime& runtime) &&;
1659
+
1660
+ /// \return the BigInt value, or asserts if not a bigint.
1661
+ BigInt getBigInt(Runtime& runtime) const& {
1662
+ assert(isBigInt());
1663
+ return BigInt(runtime.cloneBigInt(data_.pointer.ptr_));
1664
+ }
1665
+
1666
+ /// \return the BigInt value, or asserts if not a bigint.
1667
+ /// Can be used on rvalue references to avoid cloning more bigints.
1668
+ BigInt getBigInt(Runtime&) && {
1669
+ assert(isBigInt());
1670
+ auto ptr = data_.pointer.ptr_;
1671
+ data_.pointer.ptr_ = nullptr;
1672
+ return static_cast<BigInt>(ptr);
1673
+ }
1674
+
1675
+ /// \return the BigInt value, or throws JSIException if not a
1676
+ /// bigint
1677
+ BigInt asBigInt(Runtime& runtime) const&;
1678
+ BigInt asBigInt(Runtime& runtime) &&;
1679
+
1680
+ /// \return the String value, or asserts if not a string.
1681
+ String getString(Runtime& runtime) const& {
1682
+ assert(isString());
1683
+ return String(runtime.cloneString(data_.pointer.ptr_));
1684
+ }
1685
+
1686
+ /// \return the String value, or asserts if not a string.
1687
+ /// Can be used on rvalue references to avoid cloning more strings.
1688
+ String getString(Runtime&) && {
1689
+ assert(isString());
1690
+ auto ptr = data_.pointer.ptr_;
1691
+ data_.pointer.ptr_ = nullptr;
1692
+ return static_cast<String>(ptr);
1693
+ }
1694
+
1695
+ /// \return the String value, or throws JSIException if not a
1696
+ /// string.
1697
+ String asString(Runtime& runtime) const&;
1698
+ String asString(Runtime& runtime) &&;
1699
+
1700
+ /// \return the Object value, or asserts if not an object.
1701
+ Object getObject(Runtime& runtime) const& {
1702
+ assert(isObject());
1703
+ return Object(runtime.cloneObject(data_.pointer.ptr_));
1704
+ }
1705
+
1706
+ /// \return the Object value, or asserts if not an object.
1707
+ /// Can be used on rvalue references to avoid cloning more objects.
1708
+ Object getObject(Runtime&) && {
1709
+ assert(isObject());
1710
+ auto ptr = data_.pointer.ptr_;
1711
+ data_.pointer.ptr_ = nullptr;
1712
+ return static_cast<Object>(ptr);
1713
+ }
1714
+
1715
+ /// \return the Object value, or throws JSIException if not an
1716
+ /// object.
1717
+ Object asObject(Runtime& runtime) const&;
1718
+ Object asObject(Runtime& runtime) &&;
1719
+
1720
+ // \return a String like JS .toString() would do.
1721
+ String toString(Runtime& runtime) const;
1722
+
1723
+ private:
1724
+ friend class Runtime;
1725
+
1726
+ enum ValueKind {
1727
+ UndefinedKind,
1728
+ NullKind,
1729
+ BooleanKind,
1730
+ NumberKind,
1731
+ SymbolKind,
1732
+ BigIntKind,
1733
+ StringKind,
1734
+ ObjectKind,
1735
+ PointerKind = SymbolKind,
1736
+ };
1737
+
1738
+ union Data {
1739
+ // Value's ctor and dtor will manage the lifecycle of the contained Data.
1740
+ Data() {
1741
+ static_assert(
1742
+ sizeof(Data) == sizeof(uint64_t),
1743
+ "Value data should fit in a 64-bit register");
1744
+ }
1745
+ ~Data() {}
1746
+
1747
+ // scalars
1748
+ bool boolean;
1749
+ double number;
1750
+ // pointers
1751
+ Pointer pointer; // Symbol, String, Object, Array, Function
1752
+ };
1753
+
1754
+ Value(ValueKind kind) : kind_(kind) {}
1755
+
1756
+ constexpr static ValueKind kindOf(const Symbol&) {
1757
+ return SymbolKind;
1758
+ }
1759
+ constexpr static ValueKind kindOf(const BigInt&) {
1760
+ return BigIntKind;
1761
+ }
1762
+ constexpr static ValueKind kindOf(const String&) {
1763
+ return StringKind;
1764
+ }
1765
+ constexpr static ValueKind kindOf(const Object&) {
1766
+ return ObjectKind;
1767
+ }
1768
+
1769
+ ValueKind kind_;
1770
+ Data data_;
1771
+
1772
+ // In the future: Value becomes NaN-boxed. See T40538354.
1773
+ };
1774
+
1775
+ /// Not movable and not copyable RAII marker advising the underlying
1776
+ /// JavaScript VM to track resources allocated since creation until
1777
+ /// destruction so that they can be recycled eagerly when the Scope
1778
+ /// goes out of scope instead of floating in the air until the next
1779
+ /// garbage collection or any other delayed release occurs.
1780
+ ///
1781
+ /// This API should be treated only as advice, implementations can
1782
+ /// choose to ignore the fact that Scopes are created or destroyed.
1783
+ ///
1784
+ /// This class is an exception to the rule allowing destructors to be
1785
+ /// called without proper synchronization (see Runtime documentation).
1786
+ /// The whole point of this class is to enable all sorts of clean ups
1787
+ /// when the destructor is called and this proper synchronization is
1788
+ /// required at that time.
1789
+ ///
1790
+ /// Instances of this class are intended to be created as automatic stack
1791
+ /// variables in which case destructor calls don't require any additional
1792
+ /// locking, provided that the lock (if any) is managed with RAII helpers.
1793
+ class JSI_EXPORT Scope {
1794
+ public:
1795
+ explicit Scope(Runtime& rt) : rt_(rt), prv_(rt.pushScope()) {}
1796
+ ~Scope() {
1797
+ rt_.popScope(prv_);
1798
+ }
1799
+
1800
+ Scope(const Scope&) = delete;
1801
+ Scope(Scope&&) = delete;
1802
+
1803
+ Scope& operator=(const Scope&) = delete;
1804
+ Scope& operator=(Scope&&) = delete;
1805
+
1806
+ template <typename F>
1807
+ static auto callInNewScope(Runtime& rt, F f) -> decltype(f()) {
1808
+ Scope s(rt);
1809
+ return f();
1810
+ }
1811
+
1812
+ private:
1813
+ Runtime& rt_;
1814
+ Runtime::ScopeState* prv_;
1815
+ };
1816
+
1817
+ /// Base class for jsi exceptions
1818
+ class JSI_EXPORT JSIException : public std::exception {
1819
+ protected:
1820
+ JSIException() {}
1821
+ JSIException(std::string what) : what_(std::move(what)) {}
1822
+
1823
+ public:
1824
+ JSIException(const JSIException&) = default;
1825
+
1826
+ virtual const char* what() const noexcept override {
1827
+ return what_.c_str();
1828
+ }
1829
+
1830
+ virtual ~JSIException() override;
1831
+
1832
+ protected:
1833
+ std::string what_;
1834
+ };
1835
+
1836
+ /// This exception will be thrown by API functions on errors not related to
1837
+ /// JavaScript execution.
1838
+ class JSI_EXPORT JSINativeException : public JSIException {
1839
+ public:
1840
+ JSINativeException(std::string what) : JSIException(std::move(what)) {}
1841
+
1842
+ JSINativeException(const JSINativeException&) = default;
1843
+
1844
+ virtual ~JSINativeException();
1845
+ };
1846
+
1847
+ /// This exception will be thrown by API functions whenever a JS
1848
+ /// operation causes an exception as described by the spec, or as
1849
+ /// otherwise described.
1850
+ class JSI_EXPORT JSError : public JSIException {
1851
+ public:
1852
+ /// Creates a JSError referring to provided \c value
1853
+ JSError(Runtime& r, Value&& value);
1854
+
1855
+ /// Creates a JSError referring to new \c Error instance capturing current
1856
+ /// JavaScript stack. The error message property is set to given \c message.
1857
+ JSError(Runtime& rt, std::string message);
1858
+
1859
+ /// Creates a JSError referring to new \c Error instance capturing current
1860
+ /// JavaScript stack. The error message property is set to given \c message.
1861
+ JSError(Runtime& rt, const char* message)
1862
+ : JSError(rt, std::string(message)) {}
1863
+
1864
+ /// Creates a JSError referring to a JavaScript Object having message and
1865
+ /// stack properties set to provided values.
1866
+ JSError(Runtime& rt, std::string message, std::string stack);
1867
+
1868
+ /// Creates a JSError referring to provided value and what string
1869
+ /// set to provided message. This argument order is a bit weird,
1870
+ /// but necessary to avoid ambiguity with the above.
1871
+ JSError(std::string what, Runtime& rt, Value&& value);
1872
+
1873
+ /// Creates a JSError referring to the provided value, message and stack. This
1874
+ /// constructor does not take a Runtime parameter, and therefore cannot result
1875
+ /// in recursively invoking the JSError constructor.
1876
+ JSError(Value&& value, std::string message, std::string stack);
1877
+
1878
+ JSError(const JSError&) = default;
1879
+
1880
+ virtual ~JSError();
1881
+
1882
+ const std::string& getStack() const {
1883
+ return stack_;
1884
+ }
1885
+
1886
+ const std::string& getMessage() const {
1887
+ return message_;
1888
+ }
1889
+
1890
+ const jsi::Value& value() const {
1891
+ assert(value_);
1892
+ return *value_;
1893
+ }
1894
+
1895
+ private:
1896
+ // This initializes the value_ member and does some other
1897
+ // validation, so it must be called by every branch through the
1898
+ // constructors.
1899
+ void setValue(Runtime& rt, Value&& value);
1900
+
1901
+ // This needs to be on the heap, because throw requires the object
1902
+ // be copyable, and Value is not.
1903
+ std::shared_ptr<jsi::Value> value_;
1904
+ std::string message_;
1905
+ std::string stack_;
1906
+ };
1907
+
1908
+ /// Helper function to cast the object pointed to by \p ptr into an interface
1909
+ /// specified by \c U. If cast is successful, return a pointer to the object
1910
+ /// as a raw pointer of \c U. Otherwise, return nullptr.
1911
+ /// The returned interface same lifetime as the object referenced by \p ptr.
1912
+ template <typename U, typename T>
1913
+ U* castInterface(T* ptr) {
1914
+ if (ptr) {
1915
+ return static_cast<U*>(ptr->castInterface(U::uuid));
1916
+ }
1917
+ return nullptr;
1918
+ }
1919
+
1920
+ /// Helper function to cast the object managed by the shared_ptr \p ptr into an
1921
+ /// interface specified by \c U. If the cast is successful, return a shared_ptr
1922
+ /// of type \c U to the object. Otherwise, return an empty pointer.
1923
+ /// The returned shared_ptr shares ownership of the object with \p ptr.
1924
+ template <typename U, typename T>
1925
+ std::shared_ptr<U> dynamicInterfaceCast(T&& ptr) {
1926
+ auto* p = ptr->castInterface(U::uuid);
1927
+ U* res = static_cast<U*>(p);
1928
+ if (res) {
1929
+ return std::shared_ptr<U>(std::forward<T>(ptr), res);
1930
+ }
1931
+ return nullptr;
1932
+ }
1933
+
1934
+ } // namespace jsi
1935
+ } // namespace facebook
1936
+
1937
+ #include <jsi/jsi-inl.h>