Skip to content

Commit d514e95

Browse files
committed
bs-react-native-next: Add VirtualizedSectionList & SectionList
1 parent 693a019 commit d514e95

4 files changed

Lines changed: 459 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
[@react.component] [@bs.module "react-native"]
2+
// VirtualizedSectionList props
3+
external make:
4+
(
5+
~sections: array(VirtualizedSectionList.section('item)),
6+
~renderItem: VirtualizedSectionList.renderItemCallback('item),
7+
~renderSectionHeader: VirtualizedSectionList.renderSectionHeaderCallback(
8+
'item,
9+
)
10+
=?,
11+
~renderSectionFooter: VirtualizedSectionList.renderSectionHeaderCallback(
12+
'item,
13+
)
14+
=?,
15+
// @todo support components too (only?)
16+
~_SectionSeparatorComponent: React.element=?,
17+
~_ItemSeparatorComponent: React.element=?,
18+
// VirtualizedList props
19+
~_CellRendererComponent: VirtualizedList.cellRendererComponent('item)=?,
20+
~_ListEmptyComponent: React.element=?,
21+
~_ListFooterComponent: React.element=?,
22+
~_ListHeaderComponent: React.element=?,
23+
~debug: bool=?,
24+
// ~enableVirtualization: bool=?, // not working, disableVirtualization?
25+
// ~data: 'data, // any collection of 'item
26+
~disableVirtualization: bool=?, // deprecated
27+
~extraData: 'extraData=?,
28+
~getItem: ('data, int) => 'item=?,
29+
~getItemCount: 'data => int=?,
30+
~getItemLayout: ('data, int) => VirtualizedList.itemLayout=?,
31+
~initialNumToRender: int=?,
32+
~initialScrollIndex: int=?,
33+
~inverted: bool=?,
34+
~keyExtractor: ('item, int) => string,
35+
~maxToRenderPerBatch: int=?,
36+
~onEndReached: VirtualizedList.onEndReachedParams => unit=?,
37+
~onEndReachedThreshold: float=?,
38+
~onRefresh: unit => unit=?,
39+
~onScrollToIndexFailed: VirtualizedList.onScrollToIndexFailedParams => unit
40+
=?,
41+
~onViewableItemsChanged: VirtualizedList.viewableItemsChanged('item) =>
42+
unit
43+
=?,
44+
~progressViewOffset: float=?,
45+
~refreshing: bool=?,
46+
// ~renderItem: VirtualizedList.renderItemCallback('item),
47+
~renderScrollComponent: unit => React.element=?, // TODO: params?
48+
~updateCellsBatchingPeriod: float=?,
49+
~viewabilityConfig: VirtualizedList.viewabilityConfig=?,
50+
~viewabilityConfigCallbackPairs: VirtualizedList.viewabilityConfigCallbackPairs(
51+
'item,
52+
)
53+
=?,
54+
~windowSize: int=?,
55+
// ScrollView props
56+
~alwaysBounceHorizontal: bool=?,
57+
~alwaysBounceVertical: bool=?,
58+
~automaticallyAdjustContentInsets: bool=?,
59+
~bounces: bool=?,
60+
~bouncesZoom: bool=?,
61+
~canCancelContentTouches: bool=?,
62+
~centerContent: bool=?,
63+
~contentContainerStyle: Style.t=?,
64+
~contentInset: Types.insets=?,
65+
~contentInsetAdjustmentBehavior: [@bs.string] [
66+
| `automatic
67+
| `scrollableAxes
68+
| `never
69+
| `always
70+
]
71+
=?,
72+
~contentOffset: Types.point=?,
73+
~decelerationRate: [@bs.string] [ | `fast | `normal]=?,
74+
~directionalLockEnabled: bool=?,
75+
~endFillColor: Style.color=?,
76+
~horizontal: bool=?,
77+
~indicatorStyle: [@bs.string] [ | `default | `black | `white]=?,
78+
~keyboardDismissMode: [@bs.string] [ | `none | `interactive | `onDrag]=?,
79+
~keyboardShouldPersistTaps: [@bs.string] [ | `always | `never | `handled]=?,
80+
~maximumZoomScale: float=?,
81+
~minimumZoomScale: float=?,
82+
~nestedScrollEnabled: bool=?,
83+
~onContentSizeChange: ((float, float)) => unit=?,
84+
~onMomentumScrollBegin: Event.NativeScrollEvent.t => unit=?,
85+
~onMomentumScrollEnd: Event.NativeScrollEvent.t => unit=?,
86+
~onScroll: Event.NativeScrollEvent.t => unit=?,
87+
~onScrollBeginDrag: Event.NativeScrollEvent.t => unit=?,
88+
~onScrollEndDrag: Event.NativeScrollEvent.t => unit=?,
89+
~overScrollMode: [@bs.string] [ | `always | `never | `auto]=?,
90+
~pagingEnabled: bool=?,
91+
~refreshControl: React.element=?,
92+
~scrollEnabled: bool=?,
93+
~scrollEventThrottle: int=?,
94+
~scrollIndicatorInsets: Types.insets=?,
95+
~scrollPerfTag: string=?,
96+
~scrollsToTop: bool=?,
97+
~showsHorizontalScrollIndicator: bool=?,
98+
~showsVerticalScrollIndicator: bool=?,
99+
~snapToAlignment: [@bs.string] [ | `start | `center | `end_]=?,
100+
~snapToEnd: bool=?,
101+
~snapToInterval: float=?,
102+
~snapToOffsets: array(float)=?,
103+
~snapToStart: bool=?,
104+
~stickyHeaderIndices: list(int)=?,
105+
~zoomScale: float=?,
106+
// View props
107+
~accessibilityComponentType: [@bs.string] [
108+
| `none
109+
| `button
110+
| `radiobutton_checked
111+
| `radiobutton_unchecked
112+
]
113+
=?,
114+
~accessibilityElementsHidden: bool=?,
115+
~accessibilityHint: string=?,
116+
~accessibilityIgnoresInvertColors: bool=?,
117+
~accessibilityLabel: string=?,
118+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
119+
~accessibilityRole: [@bs.string] [
120+
| `none
121+
| `button
122+
| `link
123+
| `search
124+
| `image
125+
| `keyboardkey
126+
| `text
127+
| `adjustable
128+
| `header
129+
| `summary
130+
| `imagebutton
131+
]
132+
=?,
133+
~accessibilityStates: array(Types.AccessibilityState.t)=?,
134+
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
135+
~accessibilityViewIsModal: bool=?,
136+
~accessible: bool=?,
137+
~collapsable: bool=?,
138+
~hitSlop: Types.insets=?,
139+
~importantForAccessibility: [@bs.string] [
140+
| `auto
141+
| `yes
142+
| `no
143+
| [@bs.as "no-hide-descendants"]
144+
`noHideDescendants
145+
]
146+
=?,
147+
~nativeID: string=?,
148+
~needsOffscreenAlphaCompositing: bool=?,
149+
~onAccessibilityTap: unit => unit=?,
150+
~onLayout: Event.NativeLayoutEvent.t => unit=?,
151+
~onMagicTap: unit => unit=?,
152+
~onMoveShouldSetResponder: Event.NativeEvent.t => bool=?,
153+
~onMoveShouldSetResponderCapture: Event.NativeEvent.t => bool=?,
154+
~onResponderGrant: Event.NativeEvent.t => unit=?,
155+
~onResponderMove: Event.NativeEvent.t => unit=?,
156+
~onResponderReject: Event.NativeEvent.t => unit=?,
157+
~onResponderRelease: Event.NativeEvent.t => unit=?,
158+
~onResponderTerminate: Event.NativeEvent.t => unit=?,
159+
~onResponderTerminationRequest: Event.NativeEvent.t => unit=?,
160+
~onStartShouldSetResponder: Event.NativeEvent.t => bool=?,
161+
~onStartShouldSetResponderCapture: Event.NativeEvent.t => bool=?,
162+
~pointerEvents: [@bs.string] [
163+
| `auto
164+
| `none
165+
| [@bs.as "box-none"] `boxNone
166+
| [@bs.as "box-only"] `boxOnly
167+
]
168+
=?,
169+
~removeClippedSubviews: bool=?,
170+
~renderToHardwareTextureAndroid: bool=?,
171+
~shouldRasterizeIOS: bool=?,
172+
~style: Style.t=?,
173+
~testID: string=?
174+
) =>
175+
React.element =
176+
"SectionList";
177+
178+
// VirtualizedList methods
179+
type scrollToEndOptions;
180+
[@bs.obj]
181+
external scrollToEndOptions: (~animated: bool=?, unit) => scrollToEndOptions =
182+
"";
183+
[@bs.send] external scrollToEnd: React.Ref.domRef => unit = "scrollToEnd";
184+
[@bs.send]
185+
external scrollToEndWithOptions: (React.Ref.domRef, scrollToEndOptions) => unit =
186+
"scrollToEnd";
187+
188+
type scrollToIndexParams;
189+
[@bs.obj]
190+
external scrollToIndexParams:
191+
(
192+
~viewOffset: float=?,
193+
~viewPosition: float=?,
194+
~animated: bool=?,
195+
~index: int,
196+
unit
197+
) =>
198+
scrollToIndexParams =
199+
"";
200+
[@bs.send]
201+
external scrollToIndex: scrollToIndexParams => unit = "scrollToIndex";
202+
203+
type scrollToItemParams('item);
204+
[@bs.obj]
205+
external scrollToItemParams:
206+
(~viewPosition: float=?, ~animated: bool=?, ~item: 'item, unit) =>
207+
scrollToIndexParams =
208+
"";
209+
[@bs.send]
210+
external scrollToItem: scrollToItemParams('item) => unit = "scrollToItem";
211+
212+
type scrollToOffsetParams;
213+
[@bs.obj]
214+
external scrollToOffsetParams:
215+
(~animated: bool=?, ~offset: float, unit) => scrollToOffsetParams =
216+
"";
217+
[@bs.send]
218+
external scrollToOffset: scrollToOffsetParams => unit = "scrollToOffset";
219+
220+
[@bs.send] external recordInteraction: React.Ref.domRef => unit = "";
221+
222+
[@bs.send] external flashScrollIndicators: React.Ref.domRef => unit = "";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

0 commit comments

Comments
 (0)