@legendapp/list 3.0.0-beta.9 → 3.0.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/.DS_Store +0 -0
- package/CHANGELOG.md +27 -1
- package/README.md +8 -2
- package/animated.d.ts +659 -5
- package/animated.js +2 -2
- package/animated.mjs +1 -1
- package/keyboard-legacy.d.ts +226 -0
- package/keyboard-legacy.js +456 -0
- package/keyboard-legacy.mjs +435 -0
- package/keyboard.d.ts +261 -9
- package/keyboard.js +114 -135
- package/keyboard.mjs +115 -137
- package/package.json +55 -5
- package/{types-1Hgg1rTO.d.mts → react-native.d.ts} +269 -284
- package/react-native.js +6471 -0
- package/react-native.mjs +6442 -0
- package/{types-1Hgg1rTO.d.ts → react-native.web.d.ts} +330 -283
- package/react-native.web.js +7125 -0
- package/react-native.web.mjs +7096 -0
- package/react.d.ts +771 -0
- package/react.js +7125 -0
- package/react.mjs +7096 -0
- package/reanimated.d.ts +681 -8
- package/reanimated.js +225 -38
- package/reanimated.mjs +227 -40
- package/section-list.d.ts +682 -7
- package/section-list.js +85 -3854
- package/section-list.mjs +83 -3853
- package/animated.d.mts +0 -9
- package/index.d.mts +0 -23
- package/index.d.ts +0 -23
- package/index.js +0 -3935
- package/index.mjs +0 -3907
- package/index.native.d.mts +0 -23
- package/index.native.d.ts +0 -23
- package/index.native.js +0 -3739
- package/index.native.mjs +0 -3711
- package/keyboard-controller.d.mts +0 -12
- package/keyboard-controller.d.ts +0 -12
- package/keyboard-controller.js +0 -69
- package/keyboard-controller.mjs +0 -48
- package/keyboard.d.mts +0 -13
- package/reanimated.d.mts +0 -18
- package/section-list.d.mts +0 -113
- package/section-list.native.d.mts +0 -113
- package/section-list.native.d.ts +0 -113
- package/section-list.native.js +0 -3897
- package/section-list.native.mjs +0 -3876
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
import * as React
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import Reanimated from 'react-native-reanimated';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Key, Dispatch, SetStateAction } from 'react';
|
|
3
|
+
import { ScrollViewProps, NativeSyntheticEvent as NativeSyntheticEvent$1, NativeScrollEvent as NativeScrollEvent$1, ScrollView, StyleProp as StyleProp$1, ViewStyle as ViewStyle$1, ScrollViewComponent, ScrollResponderMixin, Insets as Insets$1, View } from 'react-native';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
interface MaintainVisibleContentPositionNormalized<ItemT = any> {
|
|
6
|
+
data: boolean;
|
|
7
|
+
size: boolean;
|
|
8
|
+
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
9
|
+
}
|
|
7
10
|
|
|
8
|
-
type ListenerType = "activeStickyIndex" | "
|
|
9
|
-
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
11
|
+
type ListenerType = "activeStickyIndex" | "anchoredEndSpaceSize" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
|
|
12
|
+
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
10
13
|
type ListenerTypeValueMap = {
|
|
11
14
|
activeStickyIndex: number;
|
|
12
|
-
|
|
15
|
+
anchoredEndSpaceSize: number;
|
|
13
16
|
animatedScrollY: any;
|
|
14
17
|
debugComputedScroll: number;
|
|
15
18
|
debugRawScroll: number;
|
|
16
19
|
extraData: any;
|
|
17
20
|
footerSize: number;
|
|
18
21
|
headerSize: number;
|
|
22
|
+
isAtEnd: boolean;
|
|
23
|
+
isAtStart: boolean;
|
|
24
|
+
isNearEnd: boolean;
|
|
25
|
+
isNearStart: boolean;
|
|
26
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
19
27
|
lastItemKeys: string[];
|
|
20
28
|
lastPositionUpdate: number;
|
|
21
|
-
maintainVisibleContentPosition:
|
|
29
|
+
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
22
30
|
numColumns: number;
|
|
23
31
|
numContainers: number;
|
|
24
32
|
numContainersPooled: number;
|
|
@@ -43,49 +51,44 @@ type ListenerTypeValueMap = {
|
|
|
43
51
|
} & {
|
|
44
52
|
[K in ListenerType as K extends `containerColumn${number}` ? K : never]: number;
|
|
45
53
|
} & {
|
|
46
|
-
[K in ListenerType as K extends `
|
|
54
|
+
[K in ListenerType as K extends `containerSpan${number}` ? K : never]: number;
|
|
47
55
|
} & {
|
|
48
|
-
[K in ListenerType as K extends `
|
|
56
|
+
[K in ListenerType as K extends `containerSticky${number}` ? K : never]: boolean;
|
|
49
57
|
};
|
|
50
|
-
interface StateContext {
|
|
51
|
-
animatedScrollY: AnimatedValue;
|
|
52
|
-
columnWrapperStyle: ColumnWrapperStyle | undefined;
|
|
53
|
-
contextNum: number;
|
|
54
|
-
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
55
|
-
mapViewabilityCallbacks: Map<string, ViewabilityCallback>;
|
|
56
|
-
mapViewabilityValues: Map<string, ViewToken>;
|
|
57
|
-
mapViewabilityAmountCallbacks: Map<number, ViewabilityAmountCallback>;
|
|
58
|
-
mapViewabilityAmountValues: Map<number, ViewAmountToken>;
|
|
59
|
-
mapViewabilityConfigStates: Map<string, {
|
|
60
|
-
viewableItems: ViewToken[];
|
|
61
|
-
start: number;
|
|
62
|
-
end: number;
|
|
63
|
-
previousStart: number;
|
|
64
|
-
previousEnd: number;
|
|
65
|
-
}>;
|
|
66
|
-
positionListeners: Map<string, Set<(value: any) => void>>;
|
|
67
|
-
state: InternalState;
|
|
68
|
-
values: Map<ListenerType, any>;
|
|
69
|
-
viewRefs: Map<number, React$1.RefObject<View>>;
|
|
70
|
-
}
|
|
71
58
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
requestAdjust(add: number): void;
|
|
78
|
-
getAdjust(): number;
|
|
79
|
-
commitPendingAdjust(): void;
|
|
59
|
+
interface Insets {
|
|
60
|
+
top: number;
|
|
61
|
+
left: number;
|
|
62
|
+
bottom: number;
|
|
63
|
+
right: number;
|
|
80
64
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
65
|
+
interface LayoutRectangle {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
width: number;
|
|
69
|
+
height: number;
|
|
70
|
+
}
|
|
71
|
+
interface NativeScrollEvent {
|
|
72
|
+
contentOffset: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
contentSize: {
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
};
|
|
80
|
+
layoutMeasurement: {
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
};
|
|
84
|
+
contentInset: Insets;
|
|
85
|
+
zoomScale: number;
|
|
86
|
+
}
|
|
87
|
+
interface NativeSyntheticEvent<T> {
|
|
88
|
+
nativeEvent: T;
|
|
89
|
+
}
|
|
90
|
+
type ViewStyle = Record<string, unknown>;
|
|
91
|
+
type StyleProp<T> = T | T[] | null | undefined | false;
|
|
89
92
|
type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
|
|
90
93
|
interface DataModeProps<ItemT, TItemType extends string | undefined> {
|
|
91
94
|
/**
|
|
@@ -94,13 +97,11 @@ interface DataModeProps<ItemT, TItemType extends string | undefined> {
|
|
|
94
97
|
*/
|
|
95
98
|
data: ReadonlyArray<ItemT>;
|
|
96
99
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* - A function: (props: LegendListRenderItemProps<ItemT>) => ReactNode
|
|
100
|
-
* - A React component: React.ComponentType<LegendListRenderItemProps<ItemT>>
|
|
100
|
+
* Callback to render each item in the list.
|
|
101
|
+
* To use hooks in an item component, return that component from this callback.
|
|
101
102
|
* @required when using data mode
|
|
102
103
|
*/
|
|
103
|
-
renderItem: (
|
|
104
|
+
renderItem: (props: LegendListRenderItemProps<ItemT, TItemType>) => React.ReactNode;
|
|
104
105
|
children?: never;
|
|
105
106
|
}
|
|
106
107
|
interface ChildrenModeProps {
|
|
@@ -109,7 +110,7 @@ interface ChildrenModeProps {
|
|
|
109
110
|
* Each child will be treated as an individual list item.
|
|
110
111
|
* @required when using children mode
|
|
111
112
|
*/
|
|
112
|
-
children: ReactNode;
|
|
113
|
+
children: React.ReactNode;
|
|
113
114
|
data?: never;
|
|
114
115
|
renderItem?: never;
|
|
115
116
|
}
|
|
@@ -119,10 +120,20 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
119
120
|
* @default false
|
|
120
121
|
*/
|
|
121
122
|
alignItemsAtEnd?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Keeps selected items mounted even when they scroll out of view.
|
|
125
|
+
* @default undefined
|
|
126
|
+
*/
|
|
127
|
+
alwaysRender?: AlwaysRenderConfig;
|
|
122
128
|
/**
|
|
123
129
|
* Style applied to each column's wrapper view.
|
|
124
130
|
*/
|
|
125
131
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
132
|
+
/**
|
|
133
|
+
* Version token that forces the list to treat data as updated even when the array reference is stable.
|
|
134
|
+
* Increment or change this when mutating the data array in place.
|
|
135
|
+
*/
|
|
136
|
+
dataVersion?: Key;
|
|
126
137
|
/**
|
|
127
138
|
* Distance in pixels to pre-render items ahead of the visible area.
|
|
128
139
|
* @default 250
|
|
@@ -147,25 +158,25 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
147
158
|
*/
|
|
148
159
|
extraData?: any;
|
|
149
160
|
/**
|
|
150
|
-
*
|
|
151
|
-
* Increment or change this when mutating the data array in place.
|
|
161
|
+
* In case items always have a fixed size, you can provide a function to return it.
|
|
152
162
|
*/
|
|
153
|
-
|
|
163
|
+
getFixedItemSize?: (item: ItemT, index: number, type: TItemType) => number | undefined;
|
|
154
164
|
/**
|
|
155
|
-
*
|
|
156
|
-
* Use instead of FlatList's getItemLayout or FlashList overrideItemLayout if you want to have accurate initialScrollOffset, you should provide this function
|
|
165
|
+
* Returns a stable item type used for pooling and size estimation.
|
|
157
166
|
*/
|
|
158
|
-
|
|
167
|
+
getItemType?: (item: ItemT, index: number) => TItemType;
|
|
159
168
|
/**
|
|
160
|
-
*
|
|
161
|
-
* @default 2
|
|
169
|
+
* Component to render between items, receiving the leading item as prop.
|
|
162
170
|
*/
|
|
163
|
-
|
|
171
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
172
|
+
leadingItem: ItemT;
|
|
173
|
+
}>;
|
|
164
174
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
175
|
+
* When true, the list initializes scrolled to the last item.
|
|
176
|
+
* Overrides `initialScrollIndex` and `initialScrollOffset` when data is available.
|
|
177
|
+
* @default false
|
|
167
178
|
*/
|
|
168
|
-
|
|
179
|
+
initialScrollAtEnd?: boolean;
|
|
169
180
|
/**
|
|
170
181
|
* Index to scroll to initially.
|
|
171
182
|
* @default 0
|
|
@@ -173,19 +184,17 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
173
184
|
initialScrollIndex?: number | {
|
|
174
185
|
index: number;
|
|
175
186
|
viewOffset?: number | undefined;
|
|
187
|
+
viewPosition?: number | undefined;
|
|
176
188
|
};
|
|
177
189
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* @default false
|
|
190
|
+
* Initial scroll position in pixels.
|
|
191
|
+
* @default 0
|
|
181
192
|
*/
|
|
182
|
-
|
|
193
|
+
initialScrollOffset?: number;
|
|
183
194
|
/**
|
|
184
|
-
*
|
|
195
|
+
* Custom equality function to detect semantically unchanged items.
|
|
185
196
|
*/
|
|
186
|
-
|
|
187
|
-
leadingItem: ItemT;
|
|
188
|
-
}>;
|
|
197
|
+
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
189
198
|
/**
|
|
190
199
|
* Function to extract a unique key for each item.
|
|
191
200
|
*/
|
|
@@ -210,8 +219,16 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
210
219
|
* Style for the header component.
|
|
211
220
|
*/
|
|
212
221
|
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Estimated height of the ListHeaderComponent. Provide this when the expected header height
|
|
224
|
+
* is known before layout so that only the items actually visible below the header are rendered
|
|
225
|
+
* on the initial frame, rather than a full screen's worth of items that are hidden behind it.
|
|
226
|
+
* The measured header size still replaces this value after layout.
|
|
227
|
+
*/
|
|
228
|
+
estimatedHeaderSize?: number;
|
|
213
229
|
/**
|
|
214
230
|
* If true, auto-scrolls to end when new items are added.
|
|
231
|
+
* Use an options object to opt into specific triggers and control whether that scroll is animated.
|
|
215
232
|
* @default false
|
|
216
233
|
*/
|
|
217
234
|
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
@@ -221,16 +238,34 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
221
238
|
*/
|
|
222
239
|
maintainScrollAtEndThreshold?: number;
|
|
223
240
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
241
|
+
* Maintains visibility of content.
|
|
242
|
+
* - scroll (default: true) stabilizes during size/layout changes while scrolling.
|
|
243
|
+
* - data (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
|
|
244
|
+
* - shouldRestorePosition can opt out specific items from data-change anchoring.
|
|
245
|
+
* - undefined (default) enables scroll stabilization but skips data-change anchoring.
|
|
246
|
+
* - true enables both behaviors; false disables both.
|
|
227
247
|
*/
|
|
228
|
-
maintainVisibleContentPosition?: boolean
|
|
248
|
+
maintainVisibleContentPosition?: boolean | MaintainVisibleContentPositionConfig<ItemT>;
|
|
249
|
+
/**
|
|
250
|
+
* Keeps an item visually anchored to the start by adding trailing space when the content below it underflows.
|
|
251
|
+
*/
|
|
252
|
+
anchoredEndSpace?: AnchoredEndSpaceConfig;
|
|
253
|
+
/**
|
|
254
|
+
* Adjusts the effective end content inset for web lists without replacing the base contentInset.
|
|
255
|
+
* The adjustment is also rendered as real content padding so the browser scroll range includes it.
|
|
256
|
+
*/
|
|
257
|
+
contentInsetEndAdjustment?: number;
|
|
229
258
|
/**
|
|
230
259
|
* Number of columns to render items in.
|
|
231
260
|
* @default 1
|
|
232
261
|
*/
|
|
233
262
|
numColumns?: number;
|
|
263
|
+
/**
|
|
264
|
+
* Force RTL mode for this list instance.
|
|
265
|
+
* When undefined, uses React Native's global I18nManager.isRTL.
|
|
266
|
+
* @default undefined
|
|
267
|
+
*/
|
|
268
|
+
rtl?: boolean;
|
|
234
269
|
/**
|
|
235
270
|
* Called when scrolling reaches the end within onEndReachedThreshold.
|
|
236
271
|
*/
|
|
@@ -252,10 +287,23 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
252
287
|
itemKey: string;
|
|
253
288
|
itemData: ItemT;
|
|
254
289
|
}) => void;
|
|
290
|
+
/**
|
|
291
|
+
* Called after the initial render work completes.
|
|
292
|
+
*/
|
|
293
|
+
onLoad?: (info: {
|
|
294
|
+
elapsedTimeInMs: number;
|
|
295
|
+
}) => void;
|
|
296
|
+
/**
|
|
297
|
+
* Called when list layout metrics change.
|
|
298
|
+
*/
|
|
299
|
+
onMetricsChange?: (metrics: LegendListMetrics) => void;
|
|
255
300
|
/**
|
|
256
301
|
* Function to call when the user pulls to refresh.
|
|
257
302
|
*/
|
|
258
303
|
onRefresh?: () => void;
|
|
304
|
+
/**
|
|
305
|
+
* Called when the list scrolls.
|
|
306
|
+
*/
|
|
259
307
|
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
260
308
|
/**
|
|
261
309
|
* Called when scrolling reaches the start within onStartReachedThreshold.
|
|
@@ -279,6 +327,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
279
327
|
* Called when the viewability of items changes.
|
|
280
328
|
*/
|
|
281
329
|
onViewableItemsChanged?: OnViewableItemsChanged<ItemT> | undefined;
|
|
330
|
+
/**
|
|
331
|
+
* Customize layout for multi-column lists, such as allowing items to span multiple columns.
|
|
332
|
+
*/
|
|
333
|
+
overrideItemLayout?: (layout: {
|
|
334
|
+
span?: number;
|
|
335
|
+
}, item: ItemT, index: number, maxColumns: number, extraData?: any) => void;
|
|
282
336
|
/**
|
|
283
337
|
* Offset in pixels for the refresh indicator.
|
|
284
338
|
* @default 0
|
|
@@ -292,7 +346,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
292
346
|
/**
|
|
293
347
|
* Ref to the underlying ScrollView component.
|
|
294
348
|
*/
|
|
295
|
-
refScrollView?: React.Ref<
|
|
349
|
+
refScrollView?: React.Ref<any>;
|
|
296
350
|
/**
|
|
297
351
|
* If true, shows a refresh indicator.
|
|
298
352
|
* @default false
|
|
@@ -303,13 +357,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
303
357
|
* Note: When using `stickyHeaderIndices`, you must provide an Animated ScrollView component.
|
|
304
358
|
* @default (props) => <ScrollView {...props} />
|
|
305
359
|
*/
|
|
306
|
-
renderScrollComponent?: (props:
|
|
360
|
+
renderScrollComponent?: (props: any) => React.ReactElement | null;
|
|
307
361
|
/**
|
|
308
|
-
*
|
|
309
|
-
* @required
|
|
310
|
-
* @default false
|
|
362
|
+
* Array of item indices to use as snap points.
|
|
311
363
|
*/
|
|
312
|
-
|
|
364
|
+
snapToIndices?: number[];
|
|
313
365
|
/**
|
|
314
366
|
* Configuration for determining item viewability.
|
|
315
367
|
*/
|
|
@@ -318,15 +370,6 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
318
370
|
* Pairs of viewability configs and their callbacks for tracking visibility.
|
|
319
371
|
*/
|
|
320
372
|
viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs<ItemT> | undefined;
|
|
321
|
-
/**
|
|
322
|
-
* If true, delays rendering until initial layout is complete.
|
|
323
|
-
* @default false
|
|
324
|
-
*/
|
|
325
|
-
waitForInitialLayout?: boolean;
|
|
326
|
-
onLoad?: (info: {
|
|
327
|
-
elapsedTimeInMs: number;
|
|
328
|
-
}) => void;
|
|
329
|
-
snapToIndices?: number[];
|
|
330
373
|
/**
|
|
331
374
|
* Array of child indices determining which children get docked to the top of the screen when scrolling.
|
|
332
375
|
* For example, passing stickyHeaderIndices={[0]} will cause the first child to be fixed to the top of the scroll view.
|
|
@@ -335,174 +378,77 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
335
378
|
*/
|
|
336
379
|
stickyHeaderIndices?: number[];
|
|
337
380
|
/**
|
|
338
|
-
*
|
|
381
|
+
* Configuration for sticky headers.
|
|
382
|
+
* @default undefined
|
|
339
383
|
*/
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
384
|
+
stickyHeaderConfig?: StickyHeaderConfig;
|
|
385
|
+
/**
|
|
386
|
+
* Web only: when true, listens to window/body scrolling instead of rendering a scrollable list container.
|
|
387
|
+
* @default false
|
|
388
|
+
*/
|
|
389
|
+
useWindowScroll?: boolean;
|
|
390
|
+
}
|
|
391
|
+
type LegendListPropsBase<ItemT, TScrollViewProps = Record<string, any>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollViewProps> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
392
|
+
interface MaintainVisibleContentPositionConfig<ItemT = any> {
|
|
393
|
+
data?: boolean;
|
|
394
|
+
size?: boolean;
|
|
395
|
+
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
396
|
+
}
|
|
397
|
+
interface AnchoredEndSpaceConfig {
|
|
398
|
+
anchorIndex: number;
|
|
399
|
+
anchorOffset?: number;
|
|
400
|
+
anchorMaxSize?: number;
|
|
401
|
+
includeInEndInset?: boolean;
|
|
402
|
+
onSizeChanged?: (size: number) => void;
|
|
403
|
+
}
|
|
404
|
+
interface StickyHeaderConfig {
|
|
405
|
+
/**
|
|
406
|
+
* Specifies how far from the top edge sticky headers should start sticking.
|
|
407
|
+
* Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
|
|
408
|
+
* @default 0
|
|
409
|
+
*/
|
|
410
|
+
offset?: number;
|
|
411
|
+
/**
|
|
412
|
+
* Component to render as a backdrop behind the sticky header.
|
|
413
|
+
* @default undefined
|
|
414
|
+
*/
|
|
415
|
+
backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
416
|
+
}
|
|
417
|
+
interface AlwaysRenderConfig {
|
|
418
|
+
top?: number;
|
|
419
|
+
bottom?: number;
|
|
420
|
+
indices?: number[];
|
|
421
|
+
keys?: string[];
|
|
422
|
+
}
|
|
423
|
+
interface MaintainScrollAtEndOnOptions {
|
|
424
|
+
dataChange?: boolean;
|
|
425
|
+
itemLayout?: boolean;
|
|
426
|
+
layout?: boolean;
|
|
344
427
|
}
|
|
345
|
-
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Reanimated.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
346
428
|
interface MaintainScrollAtEndOptions {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
429
|
+
/**
|
|
430
|
+
* Whether maintainScrollAtEnd should animate when it scrolls to the end.
|
|
431
|
+
*/
|
|
432
|
+
animated?: boolean;
|
|
433
|
+
/**
|
|
434
|
+
* Which events should keep the list pinned to the end.
|
|
435
|
+
* - If omitted, object values default to all triggers.
|
|
436
|
+
* - If provided, only the keys set to `true` are enabled.
|
|
437
|
+
*/
|
|
438
|
+
on?: MaintainScrollAtEndOnOptions;
|
|
350
439
|
}
|
|
351
440
|
interface ColumnWrapperStyle {
|
|
352
441
|
rowGap?: number;
|
|
353
442
|
gap?: number;
|
|
354
443
|
columnGap?: number;
|
|
355
444
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
contentSize?: number;
|
|
360
|
-
dataLength?: number;
|
|
361
|
-
atThreshold: boolean;
|
|
362
|
-
}
|
|
363
|
-
interface ScrollTarget {
|
|
364
|
-
animated?: boolean;
|
|
365
|
-
index?: number;
|
|
366
|
-
isInitialScroll?: boolean;
|
|
367
|
-
itemSize?: number;
|
|
368
|
-
offset: number;
|
|
369
|
-
precomputedWithViewOffset?: boolean;
|
|
370
|
-
viewOffset?: number;
|
|
371
|
-
viewPosition?: number;
|
|
372
|
-
}
|
|
373
|
-
interface InternalState {
|
|
374
|
-
activeStickyIndex: number | undefined;
|
|
375
|
-
adjustingFromInitialMount?: number;
|
|
376
|
-
animFrameCheckFinishedScroll?: any;
|
|
377
|
-
averageSizes: Record<string, {
|
|
378
|
-
num: number;
|
|
379
|
-
avg: number;
|
|
380
|
-
}>;
|
|
381
|
-
columns: Map<string, number>;
|
|
382
|
-
containerItemKeys: Set<string>;
|
|
383
|
-
containerItemTypes: Map<number, string>;
|
|
384
|
-
dataChangeNeedsScrollUpdate: boolean;
|
|
385
|
-
didColumnsChange?: boolean;
|
|
386
|
-
didDataChange?: boolean;
|
|
387
|
-
didFinishInitialScroll?: boolean;
|
|
388
|
-
didContainersLayout?: boolean;
|
|
389
|
-
enableScrollForNextCalculateItemsInView: boolean;
|
|
390
|
-
endBuffered: number;
|
|
391
|
-
endNoBuffer: number;
|
|
392
|
-
endReachedSnapshot: ThresholdSnapshot | undefined;
|
|
393
|
-
firstFullyOnScreenIndex: number;
|
|
394
|
-
hasScrolled?: boolean;
|
|
395
|
-
idCache: string[];
|
|
396
|
-
idsInView: string[];
|
|
397
|
-
ignoreScrollFromMVCP?: {
|
|
398
|
-
lt?: number;
|
|
399
|
-
gt?: number;
|
|
400
|
-
};
|
|
401
|
-
ignoreScrollFromMVCPIgnored?: boolean;
|
|
402
|
-
ignoreScrollFromMVCPTimeout?: any;
|
|
403
|
-
indexByKey: Map<string, number>;
|
|
404
|
-
initialAnchor?: InitialScrollAnchor;
|
|
405
|
-
initialScroll: ScrollIndexWithOffsetAndContentOffset | undefined;
|
|
406
|
-
isAtEnd: boolean;
|
|
407
|
-
isAtStart: boolean;
|
|
408
|
-
isEndReached: boolean | null;
|
|
409
|
-
isFirst?: boolean;
|
|
410
|
-
isStartReached: boolean | null;
|
|
411
|
-
lastBatchingAction: number;
|
|
412
|
-
lastLayout: LayoutRectangle | undefined;
|
|
413
|
-
lastScrollAdjustForHistory?: number;
|
|
414
|
-
loadStartTime: number;
|
|
415
|
-
maintainingScrollAtEnd?: boolean;
|
|
416
|
-
minIndexSizeChanged: number | undefined;
|
|
417
|
-
nativeMarginTop: number;
|
|
418
|
-
needsOtherAxisSize?: boolean;
|
|
419
|
-
otherAxisSize?: number;
|
|
420
|
-
pendingTotalSize?: number;
|
|
421
|
-
positions: Map<string, number>;
|
|
422
|
-
previousData?: readonly unknown[];
|
|
423
|
-
queuedCalculateItemsInView: number | undefined;
|
|
424
|
-
queuedInitialLayout?: boolean | undefined;
|
|
425
|
-
refScroller: React.RefObject<ScrollView>;
|
|
426
|
-
scroll: number;
|
|
427
|
-
scrollAdjustHandler: ScrollAdjustHandler;
|
|
428
|
-
scrollForNextCalculateItemsInView: {
|
|
429
|
-
top: number | null;
|
|
430
|
-
bottom: number | null;
|
|
431
|
-
} | undefined;
|
|
432
|
-
scrollHistory: Array<{
|
|
433
|
-
scroll: number;
|
|
434
|
-
time: number;
|
|
435
|
-
}>;
|
|
436
|
-
scrollingTo?: ScrollTarget | undefined;
|
|
437
|
-
scrollLastCalculate?: number;
|
|
438
|
-
scrollLength: number;
|
|
439
|
-
scrollPending: number;
|
|
440
|
-
scrollPrev: number;
|
|
441
|
-
scrollPrevTime: number;
|
|
442
|
-
scrollProcessingEnabled: boolean;
|
|
443
|
-
scrollTime: number;
|
|
444
|
-
sizes: Map<string, number>;
|
|
445
|
-
sizesKnown: Map<string, number>;
|
|
446
|
-
startBuffered: number;
|
|
447
|
-
startBufferedId?: string;
|
|
448
|
-
startNoBuffer: number;
|
|
449
|
-
startReachedSnapshot: ThresholdSnapshot | undefined;
|
|
450
|
-
stickyContainerPool: Set<number>;
|
|
451
|
-
stickyContainers: Map<number, number>;
|
|
452
|
-
timeouts: Set<number>;
|
|
453
|
-
timeoutSetPaddingTop?: any;
|
|
454
|
-
timeoutSizeMessage: any;
|
|
455
|
-
timeoutCheckFinishedScrollFallback?: any;
|
|
456
|
-
totalSize: number;
|
|
457
|
-
triggerCalculateItemsInView?: (params?: {
|
|
458
|
-
doMVCP?: boolean;
|
|
459
|
-
dataChanged?: boolean;
|
|
460
|
-
forceFullItemPositions?: boolean;
|
|
461
|
-
}) => void;
|
|
462
|
-
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
463
|
-
props: {
|
|
464
|
-
alignItemsAtEnd: boolean;
|
|
465
|
-
animatedProps: StylesAsSharedValue<ScrollViewProps>;
|
|
466
|
-
contentInset: Insets | undefined;
|
|
467
|
-
data: readonly any[];
|
|
468
|
-
dataVersion: Key | undefined;
|
|
469
|
-
estimatedItemSize: number | undefined;
|
|
470
|
-
getEstimatedItemSize: LegendListProps["getEstimatedItemSize"];
|
|
471
|
-
getFixedItemSize: LegendListProps["getFixedItemSize"];
|
|
472
|
-
getItemType: LegendListProps["getItemType"];
|
|
473
|
-
horizontal: boolean;
|
|
474
|
-
initialContainerPoolRatio: number;
|
|
475
|
-
itemsAreEqual: LegendListProps["itemsAreEqual"];
|
|
476
|
-
keyExtractor: LegendListProps["keyExtractor"];
|
|
477
|
-
maintainScrollAtEnd: boolean | MaintainScrollAtEndOptions;
|
|
478
|
-
maintainScrollAtEndThreshold: number | undefined;
|
|
479
|
-
maintainVisibleContentPosition: boolean;
|
|
480
|
-
numColumns: number;
|
|
481
|
-
onEndReached: LegendListProps["onEndReached"];
|
|
482
|
-
onEndReachedThreshold: number | null | undefined;
|
|
483
|
-
onItemSizeChanged: LegendListProps["onItemSizeChanged"];
|
|
484
|
-
onLoad: LegendListProps["onLoad"];
|
|
485
|
-
onScroll: LegendListProps["onScroll"];
|
|
486
|
-
onStartReached: LegendListProps["onStartReached"];
|
|
487
|
-
onStartReachedThreshold: number | null | undefined;
|
|
488
|
-
onStickyHeaderChange: LegendListProps["onStickyHeaderChange"];
|
|
489
|
-
recycleItems: boolean;
|
|
490
|
-
renderItem: LegendListProps["renderItem"];
|
|
491
|
-
scrollBuffer: number;
|
|
492
|
-
snapToIndices: number[] | undefined;
|
|
493
|
-
stickyIndicesArr: number[];
|
|
494
|
-
stickyIndicesSet: Set<number>;
|
|
495
|
-
stylePaddingBottom: number | undefined;
|
|
496
|
-
stylePaddingTop: number | undefined;
|
|
497
|
-
suggestEstimatedItemSize: boolean;
|
|
498
|
-
};
|
|
445
|
+
interface LegendListMetrics {
|
|
446
|
+
headerSize: number;
|
|
447
|
+
footerSize: number;
|
|
499
448
|
}
|
|
500
|
-
interface
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
items: T[];
|
|
504
|
-
start: number;
|
|
505
|
-
startBuffered: number;
|
|
449
|
+
interface LegendListAverageItemSize {
|
|
450
|
+
average: number;
|
|
451
|
+
count: number;
|
|
506
452
|
}
|
|
507
453
|
interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
|
|
508
454
|
data: readonly ItemT[];
|
|
@@ -511,27 +457,34 @@ interface LegendListRenderItemProps<ItemT, TItemType extends string | number | u
|
|
|
511
457
|
item: ItemT;
|
|
512
458
|
type: TItemType;
|
|
513
459
|
}
|
|
514
|
-
type LegendListState = {
|
|
460
|
+
type LegendListState$1 = {
|
|
515
461
|
activeStickyIndex: number;
|
|
516
462
|
contentLength: number;
|
|
517
463
|
data: readonly any[];
|
|
518
|
-
elementAtIndex: (index: number) =>
|
|
464
|
+
elementAtIndex: (index: number) => any;
|
|
519
465
|
end: number;
|
|
520
466
|
endBuffered: number;
|
|
521
467
|
isAtEnd: boolean;
|
|
522
468
|
isAtStart: boolean;
|
|
469
|
+
isNearEnd: boolean;
|
|
470
|
+
isNearStart: boolean;
|
|
471
|
+
isEndReached: boolean;
|
|
472
|
+
isStartReached: boolean;
|
|
473
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
474
|
+
getAverageItemSizes: () => Record<string, LegendListAverageItemSize>;
|
|
523
475
|
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
524
476
|
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
525
477
|
positionAtIndex: (index: number) => number;
|
|
526
|
-
|
|
478
|
+
positionByKey: (key: string) => number | undefined;
|
|
527
479
|
scroll: number;
|
|
528
480
|
scrollLength: number;
|
|
481
|
+
scrollVelocity: number;
|
|
529
482
|
sizeAtIndex: (index: number) => number;
|
|
530
483
|
sizes: Map<string, number>;
|
|
531
484
|
start: number;
|
|
532
485
|
startBuffered: number;
|
|
533
486
|
};
|
|
534
|
-
type LegendListRef = {
|
|
487
|
+
type LegendListRef$1 = {
|
|
535
488
|
/**
|
|
536
489
|
* Displays the scroll indicators momentarily.
|
|
537
490
|
*/
|
|
@@ -539,7 +492,7 @@ type LegendListRef = {
|
|
|
539
492
|
/**
|
|
540
493
|
* Returns the native ScrollView component reference.
|
|
541
494
|
*/
|
|
542
|
-
getNativeScrollRef():
|
|
495
|
+
getNativeScrollRef(): any;
|
|
543
496
|
/**
|
|
544
497
|
* Returns the scroll responder instance for handling scroll events.
|
|
545
498
|
*/
|
|
@@ -547,11 +500,11 @@ type LegendListRef = {
|
|
|
547
500
|
/**
|
|
548
501
|
* Returns the ScrollResponderMixin for advanced scroll handling.
|
|
549
502
|
*/
|
|
550
|
-
getScrollResponder():
|
|
503
|
+
getScrollResponder(): any;
|
|
551
504
|
/**
|
|
552
505
|
* Returns the internal state of the scroll virtualization.
|
|
553
506
|
*/
|
|
554
|
-
getState(): LegendListState;
|
|
507
|
+
getState(): LegendListState$1;
|
|
555
508
|
/**
|
|
556
509
|
* Scrolls a specific index into view.
|
|
557
510
|
* @param params - Parameters for scrolling.
|
|
@@ -561,7 +514,7 @@ type LegendListRef = {
|
|
|
561
514
|
scrollIndexIntoView(params: {
|
|
562
515
|
animated?: boolean | undefined;
|
|
563
516
|
index: number;
|
|
564
|
-
}): void
|
|
517
|
+
}): Promise<void>;
|
|
565
518
|
/**
|
|
566
519
|
* Scrolls a specific index into view.
|
|
567
520
|
* @param params - Parameters for scrolling.
|
|
@@ -571,7 +524,7 @@ type LegendListRef = {
|
|
|
571
524
|
scrollItemIntoView(params: {
|
|
572
525
|
animated?: boolean | undefined;
|
|
573
526
|
item: any;
|
|
574
|
-
}): void
|
|
527
|
+
}): Promise<void>;
|
|
575
528
|
/**
|
|
576
529
|
* Scrolls to the end of the list.
|
|
577
530
|
* @param options - Options for scrolling.
|
|
@@ -581,7 +534,7 @@ type LegendListRef = {
|
|
|
581
534
|
scrollToEnd(options?: {
|
|
582
535
|
animated?: boolean | undefined;
|
|
583
536
|
viewOffset?: number | undefined;
|
|
584
|
-
}): void
|
|
537
|
+
}): Promise<void>;
|
|
585
538
|
/**
|
|
586
539
|
* Scrolls to a specific index in the list.
|
|
587
540
|
* @param params - Parameters for scrolling.
|
|
@@ -595,7 +548,7 @@ type LegendListRef = {
|
|
|
595
548
|
index: number;
|
|
596
549
|
viewOffset?: number | undefined;
|
|
597
550
|
viewPosition?: number | undefined;
|
|
598
|
-
}): void
|
|
551
|
+
}): Promise<void>;
|
|
599
552
|
/**
|
|
600
553
|
* Scrolls to a specific item in the list.
|
|
601
554
|
* @param params - Parameters for scrolling.
|
|
@@ -609,7 +562,7 @@ type LegendListRef = {
|
|
|
609
562
|
item: any;
|
|
610
563
|
viewOffset?: number | undefined;
|
|
611
564
|
viewPosition?: number | undefined;
|
|
612
|
-
}): void
|
|
565
|
+
}): Promise<void>;
|
|
613
566
|
/**
|
|
614
567
|
* Scrolls to a specific offset in pixels.
|
|
615
568
|
* @param params - Parameters for scrolling.
|
|
@@ -619,7 +572,7 @@ type LegendListRef = {
|
|
|
619
572
|
scrollToOffset(params: {
|
|
620
573
|
offset: number;
|
|
621
574
|
animated?: boolean | undefined;
|
|
622
|
-
}): void
|
|
575
|
+
}): Promise<void>;
|
|
623
576
|
/**
|
|
624
577
|
* Sets or adds to the offset of the visible content anchor.
|
|
625
578
|
* @param value - The offset to set or add.
|
|
@@ -631,6 +584,19 @@ type LegendListRef = {
|
|
|
631
584
|
* @param enabled - If true, scroll processing is enabled.
|
|
632
585
|
*/
|
|
633
586
|
setScrollProcessingEnabled(enabled: boolean): void;
|
|
587
|
+
/**
|
|
588
|
+
* Clears internal virtualization caches.
|
|
589
|
+
* @param options - Cache clearing options.
|
|
590
|
+
* @param options.mode - `sizes` clears measurement caches. `full` also clears key/position caches.
|
|
591
|
+
*/
|
|
592
|
+
clearCaches(options?: {
|
|
593
|
+
mode?: "sizes" | "full";
|
|
594
|
+
}): void;
|
|
595
|
+
/**
|
|
596
|
+
* Reports an externally measured content inset. Pass null/undefined to clear.
|
|
597
|
+
* Values are merged on top of props/animated/native insets.
|
|
598
|
+
*/
|
|
599
|
+
reportContentInset(inset?: Partial<Insets> | null): void;
|
|
634
600
|
};
|
|
635
601
|
interface ViewToken<ItemT = any> {
|
|
636
602
|
containerId: number;
|
|
@@ -651,10 +617,15 @@ interface ViewabilityConfigCallbackPair<ItemT = any> {
|
|
|
651
617
|
viewabilityConfig: ViewabilityConfig;
|
|
652
618
|
}
|
|
653
619
|
type ViewabilityConfigCallbackPairs<ItemT> = ViewabilityConfigCallbackPair<ItemT>[];
|
|
654
|
-
|
|
655
|
-
viewableItems: Array<ViewToken<ItemT>>;
|
|
620
|
+
interface OnViewableItemsChangedInfo<ItemT> {
|
|
656
621
|
changed: Array<ViewToken<ItemT>>;
|
|
657
|
-
|
|
622
|
+
end: number;
|
|
623
|
+
endBuffered: number;
|
|
624
|
+
start: number;
|
|
625
|
+
startBuffered: number;
|
|
626
|
+
viewableItems: Array<ViewToken<ItemT>>;
|
|
627
|
+
}
|
|
628
|
+
type OnViewableItemsChanged<ItemT> = ((info: OnViewableItemsChangedInfo<ItemT>) => void) | null;
|
|
658
629
|
interface ViewabilityConfig {
|
|
659
630
|
/**
|
|
660
631
|
* A unique ID to identify this viewability config
|
|
@@ -692,12 +663,6 @@ interface LegendListRecyclingState<T> {
|
|
|
692
663
|
prevIndex: number | undefined;
|
|
693
664
|
prevItem: T | undefined;
|
|
694
665
|
}
|
|
695
|
-
type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode) => (props: P & React.RefAttributes<T>) => React.ReactNode;
|
|
696
|
-
declare const typedForwardRef: TypedForwardRef;
|
|
697
|
-
type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.JSXElementConstructor<T>>, nextProps: Readonly<React.JSXElementConstructor<T>>) => boolean) => T & {
|
|
698
|
-
displayName?: string;
|
|
699
|
-
};
|
|
700
|
-
declare const typedMemo: TypedMemo;
|
|
701
666
|
interface ScrollIndexWithOffset {
|
|
702
667
|
index: number;
|
|
703
668
|
viewOffset?: number;
|
|
@@ -709,16 +674,36 @@ interface ScrollIndexWithOffsetPosition extends ScrollIndexWithOffset {
|
|
|
709
674
|
interface ScrollIndexWithOffsetAndContentOffset extends ScrollIndexWithOffsetPosition {
|
|
710
675
|
contentOffset?: number;
|
|
711
676
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
677
|
+
|
|
678
|
+
type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewProps, TItemType>, "anchoredEndSpace" | "contentInsetEndAdjustment" | "onScroll" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
|
|
679
|
+
onScroll?: (event: NativeSyntheticEvent$1<NativeScrollEvent$1>) => void;
|
|
680
|
+
refScrollView?: React.Ref<ScrollView>;
|
|
681
|
+
renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
|
|
682
|
+
ListHeaderComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
|
|
683
|
+
ListFooterComponentStyle?: StyleProp$1<ViewStyle$1> | undefined;
|
|
684
|
+
};
|
|
685
|
+
type LegendListProps<ItemT = any, TItemType extends string | undefined = string | undefined> = LegendListPropsOverrides<ItemT, TItemType>;
|
|
686
|
+
type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
|
|
687
|
+
getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
|
|
688
|
+
getScrollResponder(): ScrollResponderMixin;
|
|
689
|
+
reportContentInset(inset?: Partial<Insets$1> | null): void;
|
|
721
690
|
};
|
|
722
|
-
type
|
|
691
|
+
type LegendListState = Omit<LegendListState$1, "elementAtIndex"> & {
|
|
692
|
+
elementAtIndex: (index: number) => View | null | undefined;
|
|
693
|
+
};
|
|
694
|
+
type LegendListComponent = <ItemT = any>(props: LegendListProps<ItemT> & React.RefAttributes<LegendListRef>) => React.ReactElement | null;
|
|
695
|
+
|
|
696
|
+
declare function useViewability<ItemT = any>(callback: ViewabilityCallback<ItemT>, configId?: string): void;
|
|
697
|
+
declare function useViewabilityAmount<ItemT = any>(callback: ViewabilityAmountCallback<ItemT>): void;
|
|
698
|
+
declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
|
|
699
|
+
declare function useRecyclingState<ItemT>(valueOrFun: ((info: LegendListRecyclingState<ItemT>) => ItemT) | ItemT): readonly [ItemT, Dispatch<SetStateAction<ItemT>>];
|
|
700
|
+
declare function useIsLastItem(): boolean;
|
|
701
|
+
declare function useListScrollSize(): {
|
|
702
|
+
width: number;
|
|
703
|
+
height: number;
|
|
704
|
+
};
|
|
705
|
+
declare function useSyncLayout(): () => void;
|
|
706
|
+
|
|
707
|
+
declare const LegendList: LegendListComponent;
|
|
723
708
|
|
|
724
|
-
export { type
|
|
709
|
+
export { type AlwaysRenderConfig, type ColumnWrapperStyle, type Insets, type LayoutRectangle, LegendList, type LegendListAverageItemSize, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListState, type MaintainScrollAtEndOnOptions, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type NativeScrollEvent, type NativeSyntheticEvent, type OnViewableItemsChanged, type OnViewableItemsChangedInfo, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type StickyHeaderConfig, type StyleProp, type ViewAmountToken, type ViewStyle, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|