Skip to content

Commit 6092bfd

Browse files
huntiefacebook-github-bot
authored andcommitted
Expose ListViewToken type as root export
Summary: Resolves react-native-community/discussions-and-proposals#893 (comment). Changelog: [General][Added] - `ListViewToken` is now exposed when using `"react-native-strict-api"` Differential Revision: D81380882
1 parent e30f34e commit 6092bfd

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

packages/react-native/Libraries/Lists/VirtualizedList.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const VirtualizedListComponent: VirtualizedListType =
1919
export type {
2020
ListRenderItemInfo,
2121
ListRenderItem,
22+
ListViewToken,
2223
Separators,
2324
VirtualizedListProps,
2425
} from '@react-native/virtualized-lists';

packages/react-native/ReactNativeApi.d.ts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<0170bc4ced1f6d3d4092d837027cd391>>
7+
* @generated SignedSource<<0636b81dd22e1783cdef3e4b5696f367>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -3087,6 +3087,13 @@ declare type ListRenderItemInfo<ItemT> = {
30873087
item: ItemT
30883088
separators: Separators
30893089
}
3090+
declare type ListViewToken = {
3091+
index: number | undefined
3092+
isViewable: boolean
3093+
item: any
3094+
key: string
3095+
section?: any
3096+
}
30903097
declare type LogBox = typeof LogBox
30913098
declare type LogData = {
30923099
readonly category: Category
@@ -3509,8 +3516,8 @@ declare type OptionalVirtualizedListProps = {
35093516
onStartReached?: (info: { distanceFromStart: number }) => void
35103517
onStartReachedThreshold?: number
35113518
onViewableItemsChanged?: (info: {
3512-
changed: Array<ViewToken>
3513-
viewableItems: Array<ViewToken>
3519+
changed: Array<ListViewToken>
3520+
viewableItems: Array<ListViewToken>
35143521
}) => void
35153522
persistentScrollbar?: boolean
35163523
progressViewOffset?: number
@@ -5676,8 +5683,8 @@ declare type ViewabilityConfig = {
56765683
declare type ViewabilityConfigCallbackPair = {
56775684
viewabilityConfig: ViewabilityConfig
56785685
onViewableItemsChanged: (info: {
5679-
changed: Array<ViewToken>
5680-
viewableItems: Array<ViewToken>
5686+
changed: Array<ListViewToken>
5687+
viewableItems: Array<ListViewToken>
56815688
}) => void
56825689
}
56835690
declare class ViewabilityHelper_default {
@@ -5702,10 +5709,10 @@ declare class ViewabilityHelper_default {
57025709
index: number,
57035710
isViewable: boolean,
57045711
props: CellMetricProps,
5705-
) => ViewToken,
5712+
) => ListViewToken,
57065713
onViewableItemsChanged: ($$PARAM_0$$: {
5707-
changed: Array<ViewToken>
5708-
viewableItems: Array<ViewToken>
5714+
changed: Array<ListViewToken>
5715+
viewableItems: Array<ListViewToken>
57095716
}) => void,
57105717
renderRange?: {
57115718
first: number
@@ -5790,13 +5797,6 @@ declare type ViewPropsIOS = {
57905797
}
57915798
declare type ViewStyle = ____ViewStyle_Internal
57925799
declare type ViewStyleProp = ____ViewStyleProp_Internal
5793-
declare type ViewToken = {
5794-
index: number | undefined
5795-
isViewable: boolean
5796-
item: any
5797-
key: string
5798-
section?: any
5799-
}
58005800
declare type VirtualizedList = typeof VirtualizedList
58015801
declare class VirtualizedList_default extends StateSafePureComponent_default<
58025802
VirtualizedListProps,
@@ -6010,8 +6010,8 @@ export {
60106010
EventSubscription, // b8d084aa
60116011
ExtendedExceptionData, // 5a6ccf5a
60126012
FilterFunction, // bf24c0e3
6013-
FlatList, // 714df8ad
6014-
FlatListProps, // e3e724ea
6013+
FlatList, // 4f1b407e
6014+
FlatListProps, // b225fb7a
60156015
FocusEvent, // 529b43eb
60166016
FontVariant, // 7c7558bb
60176017
GestureResponderEvent, // b466f6d6
@@ -6065,6 +6065,7 @@ export {
60656065
Linking, // 292de0a0
60666066
ListRenderItem, // b5353fd8
60676067
ListRenderItemInfo, // e8595b03
6068+
ListViewToken, // 833d3481
60686069
LogBox, // b58880c6
60696070
LogData, // 89af6d4c
60706071
MeasureInWindowOnSuccessCallback, // a285f598
@@ -6148,9 +6149,9 @@ export {
61486149
ScrollViewPropsIOS, // d83c9733
61496150
ScrollViewScrollToOptions, // 3313411e
61506151
SectionBase, // 0ccaedac
6151-
SectionList, // cc6dec0b
6152+
SectionList, // a1a4786b
61526153
SectionListData, // 1c80bb2e
6153-
SectionListProps, // 97fcf95a
6154+
SectionListProps, // 7fb5371e
61546155
SectionListRenderItem, // cffebb53
61556156
SectionListRenderItemInfo, // 946c2128
61566157
Separators, // 6a45f7e3
@@ -6215,9 +6216,9 @@ export {
62156216
ViewStyle, // c2db0e6e
62166217
VirtualViewMode, // 85a69ef6
62176218
VirtualizedList, // 4d513939
6218-
VirtualizedListProps, // 8efa6d8e
6219+
VirtualizedListProps, // be716140
62196220
VirtualizedSectionList, // 446ba0df
6220-
VirtualizedSectionListProps, // c5e64f83
6221+
VirtualizedSectionListProps, // a6899dfb
62216222
WrapperComponentProvider, // 9cf3844c
62226223
codegenNativeCommands, // e16d62f7
62236224
codegenNativeComponent, // ed4c8103

packages/react-native/index.js.flow

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export {default as View} from './Libraries/Components/View/View';
184184
export type {
185185
ListRenderItemInfo,
186186
ListRenderItem,
187+
ListViewToken,
187188
Separators,
188189
VirtualizedListProps,
189190
} from './Libraries/Lists/VirtualizedList';

packages/virtualized-lists/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {typeof VirtualizedListContextResetter as VirtualizedListContextResetterT
1919
import {keyExtractor} from './Lists/VirtualizeUtils';
2020

2121
export type {
22-
ViewToken,
22+
ViewToken as ListViewToken,
2323
ViewabilityConfig,
2424
ViewabilityConfigCallbackPair,
2525
ViewabilityConfigCallbackPairs,

0 commit comments

Comments
 (0)