react-native-tvos 0.75.2-0rc0 → 0.75.3-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 (65) hide show
  1. package/Libraries/Components/Pressable/Pressable.js +5 -6
  2. package/Libraries/Components/ScrollView/ScrollView.d.ts +1 -1
  3. package/Libraries/Components/TV/TVEventHandler.js +11 -6
  4. package/Libraries/Components/TV/TVFocusEventHandler.js +2 -1
  5. package/Libraries/Components/TV/TVFocusGuideView.js +16 -15
  6. package/Libraries/Components/TV/TVTextScrollView.js +10 -9
  7. package/Libraries/Components/TV/TVViewPropTypes.js +1 -1
  8. package/Libraries/Components/TV/tagForComponentOrHandle.js +13 -13
  9. package/Libraries/Components/TV/useTVEventHandler.js +7 -3
  10. package/Libraries/Components/TabBarIOS/RCTTabBarNativeComponent.js +3 -2
  11. package/Libraries/Components/TabBarIOS/TabBarIOS.ios.js +6 -55
  12. package/Libraries/Components/TabBarIOS/{TabBarIOS.android.js → TabBarIOS.js} +8 -5
  13. package/Libraries/Components/TabBarIOS/TabBarIOSProps.js +52 -0
  14. package/Libraries/Components/TabBarIOS/{TabBarItemIOS.android.js → TabBarItemIOS.js} +3 -1
  15. package/Libraries/Components/Touchable/TVTouchable.js +6 -5
  16. package/Libraries/Components/Touchable/Touchable.js +2 -3
  17. package/Libraries/Components/Touchable/TouchableBounce.js +2 -5
  18. package/Libraries/Components/Touchable/TouchableHighlight.js +3 -4
  19. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +3 -4
  20. package/Libraries/Core/ReactNativeVersion.js +2 -2
  21. package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
  22. package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +3 -1
  23. package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -2
  24. package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -2
  25. package/Libraries/NativeComponent/TVViewConfig.js +4 -1
  26. package/Libraries/NewAppScreen/components/DebugInstructions.js +7 -7
  27. package/Libraries/NewAppScreen/components/HermesBadge.js +3 -6
  28. package/Libraries/Pressability/Pressability.js +6 -3
  29. package/Libraries/ReactNative/AppContainer-dev.js +4 -3
  30. package/Libraries/ReactNative/RendererImplementation.js +2 -2
  31. package/Libraries/Renderer/shims/ReactNativeTypes.js +1 -0
  32. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +17 -15
  33. package/Libraries/Utilities/BackHandler.ios.js +25 -23
  34. package/Libraries/Utilities/Platform.d.ts +1 -0
  35. package/Libraries/Utilities/Platform.flow.js +2 -0
  36. package/Libraries/Vibration/Vibration.js +1 -1
  37. package/README-core.md +5 -5
  38. package/README.md +76 -41
  39. package/React/Base/RCTVersion.m +2 -2
  40. package/ReactAndroid/api/ReactAndroid.api +2 -2
  41. package/ReactAndroid/gradle.properties +1 -1
  42. package/ReactAndroid/publish.gradle +1 -1
  43. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.java +2 -4
  44. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
  45. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java +9 -4
  46. package/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/ImageSource.kt +6 -4
  47. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +18 -0
  48. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocketDelegate.cpp +11 -2
  49. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocketDelegate.h +1 -3
  50. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  51. package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +3 -3
  52. package/index.js +3 -3
  53. package/package.json +12 -11
  54. package/scripts/bundle.js +2 -0
  55. package/scripts/cocoapods/autolinking.rb +2 -1
  56. package/scripts/codegen/generate-artifacts-executor.js +3 -2
  57. package/scripts/hermes/hermes-utils.js +0 -1
  58. package/sdks/hermes-engine/utils/build-ios-framework.sh +2 -2
  59. package/sdks/hermesc/osx-bin/hermes +0 -0
  60. package/sdks/hermesc/osx-bin/hermesc +0 -0
  61. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  62. package/types/experimental.d.ts +1 -1
  63. package/types/public/ReactNativeTVTypes.d.ts +44 -3
  64. package/ReactAndroid/src/main/jni/react/devsupport/JOptional.cpp +0 -29
  65. package/ReactAndroid/src/main/jni/react/devsupport/JOptional.h +0 -27
