react-native-tvos 0.87.1-0 → 0.87.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +2 -2
- package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +96 -0
- package/types_generated/Libraries/Alert/Alert.d.ts +92 -0
- package/types_generated/Libraries/Animated/Animated.d.ts +14 -0
- package/types_generated/Libraries/Animated/AnimatedEvent.d.ts +30 -0
- package/types_generated/Libraries/Animated/AnimatedExports.d.ts +191 -0
- package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +232 -0
- package/types_generated/Libraries/Animated/AnimatedPlatformConfig.d.ts +13 -0
- package/types_generated/Libraries/Animated/Easing.d.ts +172 -0
- package/types_generated/Libraries/Animated/animations/Animation.d.ts +35 -0
- package/types_generated/Libraries/Animated/animations/DecayAnimation.d.ts +42 -0
- package/types_generated/Libraries/Animated/animations/SpringAnimation.d.ts +130 -0
- package/types_generated/Libraries/Animated/animations/TimingAnimation.d.ts +54 -0
- package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +22 -0
- package/types_generated/Libraries/Animated/components/AnimatedImage.d.ts +18 -0
- package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +23 -0
- package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +22 -0
- package/types_generated/Libraries/Animated/components/AnimatedText.d.ts +18 -0
- package/types_generated/Libraries/Animated/components/AnimatedView.d.ts +19 -0
- package/types_generated/Libraries/Animated/createAnimatedComponent.d.ts +44 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedAddition.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedColor.d.ts +80 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedDiffClamp.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedDivision.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedInterpolation.d.ts +38 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedModulo.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedMultiplication.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedNode.d.ts +50 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedProps.d.ts +30 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedStyle.d.ts +32 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedSubtraction.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedTracking.d.ts +21 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedValue.d.ts +126 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedValueXY.d.ts +135 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedWithChildren.d.ts +15 -0
- package/types_generated/Libraries/Animated/useAnimatedColor.d.ts +16 -0
- package/types_generated/Libraries/Animated/useAnimatedValue.d.ts +15 -0
- package/types_generated/Libraries/Animated/useAnimatedValueXY.d.ts +18 -0
- package/types_generated/Libraries/AppState/AppState.d.ts +82 -0
- package/types_generated/Libraries/BatchedBridge/BatchedBridge.d.ts +17 -0
- package/types_generated/Libraries/BatchedBridge/MessageQueue.d.ts +39 -0
- package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +27 -0
- package/types_generated/Libraries/Blob/Blob.d.ts +80 -0
- package/types_generated/Libraries/Blob/BlobTypes.d.ts +27 -0
- package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +223 -0
- package/types_generated/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.d.ts +20 -0
- package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +133 -0
- package/types_generated/Libraries/Components/Button.d.ts +167 -0
- package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +43 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +17 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.d.ts +27 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.d.ts +157 -0
- package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +115 -0
- package/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +82 -0
- package/types_generated/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +23 -0
- package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +170 -0
- package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +48 -0
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +32 -0
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +67 -0
- package/types_generated/Libraries/Components/RefreshControl/RefreshControl.d.ts +96 -0
- package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +31 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +723 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollViewContext.d.ts +24 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +36 -0
- package/types_generated/Libraries/Components/StatusBar/StatusBar.d.ts +189 -0
- package/types_generated/Libraries/Components/Switch/Switch.d.ts +143 -0
- package/types_generated/Libraries/Components/TV/TVEventControl.d.ts +23 -0
- package/types_generated/Libraries/Components/TV/TVEventHandler.d.ts +34 -0
- package/types_generated/Libraries/Components/TV/TVFocusGuideView.d.ts +96 -0
- package/types_generated/Libraries/Components/TV/TVTextScrollView.d.ts +97 -0
- package/types_generated/Libraries/Components/TV/TVViewPropTypes.d.ts +123 -0
- package/types_generated/Libraries/Components/TV/tagForComponentOrHandle.d.ts +24 -0
- package/types_generated/Libraries/Components/TV/useTVEventHandler.d.ts +20 -0
- package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +37 -0
- package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +162 -0
- package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +1020 -0
- package/types_generated/Libraries/Components/TextInput/TextInputState.d.ts +54 -0
- package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +99 -0
- package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +62 -0
- package/types_generated/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +155 -0
- package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +47 -0
- package/types_generated/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +121 -0
- package/types_generated/Libraries/Components/View/View.d.ts +34 -0
- package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +426 -0
- package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +38 -0
- package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +412 -0
- package/types_generated/Libraries/Core/Devtools/symbolicateStackTrace.d.ts +27 -0
- package/types_generated/Libraries/Core/ExceptionsManager.d.ts +43 -0
- package/types_generated/Libraries/Core/ExtendedError.d.ts +26 -0
- package/types_generated/Libraries/Core/NativeExceptionsManager.d.ts +17 -0
- package/types_generated/Libraries/Core/RawEventEmitter.d.ts +26 -0
- package/types_generated/Libraries/Core/ReactFiberErrorDialog.d.ts +27 -0
- package/types_generated/Libraries/Core/ReactNativeVersion.d.ts +48 -0
- package/types_generated/Libraries/Core/registerCallableModule.d.ts +18 -0
- package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +75 -0
- package/types_generated/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts +19 -0
- package/types_generated/Libraries/EventEmitter/RCTEventEmitter.d.ts +18 -0
- package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +24 -0
- package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +60 -0
- package/types_generated/Libraries/Image/Image.d.ts +18 -0
- package/types_generated/Libraries/Image/ImageBackground.d.ts +55 -0
- package/types_generated/Libraries/Image/ImageProps.d.ts +462 -0
- package/types_generated/Libraries/Image/ImageResizeMode.d.ts +17 -0
- package/types_generated/Libraries/Image/ImageSource.d.ts +94 -0
- package/types_generated/Libraries/Image/ImageTypes.flow.d.ts +62 -0
- package/types_generated/Libraries/Interaction/PanResponder.d.ts +234 -0
- package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +87 -0
- package/types_generated/Libraries/Linking/Linking.d.ts +76 -0
- package/types_generated/Libraries/Lists/FlatList.d.ts +316 -0
- package/types_generated/Libraries/Lists/SectionList.d.ts +177 -0
- package/types_generated/Libraries/Lists/VirtualizedList.d.ts +21 -0
- package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +21 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxData.d.ts +78 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxLog.d.ts +71 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxSymbolication.d.ts +17 -0
- package/types_generated/Libraries/LogBox/Data/parseLogBoxLog.d.ts +49 -0
- package/types_generated/Libraries/LogBox/LogBox.d.ts +32 -0
- package/types_generated/Libraries/Modal/Modal.d.ts +145 -0
- package/types_generated/Libraries/NativeComponent/NativeComponentRegistry.d.ts +50 -0
- package/types_generated/Libraries/Network/FormData.d.ts +56 -0
- package/types_generated/Libraries/Network/RCTNetworking.d.ts +25 -0
- package/types_generated/Libraries/Network/RCTNetworkingEventDefinitions.flow.d.ts +22 -0
- package/types_generated/Libraries/Network/XMLHttpRequest.d.ts +114 -0
- package/types_generated/Libraries/Network/convertRequestBody.d.ts +21 -0
- package/types_generated/Libraries/Performance/Systrace.d.ts +71 -0
- package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +139 -0
- package/types_generated/Libraries/Pressability/Pressability.d.ts +241 -0
- package/types_generated/Libraries/Pressability/usePressability.d.ts +27 -0
- package/types_generated/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +327 -0
- package/types_generated/Libraries/ReactNative/AppRegistry.d.ts +14 -0
- package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +43 -0
- package/types_generated/Libraries/ReactNative/AppRegistryImpl.d.ts +120 -0
- package/types_generated/Libraries/ReactNative/DisplayMode.d.ts +24 -0
- package/types_generated/Libraries/ReactNative/I18nManager.d.ts +42 -0
- package/types_generated/Libraries/ReactNative/IPerformanceLogger.flow.d.ts +57 -0
- package/types_generated/Libraries/ReactNative/NativeI18nManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/NativeUIManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.d.ts +31 -0
- package/types_generated/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.d.ts +15 -0
- package/types_generated/Libraries/ReactNative/RendererImplementation.d.ts +36 -0
- package/types_generated/Libraries/ReactNative/RendererProxy.d.ts +13 -0
- package/types_generated/Libraries/ReactNative/RootTag.d.ts +22 -0
- package/types_generated/Libraries/ReactNative/UIManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/requireNativeComponent.d.ts +25 -0
- package/types_generated/Libraries/ReactPrivate/ReactNativePrivateInterface.d.ts +17 -0
- package/types_generated/Libraries/Renderer/shims/ReactFabric.d.ts +17 -0
- package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +155 -0
- package/types_generated/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.d.ts +41 -0
- package/types_generated/Libraries/Settings/Settings.d.ts +21 -0
- package/types_generated/Libraries/Share/Share.d.ts +82 -0
- package/types_generated/Libraries/StyleSheet/EdgeInsetsPropType.d.ts +15 -0
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +23 -0
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +27 -0
- package/types_generated/Libraries/StyleSheet/PointPropType.d.ts +16 -0
- package/types_generated/Libraries/StyleSheet/Rect.d.ts +22 -0
- package/types_generated/Libraries/StyleSheet/StyleSheet.d.ts +153 -0
- package/types_generated/Libraries/StyleSheet/StyleSheetExports.d.ts +94 -0
- package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +872 -0
- package/types_generated/Libraries/StyleSheet/flattenStyle.d.ts +19 -0
- package/types_generated/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.d.ts +17 -0
- package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +76 -0
- package/types_generated/Libraries/StyleSheet/processColor.d.ts +18 -0
- package/types_generated/Libraries/Text/Text.d.ts +34 -0
- package/types_generated/Libraries/Text/TextAncestorContext.d.ts +20 -0
- package/types_generated/Libraries/Text/TextNativeComponent.d.ts +41 -0
- package/types_generated/Libraries/Text/TextProps.d.ts +175 -0
- package/types_generated/Libraries/TurboModule/RCTExport.d.ts +35 -0
- package/types_generated/Libraries/TurboModule/TurboModuleRegistry.d.ts +15 -0
- package/types_generated/Libraries/Types/CodegenTypes.d.ts +24 -0
- package/types_generated/Libraries/Types/CodegenTypesNamespace.d.ts +14 -0
- package/types_generated/Libraries/Types/CoreEventTypes.d.ts +361 -0
- package/types_generated/Libraries/Types/RootTagTypes.d.ts +13 -0
- package/types_generated/Libraries/Types/UIManagerJSInterface.d.ts +17 -0
- package/types_generated/Libraries/UTFSequence.d.ts +39 -0
- package/types_generated/Libraries/Utilities/Appearance.d.ts +43 -0
- package/types_generated/Libraries/Utilities/BackHandler.d.ts +43 -0
- package/types_generated/Libraries/Utilities/DevSettings.d.ts +41 -0
- package/types_generated/Libraries/Utilities/DeviceInfo.d.ts +17 -0
- package/types_generated/Libraries/Utilities/Dimensions.d.ts +60 -0
- package/types_generated/Libraries/Utilities/NativeAppearance.d.ts +17 -0
- package/types_generated/Libraries/Utilities/NativeDeviceInfo.d.ts +14 -0
- package/types_generated/Libraries/Utilities/PixelRatio.d.ts +113 -0
- package/types_generated/Libraries/Utilities/Platform.d.ts +20 -0
- package/types_generated/Libraries/Utilities/PlatformTypes.d.ts +193 -0
- package/types_generated/Libraries/Utilities/codegenNativeCommands.d.ts +19 -0
- package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +24 -0
- package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +33 -0
- package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +19 -0
- package/types_generated/Libraries/Utilities/useColorScheme.d.ts +25 -0
- package/types_generated/Libraries/Utilities/useWindowDimensions.d.ts +21 -0
- package/types_generated/Libraries/Vibration/Vibration.d.ts +37 -0
- package/types_generated/Libraries/vendor/core/ErrorUtils.d.ts +39 -0
- package/types_generated/Libraries/vendor/emitter/EventEmitter.d.ts +67 -0
- package/types_generated/index.d.ts +190 -0
- package/types_generated/src/private/assets/AssetRegistry.d.ts +42 -0
- package/types_generated/src/private/components/virtualcollection/FlingConstants.d.ts +20 -0
- package/types_generated/src/private/components/virtualcollection/Virtual.d.ts +46 -0
- package/types_generated/src/private/components/virtualcollection/VirtualCollectionView.d.ts +81 -0
- package/types_generated/src/private/components/virtualcollection/column/VirtualColumn.d.ts +23 -0
- package/types_generated/src/private/components/virtualcollection/column/VirtualColumnGenerator.d.ts +17 -0
- package/types_generated/src/private/components/virtualcollection/dom/getScrollParent.d.ts +21 -0
- package/types_generated/src/private/components/virtualcollection/row/VirtualRow.d.ts +23 -0
- package/types_generated/src/private/components/virtualview/VirtualView.d.ts +75 -0
- package/types_generated/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.d.ts +107 -0
- package/types_generated/src/private/components/virtualview/VirtualViewNativeComponent.d.ts +107 -0
- package/types_generated/src/private/devsupport/devmenu/DevMenu.d.ts +28 -0
- package/types_generated/src/private/renderer/events/dispatchNativeEvent.d.ts +26 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +27 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +46 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +45 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeI18nManager.d.ts +27 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +109 -0
- package/types_generated/src/private/styles/composeStyles.d.ts +19 -0
- package/types_generated/src/private/types/HostComponent.d.ts +19 -0
- package/types_generated/src/private/types/HostInstance.d.ts +57 -0
- package/types_generated/src/private/webapis/dom/events/CustomEvent.d.ts +27 -0
- package/types_generated/src/private/webapis/dom/events/Event.d.ts +50 -0
- package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +36 -0
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeDocument.d.ts +35 -0
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeElement.d.ts +89 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyCharacterData.d.ts +32 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyElement.d.ts +56 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyNode.d.ts +131 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyText.d.ts +26 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/NodeInternals.d.ts +36 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.d.ts +23 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.d.ts +22 -0
- package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +229 -0
- package/types_generated/src/private/webapis/dom/oldstylecollections/HTMLCollection.d.ts +24 -0
- package/types_generated/src/private/webapis/dom/oldstylecollections/NodeList.d.ts +27 -0
- package/types_generated/src/private/webapis/geometry/DOMRect.d.ts +46 -0
- package/types_generated/src/private/webapis/geometry/DOMRectReadOnly.d.ts +73 -0
- package/types_generated/src/private/webapis/utils/ArrayLikeUtils.d.ts +27 -0
- package/types_generated/src/react-private-interface.d.ts +33 -0
- package/types_generated/tsconfig.json +3 -0
|
@@ -0,0 +1,723 @@
|
|
|
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
|
+
* @generated SignedSource<<783261346703a71a02f7c2d43f34c6ed>>
|
|
8
|
+
*
|
|
9
|
+
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
|
+
* Original file: packages/react-native/Libraries/Components/ScrollView/ScrollView.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { HostInstance } from "../../../src/private/types/HostInstance";
|
|
14
|
+
import type { EdgeInsetsProp } from "../../StyleSheet/EdgeInsetsPropType";
|
|
15
|
+
import type { PointProp } from "../../StyleSheet/PointPropType";
|
|
16
|
+
import type { ViewStyleProp } from "../../StyleSheet/StyleSheet";
|
|
17
|
+
import type { ColorValue } from "../../StyleSheet/StyleSheet";
|
|
18
|
+
import type { ScrollEvent } from "../../Types/CoreEventTypes";
|
|
19
|
+
import type { KeyboardEvent } from "../Keyboard/Keyboard";
|
|
20
|
+
import type { ViewProps } from "../View/ViewPropTypes";
|
|
21
|
+
import type { ScrollViewStickyHeaderProps } from "./ScrollViewStickyHeader";
|
|
22
|
+
import View from "../View/View";
|
|
23
|
+
import ScrollViewContext from "./ScrollViewContext";
|
|
24
|
+
import * as React from "react";
|
|
25
|
+
export interface ScrollViewScrollToOptions {
|
|
26
|
+
x?: number | undefined;
|
|
27
|
+
y?: number | undefined;
|
|
28
|
+
animated?: boolean | undefined;
|
|
29
|
+
}
|
|
30
|
+
export interface ScrollViewImperativeMethods {
|
|
31
|
+
/**
|
|
32
|
+
* Returns a reference to the underlying scroll responder, which supports
|
|
33
|
+
* operations like `scrollTo`. All ScrollView-like components should
|
|
34
|
+
* implement this method so that they can be composed while providing access
|
|
35
|
+
* to the underlying scroll responder's methods.
|
|
36
|
+
*/
|
|
37
|
+
readonly getScrollResponder: () => ScrollResponderType;
|
|
38
|
+
readonly getScrollableNode: () => number | undefined;
|
|
39
|
+
readonly getInnerViewNode: () => number | undefined;
|
|
40
|
+
readonly getInnerViewRef: () => InnerViewInstance | null;
|
|
41
|
+
/**
|
|
42
|
+
* Returns a reference to the underlying native scroll view, or null if the
|
|
43
|
+
* native instance is not mounted.
|
|
44
|
+
*/
|
|
45
|
+
readonly getNativeScrollRef: () => ScrollViewInstance | null;
|
|
46
|
+
/**
|
|
47
|
+
* Scrolls to a given x, y offset, either immediately or with a smooth animation.
|
|
48
|
+
* Syntax:
|
|
49
|
+
*
|
|
50
|
+
* scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})
|
|
51
|
+
*
|
|
52
|
+
* Note: The weird argument signature is due to the fact that, for historical reasons,
|
|
53
|
+
* the function also accepts separate arguments as an alternative to the options object.
|
|
54
|
+
* This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.
|
|
55
|
+
*/
|
|
56
|
+
readonly scrollTo: (options?: ScrollViewScrollToOptions | number, deprecatedX?: number, deprecatedAnimated?: boolean) => void;
|
|
57
|
+
/**
|
|
58
|
+
* A helper function that scrolls to the end of the scrollview;
|
|
59
|
+
* If this is a vertical ScrollView, it scrolls to the bottom.
|
|
60
|
+
* If this is a horizontal ScrollView scrolls to the right.
|
|
61
|
+
*
|
|
62
|
+
* The options object has an animated prop, that enables the scrolling animation or not.
|
|
63
|
+
* The animated prop defaults to true
|
|
64
|
+
*/
|
|
65
|
+
readonly scrollToEnd: (options?: ScrollViewScrollToOptions | undefined) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Displays the scroll indicators momentarily.
|
|
68
|
+
*/
|
|
69
|
+
readonly flashScrollIndicators: () => void;
|
|
70
|
+
readonly scrollResponderZoomTo: (rect: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
animated?: boolean | undefined;
|
|
76
|
+
}, animated?: boolean) => void;
|
|
77
|
+
readonly scrollResponderScrollNativeHandleToKeyboard: (nodeHandle: number | HostInstance, additionalOffset?: number, preventNegativeScrollOffset?: boolean) => void;
|
|
78
|
+
}
|
|
79
|
+
export type DecelerationRateType = "fast" | "normal" | number;
|
|
80
|
+
export type ScrollAnimationEasing = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | [number, number, number, number];
|
|
81
|
+
export type ScrollResponderType = ScrollViewImperativeMethods;
|
|
82
|
+
export interface ScrollViewInstance extends HostInstance, ScrollViewImperativeMethods {}
|
|
83
|
+
type InnerViewInstance = React.ComponentRef<typeof View>;
|
|
84
|
+
export type ScrollViewPropsIOS = Readonly<{
|
|
85
|
+
/**
|
|
86
|
+
* Controls whether iOS should automatically adjust the content inset
|
|
87
|
+
* for scroll views that are placed behind a navigation bar or
|
|
88
|
+
* tab bar/toolbar.
|
|
89
|
+
*
|
|
90
|
+
* @default `true`
|
|
91
|
+
* @platform ios
|
|
92
|
+
*/
|
|
93
|
+
automaticallyAdjustContentInsets?: boolean | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Controls whether the ScrollView should automatically adjust its `contentInset`
|
|
96
|
+
* and `scrollViewInsets` when the Keyboard changes its size.
|
|
97
|
+
*
|
|
98
|
+
* @default `false`
|
|
99
|
+
* @platform ios
|
|
100
|
+
*/
|
|
101
|
+
automaticallyAdjustKeyboardInsets?: boolean | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Controls whether iOS should automatically adjust the scroll indicator
|
|
104
|
+
* insets. Available on iOS 13 and later.
|
|
105
|
+
*
|
|
106
|
+
* @default `true`
|
|
107
|
+
* @platform ios
|
|
108
|
+
*/
|
|
109
|
+
automaticallyAdjustsScrollIndicatorInsets?: boolean | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* The amount by which the scroll view content is inset from the edges
|
|
112
|
+
* of the scroll view.
|
|
113
|
+
*
|
|
114
|
+
* @default `{top: 0, left: 0, bottom: 0, right: 0}`
|
|
115
|
+
* @platform ios
|
|
116
|
+
*/
|
|
117
|
+
contentInset?: EdgeInsetsProp | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* When true, the scroll view bounces when it reaches the end of the
|
|
120
|
+
* content if the content is larger than the scroll view along the axis of
|
|
121
|
+
* the scroll direction. When `false`, it disables all bouncing even if
|
|
122
|
+
* the `alwaysBounce*` props are `true`.
|
|
123
|
+
*
|
|
124
|
+
* @default `true`
|
|
125
|
+
* @platform ios
|
|
126
|
+
*/
|
|
127
|
+
bounces?: boolean | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* By default, ScrollView has an active pan responder that hijacks panresponders
|
|
130
|
+
* deeper in the render tree in order to prevent accidental touches while scrolling.
|
|
131
|
+
* However, in certain occasions (such as when using snapToInterval) in a vertical scrollview
|
|
132
|
+
* You may want to disable this behavior in order to prevent the ScrollView from blocking touches
|
|
133
|
+
*/
|
|
134
|
+
disableScrollViewPanResponder?: boolean | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* When true, gestures can drive zoom past min/max and the zoom will animate
|
|
137
|
+
* to the min/max value at gesture end, otherwise the zoom will not exceed
|
|
138
|
+
* the limits.
|
|
139
|
+
* @platform ios
|
|
140
|
+
*/
|
|
141
|
+
bouncesZoom?: boolean | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* When true, the scroll view bounces horizontally when it reaches the end
|
|
144
|
+
* even if the content is smaller than the scroll view itself.
|
|
145
|
+
*
|
|
146
|
+
* @default {@platform horizontal} `true`
|
|
147
|
+
* @platform ios
|
|
148
|
+
*/
|
|
149
|
+
alwaysBounceHorizontal?: boolean | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* When true, the scroll view bounces vertically when it reaches the end
|
|
152
|
+
* even if the content is smaller than the scroll view itself.
|
|
153
|
+
*
|
|
154
|
+
* @default {@platform horizontal} `false`
|
|
155
|
+
* @platform ios
|
|
156
|
+
*/
|
|
157
|
+
alwaysBounceVertical?: boolean | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* When true, the scroll view automatically centers the content when the
|
|
160
|
+
* content is smaller than the scroll view bounds; when the content is
|
|
161
|
+
* larger than the scroll view, this property has no effect.
|
|
162
|
+
*
|
|
163
|
+
* @default `false`
|
|
164
|
+
* @platform ios
|
|
165
|
+
*/
|
|
166
|
+
centerContent?: boolean | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* The style of the scroll indicators.
|
|
169
|
+
*
|
|
170
|
+
* - `'default'` (the default), same as `black`.
|
|
171
|
+
* - `'black'`, scroll indicator is black. This style is good against a light background.
|
|
172
|
+
* - `'white'`, scroll indicator is white. This style is good against a dark background.
|
|
173
|
+
*
|
|
174
|
+
* @platform ios
|
|
175
|
+
*/
|
|
176
|
+
indicatorStyle?: ("default" | "black" | "white") | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* When true, the ScrollView will try to lock to only vertical or horizontal
|
|
179
|
+
* scrolling while dragging.
|
|
180
|
+
*
|
|
181
|
+
* @default `false`
|
|
182
|
+
* @platform ios
|
|
183
|
+
*/
|
|
184
|
+
directionalLockEnabled?: boolean | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* When false, once tracking starts, the scroll view will not try to drag
|
|
187
|
+
* if the touch moves.
|
|
188
|
+
*
|
|
189
|
+
* @default `true`
|
|
190
|
+
* @platform ios
|
|
191
|
+
*/
|
|
192
|
+
canCancelContentTouches?: boolean | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* The maximum allowed zoom scale.
|
|
195
|
+
*
|
|
196
|
+
* @default `1.0`
|
|
197
|
+
* @platform ios
|
|
198
|
+
*/
|
|
199
|
+
maximumZoomScale?: number | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* The minimum allowed zoom scale.
|
|
202
|
+
*
|
|
203
|
+
* @default `1.0`
|
|
204
|
+
* @platform ios
|
|
205
|
+
*/
|
|
206
|
+
minimumZoomScale?: number | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* When true, ScrollView allows use of pinch gestures to zoom in and out.
|
|
209
|
+
*
|
|
210
|
+
* @default `true`
|
|
211
|
+
* @platform ios
|
|
212
|
+
*/
|
|
213
|
+
pinchGestureEnabled?: boolean | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* The amount by which the scroll view indicators are inset from the edges
|
|
216
|
+
* of the scroll view. This should normally be set to the same value as
|
|
217
|
+
* the `contentInset`.
|
|
218
|
+
*
|
|
219
|
+
* @default `{top: 0, left: 0, bottom: 0, right: 0}`
|
|
220
|
+
* @platform ios
|
|
221
|
+
*/
|
|
222
|
+
scrollIndicatorInsets?: EdgeInsetsProp | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* When true, the scroll view can be programmatically scrolled beyond its
|
|
225
|
+
* content size.
|
|
226
|
+
*
|
|
227
|
+
* @default `false`
|
|
228
|
+
* @platform ios
|
|
229
|
+
*/
|
|
230
|
+
scrollToOverflowEnabled?: boolean | undefined;
|
|
231
|
+
/**
|
|
232
|
+
* When true, the scroll view scrolls to top when the status bar is tapped.
|
|
233
|
+
*
|
|
234
|
+
* @default `true`
|
|
235
|
+
* @platform ios
|
|
236
|
+
*/
|
|
237
|
+
scrollsToTop?: boolean | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Fires when the scroll view scrolls to top after the status bar has been tapped
|
|
240
|
+
* @platform ios
|
|
241
|
+
*/
|
|
242
|
+
onScrollToTop?: ((event: ScrollEvent) => void) | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* When true, shows a horizontal scroll indicator.
|
|
245
|
+
*
|
|
246
|
+
* @default `true`
|
|
247
|
+
*/
|
|
248
|
+
showsHorizontalScrollIndicator?: boolean | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* The current scale of the scroll view content.
|
|
251
|
+
*
|
|
252
|
+
* @default `1.0`
|
|
253
|
+
* @platform ios
|
|
254
|
+
*/
|
|
255
|
+
zoomScale?: number | undefined;
|
|
256
|
+
/**
|
|
257
|
+
* This property specifies how the safe area insets are used to modify the
|
|
258
|
+
* content area of the scroll view.
|
|
259
|
+
*
|
|
260
|
+
* @default `'never'`
|
|
261
|
+
* @platform ios
|
|
262
|
+
*/
|
|
263
|
+
contentInsetAdjustmentBehavior?: ("automatic" | "scrollableAxes" | "never" | "always") | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* (TvOS only)
|
|
266
|
+
* Defines if UIScrollView index should be shown when fast scrolling.
|
|
267
|
+
* Defaults to true.
|
|
268
|
+
*/
|
|
269
|
+
showsScrollIndex?: boolean | undefined;
|
|
270
|
+
}>;
|
|
271
|
+
export type ScrollViewPropsAndroid = Readonly<{
|
|
272
|
+
/**
|
|
273
|
+
* Enables nested scrolling for Android API level 21+. Nested scrolling is
|
|
274
|
+
* supported by default on iOS.
|
|
275
|
+
*
|
|
276
|
+
* @default `false`
|
|
277
|
+
* @platform android
|
|
278
|
+
*/
|
|
279
|
+
nestedScrollEnabled?: boolean | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* Sometimes a scrollview takes up more space than its content fills. When this is
|
|
282
|
+
* the case, this prop will fill the rest of the scrollview with a color to avoid setting
|
|
283
|
+
* a background and creating unnecessary overdraw. This is an advanced optimization
|
|
284
|
+
* that is not needed in the general case.
|
|
285
|
+
* @platform android
|
|
286
|
+
*/
|
|
287
|
+
endFillColor?: ColorValue | undefined;
|
|
288
|
+
/**
|
|
289
|
+
* Tag used to log scroll performance on this scroll view. Will force
|
|
290
|
+
* momentum events to be turned on (see sendMomentumEvents). This doesn't do
|
|
291
|
+
* anything out of the box and you need to implement a custom native
|
|
292
|
+
* FpsListener for it to be useful.
|
|
293
|
+
* @platform android
|
|
294
|
+
*/
|
|
295
|
+
scrollPerfTag?: string | undefined;
|
|
296
|
+
/**
|
|
297
|
+
* Used to override default value of overScroll mode.
|
|
298
|
+
*
|
|
299
|
+
* Possible values:
|
|
300
|
+
*
|
|
301
|
+
* - `'auto'` - Default value, allow a user to over-scroll
|
|
302
|
+
* this view only if the content is large enough to meaningfully scroll.
|
|
303
|
+
* - `'always'` - Always allow a user to over-scroll this view.
|
|
304
|
+
* - `'never'` - Never allow a user to over-scroll this view.
|
|
305
|
+
*
|
|
306
|
+
* @platform android
|
|
307
|
+
*/
|
|
308
|
+
overScrollMode?: ("auto" | "always" | "never") | undefined;
|
|
309
|
+
/**
|
|
310
|
+
* Causes the scrollbars not to turn transparent when they are not in use.
|
|
311
|
+
*
|
|
312
|
+
* @default `false`
|
|
313
|
+
* @platform android
|
|
314
|
+
*/
|
|
315
|
+
persistentScrollbar?: boolean | undefined;
|
|
316
|
+
/**
|
|
317
|
+
* Controls the fading effect at the edges of the scroll content.
|
|
318
|
+
*
|
|
319
|
+
* A value greater than 0 will apply the fading effect, indicating more content is available
|
|
320
|
+
* to scroll.
|
|
321
|
+
*
|
|
322
|
+
* You can specify a single number to apply the same fading length to both edges.
|
|
323
|
+
* Alternatively, use an object with `start` and `end` properties to set different
|
|
324
|
+
* fading lengths for the start and end of the scroll content.
|
|
325
|
+
*
|
|
326
|
+
* The default value is 0.
|
|
327
|
+
*
|
|
328
|
+
* @platform android
|
|
329
|
+
*/
|
|
330
|
+
fadingEdgeLength?: (number | undefined) | {
|
|
331
|
+
start: number;
|
|
332
|
+
end: number;
|
|
333
|
+
} | undefined;
|
|
334
|
+
/**
|
|
335
|
+
* When false, the ScrollView will not automatically scroll to a focused child when
|
|
336
|
+
* the child requests focus. This can be useful when you want to control the scroll
|
|
337
|
+
* position programmatically.
|
|
338
|
+
*
|
|
339
|
+
* @default `true`
|
|
340
|
+
* @platform android
|
|
341
|
+
*/
|
|
342
|
+
scrollsChildToFocus?: boolean | undefined;
|
|
343
|
+
}>;
|
|
344
|
+
type StickyHeaderComponentType = (props: Omit<ScrollViewStickyHeaderProps, keyof {
|
|
345
|
+
ref?: React.Ref<Readonly<{
|
|
346
|
+
setNextHeaderY: ($$PARAM_0$$: number) => void;
|
|
347
|
+
}>> | undefined;
|
|
348
|
+
}> & {
|
|
349
|
+
ref?: React.Ref<Readonly<{
|
|
350
|
+
setNextHeaderY: ($$PARAM_0$$: number) => void;
|
|
351
|
+
}>> | undefined;
|
|
352
|
+
}) => React.ReactNode;
|
|
353
|
+
type ScrollViewBaseProps = Readonly<{
|
|
354
|
+
/**
|
|
355
|
+
* These styles will be applied to the scroll view content container which
|
|
356
|
+
* wraps all of the child views.
|
|
357
|
+
*
|
|
358
|
+
* Example:
|
|
359
|
+
*
|
|
360
|
+
* ```tsx
|
|
361
|
+
* return (
|
|
362
|
+
* <ScrollView contentContainerStyle={styles.contentContainer}>
|
|
363
|
+
* </ScrollView>
|
|
364
|
+
* );
|
|
365
|
+
* ...
|
|
366
|
+
* const styles = StyleSheet.create({
|
|
367
|
+
* contentContainer: {
|
|
368
|
+
* paddingVertical: 20
|
|
369
|
+
* }
|
|
370
|
+
* });
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
contentContainerStyle?: ViewStyleProp | undefined;
|
|
374
|
+
/**
|
|
375
|
+
* Used to manually set the starting scroll offset.
|
|
376
|
+
*
|
|
377
|
+
* @default `{x: 0, y: 0}`
|
|
378
|
+
*/
|
|
379
|
+
contentOffset?: PointProp | undefined;
|
|
380
|
+
/**
|
|
381
|
+
* When true, the scroll view stops on the next index (in relation to scroll
|
|
382
|
+
* position at release) regardless of how fast the gesture is. This can be
|
|
383
|
+
* used for pagination when the page is less than the width of the
|
|
384
|
+
* horizontal ScrollView or the height of the vertical ScrollView.
|
|
385
|
+
*
|
|
386
|
+
* @default `false`
|
|
387
|
+
*/
|
|
388
|
+
disableIntervalMomentum?: boolean | undefined;
|
|
389
|
+
/**
|
|
390
|
+
* A floating-point number that determines how quickly the scroll view
|
|
391
|
+
* decelerates after the user lifts their finger. You may also use string
|
|
392
|
+
* shortcuts `"normal"` and `"fast"` which match the underlying iOS settings
|
|
393
|
+
* for `UIScrollViewDecelerationRateNormal` and
|
|
394
|
+
* `UIScrollViewDecelerationRateFast` respectively.
|
|
395
|
+
*
|
|
396
|
+
* - `'normal'`: 0.998 on iOS, 0.985 on Android
|
|
397
|
+
* - `'fast'`: 0.99 on iOS, 0.9 on Android
|
|
398
|
+
*
|
|
399
|
+
* @default `'normal'`
|
|
400
|
+
*/
|
|
401
|
+
decelerationRate?: DecelerationRateType | undefined;
|
|
402
|
+
/**
|
|
403
|
+
* *Experimental, iOS Only*. The API is experimental and will change in future releases.
|
|
404
|
+
*
|
|
405
|
+
* Controls how much distance is traveled after user stops scrolling.
|
|
406
|
+
* A value greater than 1 will increase the distance traveled.
|
|
407
|
+
* A value less than 1 will decrease the distance traveled.
|
|
408
|
+
*
|
|
409
|
+
* @deprecated
|
|
410
|
+
*
|
|
411
|
+
* @default `1`
|
|
412
|
+
*/
|
|
413
|
+
experimental_endDraggingSensitivityMultiplier?: number | undefined;
|
|
414
|
+
/**
|
|
415
|
+
* When true, the scroll view's children are arranged horizontally in a row
|
|
416
|
+
* instead of vertically in a column.
|
|
417
|
+
*
|
|
418
|
+
* @default `false`
|
|
419
|
+
*/
|
|
420
|
+
horizontal?: boolean | undefined;
|
|
421
|
+
/**
|
|
422
|
+
* If sticky headers should stick at the bottom instead of the top of the
|
|
423
|
+
* ScrollView. This is usually used with inverted ScrollViews.
|
|
424
|
+
*/
|
|
425
|
+
invertStickyHeaders?: boolean | undefined;
|
|
426
|
+
/**
|
|
427
|
+
* Determines whether the keyboard gets dismissed in response to a drag.
|
|
428
|
+
*
|
|
429
|
+
* *Cross platform*
|
|
430
|
+
*
|
|
431
|
+
* - `'none'`, drags do not dismiss the keyboard.
|
|
432
|
+
* - `'on-drag'`, the keyboard is dismissed when a drag begins.
|
|
433
|
+
*
|
|
434
|
+
* *iOS Only*
|
|
435
|
+
*
|
|
436
|
+
* - `'interactive'`, the keyboard is dismissed interactively with the drag and moves in
|
|
437
|
+
* synchrony with the touch; dragging upwards cancels the dismissal.
|
|
438
|
+
* On Android this is not supported and it will have the same behavior as `'none'`.
|
|
439
|
+
*
|
|
440
|
+
* @default `'none'`
|
|
441
|
+
*/
|
|
442
|
+
keyboardDismissMode?: ("none" | "on-drag" | "interactive") | undefined;
|
|
443
|
+
/**
|
|
444
|
+
* Determines when the keyboard should stay visible after a tap.
|
|
445
|
+
*
|
|
446
|
+
* - `'never'`, tapping outside of the focused text input when the keyboard
|
|
447
|
+
* is up dismisses the keyboard. When this happens, children will not receive the tap.
|
|
448
|
+
* - `'always'`, the keyboard will not dismiss automatically, and the scroll view will not
|
|
449
|
+
* catch taps, but children of the scroll view can catch taps.
|
|
450
|
+
* - `'handled'`, the keyboard will not dismiss automatically when the tap was handled by
|
|
451
|
+
* children, (or captured by an ancestor).
|
|
452
|
+
*
|
|
453
|
+
* @default `'never'`
|
|
454
|
+
*/
|
|
455
|
+
keyboardShouldPersistTaps?: ("always" | "never" | "handled") | undefined;
|
|
456
|
+
/**
|
|
457
|
+
* When set, the scroll view will adjust the scroll position so that the first child that is
|
|
458
|
+
* partially or fully visible and at or beyond `minIndexForVisible` will not change position.
|
|
459
|
+
* This is useful for lists that are loading content in both directions, e.g. a chat thread,
|
|
460
|
+
* where new messages coming in might otherwise cause the scroll position to jump. A value of 0
|
|
461
|
+
* is common, but other values such as 1 can be used to skip loading spinners or other content
|
|
462
|
+
* that should not maintain position.
|
|
463
|
+
*
|
|
464
|
+
* The optional `autoscrollToTopThreshold` can be used to make the content automatically scroll
|
|
465
|
+
* to the top after making the adjustment if the user was within the threshold of the top before
|
|
466
|
+
* the adjustment was made. This is also useful for chat-like applications where you want to see
|
|
467
|
+
* new messages scroll into place, but not if the user has scrolled up a ways and it would be
|
|
468
|
+
* disruptive to scroll a bunch.
|
|
469
|
+
*
|
|
470
|
+
* Caveat 1: Reordering elements in the scrollview with this enabled will probably cause
|
|
471
|
+
* jumpiness and jank. It can be fixed, but there are currently no plans to do so. For now,
|
|
472
|
+
* don't re-order the content of any ScrollViews or Lists that use this feature.
|
|
473
|
+
*
|
|
474
|
+
* Caveat 2: This simply uses `contentOffset` and `frame.origin` in native code to compute
|
|
475
|
+
* visibility. Occlusion, transforms, and other complexity won't be taken into account as to
|
|
476
|
+
* whether content is "visible" or not.
|
|
477
|
+
*
|
|
478
|
+
*/
|
|
479
|
+
maintainVisibleContentPosition?: Readonly<{
|
|
480
|
+
minIndexForVisible: number;
|
|
481
|
+
autoscrollToTopThreshold?: number | undefined;
|
|
482
|
+
}> | undefined;
|
|
483
|
+
/**
|
|
484
|
+
* Called when the momentum scroll starts (scroll which occurs as the ScrollView glides to a stop).
|
|
485
|
+
*/
|
|
486
|
+
onMomentumScrollBegin?: ((event: ScrollEvent) => void) | undefined;
|
|
487
|
+
/**
|
|
488
|
+
* Called when the momentum scroll ends (scroll which occurs as the ScrollView glides to a stop).
|
|
489
|
+
*/
|
|
490
|
+
onMomentumScrollEnd?: ((event: ScrollEvent) => void) | undefined;
|
|
491
|
+
/**
|
|
492
|
+
* Fires at most once per frame during scrolling.
|
|
493
|
+
*/
|
|
494
|
+
onScroll?: ((event: ScrollEvent) => void) | undefined;
|
|
495
|
+
/**
|
|
496
|
+
* Called when the user begins to drag the scroll view.
|
|
497
|
+
*/
|
|
498
|
+
onScrollBeginDrag?: ((event: ScrollEvent) => void) | undefined;
|
|
499
|
+
/**
|
|
500
|
+
* Called when the user stops dragging the scroll view and it either stops
|
|
501
|
+
* or begins to glide.
|
|
502
|
+
*/
|
|
503
|
+
onScrollEndDrag?: ((event: ScrollEvent) => void) | undefined;
|
|
504
|
+
/**
|
|
505
|
+
* Called when scrollable content view of the ScrollView changes.
|
|
506
|
+
*
|
|
507
|
+
* Handler function is passed the content width and content height as parameters:
|
|
508
|
+
* `(contentWidth, contentHeight)`
|
|
509
|
+
*
|
|
510
|
+
* It's implemented using onLayout handler attached to the content container
|
|
511
|
+
* which this ScrollView renders.
|
|
512
|
+
*/
|
|
513
|
+
onContentSizeChange?: ((contentWidth: number, contentHeight: number) => void) | undefined;
|
|
514
|
+
onKeyboardDidShow?: ((event: KeyboardEvent) => void) | undefined;
|
|
515
|
+
onKeyboardDidHide?: ((event: KeyboardEvent) => void) | undefined;
|
|
516
|
+
onKeyboardWillShow?: ((event: KeyboardEvent) => void) | undefined;
|
|
517
|
+
onKeyboardWillHide?: ((event: KeyboardEvent) => void) | undefined;
|
|
518
|
+
/**
|
|
519
|
+
* When true, the scroll view stops on multiples of the scroll view's size
|
|
520
|
+
* when scrolling. This can be used for horizontal pagination.
|
|
521
|
+
*
|
|
522
|
+
* @default `false`
|
|
523
|
+
*/
|
|
524
|
+
pagingEnabled?: boolean | undefined;
|
|
525
|
+
/**
|
|
526
|
+
* When false, the view cannot be scrolled via touch interaction.
|
|
527
|
+
* Note that the view can always be scrolled by calling `scrollTo`.
|
|
528
|
+
*
|
|
529
|
+
* @default `true`
|
|
530
|
+
*/
|
|
531
|
+
scrollEnabled?: boolean | undefined;
|
|
532
|
+
/**
|
|
533
|
+
* Limits how often scroll events will be fired while scrolling, specified as
|
|
534
|
+
* a time interval in ms. This may be useful when expensive work is performed
|
|
535
|
+
* in response to scrolling. Values <= `16` will disable throttling,
|
|
536
|
+
* regardless of the refresh rate of the device.
|
|
537
|
+
*
|
|
538
|
+
* @default `0`
|
|
539
|
+
*/
|
|
540
|
+
scrollEventThrottle?: number | undefined;
|
|
541
|
+
/**
|
|
542
|
+
* When true, shows a vertical scroll indicator.
|
|
543
|
+
*
|
|
544
|
+
* @default `true`
|
|
545
|
+
*/
|
|
546
|
+
showsVerticalScrollIndicator?: boolean | undefined;
|
|
547
|
+
/**
|
|
548
|
+
* When true, the sticky header is hidden when scrolling down, and docks
|
|
549
|
+
* at the top when scrolling up.
|
|
550
|
+
*
|
|
551
|
+
* @default `false`
|
|
552
|
+
*/
|
|
553
|
+
stickyHeaderHiddenOnScroll?: boolean | undefined;
|
|
554
|
+
/**
|
|
555
|
+
* An array of child indices determining which children get docked to the
|
|
556
|
+
* top of the screen when scrolling. For example, passing
|
|
557
|
+
* `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the
|
|
558
|
+
* top of the scroll view. This property is not supported in conjunction
|
|
559
|
+
* with `horizontal={true}`.
|
|
560
|
+
*/
|
|
561
|
+
stickyHeaderIndices?: ReadonlyArray<number> | undefined;
|
|
562
|
+
/**
|
|
563
|
+
* A React Component that will be used to render sticky headers.
|
|
564
|
+
* To be used together with `stickyHeaderIndices` or with `SectionList`, defaults to `ScrollViewStickyHeader`.
|
|
565
|
+
* You may need to set this if your sticky header uses custom transforms (eg. translation),
|
|
566
|
+
* for example when you want your list to have an animated hidable header.
|
|
567
|
+
*/
|
|
568
|
+
StickyHeaderComponent?: StickyHeaderComponentType | undefined;
|
|
569
|
+
/**
|
|
570
|
+
* When `snapToInterval` is set, `snapToAlignment` defines the relationship
|
|
571
|
+
* of the snapping to the scroll view.
|
|
572
|
+
*
|
|
573
|
+
* - `'start'` (the default) will align the snap at the left (horizontal) or top (vertical)
|
|
574
|
+
* - `'center'` will align the snap in the center
|
|
575
|
+
* - `'end'` will align the snap at the right (horizontal) or bottom (vertical)
|
|
576
|
+
* - `'item'` will align the snap according to each item's own `scrollSnapAlign` or `scrollSnapOffset` prop (TV platforms only).
|
|
577
|
+
*
|
|
578
|
+
* @default `'start'`
|
|
579
|
+
*/
|
|
580
|
+
snapToAlignment?: ("start" | "center" | "end" | "item") | undefined;
|
|
581
|
+
/**
|
|
582
|
+
* Padding applied when snapping to items using `snapToAlignment="item"`.
|
|
583
|
+
* This is set on the parent scroll view, not directly on child items.
|
|
584
|
+
* Only used when `snapToAlignment` is set to `'item'`.
|
|
585
|
+
*/
|
|
586
|
+
snapToItemPadding?: number | undefined;
|
|
587
|
+
/**
|
|
588
|
+
* When set, causes the scroll view to stop at multiples of the value of
|
|
589
|
+
* `snapToInterval`. This can be used for paginating through children
|
|
590
|
+
* that have lengths smaller than the scroll view. Typically used in
|
|
591
|
+
* combination with `snapToAlignment` and `decelerationRate="fast"`.
|
|
592
|
+
*
|
|
593
|
+
* Overrides less configurable `pagingEnabled` prop.
|
|
594
|
+
*/
|
|
595
|
+
snapToInterval?: number | undefined;
|
|
596
|
+
/**
|
|
597
|
+
* When set, causes the scroll view to stop at the defined offsets.
|
|
598
|
+
* This can be used for paginating through variously sized children
|
|
599
|
+
* that have lengths smaller than the scroll view. Typically used in
|
|
600
|
+
* combination with `decelerationRate="fast"`.
|
|
601
|
+
*
|
|
602
|
+
* Overrides less configurable `pagingEnabled` and `snapToInterval` props.
|
|
603
|
+
*/
|
|
604
|
+
snapToOffsets?: ReadonlyArray<number> | undefined;
|
|
605
|
+
/**
|
|
606
|
+
* Use in conjunction with `snapToOffsets`. By default, the beginning
|
|
607
|
+
* of the list counts as a snap offset. Set `snapToStart` to `false` to disable
|
|
608
|
+
* this behavior and allow the list to scroll freely between its start and
|
|
609
|
+
* the first `snapToOffsets` offset.
|
|
610
|
+
*
|
|
611
|
+
* @default `true`
|
|
612
|
+
*/
|
|
613
|
+
snapToStart?: boolean | undefined;
|
|
614
|
+
/**
|
|
615
|
+
* Use in conjunction with `snapToOffsets`. By default, the end
|
|
616
|
+
* of the list counts as a snap offset. Set `snapToEnd` to `false` to disable
|
|
617
|
+
* this behavior and allow the list to scroll freely between its end and
|
|
618
|
+
* the last `snapToOffsets` offset.
|
|
619
|
+
*
|
|
620
|
+
* @default `true`
|
|
621
|
+
*/
|
|
622
|
+
snapToEnd?: boolean | undefined;
|
|
623
|
+
/**
|
|
624
|
+
* Experimental: When true, offscreen child views (whose `overflow` value is
|
|
625
|
+
* `hidden`) are removed from their native backing superview when offscreen.
|
|
626
|
+
* This can improve scrolling performance on long lists.
|
|
627
|
+
*
|
|
628
|
+
* @default `true`
|
|
629
|
+
*/
|
|
630
|
+
removeClippedSubviews?: boolean | undefined;
|
|
631
|
+
/**
|
|
632
|
+
* (TV only)
|
|
633
|
+
* When false, the scroll view will jump to the correct offset without animation
|
|
634
|
+
* when focus changes. Defaults to true.
|
|
635
|
+
*/
|
|
636
|
+
scrollAnimationEnabled?: boolean | undefined;
|
|
637
|
+
/**
|
|
638
|
+
* (Android TV only)
|
|
639
|
+
* Duration in milliseconds of the animated scroll that runs when focus moves to
|
|
640
|
+
* another item. Applies to the snap scroll (`snapToAlignment="item"` with
|
|
641
|
+
* per-item `scrollSnapAlign`/`scrollSnapOffset` markers) and to animated
|
|
642
|
+
* `scrollTo` commands; other focus scrolls are instant. When unset or <= 0, the platform default (~250ms) is used.
|
|
643
|
+
* On tvOS the focus engine owns this animation and the prop has no effect.
|
|
644
|
+
*/
|
|
645
|
+
scrollAnimationDuration?: number | undefined;
|
|
646
|
+
/**
|
|
647
|
+
* (Android TV only)
|
|
648
|
+
* Easing curve of that animation, either a CSS easing keyword or explicit
|
|
649
|
+
* cubic-bezier control points `[x1, y1, x2, y2]`. When unset, the platform
|
|
650
|
+
* default curve (`AccelerateDecelerateInterpolator`) is used.
|
|
651
|
+
* On tvOS the focus engine owns this animation and the prop has no effect.
|
|
652
|
+
*/
|
|
653
|
+
scrollAnimationEasing?: ScrollAnimationEasing | undefined;
|
|
654
|
+
/**
|
|
655
|
+
* A RefreshControl component, used to provide pull-to-refresh
|
|
656
|
+
* functionality for the ScrollView. Only works for vertical ScrollViews
|
|
657
|
+
* (`horizontal` prop must be `false`).
|
|
658
|
+
*
|
|
659
|
+
* See [RefreshControl](docs/refreshcontrol.html).
|
|
660
|
+
*/
|
|
661
|
+
refreshControl?: React.JSX.Element | undefined;
|
|
662
|
+
children?: React.ReactNode | undefined;
|
|
663
|
+
/**
|
|
664
|
+
* A ref to the inner View element of the ScrollView. This should be used
|
|
665
|
+
* instead of calling `getInnerViewRef`.
|
|
666
|
+
*/
|
|
667
|
+
innerViewRef?: React.Ref<InnerViewInstance> | undefined;
|
|
668
|
+
/**
|
|
669
|
+
* A ref to the Native ScrollView component. This ref can be used to call
|
|
670
|
+
* all of ScrollView's public methods, in addition to native methods like
|
|
671
|
+
* measure, measureLayout, etc.
|
|
672
|
+
*/
|
|
673
|
+
scrollViewRef?: React.Ref<ScrollViewInstance> | undefined;
|
|
674
|
+
}>;
|
|
675
|
+
export interface ScrollViewProps extends Readonly<Omit<Omit<ViewProps, "experimental_accessibilityOrder">, keyof ScrollViewPropsIOS | keyof ScrollViewPropsAndroid | keyof ScrollViewBaseProps | keyof {}> & Omit<ScrollViewPropsIOS, keyof ScrollViewPropsAndroid | keyof ScrollViewBaseProps | keyof {}> & Omit<ScrollViewPropsAndroid, keyof ScrollViewBaseProps | keyof {}> & Omit<ScrollViewBaseProps, keyof {}>> {}
|
|
676
|
+
export type ScrollViewComponentStatics = Readonly<{
|
|
677
|
+
Context: typeof ScrollViewContext;
|
|
678
|
+
}>;
|
|
679
|
+
declare const ScrollViewWrapper: (props: Omit<ScrollViewProps, keyof {
|
|
680
|
+
ref?: React.Ref<ScrollViewInstance> | undefined;
|
|
681
|
+
}> & {
|
|
682
|
+
ref?: React.Ref<ScrollViewInstance> | undefined;
|
|
683
|
+
}) => React.ReactNode;
|
|
684
|
+
/**
|
|
685
|
+
* Component that wraps platform ScrollView while providing
|
|
686
|
+
* integration with touch locking "responder" system.
|
|
687
|
+
*
|
|
688
|
+
* Keep in mind that ScrollViews must have a bounded height in order to work,
|
|
689
|
+
* since they contain unbounded-height children into a bounded container (via
|
|
690
|
+
* a scroll interaction). In order to bound the height of a ScrollView, either
|
|
691
|
+
* set the height of the view directly (discouraged) or make sure all parent
|
|
692
|
+
* views have bounded height. Forgetting to transfer `{flex: 1}` down the
|
|
693
|
+
* view stack can lead to errors here, which the element inspector makes
|
|
694
|
+
* easy to debug.
|
|
695
|
+
*
|
|
696
|
+
* Doesn't yet support other contained responders from blocking this scroll
|
|
697
|
+
* view from becoming the responder.
|
|
698
|
+
*
|
|
699
|
+
*
|
|
700
|
+
* `<ScrollView>` vs [`<FlatList>`](https://reactnative.dev/docs/flatlist) - which one to use?
|
|
701
|
+
*
|
|
702
|
+
* `ScrollView` simply renders all its react child components at once. That
|
|
703
|
+
* makes it very easy to understand and use.
|
|
704
|
+
*
|
|
705
|
+
* On the other hand, this has a performance downside. Imagine you have a very
|
|
706
|
+
* long list of items you want to display, maybe several screens worth of
|
|
707
|
+
* content. Creating JS components and native views for everything all at once,
|
|
708
|
+
* much of which may not even be shown, will contribute to slow rendering and
|
|
709
|
+
* increased memory usage.
|
|
710
|
+
*
|
|
711
|
+
* This is where `FlatList` comes into play. `FlatList` renders items lazily,
|
|
712
|
+
* just when they are about to appear, and removes items that scroll way off
|
|
713
|
+
* screen to save memory and processing time.
|
|
714
|
+
*
|
|
715
|
+
* `FlatList` is also handy if you want to render separators between your items,
|
|
716
|
+
* multiple columns, infinite scroll loading, or any number of other features it
|
|
717
|
+
* supports out of the box.
|
|
718
|
+
*
|
|
719
|
+
* @see https://reactnative.dev/docs/scrollview
|
|
720
|
+
*/
|
|
721
|
+
declare const $$ScrollView: typeof ScrollViewWrapper & ScrollViewComponentStatics;
|
|
722
|
+
declare type $$ScrollView = typeof $$ScrollView;
|
|
723
|
+
export default $$ScrollView;
|