react-native-tvos 0.72.4-0rc0 → 0.72.5-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 (91) hide show
  1. package/Libraries/Components/Pressable/Pressable.js +11 -5
  2. package/Libraries/Components/ScrollView/ScrollView.d.ts +7 -0
  3. package/Libraries/Components/ScrollView/ScrollView.js +8 -0
  4. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +1 -0
  5. package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -0
  6. package/Libraries/Components/ScrollView/ScrollViewViewConfig.js +1 -0
  7. package/Libraries/Core/ReactNativeVersion.js +2 -2
  8. package/README-core.md +147 -0
  9. package/README.md +32 -39
  10. package/React/Base/RCTBundleURLProvider.h +33 -2
  11. package/React/Base/RCTBundleURLProvider.mm +78 -15
  12. package/React/Base/RCTVersion.m +2 -2
  13. package/React/CoreModules/RCTTiming.mm +5 -0
  14. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +4 -0
  15. package/React/Fabric/RCTThirdPartyFabricComponentsProvider.h +29 -0
  16. package/React/Fabric/RCTThirdPartyFabricComponentsProvider.mm +29 -0
  17. package/React/Views/ScrollView/RCTScrollView.h +1 -0
  18. package/React/Views/ScrollView/RCTScrollView.m +12 -0
  19. package/React/Views/ScrollView/RCTScrollViewManager.m +1 -0
  20. package/ReactAndroid/gradle.properties +1 -1
  21. package/ReactAndroid/hermes-engine/build.gradle +1 -1
  22. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
  23. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.java +4 -0
  24. package/ReactAndroid/src/main/jni/CMakeLists.txt +5 -0
  25. package/ReactCommon/React-Fabric.podspec +1 -1
  26. package/ReactCommon/ReactCommon.podspec +1 -1
  27. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  28. package/ReactCommon/jsc/JSCRuntime.cpp +10 -0
  29. package/ReactCommon/react/debug/React-debug.podspec +1 -1
  30. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  31. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
  32. package/ReactCommon/react/renderer/components/rncore/ComponentDescriptors.h +29 -0
  33. package/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp +111 -0
  34. package/ReactCommon/react/renderer/components/rncore/EventEmitters.h +186 -0
  35. package/ReactCommon/react/renderer/components/rncore/Props.cpp +157 -0
  36. package/ReactCommon/react/renderer/components/rncore/Props.h +395 -0
  37. package/ReactCommon/react/renderer/components/rncore/RCTComponentViewHelpers.h +257 -0
  38. package/ReactCommon/react/renderer/components/rncore/ShadowNodes.cpp +26 -0
  39. package/ReactCommon/react/renderer/components/rncore/ShadowNodes.h +111 -0
  40. package/ReactCommon/react/renderer/components/rncore/States.cpp +18 -0
  41. package/ReactCommon/react/renderer/components/rncore/States.h +141 -0
  42. package/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp +15 -1
  43. package/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h +1 -0
  44. package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +2 -0
  45. package/ReactCommon/react/renderer/core/RawPropsParser.cpp +1 -0
  46. package/ReactCommon/react/renderer/core/RawPropsPrimitives.h +4 -4
  47. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  48. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
  49. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -1
  50. package/ReactCommon/react/utils/React-utils.podspec +1 -1
  51. package/package.json +7 -6
  52. package/scripts/cocoapods/helpers.rb +16 -0
  53. package/scripts/cocoapods/utils.rb +98 -8
  54. package/scripts/react_native_pods.rb +6 -2
  55. package/sdks/.hermesversion +1 -1
  56. package/sdks/hermes-engine/utils/build-apple-framework.sh +8 -1
  57. package/sdks/hermes-engine/utils/build-hermes-xcode.sh +8 -0
  58. package/sdks/hermesc/osx-bin/hermesc +0 -0
  59. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  60. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +95 -13
  61. package/template/package.json +5 -4
  62. package/types/index.d.ts +1 -0
  63. package/types/public/ReactNativeTVTypes.d.ts +192 -0
  64. package/scripts/cocoapods/__tests__/codegen-test.rb +0 -242
  65. package/scripts/cocoapods/__tests__/codegen_utils-test.rb +0 -602
  66. package/scripts/cocoapods/__tests__/fabric-test.rb +0 -68
  67. package/scripts/cocoapods/__tests__/flipper-test.rb +0 -161
  68. package/scripts/cocoapods/__tests__/jsengine-test.rb +0 -130
  69. package/scripts/cocoapods/__tests__/local_podspec_patch-test.rb +0 -167
  70. package/scripts/cocoapods/__tests__/new_architecture-test.rb +0 -303
  71. package/scripts/cocoapods/__tests__/test_utils/CodegenScriptPhaseExtractorMock.rb +0 -21
  72. package/scripts/cocoapods/__tests__/test_utils/CodegenUtilsMock.rb +0 -108
  73. package/scripts/cocoapods/__tests__/test_utils/DirMock.rb +0 -72
  74. package/scripts/cocoapods/__tests__/test_utils/EnvironmentMock.rb +0 -21
  75. package/scripts/cocoapods/__tests__/test_utils/FileMock.rb +0 -113
  76. package/scripts/cocoapods/__tests__/test_utils/FileUtilsMock.rb +0 -40
  77. package/scripts/cocoapods/__tests__/test_utils/FinderMock.rb +0 -28
  78. package/scripts/cocoapods/__tests__/test_utils/InstallerMock.rb +0 -222
  79. package/scripts/cocoapods/__tests__/test_utils/LocalPodspecPatchMock.rb +0 -14
  80. package/scripts/cocoapods/__tests__/test_utils/Open3Mock.rb +0 -43
  81. package/scripts/cocoapods/__tests__/test_utils/PathnameMock.rb +0 -42
  82. package/scripts/cocoapods/__tests__/test_utils/PodMock.rb +0 -144
  83. package/scripts/cocoapods/__tests__/test_utils/SpecMock.rb +0 -30
  84. package/scripts/cocoapods/__tests__/test_utils/SysctlCheckerMock.rb +0 -21
  85. package/scripts/cocoapods/__tests__/test_utils/TargetDefinitionMock.rb +0 -12
  86. package/scripts/cocoapods/__tests__/test_utils/podSpy.rb +0 -39
  87. package/scripts/cocoapods/__tests__/test_utils/systemUtils.rb +0 -14
  88. package/scripts/cocoapods/__tests__/utils-test.rb +0 -766
  89. package/scripts/codegen/__test_fixtures__/fixtures.js +0 -132
  90. package/scripts/codegen/__tests__/generate-artifacts-executor-test.js +0 -500
  91. package/scripts/codegen/__tests__/generate-specs-cli-executor-test.js +0 -88