@@ -13,7 +13,6 @@ import androidx.annotation.Nullable;
13
13
  import com.facebook.jni.HybridData;
14
14
  import com.facebook.proguard.annotations.DoNotStrip;
15
15
  import java.io.Closeable;
16
- import java.util.OptionalInt;
17
16
  import java.util.concurrent.TimeUnit;
18
17
  import okhttp3.OkHttpClient;
19
18
  import okhttp3.Request;
@@ -47,7 +46,7 @@ import okhttp3.WebSocketListener;
47
46
  private static class WebSocketDelegate implements Closeable {
48
47
  private final HybridData mHybridData;
49
48
 
50
- public native void didFailWithError(OptionalInt posixCode, String error);
49
+ public native void didFailWithError(@Nullable Integer posixCode, String error);
51
50
 
52
51
  public native void didReceiveMessage(String message);
53
52
 
@@ -103,8 +102,7 @@ import okhttp3.WebSocketListener;
103
102
  @Override
104
103
  public void onFailure(WebSocket _unused, Throwable t, @Nullable Response response) {
105
104
  @Nullable String message = t.getMessage();
106
- delegate.didFailWithError(
107
- OptionalInt.empty(), message != null ? message : "<Unknown error>");
105
+ delegate.didFailWithError(null, message != null ? message : "<Unknown error>");
108
106
  // "No further calls to this listener will be made." -OkHttp docs for
109
107
  // WebSocketListener.onFailure
110
108
  delegate.close();
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 75,
20
- "patch", 2,
21
- "prerelease", "0rc0");
20
+ "patch", 3,
21
+ "prerelease", "0");
22
22
  }
@@ -605,6 +605,7 @@ public class CSSBackgroundDrawable extends Drawable {
605
605
  }
606
606
 
607
607
  // Clip border ONLY if its color is non transparent
