Moving ScrollView props into proper OS based type (#48132)

* add missing type for ScrollView maintainVisibleContentPosition on iOS

* add test

* Apply suggestions from code review

Co-authored-by: Eloy Durán <eloy.de.enige@gmail.com>

* put stickHeaderIndices, snapToAlignment, and decelerationRate props under correct scrollview type

Co-authored-by: Vir Desai <virdesai@virs-mbp.lan>
Co-authored-by: Eloy Durán <eloy.de.enige@gmail.com>
This commit is contained in:
Vir Desai 2020-09-25 04:54:27 -04:00 committed by GitHub
parent ea2a3d28f3
commit 6c915c17c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6480,14 +6480,6 @@ export interface ScrollViewPropsIOS {
*/
contentInsetAdjustmentBehavior?: 'automatic' | 'scrollableAxes' | 'never' | 'always';
/**
* A floating-point number that determines how quickly the scroll view
* decelerates after the user lifts their finger. Reasonable choices include
* - Normal: 0.998 (the default)
* - Fast: 0.9
*/
decelerationRate?: 'fast' | 'normal' | number;
/**
* When true the ScrollView will try to lock to only vertical or horizontal
* scrolling while dragging. The default value is false.
@ -6579,19 +6571,19 @@ export interface ScrollViewPropsIOS {
*/
scrollsToTop?: boolean;
/**
* When `snapToInterval` is set, `snapToAlignment` will define the relationship of the the snapping to the scroll view.
* - `start` (the default) will align the snap at the left (horizontal) or top (vertical)
* - `center` will align the snap in the center
* - `end` will align the snap at the right (horizontal) or bottom (vertical)
*/
snapToAlignment?: 'start' | 'center' | 'end';
/**
* Fires when the scroll view scrolls to top after the status bar has been tapped
* @platform ios
*/
onScrollToTop?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
/**
* An array of child indices determining which children get docked to the
* top of the screen when scrolling. For example passing
* `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the
* top of the scroll view. This property is not supported in conjunction
* with `horizontal={true}`.
*/
stickyHeaderIndices?: number[];
/**
* The current scale of the scroll view content. The default value is 1.0.
@ -6669,6 +6661,18 @@ export interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollVi
*/
contentContainerStyle?: StyleProp<ViewStyle>;
/**
* A floating-point number that determines how quickly the scroll view
* decelerates after the user lifts their finger. You may also use string
* shortcuts `"normal"` and `"fast"` which match the underlying iOS settings
* for `UIScrollViewDecelerationRateNormal` and
* `UIScrollViewDecelerationRateFast` respectively.
*
* - `'normal'`: 0.998 on iOS, 0.985 on Android (the default)
* - `'fast'`: 0.99 on iOS, 0.9 on Android
*/
decelerationRate?: 'fast' | 'normal' | number,
/**
* When true the scroll view's children are arranged horizontally in a row
* instead of vertically in a column. The default value is false.
@ -6776,14 +6780,6 @@ export interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollVi
*/
refreshControl?: React.ReactElement<RefreshControlProps>;
/**
* When `snapToInterval` is set, `snapToAlignment` will define the relationship of the the snapping to the scroll view.
* - `start` (the default) will align the snap at the left (horizontal) or top (vertical)
* - `center` will align the snap in the center
* - `end` will align the snap at the right (horizontal) or bottom (vertical)
*/
snapToAlignment?: 'start' | 'center' | 'end';
/**
* When set, causes the scroll view to stop at multiples of the value of `snapToInterval`.
* This can be used for paginating through children that have lengths smaller than the scroll view.
@ -6814,6 +6810,15 @@ export interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollVi
*/
snapToEnd?: boolean;
/**
* An array of child indices determining which children get docked to the
* top of the screen when scrolling. For example passing
* `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the
* top of the scroll view. This property is not supported in conjunction
* with `horizontal={true}`.
*/
stickyHeaderIndices?: number[];
/**
* When true, the scroll view stops on the next index (in relation to scroll position at release)
* regardless of how fast the gesture is. This can be used for horizontal pagination when the page