Binary file
@@ -3,7 +3,7 @@
3
3
  archiveVersion = 1;
4
4
  classes = {
5
5
  };
6
- objectVersion = 46;
6
+ objectVersion = 54;
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
@@ -254,6 +254,7 @@
254
254
  2D02E4791E0B4A5D006451C7 /* Resources */,
255
255
  2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */,
256
256
  42686649B799B0EA1ADB4648 /* [CP] Copy Pods Resources */,
257
+ 1D628A144AB903441126BE7D /* [CP] Embed Pods Frameworks */,
257
258
  );
258
259
  buildRules = (
259
260
  );
@@ -273,6 +274,7 @@
273
274
  2D02E48D1E0B4A5D006451C7 /* Frameworks */,
274
275
  2D02E48E1E0B4A5D006451C7 /* Resources */,
275
276
  84F93B44286727BF8D357577 /* [CP] Copy Pods Resources */,
277
+ 1B09D78B63D400B062C57686 /* [CP] Embed Pods Frameworks */,
276
278
  );
277
279
  buildRules = (
278
280
  );
@@ -399,6 +401,40 @@
399
401
  shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources.sh\"\n";
400
402
  showEnvVarsInLog = 0;
401
403
  };
404
+ 1B09D78B63D400B062C57686 /* [CP] Embed Pods Frameworks */ = {
405
+ isa = PBXShellScriptBuildPhase;
406
+ buildActionMask = 2147483647;
407
+ files = (
408
+ );
409
+ inputFileListPaths = (
410
+ "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-tvOS-HelloWorld-tvOSTests/Pods-HelloWorld-tvOS-HelloWorld-tvOSTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
411
+ );
412
+ name = "[CP] Embed Pods Frameworks";
413
+ outputFileListPaths = (
414
+ "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-tvOS-HelloWorld-tvOSTests/Pods-HelloWorld-tvOS-HelloWorld-tvOSTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
415
+ );
416
+ runOnlyForDeploymentPostprocessing = 0;
417
+ shellPath = /bin/sh;
418
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-tvOS-HelloWorld-tvOSTests/Pods-HelloWorld-tvOS-HelloWorld-tvOSTests-frameworks.sh\"\n";
419
+ showEnvVarsInLog = 0;
420
+ };
421
+ 1D628A144AB903441126BE7D /* [CP] Embed Pods Frameworks */ = {
422
+ isa = PBXShellScriptBuildPhase;
423
+ buildActionMask = 2147483647;
424
+ files = (
425
+ );
426
+ inputFileListPaths = (
427
+ "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-tvOS/Pods-HelloWorld-tvOS-frameworks-${CONFIGURATION}-input-files.xcfilelist",
428
+ );
429
+ name = "[CP] Embed Pods Frameworks";
430
+ outputFileListPaths = (
431
+ "${PODS_ROOT}/Target Support Files/Pods-HelloWorld-tvOS/Pods-HelloWorld-tvOS-frameworks-${CONFIGURATION}-output-files.xcfilelist",
432
+ );
433
+ runOnlyForDeploymentPostprocessing = 0;
434
+ shellPath = /bin/sh;
435
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HelloWorld-tvOS/Pods-HelloWorld-tvOS-frameworks.sh\"\n";
436
+ showEnvVarsInLog = 0;
437
+ };
402
438
  2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