608
+ float pathAdjustment = 0f;
608
609
  if (Color.alpha(colorLeft) != 0
609
610
  && Color.alpha(colorTop) != 0
610
611
  && Color.alpha(colorRight) != 0
@@ -615,6 +616,10 @@ public class CSSBackgroundDrawable extends Drawable {
615
616
  mInnerClipTempRectForBorderRadius.bottom -= borderWidth.bottom;
616
617
  mInnerClipTempRectForBorderRadius.left += borderWidth.left;
617
618
  mInnerClipTempRectForBorderRadius.right -= borderWidth.right;
619
+
620
+ // only close gap between border and main path if we draw the border, otherwise
621
+ // we wind up pixelating small pixel-radius curves
622
+ pathAdjustment = mGapBetweenPaths;
618
623
  }
619
624
 
620
625
  mTempRectForCenterDrawPath.top += borderWidth.top * 0.5f;
@@ -661,10 +666,10 @@ public class CSSBackgroundDrawable extends Drawable {
661
666
  // (mInnerClipTempRectForBorderRadius), ensuring the border can be
662
667
  // drawn on top without the gap.
663
668
  mBackgroundColorRenderPath.addRoundRect(
664
- mInnerClipTempRectForBorderRadius.left - mGapBetweenPaths,
665
- mInnerClipTempRectForBorderRadius.top - mGapBetweenPaths,
666
- mInnerClipTempRectForBorderRadius.right + mGapBetweenPaths,
667
- mInnerClipTempRectForBorderRadius.bottom + mGapBetweenPaths,
669
+ mInnerClipTempRectForBorderRadius.left - pathAdjustment,
670
+ mInnerClipTempRectForBorderRadius.top - pathAdjustment,
671
+ mInnerClipTempRectForBorderRadius.right + pathAdjustment,
672
+ mInnerClipTempRectForBorderRadius.bottom + pathAdjustment,
668
673
  new float[] {
669
674
  innerTopLeftRadiusX,
670
675
  innerTopLeftRadiusY,
@@ -23,12 +23,14 @@ constructor(
23
23
  ) {
24
24
 
25
25
  /** Get the URI for this image - can be either a parsed network URI or a resource URI. */
26
- public val uri: Uri = computeUri(context)
26
+ public open val uri: Uri = computeUri(context)
27
27
  /** Get the area of this image. */
28
28
  public val size: Double = width * height
29
29
  /** Get whether this image source represents an Android resource or a network URI. */
30
- public var isResource: Boolean = false
31
- private set
30
+ public open val isResource: Boolean
31
+ get() = _isResource
32
+
33
+ private var _isResource: Boolean = false
32
34
 
33
35
  override fun equals(other: Any?): Boolean {
34
36
  if (this === other) {
@@ -58,7 +60,7 @@ constructor(
58
60
  }
59
61
 
60
62
  private fun computeLocalUri(context: Context): Uri {
61
- isResource = true
63
+ _isResource = true
62
64
  return ResourceDrawableIdHelper.instance.getResourceDrawableUri(context, source)
63
65
  }
64
66
 
@@ -7,6 +7,8 @@
7
7
 
8
8
  package com.facebook.react.views.view;
9
9
 
10
+ import android.content.Context;
11
+ import android.content.pm.PackageManager;
10
12
  import android.graphics.Rect;
11
13
  import android.util.Log;
12
14
  import android.view.View;
@@ -85,6 +87,14 @@ public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> {
85
87
  @ReactProp(name = "accessible")
86
88
  public void setAccessible(ReactViewGroup view, boolean accessible) {
87
89
  view.setFocusable(accessible);
90
+ // This is required to handle Android TV/ Fire TV Devices that are Touch Enabled as well as LeanBack
91
+ // https://developer.android.com/reference/android/view/View#requestFocus(int,%20android.graphics.Rect)
92
+ // ** A view will not actually take focus if it is not focusable (isFocusable() returns false), **
93
+ // ** or if it is focusable and it is not focusable in touch mode (isFocusableInTouchMode()) **
94
+ // ** while the device is in touch mode. **
95
+ if (hasTouchScreen(view.getContext())) {
96
+ view.setFocusableInTouchMode(accessible);
97
+ }
88
98
  }
89
99
 
90
100
  @ReactProp(name = "hasTVPreferredFocus")
@@ -438,6 +448,14 @@ public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> {
438
448
  root.setFocusDestinations(fd);
439
449
  }
440
450
 
451
+ /**
452
+ * Utility function to help capture Android TV/ Fire TV Devices with Touch Support
453
+ */
454
+ private boolean hasTouchScreen(Context context) {
455
+ PackageManager pm = context.getPackageManager();
456
+ return pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN);
457
+ }
458
+
441
459
  @ReactProp(name = "autoFocus")
442
460
  public void setAutoFocusTV(ReactViewGroup view, boolean autoFocus) {
443
461
  view.setAutoFocusTV(autoFocus);
@@ -7,6 +7,8 @@
7
7
 
8
8
  #include "JCxxInspectorPackagerConnectionWebSocketDelegate.h"
9
9
 
10
+ #include <optional>
11
+
10
12
  using namespace facebook::jni;
11
13
 
12
14
  namespace facebook::react::jsinspector_modern {
@@ -17,10 +19,17 @@ JCxxInspectorPackagerConnectionWebSocketDelegate::
17
19
  : cxxDelegate_(cxxDelegate) {}
18
20
 
19
21
  void JCxxInspectorPackagerConnectionWebSocketDelegate::didFailWithError(
20
- alias_ref<JOptionalInt::javaobject> posixCode,
22
+ alias_ref<jni::JInteger> posixCode,
21
23
  const std::string& error) {
24
+ std::optional<int> posixCodeVal;
25
+
26
+ // Handle @Nullable JInteger param
27
+ if (posixCode.get() != nullptr) {
28
+ posixCodeVal = posixCode->intValue();
29
+ }
30
+
22
31
  if (auto delegate = cxxDelegate_.lock()) {
23
- delegate->didFailWithError(*posixCode, error);
32
+ delegate->didFailWithError(posixCodeVal, error);
24
33
  }
25
34
  }
26
35
 
@@ -7,8 +7,6 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #include "JOptional.h"
11
-
12
10
  #include <fbjni/fbjni.h>
13
11
  #include <jsinspector-modern/InspectorPackagerConnection.h>
14
12
 
@@ -29,7 +27,7 @@ class JCxxInspectorPackagerConnectionWebSocketDelegate
29
27
  "Lcom/facebook/react/devsupport/CxxInspectorPackagerConnection$WebSocketDelegate;";
30
28
 
31
29
  void didFailWithError(
32
- jni::alias_ref<JOptionalInt::javaobject> posixCode,
30
+ jni::alias_ref<jni::JInteger> posixCode,
33
31
  const std::string& error);
34
32
 
35
33
  void didReceiveMessage(const std::string& message);
@@ -17,8 +17,8 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 75;
20
- int32_t Patch = 2;
21
- std::string_view Prerelease = "0rc0";
20
+ int32_t Patch = 3;
21
+ std::string_view Prerelease = "0";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -62,13 +62,13 @@ BaseViewProps::BaseViewProps(
62
62
  rawProps,
63
63
  "isTVSelectable",
64
64
  sourceProps.isTVSelectable,
65
- (Boolean) false)),
65
+ false)),
66
66
  hasTVPreferredFocus(CoreFeatures::enablePropIteratorSetter ? sourceProps.hasTVPreferredFocus : convertRawProp(
67
67
  context,
68
68
  rawProps,
69
69
  "hasTVPreferredFocus",
70
70
  sourceProps.hasTVPreferredFocus,
71
- (Boolean) false)),
71
+ false)),
72
72
  tvParallaxProperties(CoreFeatures::enablePropIteratorSetter ? sourceProps.tvParallaxProperties : convertRawProp(
73
73
  context,
74
74
  rawProps,
@@ -104,7 +104,7 @@ BaseViewProps::BaseViewProps(
104
104
  rawProps,
105
105
  "autoFocus",
106
106
  sourceProps.autoFocus,
107
- (Boolean) false)),
107
+ false)),
108
108
  trapFocusUp(CoreFeatures::enablePropIteratorSetter ? sourceProps.trapFocusUp : convertRawProp(
109
109
  context,
110
110
  rawProps,
package/index.js CHANGED
@@ -87,7 +87,7 @@ import typeof DevSettings from './Libraries/Utilities/DevSettings';
87
87
  import typeof Dimensions from './Libraries/Utilities/Dimensions';
88
88
  import typeof PixelRatio from './Libraries/Utilities/PixelRatio';
89
89
  import typeof Platform from './Libraries/Utilities/Platform';
90
- import typeof TabBarIOS from './Libraries/Components/TabBarIOS/TabBarIOS';
90
+ // import typeof TabBarIOS from './Libraries/Components/TabBarIOS/TabBarIOS';
91
91
  import typeof TVEventHandler from './Libraries/Components/TV/TVEventHandler';
92
92
  import typeof TVFocusGuideView from './Libraries/Components/TV/TVFocusGuideView';
93
93
  import typeof TVEventControl from './Libraries/Components/TV/TVEventControl';
@@ -174,7 +174,7 @@ module.exports = {
174
174
  get Switch(): Switch {
175
175
  return require('./Libraries/Components/Switch/Switch').default;
176
176
  },
177
- get TabBarIOS(): TabBarIOS {
177
+ get TabBarIOS(): any {
178
178
  return require('./Libraries/Components/TabBarIOS/TabBarIOS');
179
179
  },
180
180
  get Text(): Text {
@@ -334,7 +334,7 @@ module.exports = {
334
334
  get TVMenuControl(): TVEventControl {
335
335
  warnOnce(
336
336
  'TVMenuControl-moved',
337
- 'TVMenuControl has been moved to TVEventControl, and now supports enabling/disabling both menu key events and pan gesture events.'
337
+ 'TVMenuControl has been moved to TVEventControl, and now supports enabling/disabling both menu key events and pan gesture events.',
338
338
  );
339
339
  return require('./Libraries/Components/TV/TVEventControl');
340
340
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.75.2-0rc0",
3
+ "version": "0.75.3-0",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -110,21 +110,22 @@
110
110
  },
111
111
  "dependencies": {
112
112
  "@jest/create-cache-key-function": "^29.6.3",
113
- "@react-native-community/cli": "14.0.0",
114
- "@react-native-community/cli-platform-android": "14.0.0",
115
- "@react-native-community/cli-platform-ios": "14.0.0",
116
- "@react-native/assets-registry": "0.75.2",
117
- "@react-native/codegen": "0.75.2",
118
- "@react-native/community-cli-plugin": "0.75.2",
119
- "@react-native/gradle-plugin": "0.75.2",
120
- "@react-native/js-polyfills": "0.75.2",
121
- "@react-native/normalize-colors": "0.75.2",
122
- "@react-native-tvos/virtualized-lists": "0.75.2-0rc0",
113
+ "@react-native-community/cli": "14.1.0",
114
+ "@react-native-community/cli-platform-android": "14.1.0",
115
+ "@react-native-community/cli-platform-ios": "14.1.0",
116
+ "@react-native/assets-registry": "0.75.3",
117
+ "@react-native/codegen": "0.75.3",
118
+ "@react-native/community-cli-plugin": "0.75.3",
119
+ "@react-native/gradle-plugin": "0.75.3",
120
+ "@react-native/js-polyfills": "0.75.3",
121
+ "@react-native/normalize-colors": "0.75.3",
122
+ "@react-native-tvos/virtualized-lists": "0.75.3-0",
123
123
  "abort-controller": "^3.0.0",
124
124
  "anser": "^1.4.9",
125
125
  "ansi-regex": "^5.0.0",
126
126
  "base64-js": "^1.5.1",
127
127
  "chalk": "^4.0.0",
128
+ "commander": "^9.4.1",
128
129
  "event-target-shim": "^5.0.1",
129
130
  "flow-enums-runtime": "^0.0.6",
130
131
  "glob": "^7.1.1",
package/scripts/bundle.js CHANGED
@@ -31,6 +31,8 @@ program
31
31
  'npx react-native config',
32
32
  )
33
33
  .option('--load-config <string>', 'JSON project config')
34
+ .option('--verbose', 'Additional logs', () => true, false)
35
+ .allowUnknownOption()
34
36
  .action(async function handleAction() {
35
37
  let config = null;
36
38
  let options = program.opts();
@@ -73,6 +73,7 @@ def list_native_modules!(config_command)
73
73
  found_pods.push({
74
74
  "configurations": configurations,
75
75
  "name": name,
76
+ "root": package["root"],
76
77
  "path": relative_path.to_path,
77
78
  "podspec_path": podspec_path,
78
79
  "script_phases": script_phases
@@ -168,7 +169,7 @@ def link_native_modules!(config)
168
169
 
169
170
  # Support passing in a path relative to the root of the package
170
171
  if phase["path"]
171
- phase["script"] = File.read(File.expand_path(phase["path"], package[:path]))
172
+ phase["script"] = File.read(File.expand_path(phase["path"], package[:root]))
172
173
  phase.delete("path")
173
174
  end
174
175
 
@@ -225,7 +225,7 @@ function extractSupportedApplePlatforms(dependency, dependencyPath) {
225
225
  return supportedPlatformsMap;
226
226
  }
227
227
 
228
- function findExternalLibraries(pkgJson) {
228
+ function findExternalLibraries(pkgJson, projectRoot) {
229
229
  const dependencies = {
230
230
  ...pkgJson.dependencies,
231
231
  ...pkgJson.devDependencies,
@@ -241,6 +241,7 @@ function findExternalLibraries(pkgJson) {
241
241
  try {
242
242
  const configFilePath = require.resolve(
243
243
  path.join(dependency, 'package.json'),
244
+ {paths: [projectRoot]},
244
245
  );
245
246
  const configFile = JSON.parse(fs.readFileSync(configFilePath));
246
247
  const codegenConfigFileDir = path.dirname(configFilePath);
@@ -534,7 +535,7 @@ function findCodegenEnabledLibraries(pkgJson, projectRoot) {
534
535
  } else {
535
536
  return [
536
537
  ...projectLibraries,
537
- ...findExternalLibraries(pkgJson),
538
+ ...findExternalLibraries(pkgJson, projectRoot),
538
539
  ...findLibrariesFromReactNativeConfig(projectRoot),
539
540
  ];
540
541
  }
@@ -14,7 +14,6 @@ const {execSync, spawnSync} = require('child_process');
14
14
  const fs = require('fs');
15
15
  const os = require('os');
16
16
  const path = require('path');
17
- const {stdin} = require('process');
18
17
 
19
18
  /*::
20
19
  type BuildType = 'dry-run' | 'release' | 'nightly' | 'prealpha';
@@ -12,9 +12,9 @@ set -e
12
12
  # Given a specific target, retrieve the right architecture for it
13
13
  # $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, xros, xrsimulator
14
14
  function get_architecture {
15
- if [[ $1 == "iphoneos" || $1 == "xros" || $1 == "xrsimulator" ]]; then
15
+ if [[ $1 == "iphoneos" || $1 == "xros" ]]; then
16
16
  echo "arm64"
17
- elif [[ $1 == "iphonesimulator" ]]; then
17
+ elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" ]]; then
18
18
  echo "x86_64;arm64"
19
19
  elif [[ $1 == "appletvos" ]]; then
20
20
  echo "arm64"
Binary file
Binary file
Binary file
@@ -32,7 +32,7 @@
32
32
  * Either the import or the reference only needs to appear once, anywhere in the project.
33
33
  */
34
34
 
35
- import {DimensionValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
35
+ import {DimensionValue} from '../Libraries/StyleSheet/StyleSheetTypes';
36
36
 
37
37
  export {};
38
38
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { View, ScrollViewProps, HostComponent, TVParallaxProperties, EventSubscription } from 'react-native';
2
+ import type { View, ScrollViewProps, HostComponent, EventSubscription } from 'react-native';
3
3
 
4
4
  declare module 'react-native' {
5
5
  interface ViewProps {
@@ -63,7 +63,49 @@ declare module 'react-native' {
63
63
  } | undefined
64
64
  };
65
65
 
66
- export const TVEventHandler: {
66
+ export type TVParallaxProperties = {
67
+ /**
68
+ * If true, parallax effects are enabled. Defaults to true.
69
+ */
70
+ enabled?: boolean | undefined,
71
+
72
+ /**
73
+ * Defaults to 2.0.
74
+ */
75
+ shiftDistanceX?: number | undefined,
76
+
77
+ /**
78
+ * Defaults to 2.0.
79
+ */
80
+ shiftDistanceY?: number | undefined,
81
+
82
+ /**
83
+ * Defaults to 0.05.
84
+ */
85
+ tiltAngle?: number | undefined,
86
+
87
+ /**
88
+ * Defaults to 1.0
89
+ */
90
+ magnification?: number | undefined,
91
+
92
+ /**
93
+ * Defaults to 1.0
94
+ */
95
+ pressMagnification?: number | undefined,
96
+
97
+ /**
98
+ * Defaults to 0.3
99
+ */
100
+ pressDuration?: number | undefined,
101
+
102
+ /**
103
+ * Defaults to 0.3
104
+ */
105
+ pressDelay?: number | undefined,
106
+ };
107
+
108
+ export const TVEventHandler: {
67
109
  addListener: (listener: (event: HWEvent) => void) => EventSubscription | undefined
68
110
  };
69
111
 
@@ -188,5 +230,4 @@ declare module 'react-native' {
188
230
  */
189
231
  tvParallaxProperties?: TVParallaxProperties | undefined;
190
232
  }
191
-
192
233
  }
@@ -1,29 +0,0 @@
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
- #include "JOptional.h"
9
-
10
- namespace facebook::react {
11
-
12
- int JOptionalInt::getAsInt() const {
13
- static auto method = javaClassStatic()->getMethod<jint()>("getAsInt");
14
- return method(self());
15
- }
16
-
17
- bool JOptionalInt::isPresent() const {
18
- static auto method = javaClassStatic()->getMethod<jboolean()>("isPresent");
19
- return method(self());
20
- }
21
-
22
- JOptionalInt::operator std::optional<int>() const {
23
- if (!isPresent()) {
24
- return {};
25
- }
26
- return getAsInt();
27
- }
28
-
29
- } // namespace facebook::react
@@ -1,27 +0,0 @@
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 <fbjni/fbjni.h>
11
-
12
- #include <optional>
13
-
14
- // TODO(moti): Consider moving this into fbjni
15
-
16
- namespace facebook::react {
17
-
18
- class JOptionalInt : public facebook::jni::JavaClass<JOptionalInt> {
19
- public:
20
- static auto constexpr kJavaDescriptor = "Ljava/util/OptionalInt;";
21
-
22
- int getAsInt() const;
23
- bool isPresent() const;
24
- operator std::optional<int>() const;
25
- };
26
-
27
- } // namespace facebook::react