403
439
  isa = PBXShellScriptBuildPhase;
404
440
  buildActionMask = 2147483647;
@@ -688,7 +724,11 @@
688
724
  );
689
725
  INFOPLIST_FILE = HelloWorldTests/Info.plist;
690
726
  IPHONEOS_DEPLOYMENT_TARGET = 12.4;
691
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
727
+ LD_RUNPATH_SEARCH_PATHS = (
728
+ "$(inherited)",
729
+ "@executable_path/Frameworks",
730
+ "@loader_path/Frameworks",
731
+ );
692
732
  OTHER_LDFLAGS = (
693
733
  "-ObjC",
694
734
  "-lc++",
@@ -708,7 +748,11 @@
708
748
  COPY_PHASE_STRIP = NO;
709
749
  INFOPLIST_FILE = HelloWorldTests/Info.plist;
710
750
  IPHONEOS_DEPLOYMENT_TARGET = 12.4;
711
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
751
+ LD_RUNPATH_SEARCH_PATHS = (
752
+ "$(inherited)",
753
+ "@executable_path/Frameworks",
754
+ "@loader_path/Frameworks",
755
+ );
712
756
  OTHER_LDFLAGS = (
713
757
  "-ObjC",
714
758
  "-lc++",
@@ -733,7 +777,11 @@
733
777
  "COCOAPODS=1",
734
778
  );
735
779
  INFOPLIST_FILE = HelloWorld/Info.plist;
736
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
780
+ LD_RUNPATH_SEARCH_PATHS = (
781
+ "$(inherited)",
782
+ "@executable_path/Frameworks",
783
+ "@loader_path/Frameworks",
784
+ );
737
785
  MARKETING_VERSION = 1.0;
738
786
  OTHER_LDFLAGS = (
739
787
  "$(inherited)",
@@ -756,7 +804,11 @@
756
804
  CLANG_ENABLE_MODULES = YES;
757
805
  CURRENT_PROJECT_VERSION = 1;
758
806
  INFOPLIST_FILE = HelloWorld/Info.plist;
759
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
807
+ LD_RUNPATH_SEARCH_PATHS = (
808
+ "$(inherited)",
809
+ "@executable_path/Frameworks",
810
+ "@loader_path/Frameworks",
811
+ );
760
812
  MARKETING_VERSION = 1.0;
761
813
  OTHER_LDFLAGS = (
762
814
  "$(inherited)",
@@ -785,7 +837,11 @@
785
837
  ENABLE_TESTABILITY = YES;
786
838
  GCC_NO_COMMON_BLOCKS = YES;
787
839
  INFOPLIST_FILE = "HelloWorld-tvOS/Info.plist";
788
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
840
+ LD_RUNPATH_SEARCH_PATHS = (
841
+ "$(inherited)",
842
+ "@executable_path/Frameworks",
843
+ "@loader_path/Frameworks",
844
+ );
789
845
  MARKETING_VERSION = 1.0;
790
846
  OTHER_LDFLAGS = (
791
847
  "$(inherited)",
@@ -814,10 +870,14 @@
814
870
  CLANG_WARN_SUSPICIOUS_MOVE = YES;
815
871
  COPY_PHASE_STRIP = NO;
816
872
  DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
817
- ENABLE_BITCODE = YES;
873
+ ENABLE_BITCODE = NO;
818
874
  GCC_NO_COMMON_BLOCKS = YES;
819
875
  INFOPLIST_FILE = "HelloWorld-tvOS/Info.plist";
820
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
876
+ LD_RUNPATH_SEARCH_PATHS = (
877
+ "$(inherited)",
878
+ "@executable_path/Frameworks",
879
+ "@loader_path/Frameworks",
880
+ );
821
881
  MARKETING_VERSION = 1.0;
822
882
  OTHER_LDFLAGS = (
823
883
  "$(inherited)",
@@ -846,7 +906,11 @@
846
906
  ENABLE_TESTABILITY = YES;
847
907
  GCC_NO_COMMON_BLOCKS = YES;
848
908
  INFOPLIST_FILE = "HelloWorld-tvOSTests/Info.plist";
849
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
909
+ LD_RUNPATH_SEARCH_PATHS = (
910
+ "$(inherited)",
911
+ "@executable_path/Frameworks",
912
+ "@loader_path/Frameworks",
913
+ );
850
914
  OTHER_LDFLAGS = (
851
915
  "$(inherited)",
852
916
  "-ObjC",
@@ -873,7 +937,11 @@
873
937
  DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
874
938
  GCC_NO_COMMON_BLOCKS = YES;
875
939
  INFOPLIST_FILE = "HelloWorld-tvOSTests/Info.plist";
876
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
940
+ LD_RUNPATH_SEARCH_PATHS = (
941
+ "$(inherited)",
942
+ "@executable_path/Frameworks",
943
+ "@loader_path/Frameworks",
944
+ );
877
945
  OTHER_LDFLAGS = (
878
946
  "$(inherited)",
879
947
  "-ObjC",
@@ -919,6 +987,7 @@
919
987
  COPY_PHASE_STRIP = NO;
920
988
  ENABLE_STRICT_OBJC_MSGSEND = YES;
921
989
  ENABLE_TESTABILITY = YES;
990
+ "EXCLUDED_ARCHS[sdk=appletvsimulator*]" = i386;
922
991
  "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
923
992
  GCC_C_LANGUAGE_STANDARD = gnu99;
924
993
  GCC_DYNAMIC_NO_PIC = NO;
@@ -936,7 +1005,10 @@
936
1005
  GCC_WARN_UNUSED_FUNCTION = YES;
937
1006
  GCC_WARN_UNUSED_VARIABLE = YES;
938
1007
  IPHONEOS_DEPLOYMENT_TARGET = 12.4;
939
- LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
1008
+ LD_RUNPATH_SEARCH_PATHS = (
1009
+ /usr/lib/swift,
1010
+ "$(inherited)",
1011
+ );
940
1012
  LIBRARY_SEARCH_PATHS = (
941
1013
  "$(SDKROOT)/usr/lib/swift",
942
1014
  "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
@@ -944,6 +1016,9 @@
944
1016
  );
945
1017
  MTL_ENABLE_DEBUG_INFO = YES;
946
1018
  ONLY_ACTIVE_ARCH = YES;
1019
+ OTHER_CFLAGS = "$(inherited)";
1020
+ OTHER_CPLUSPLUSFLAGS = "$(inherited)";
1021
+ REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
947
1022
  SDKROOT = iphoneos;
948
1023
  };
949
1024
  name = Debug;
@@ -953,7 +1028,7 @@
953
1028
  buildSettings = {
954
1029
  ALWAYS_SEARCH_USER_PATHS = NO;
955
1030
  CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
956
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
1031
+ CLANG_CXX_LANGUAGE_STANDARD = "c++17";
957
1032
  CLANG_CXX_LIBRARY = "libc++";
958
1033
  CLANG_ENABLE_MODULES = YES;
959
1034
  CLANG_ENABLE_OBJC_ARC = YES;
@@ -980,6 +1055,7 @@
980
1055
  COPY_PHASE_STRIP = YES;
981
1056
  ENABLE_NS_ASSERTIONS = NO;
982
1057
  ENABLE_STRICT_OBJC_MSGSEND = YES;
1058
+ "EXCLUDED_ARCHS[sdk=appletvsimulator*]" = i386;
983
1059
  "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
984
1060
  GCC_C_LANGUAGE_STANDARD = gnu99;
985
1061
  GCC_NO_COMMON_BLOCKS = YES;
@@ -990,13 +1066,19 @@
990
1066
  GCC_WARN_UNUSED_FUNCTION = YES;
991
1067
  GCC_WARN_UNUSED_VARIABLE = YES;
992
1068
  IPHONEOS_DEPLOYMENT_TARGET = 12.4;
993
- LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
1069
+ LD_RUNPATH_SEARCH_PATHS = (
1070
+ /usr/lib/swift,
1071
+ "$(inherited)",
1072
+ );
994
1073
  LIBRARY_SEARCH_PATHS = (
995
1074
  "$(SDKROOT)/usr/lib/swift",
996
1075
  "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
997
1076
  "\"$(inherited)\"",
998
1077
  );
999
1078
  MTL_ENABLE_DEBUG_INFO = NO;
1079
+ OTHER_CFLAGS = "$(inherited)";
1080
+ OTHER_CPLUSPLUSFLAGS = "$(inherited)";
1081
+ REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
1000
1082
  SDKROOT = iphoneos;
1001
1083
  VALIDATE_PRODUCT = YES;
1002
1084
  };
@@ -3,16 +3,17 @@
3
3
  "version": "0.0.1",
4
4
  "private": true,
5
5
  "scripts": {
6
- "android": "react-native run-android",
7
- "ios": "react-native run-ios",
6
+ "android": "expo run:android",
7
+ "ios": "expo run:ios",
8
+ "tvos": "expo run:ios --scheme HelloWorld-tvOS --device \"Apple TV\"",
8
9
  "lint": "eslint .",
9
- "start": "react-native start",
10
+ "start": "expo start",
10
11
  "test": "jest"
11
12
  },
12
13
  "dependencies": {
13
14
  "expo": "^49.0.7",
14
15
  "react": "18.2.0",
15
- "react-native": "npm:react-native-tvos@0.72.4-0rc0"
16
+ "react-native": "npm:react-native-tvos@0.72.5-0"
16
17
  },
17
18
  "devDependencies": {
18
19
  "@babel/core": "^7.20.0",
package/types/index.d.ts CHANGED
@@ -156,6 +156,7 @@ export * from './public/DeprecatedPropertiesAlias';
156
156
  export * from './public/Insets';
157
157
  export * from './public/ReactNativeRenderer';
158
158
  export * from './public/ReactNativeTypes';
159
+ export * from './public/ReactNativeTVTypes';
159
160
 
160
161
  import type {ErrorUtils} from '../Libraries/vendor/core/ErrorUtils';
161
162
 
@@ -0,0 +1,192 @@
1
+ import React from 'react';
2
+ import { ViewProps, ScrollViewProps } from 'react-native';
3
+
4
+ declare module 'react-native' {
5
+ interface ViewProps {
6
+ /**
7
+ * TV next focus down (see documentation for the View component).
8
+ */
9
+ nextFocusDown?: number,
10
+
11
+ /**
12
+ * TV next focus forward (see documentation for the View component).
13
+ *
14
+ * @platform android
15
+ */
16
+ nextFocusForward?: number,
17
+
18
+ /**
19
+ * TV next focus left (see documentation for the View component).
20
+ */
21
+ nextFocusLeft?: number,
22
+
23
+ /**
24
+ * TV next focus right (see documentation for the View component).
25
+ */
26
+ nextFocusRight?: number,
27
+
28
+ /**
29
+ * TV next focus up (see documentation for the View component).
30
+ */
31
+ nextFocusUp?: number,
32
+ }
33
+
34
+ export interface NativeMethods {
35
+ requestTVFocus(): void;
36
+ }
37
+
38
+ export const useTVEventHandler: (handleEvent: (event: HWEvent) => void) => void;
39
+
40
+ export const TVEventControl: {
41
+ enableTVMenuKey(): void;
42
+ disableTVMenuKey(): void;
43
+ enableTVPanGesture(): void;
44
+ disableTVPanGesture(): void;
45
+ enableGestureHandlersCancelTouches(): void;
46
+ disableGestureHandlersCancelTouches(): void;
47
+ };
48
+
49
+ export type HWEvent = {
50
+ eventType: 'up' | 'down' | 'right' | 'left' | 'longUp' | 'longDown' | 'longRight' | 'longLeft' | 'blur' | 'focus' | 'pan' | string;
51
+ eventKeyAction?: -1 | 1 | 0 | number;
52
+ tag?: number;
53
+ body?: {
54
+ state: "Began" | "Changed" | "Ended",
55
+ x: number,
56
+ y: number,
57
+ velocityx: number,
58
+ velocityy: number
59
+ }
60
+ };
61
+
62
+ export class TVEventHandler {
63
+ enable<T extends React.Component<unknown>>(
64
+ component?: T,
65
+ callback?: (component: T, data: HWEvent) => void
66
+ ): void;
67
+ disable(): void;
68
+ }
69
+
70
+ export interface FocusGuideProps extends ViewProps {
71
+ /**
72
+ * If the view should be "visible". display "flex" if visible, otherwise "none".
73
+ * Defaults to true
74
+ */
75
+ enabled?: boolean;
76
+ /**
77
+ * Array of `Component`s to register as destinations with `UIFocusGuide`
78
+ */
79
+ destinations?: (null | number | React.Component<any, any> | React.ComponentClass<any>)[];
80
+ /**
81
+ * If true, `TVFocusGuide` will automatically manage focus for you.
82
+ * It will redirect the focus to the first focusable child on the first visit.
83
+ * It also remembers the last focused child and redirects the focus
84
+ * to it on the subsequent visits.
85
+ *
86
+ * `destinations` prop takes precedence over this prop when used together.
87
+ *
88
+ * @default false
89
+ */
90
+ autoFocus?: boolean;
91
+ /**
92
+ * Enables focus trapping for the focus guide (see README).
93
+ */
94
+ trapFocusUp?: boolean;
95
+ /**
96
+ * Enables focus trapping for the focus guide (see README).
97
+ */
98
+ trapFocusDown?: boolean;
99
+ /**
100
+ * Enables focus trapping for the focus guide (see README).
101
+ */
102
+ trapFocusLeft?: boolean;
103
+ /**
104
+ * Enables focus trapping for the focus guide (see README).
105
+ */
106
+ trapFocusRight?: boolean;
107
+ /**
108
+ * @deprecated Don't use it, no longer necessary.
109
+ */
110
+ safePadding?: 'both' | 'vertical' | 'horizontal' | null;
111
+ }
112
+
113
+ export type FocusGuideMethods = {
114
+ setDestinations: (
115
+ destinations: (React.ElementRef<HostComponent<unknown>> | null | undefined)[],
116
+ ) => void;
117
+ }
118
+
119
+ /**
120
+ * This component provides support for Apple's `UIFocusGuide` API,
121
+ * to help ensure that focusable controls can be navigated to,
122
+ * even if they are not directly in line with other controls on both tvOS and Android.
123
+ * An example is provided in `RNTester` that shows different ways of using this component.
124
+ * https://github.com/react-native-tvos/react-native-tvos/blob/tvos-v0.69.8/packages/rn-tester/js/examples/TVFocusGuide/TVFocusGuideAutoFocusExample.js
125
+ */
126
+ export const TVFocusGuideView: React.ForwardRefExoticComponent<FocusGuideProps & React.RefAttributes<View & FocusGuideMethods>>;
127
+ export interface TVTextScrollViewProps extends ScrollViewProps {
128
+ /**
129
+ * The duration of the scroll animation when a swipe is detected.
130
+ * Default value is 0.3 s
131
+ */
132
+ scrollDuration?: number;
133
+ /**
134
+ * Scrolling distance when a swipe is detected
135
+ * Default value is half the visible height (vertical scroller)
136
+ * or width (horizontal scroller)
137
+ */
138
+ pageSize?: number;
139
+ /**
140
+ * If true, will scroll to start when focus moves out past the beginning
141
+ * of the scroller
142
+ * Defaults to true
143
+ */
144
+ snapToStart?: boolean;
145
+ /**
146
+ * If true, will scroll to end when focus moves out past the end of the
147
+ * scroller
148
+ * Defaults to true
149
+ */
150
+ snapToEnd?: boolean;
151
+ /**
152
+ * Called when the scroller comes into focus (e.g. for highlighting)
153
+ */
154
+ onFocus?(evt: HWEvent): void;
155
+ /**
156
+ * Called when the scroller goes out of focus
157
+ */
158
+ onBlur?(evt: HWEvent): void;
159
+ }
160
+
161
+ export class TVTextScrollView extends React.Component<TVTextScrollViewProps> {}
162
+
163
+ export interface PressableStateCallbackType {
164
+ readonly focused: boolean;
165
+ }
166
+
167
+ export interface TouchableWithoutFeedbackPropsIOS {
168
+ /**
169
+ * *(Apple TV only)* TV preferred focus (see documentation for the View component).
170
+ *
171
+ * @platform ios
172
+ */
173
+ hasTVPreferredFocus?: boolean;
174
+
175
+ /**
176
+ * *(Apple TV only)* Object with properties to control Apple TV parallax effects.
177
+ *
178
+ * enabled: If true, parallax effects are enabled. Defaults to true.
179
+ * shiftDistanceX: Defaults to 2.0.
180
+ * shiftDistanceY: Defaults to 2.0.
181
+ * tiltAngle: Defaults to 0.05.
182
+ * magnification: Defaults to 1.0.
183
+ * pressMagnification: Defaults to 1.0.
184
+ * pressDuration: Defaults to 0.3.
185
+ * pressDelay: Defaults to 0.0.
186
+ *
187
+ * @platform ios
188
+ */
189
+ tvParallaxProperties?: TVParallaxProperties;
190
+ }
191
+
192
+ }