@legendapp/list 3.0.0-beta.17 → 3.0.0-beta.18
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/index.d.mts +756 -9
- package/index.d.ts +756 -9
- package/index.js +28 -13
- package/index.mjs +27 -14
- package/index.native.js +28 -13
- package/index.native.mjs +27 -14
- package/package.json +1 -1
- package/section-list.d.mts +1 -2
- package/section-list.d.ts +1 -2
- package/section-list.js +25 -3895
- package/section-list.mjs +23 -3894
- package/index.native.d.mts +0 -23
- package/index.native.d.ts +0 -23
- package/section-list.native.d.mts +0 -113
- package/section-list.native.d.ts +0 -113
- package/section-list.native.js +0 -3979
- package/section-list.native.mjs +0 -3958
- package/types-Dj2MEm9V.d.mts +0 -752
- package/types-Dj2MEm9V.d.ts +0 -752
package/types-Dj2MEm9V.d.ts
DELETED
|
@@ -1,752 +0,0 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
import { ComponentProps, Key, ReactNode } from 'react';
|
|
3
|
-
import { View, ScrollView, Animated, LayoutRectangle, ScrollViewProps, Insets, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
|
|
4
|
-
import Reanimated from 'react-native-reanimated';
|
|
5
|
-
|
|
6
|
-
type AnimatedValue = number;
|
|
7
|
-
|
|
8
|
-
type ListenerType = "activeStickyIndex" | "alignItemsPaddingTop" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | `containerColumn${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}` | `containerStickyOffset${number}`;
|
|
9
|
-
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
10
|
-
type ListenerTypeValueMap = {
|
|
11
|
-
activeStickyIndex: number;
|
|
12
|
-
alignItemsPaddingTop: number;
|
|
13
|
-
animatedScrollY: any;
|
|
14
|
-
debugComputedScroll: number;
|
|
15
|
-
debugRawScroll: number;
|
|
16
|
-
extraData: any;
|
|
17
|
-
footerSize: number;
|
|
18
|
-
headerSize: number;
|
|
19
|
-
lastItemKeys: string[];
|
|
20
|
-
lastPositionUpdate: number;
|
|
21
|
-
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
22
|
-
numColumns: number;
|
|
23
|
-
numContainers: number;
|
|
24
|
-
numContainersPooled: number;
|
|
25
|
-
otherAxisSize: number;
|
|
26
|
-
readyToRender: boolean;
|
|
27
|
-
scrollAdjust: number;
|
|
28
|
-
scrollAdjustPending: number;
|
|
29
|
-
scrollAdjustUserOffset: number;
|
|
30
|
-
scrollSize: {
|
|
31
|
-
width: number;
|
|
32
|
-
height: number;
|
|
33
|
-
};
|
|
34
|
-
snapToOffsets: number[];
|
|
35
|
-
stylePaddingTop: number;
|
|
36
|
-
totalSize: number;
|
|
37
|
-
} & {
|
|
38
|
-
[K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
|
|
39
|
-
} & {
|
|
40
|
-
[K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
|
|
41
|
-
} & {
|
|
42
|
-
[K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
|
|
43
|
-
} & {
|
|
44
|
-
[K in ListenerType as K extends `containerColumn${number}` ? K : never]: number;
|
|
45
|
-
} & {
|
|
46
|
-
[K in ListenerType as K extends `containerSticky${number}` ? K : never]: boolean;
|
|
47
|
-
} & {
|
|
48
|
-
[K in ListenerType as K extends `containerStickyOffset${number}` ? K : never]: number;
|
|
49
|
-
};
|
|
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
|
-
|
|
72
|
-
declare class ScrollAdjustHandler {
|
|
73
|
-
private appliedAdjust;
|
|
74
|
-
private pendingAdjust;
|
|
75
|
-
private ctx;
|
|
76
|
-
constructor(ctx: StateContext);
|
|
77
|
-
requestAdjust(add: number): void;
|
|
78
|
-
getAdjust(): number;
|
|
79
|
-
commitPendingAdjust(scrollTarget: ScrollTarget): void;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
type BaseSharedValue<T = number> = {
|
|
83
|
-
get: () => T;
|
|
84
|
-
};
|
|
85
|
-
type StylesAsSharedValue<Style> = {
|
|
86
|
-
[key in keyof Style]: Style[key] | BaseSharedValue<Style[key]>;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
|
|
90
|
-
interface DataModeProps<ItemT, TItemType extends string | undefined> {
|
|
91
|
-
/**
|
|
92
|
-
* Array of items to render in the list.
|
|
93
|
-
* @required when using data mode
|
|
94
|
-
*/
|
|
95
|
-
data: ReadonlyArray<ItemT>;
|
|
96
|
-
/**
|
|
97
|
-
* Function or React component to render each item in the list.
|
|
98
|
-
* Can be either:
|
|
99
|
-
* - A function: (props: LegendListRenderItemProps<ItemT>) => ReactNode
|
|
100
|
-
* - A React component: React.ComponentType<LegendListRenderItemProps<ItemT>>
|
|
101
|
-
* @required when using data mode
|
|
102
|
-
*/
|
|
103
|
-
renderItem: ((props: LegendListRenderItemProps<ItemT, TItemType>) => ReactNode) | React.ComponentType<LegendListRenderItemProps<ItemT, TItemType>>;
|
|
104
|
-
children?: never;
|
|
105
|
-
}
|
|
106
|
-
interface ChildrenModeProps {
|
|
107
|
-
/**
|
|
108
|
-
* React children elements to render as list items.
|
|
109
|
-
* Each child will be treated as an individual list item.
|
|
110
|
-
* @required when using children mode
|
|
111
|
-
*/
|
|
112
|
-
children: ReactNode;
|
|
113
|
-
data?: never;
|
|
114
|
-
renderItem?: never;
|
|
115
|
-
}
|
|
116
|
-
interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
117
|
-
/**
|
|
118
|
-
* If true, aligns items at the end of the list.
|
|
119
|
-
* @default false
|
|
120
|
-
*/
|
|
121
|
-
alignItemsAtEnd?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Style applied to each column's wrapper view.
|
|
124
|
-
*/
|
|
125
|
-
columnWrapperStyle?: ColumnWrapperStyle;
|
|
126
|
-
/**
|
|
127
|
-
* Distance in pixels to pre-render items ahead of the visible area.
|
|
128
|
-
* @default 250
|
|
129
|
-
*/
|
|
130
|
-
drawDistance?: number;
|
|
131
|
-
/**
|
|
132
|
-
* Estimated size of each item in pixels, a hint for the first render. After some
|
|
133
|
-
* items are rendered, the average size of rendered items will be used instead.
|
|
134
|
-
* @default undefined
|
|
135
|
-
*/
|
|
136
|
-
estimatedItemSize?: number;
|
|
137
|
-
/**
|
|
138
|
-
* Estimated size of the ScrollView in pixels, a hint for the first render to improve performance
|
|
139
|
-
* @default undefined
|
|
140
|
-
*/
|
|
141
|
-
estimatedListSize?: {
|
|
142
|
-
height: number;
|
|
143
|
-
width: number;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* Extra data to trigger re-rendering when changed.
|
|
147
|
-
*/
|
|
148
|
-
extraData?: any;
|
|
149
|
-
/**
|
|
150
|
-
* Version token that forces the list to treat data as updated even when the array reference is stable.
|
|
151
|
-
* Increment or change this when mutating the data array in place.
|
|
152
|
-
*/
|
|
153
|
-
dataVersion?: Key;
|
|
154
|
-
/**
|
|
155
|
-
* In case you have distinct item sizes, you can provide a function to get the size of an item.
|
|
156
|
-
* Use instead of FlatList's getItemLayout or FlashList overrideItemLayout if you want to have accurate initialScrollOffset, you should provide this function
|
|
157
|
-
*/
|
|
158
|
-
getEstimatedItemSize?: (index: number, item: ItemT, type: TItemType) => number;
|
|
159
|
-
/**
|
|
160
|
-
* Ratio of initial container pool size to data length (e.g., 0.5 for half).
|
|
161
|
-
* @default 2
|
|
162
|
-
*/
|
|
163
|
-
initialContainerPoolRatio?: number | undefined;
|
|
164
|
-
/**
|
|
165
|
-
* Initial scroll position in pixels.
|
|
166
|
-
* @default 0
|
|
167
|
-
*/
|
|
168
|
-
initialScrollOffset?: number;
|
|
169
|
-
/**
|
|
170
|
-
* Index to scroll to initially.
|
|
171
|
-
* @default 0
|
|
172
|
-
*/
|
|
173
|
-
initialScrollIndex?: number | {
|
|
174
|
-
index: number;
|
|
175
|
-
viewOffset?: number | undefined;
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* When true, the list initializes scrolled to the last item.
|
|
179
|
-
* Overrides `initialScrollIndex` and `initialScrollOffset` when data is available.
|
|
180
|
-
* @default false
|
|
181
|
-
*/
|
|
182
|
-
initialScrollAtEnd?: boolean;
|
|
183
|
-
/**
|
|
184
|
-
* Component to render between items, receiving the leading item as prop.
|
|
185
|
-
*/
|
|
186
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
187
|
-
leadingItem: ItemT;
|
|
188
|
-
}>;
|
|
189
|
-
/**
|
|
190
|
-
* Function to extract a unique key for each item.
|
|
191
|
-
*/
|
|
192
|
-
keyExtractor?: (item: ItemT, index: number) => string;
|
|
193
|
-
/**
|
|
194
|
-
* Component or element to render when the list is empty.
|
|
195
|
-
*/
|
|
196
|
-
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
197
|
-
/**
|
|
198
|
-
* Component or element to render below the list.
|
|
199
|
-
*/
|
|
200
|
-
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
201
|
-
/**
|
|
202
|
-
* Style for the footer component.
|
|
203
|
-
*/
|
|
204
|
-
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
205
|
-
/**
|
|
206
|
-
* Component or element to render above the list.
|
|
207
|
-
*/
|
|
208
|
-
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
209
|
-
/**
|
|
210
|
-
* Style for the header component.
|
|
211
|
-
*/
|
|
212
|
-
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
213
|
-
/**
|
|
214
|
-
* If true, auto-scrolls to end when new items are added.
|
|
215
|
-
* @default false
|
|
216
|
-
*/
|
|
217
|
-
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
218
|
-
/**
|
|
219
|
-
* Distance threshold in percentage of screen size to trigger maintainScrollAtEnd.
|
|
220
|
-
* @default 0.1
|
|
221
|
-
*/
|
|
222
|
-
maintainScrollAtEndThreshold?: number;
|
|
223
|
-
/**
|
|
224
|
-
* Maintains visibility of content.
|
|
225
|
-
* - scroll (default: true) stabilizes during size/layout changes while scrolling.
|
|
226
|
-
* - data (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
|
|
227
|
-
* - undefined (default) enables scroll stabilization but skips data-change anchoring.
|
|
228
|
-
* - true enables both behaviors; false disables both.
|
|
229
|
-
*/
|
|
230
|
-
maintainVisibleContentPosition?: boolean | MaintainVisibleContentPositionConfig;
|
|
231
|
-
/**
|
|
232
|
-
* Number of columns to render items in.
|
|
233
|
-
* @default 1
|
|
234
|
-
*/
|
|
235
|
-
numColumns?: number;
|
|
236
|
-
/**
|
|
237
|
-
* Called when scrolling reaches the end within onEndReachedThreshold.
|
|
238
|
-
*/
|
|
239
|
-
onEndReached?: ((info: {
|
|
240
|
-
distanceFromEnd: number;
|
|
241
|
-
}) => void) | null | undefined;
|
|
242
|
-
/**
|
|
243
|
-
* How close to the end (in fractional units of visible length) to trigger onEndReached.
|
|
244
|
-
* @default 0.5
|
|
245
|
-
*/
|
|
246
|
-
onEndReachedThreshold?: number | null | undefined;
|
|
247
|
-
/**
|
|
248
|
-
* Called when an item's size changes.
|
|
249
|
-
*/
|
|
250
|
-
onItemSizeChanged?: (info: {
|
|
251
|
-
size: number;
|
|
252
|
-
previous: number;
|
|
253
|
-
index: number;
|
|
254
|
-
itemKey: string;
|
|
255
|
-
itemData: ItemT;
|
|
256
|
-
}) => void;
|
|
257
|
-
/**
|
|
258
|
-
* Function to call when the user pulls to refresh.
|
|
259
|
-
*/
|
|
260
|
-
onRefresh?: () => void;
|
|
261
|
-
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
262
|
-
/**
|
|
263
|
-
* Called when scrolling reaches the start within onStartReachedThreshold.
|
|
264
|
-
*/
|
|
265
|
-
onStartReached?: ((info: {
|
|
266
|
-
distanceFromStart: number;
|
|
267
|
-
}) => void) | null | undefined;
|
|
268
|
-
/**
|
|
269
|
-
* How close to the start (in fractional units of visible length) to trigger onStartReached.
|
|
270
|
-
* @default 0.5
|
|
271
|
-
*/
|
|
272
|
-
onStartReachedThreshold?: number | null | undefined;
|
|
273
|
-
/**
|
|
274
|
-
* Called when the sticky header changes.
|
|
275
|
-
*/
|
|
276
|
-
onStickyHeaderChange?: (info: {
|
|
277
|
-
index: number;
|
|
278
|
-
item: any;
|
|
279
|
-
}) => void;
|
|
280
|
-
/**
|
|
281
|
-
* Called when the viewability of items changes.
|
|
282
|
-
*/
|
|
283
|
-
onViewableItemsChanged?: OnViewableItemsChanged<ItemT> | undefined;
|
|
284
|
-
/**
|
|
285
|
-
* Offset in pixels for the refresh indicator.
|
|
286
|
-
* @default 0
|
|
287
|
-
*/
|
|
288
|
-
progressViewOffset?: number;
|
|
289
|
-
/**
|
|
290
|
-
* If true, recycles item views for better performance.
|
|
291
|
-
* @default false
|
|
292
|
-
*/
|
|
293
|
-
recycleItems?: boolean;
|
|
294
|
-
/**
|
|
295
|
-
* Ref to the underlying ScrollView component.
|
|
296
|
-
*/
|
|
297
|
-
refScrollView?: React.Ref<ScrollView>;
|
|
298
|
-
/**
|
|
299
|
-
* If true, shows a refresh indicator.
|
|
300
|
-
* @default false
|
|
301
|
-
*/
|
|
302
|
-
refreshing?: boolean;
|
|
303
|
-
/**
|
|
304
|
-
* Render custom ScrollView component.
|
|
305
|
-
* Note: When using `stickyHeaderIndices`, you must provide an Animated ScrollView component.
|
|
306
|
-
* @default (props) => <ScrollView {...props} />
|
|
307
|
-
*/
|
|
308
|
-
renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
|
|
309
|
-
/**
|
|
310
|
-
* This will log a suggested estimatedItemSize.
|
|
311
|
-
* @required
|
|
312
|
-
* @default false
|
|
313
|
-
*/
|
|
314
|
-
suggestEstimatedItemSize?: boolean;
|
|
315
|
-
/**
|
|
316
|
-
* Configuration for determining item viewability.
|
|
317
|
-
*/
|
|
318
|
-
viewabilityConfig?: ViewabilityConfig;
|
|
319
|
-
/**
|
|
320
|
-
* Pairs of viewability configs and their callbacks for tracking visibility.
|
|
321
|
-
*/
|
|
322
|
-
viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs<ItemT> | undefined;
|
|
323
|
-
/**
|
|
324
|
-
* If true, delays rendering until initial layout is complete.
|
|
325
|
-
* @default false
|
|
326
|
-
*/
|
|
327
|
-
waitForInitialLayout?: boolean;
|
|
328
|
-
onLoad?: (info: {
|
|
329
|
-
elapsedTimeInMs: number;
|
|
330
|
-
}) => void;
|
|
331
|
-
snapToIndices?: number[];
|
|
332
|
-
/**
|
|
333
|
-
* Array of child indices determining which children get docked to the top of the screen when scrolling.
|
|
334
|
-
* For example, passing stickyHeaderIndices={[0]} will cause the first child to be fixed to the top of the scroll view.
|
|
335
|
-
* Not supported in conjunction with horizontal={true}.
|
|
336
|
-
* @default undefined
|
|
337
|
-
*/
|
|
338
|
-
stickyHeaderIndices?: number[];
|
|
339
|
-
/**
|
|
340
|
-
* @deprecated Use stickyHeaderIndices instead for parity with React Native.
|
|
341
|
-
*/
|
|
342
|
-
stickyIndices?: number[];
|
|
343
|
-
/**
|
|
344
|
-
* Configuration for sticky headers.
|
|
345
|
-
* @default undefined
|
|
346
|
-
*/
|
|
347
|
-
stickyHeaderConfig?: StickyHeaderConfig;
|
|
348
|
-
getItemType?: (item: ItemT, index: number) => TItemType;
|
|
349
|
-
getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
|
|
350
|
-
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
351
|
-
}
|
|
352
|
-
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);
|
|
353
|
-
interface MaintainVisibleContentPositionConfig {
|
|
354
|
-
data?: boolean;
|
|
355
|
-
size?: boolean;
|
|
356
|
-
}
|
|
357
|
-
interface MaintainVisibleContentPositionNormalized {
|
|
358
|
-
data: boolean;
|
|
359
|
-
size: boolean;
|
|
360
|
-
}
|
|
361
|
-
interface StickyHeaderConfig {
|
|
362
|
-
/**
|
|
363
|
-
* Specifies how far from the top edge sticky headers should start sticking.
|
|
364
|
-
* Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
|
|
365
|
-
* @default 0
|
|
366
|
-
*/
|
|
367
|
-
offset?: number;
|
|
368
|
-
/**
|
|
369
|
-
* Component to render as a backdrop behind the sticky header.
|
|
370
|
-
* @default undefined
|
|
371
|
-
*/
|
|
372
|
-
backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
373
|
-
}
|
|
374
|
-
interface MaintainScrollAtEndOptions {
|
|
375
|
-
onLayout?: boolean;
|
|
376
|
-
onItemLayout?: boolean;
|
|
377
|
-
onDataChange?: boolean;
|
|
378
|
-
}
|
|
379
|
-
interface ColumnWrapperStyle {
|
|
380
|
-
rowGap?: number;
|
|
381
|
-
gap?: number;
|
|
382
|
-
columnGap?: number;
|
|
383
|
-
}
|
|
384
|
-
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
385
|
-
interface ThresholdSnapshot {
|
|
386
|
-
scrollPosition: number;
|
|
387
|
-
contentSize?: number;
|
|
388
|
-
dataLength?: number;
|
|
389
|
-
atThreshold: boolean;
|
|
390
|
-
}
|
|
391
|
-
interface ScrollTarget {
|
|
392
|
-
animated?: boolean;
|
|
393
|
-
index?: number;
|
|
394
|
-
isInitialScroll?: boolean;
|
|
395
|
-
itemSize?: number;
|
|
396
|
-
offset: number;
|
|
397
|
-
precomputedWithViewOffset?: boolean;
|
|
398
|
-
viewOffset?: number;
|
|
399
|
-
viewPosition?: number;
|
|
400
|
-
}
|
|
401
|
-
interface InternalState {
|
|
402
|
-
activeStickyIndex: number | undefined;
|
|
403
|
-
adjustingFromInitialMount?: number;
|
|
404
|
-
animFrameCheckFinishedScroll?: any;
|
|
405
|
-
averageSizes: Record<string, {
|
|
406
|
-
num: number;
|
|
407
|
-
avg: number;
|
|
408
|
-
}>;
|
|
409
|
-
columns: Map<string, number>;
|
|
410
|
-
containerItemKeys: Set<string>;
|
|
411
|
-
containerItemTypes: Map<number, string>;
|
|
412
|
-
dataChangeNeedsScrollUpdate: boolean;
|
|
413
|
-
didColumnsChange?: boolean;
|
|
414
|
-
didDataChange?: boolean;
|
|
415
|
-
didFinishInitialScroll?: boolean;
|
|
416
|
-
didContainersLayout?: boolean;
|
|
417
|
-
enableScrollForNextCalculateItemsInView: boolean;
|
|
418
|
-
endBuffered: number;
|
|
419
|
-
endNoBuffer: number;
|
|
420
|
-
endReachedSnapshot: ThresholdSnapshot | undefined;
|
|
421
|
-
firstFullyOnScreenIndex: number;
|
|
422
|
-
hasScrolled?: boolean;
|
|
423
|
-
idCache: string[];
|
|
424
|
-
idsInView: string[];
|
|
425
|
-
ignoreScrollFromMVCP?: {
|
|
426
|
-
lt?: number;
|
|
427
|
-
gt?: number;
|
|
428
|
-
};
|
|
429
|
-
ignoreScrollFromMVCPIgnored?: boolean;
|
|
430
|
-
ignoreScrollFromMVCPTimeout?: any;
|
|
431
|
-
indexByKey: Map<string, number>;
|
|
432
|
-
initialAnchor?: InitialScrollAnchor;
|
|
433
|
-
initialScroll: ScrollIndexWithOffsetAndContentOffset | undefined;
|
|
434
|
-
isAtEnd: boolean;
|
|
435
|
-
isAtStart: boolean;
|
|
436
|
-
isEndReached: boolean | null;
|
|
437
|
-
isFirst?: boolean;
|
|
438
|
-
isStartReached: boolean | null;
|
|
439
|
-
lastBatchingAction: number;
|
|
440
|
-
lastLayout: LayoutRectangle | undefined;
|
|
441
|
-
lastScrollAdjustForHistory?: number;
|
|
442
|
-
loadStartTime: number;
|
|
443
|
-
maintainingScrollAtEnd?: boolean;
|
|
444
|
-
minIndexSizeChanged: number | undefined;
|
|
445
|
-
nativeMarginTop: number;
|
|
446
|
-
needsOtherAxisSize?: boolean;
|
|
447
|
-
otherAxisSize?: number;
|
|
448
|
-
pendingTotalSize?: number;
|
|
449
|
-
positions: Map<string, number>;
|
|
450
|
-
previousData?: readonly unknown[];
|
|
451
|
-
queuedCalculateItemsInView: number | undefined;
|
|
452
|
-
queuedInitialLayout?: boolean | undefined;
|
|
453
|
-
refScroller: React.RefObject<ScrollView>;
|
|
454
|
-
scroll: number;
|
|
455
|
-
scrollAdjustHandler: ScrollAdjustHandler;
|
|
456
|
-
scrollForNextCalculateItemsInView: {
|
|
457
|
-
top: number | null;
|
|
458
|
-
bottom: number | null;
|
|
459
|
-
} | undefined;
|
|
460
|
-
scrollHistory: Array<{
|
|
461
|
-
scroll: number;
|
|
462
|
-
time: number;
|
|
463
|
-
}>;
|
|
464
|
-
scrollingTo?: ScrollTarget | undefined;
|
|
465
|
-
scrollLastCalculate?: number;
|
|
466
|
-
scrollLength: number;
|
|
467
|
-
scrollPending: number;
|
|
468
|
-
scrollPrev: number;
|
|
469
|
-
scrollPrevTime: number;
|
|
470
|
-
scrollProcessingEnabled: boolean;
|
|
471
|
-
scrollTime: number;
|
|
472
|
-
sizes: Map<string, number>;
|
|
473
|
-
sizesKnown: Map<string, number>;
|
|
474
|
-
startBuffered: number;
|
|
475
|
-
startBufferedId?: string;
|
|
476
|
-
startNoBuffer: number;
|
|
477
|
-
startReachedSnapshot: ThresholdSnapshot | undefined;
|
|
478
|
-
stickyContainerPool: Set<number>;
|
|
479
|
-
stickyContainers: Map<number, number>;
|
|
480
|
-
timeouts: Set<number>;
|
|
481
|
-
timeoutSetPaddingTop?: any;
|
|
482
|
-
timeoutSizeMessage: any;
|
|
483
|
-
timeoutCheckFinishedScrollFallback?: any;
|
|
484
|
-
totalSize: number;
|
|
485
|
-
triggerCalculateItemsInView?: (params?: {
|
|
486
|
-
doMVCP?: boolean;
|
|
487
|
-
dataChanged?: boolean;
|
|
488
|
-
forceFullItemPositions?: boolean;
|
|
489
|
-
}) => void;
|
|
490
|
-
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
491
|
-
props: {
|
|
492
|
-
alignItemsAtEnd: boolean;
|
|
493
|
-
animatedProps: StylesAsSharedValue<ScrollViewProps>;
|
|
494
|
-
contentInset: Insets | undefined;
|
|
495
|
-
data: readonly any[];
|
|
496
|
-
dataVersion: Key | undefined;
|
|
497
|
-
estimatedItemSize: number | undefined;
|
|
498
|
-
getEstimatedItemSize: LegendListProps["getEstimatedItemSize"];
|
|
499
|
-
getFixedItemSize: LegendListProps["getFixedItemSize"];
|
|
500
|
-
getItemType: LegendListProps["getItemType"];
|
|
501
|
-
horizontal: boolean;
|
|
502
|
-
initialContainerPoolRatio: number;
|
|
503
|
-
itemsAreEqual: LegendListProps["itemsAreEqual"];
|
|
504
|
-
keyExtractor: LegendListProps["keyExtractor"];
|
|
505
|
-
maintainScrollAtEnd: boolean | MaintainScrollAtEndOptions;
|
|
506
|
-
maintainScrollAtEndThreshold: number | undefined;
|
|
507
|
-
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
508
|
-
numColumns: number;
|
|
509
|
-
onEndReached: LegendListProps["onEndReached"];
|
|
510
|
-
onEndReachedThreshold: number | null | undefined;
|
|
511
|
-
onItemSizeChanged: LegendListProps["onItemSizeChanged"];
|
|
512
|
-
onLoad: LegendListProps["onLoad"];
|
|
513
|
-
onScroll: LegendListProps["onScroll"];
|
|
514
|
-
onStartReached: LegendListProps["onStartReached"];
|
|
515
|
-
onStartReachedThreshold: number | null | undefined;
|
|
516
|
-
onStickyHeaderChange: LegendListProps["onStickyHeaderChange"];
|
|
517
|
-
recycleItems: boolean;
|
|
518
|
-
renderItem: LegendListProps["renderItem"];
|
|
519
|
-
scrollBuffer: number;
|
|
520
|
-
snapToIndices: number[] | undefined;
|
|
521
|
-
stickyIndicesArr: number[];
|
|
522
|
-
stickyIndicesSet: Set<number>;
|
|
523
|
-
stylePaddingBottom: number | undefined;
|
|
524
|
-
stylePaddingTop: number | undefined;
|
|
525
|
-
suggestEstimatedItemSize: boolean;
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
interface ViewableRange<T> {
|
|
529
|
-
end: number;
|
|
530
|
-
endBuffered: number;
|
|
531
|
-
items: T[];
|
|
532
|
-
start: number;
|
|
533
|
-
startBuffered: number;
|
|
534
|
-
}
|
|
535
|
-
interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
|
|
536
|
-
data: readonly ItemT[];
|
|
537
|
-
extraData: any;
|
|
538
|
-
index: number;
|
|
539
|
-
item: ItemT;
|
|
540
|
-
type: TItemType;
|
|
541
|
-
}
|
|
542
|
-
type LegendListState = {
|
|
543
|
-
activeStickyIndex: number;
|
|
544
|
-
contentLength: number;
|
|
545
|
-
data: readonly any[];
|
|
546
|
-
elementAtIndex: (index: number) => View | null | undefined;
|
|
547
|
-
end: number;
|
|
548
|
-
endBuffered: number;
|
|
549
|
-
isAtEnd: boolean;
|
|
550
|
-
isAtStart: boolean;
|
|
551
|
-
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
552
|
-
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
553
|
-
positionAtIndex: (index: number) => number;
|
|
554
|
-
positions: Map<string, number>;
|
|
555
|
-
scroll: number;
|
|
556
|
-
scrollLength: number;
|
|
557
|
-
sizeAtIndex: (index: number) => number;
|
|
558
|
-
sizes: Map<string, number>;
|
|
559
|
-
start: number;
|
|
560
|
-
startBuffered: number;
|
|
561
|
-
};
|
|
562
|
-
type LegendListRef = {
|
|
563
|
-
/**
|
|
564
|
-
* Displays the scroll indicators momentarily.
|
|
565
|
-
*/
|
|
566
|
-
flashScrollIndicators(): void;
|
|
567
|
-
/**
|
|
568
|
-
* Returns the native ScrollView component reference.
|
|
569
|
-
*/
|
|
570
|
-
getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
|
|
571
|
-
/**
|
|
572
|
-
* Returns the scroll responder instance for handling scroll events.
|
|
573
|
-
*/
|
|
574
|
-
getScrollableNode(): any;
|
|
575
|
-
/**
|
|
576
|
-
* Returns the ScrollResponderMixin for advanced scroll handling.
|
|
577
|
-
*/
|
|
578
|
-
getScrollResponder(): ScrollResponderMixin;
|
|
579
|
-
/**
|
|
580
|
-
* Returns the internal state of the scroll virtualization.
|
|
581
|
-
*/
|
|
582
|
-
getState(): LegendListState;
|
|
583
|
-
/**
|
|
584
|
-
* Scrolls a specific index into view.
|
|
585
|
-
* @param params - Parameters for scrolling.
|
|
586
|
-
* @param params.animated - If true, animates the scroll. Default: true.
|
|
587
|
-
* @param params.index - The index to scroll to.
|
|
588
|
-
*/
|
|
589
|
-
scrollIndexIntoView(params: {
|
|
590
|
-
animated?: boolean | undefined;
|
|
591
|
-
index: number;
|
|
592
|
-
}): void;
|
|
593
|
-
/**
|
|
594
|
-
* Scrolls a specific index into view.
|
|
595
|
-
* @param params - Parameters for scrolling.
|
|
596
|
-
* @param params.animated - If true, animates the scroll. Default: true.
|
|
597
|
-
* @param params.item - The item to scroll to.
|
|
598
|
-
*/
|
|
599
|
-
scrollItemIntoView(params: {
|
|
600
|
-
animated?: boolean | undefined;
|
|
601
|
-
item: any;
|
|
602
|
-
}): void;
|
|
603
|
-
/**
|
|
604
|
-
* Scrolls to the end of the list.
|
|
605
|
-
* @param options - Options for scrolling.
|
|
606
|
-
* @param options.animated - If true, animates the scroll. Default: true.
|
|
607
|
-
* @param options.viewOffset - Offset from the target position.
|
|
608
|
-
*/
|
|
609
|
-
scrollToEnd(options?: {
|
|
610
|
-
animated?: boolean | undefined;
|
|
611
|
-
viewOffset?: number | undefined;
|
|
612
|
-
}): void;
|
|
613
|
-
/**
|
|
614
|
-
* Scrolls to a specific index in the list.
|
|
615
|
-
* @param params - Parameters for scrolling.
|
|
616
|
-
* @param params.animated - If true, animates the scroll. Default: true.
|
|
617
|
-
* @param params.index - The index to scroll to.
|
|
618
|
-
* @param params.viewOffset - Offset from the target position.
|
|
619
|
-
* @param params.viewPosition - Position of the item in the viewport (0 to 1).
|
|
620
|
-
*/
|
|
621
|
-
scrollToIndex(params: {
|
|
622
|
-
animated?: boolean | undefined;
|
|
623
|
-
index: number;
|
|
624
|
-
viewOffset?: number | undefined;
|
|
625
|
-
viewPosition?: number | undefined;
|
|
626
|
-
}): void;
|
|
627
|
-
/**
|
|
628
|
-
* Scrolls to a specific item in the list.
|
|
629
|
-
* @param params - Parameters for scrolling.
|
|
630
|
-
* @param params.animated - If true, animates the scroll. Default: true.
|
|
631
|
-
* @param params.item - The item to scroll to.
|
|
632
|
-
* @param params.viewOffset - Offset from the target position.
|
|
633
|
-
* @param params.viewPosition - Position of the item in the viewport (0 to 1).
|
|
634
|
-
*/
|
|
635
|
-
scrollToItem(params: {
|
|
636
|
-
animated?: boolean | undefined;
|
|
637
|
-
item: any;
|
|
638
|
-
viewOffset?: number | undefined;
|
|
639
|
-
viewPosition?: number | undefined;
|
|
640
|
-
}): void;
|
|
641
|
-
/**
|
|
642
|
-
* Scrolls to a specific offset in pixels.
|
|
643
|
-
* @param params - Parameters for scrolling.
|
|
644
|
-
* @param params.offset - The pixel offset to scroll to.
|
|
645
|
-
* @param params.animated - If true, animates the scroll. Default: true.
|
|
646
|
-
*/
|
|
647
|
-
scrollToOffset(params: {
|
|
648
|
-
offset: number;
|
|
649
|
-
animated?: boolean | undefined;
|
|
650
|
-
}): void;
|
|
651
|
-
/**
|
|
652
|
-
* Sets or adds to the offset of the visible content anchor.
|
|
653
|
-
* @param value - The offset to set or add.
|
|
654
|
-
* @param animated - If true, uses Animated to animate the change.
|
|
655
|
-
*/
|
|
656
|
-
setVisibleContentAnchorOffset(value: number | ((val: number) => number)): void;
|
|
657
|
-
/**
|
|
658
|
-
* Sets whether scroll processing is enabled.
|
|
659
|
-
* @param enabled - If true, scroll processing is enabled.
|
|
660
|
-
*/
|
|
661
|
-
setScrollProcessingEnabled(enabled: boolean): void;
|
|
662
|
-
};
|
|
663
|
-
interface ViewToken<ItemT = any> {
|
|
664
|
-
containerId: number;
|
|
665
|
-
index: number;
|
|
666
|
-
isViewable: boolean;
|
|
667
|
-
item: ItemT;
|
|
668
|
-
key: string;
|
|
669
|
-
}
|
|
670
|
-
interface ViewAmountToken<ItemT = any> extends ViewToken<ItemT> {
|
|
671
|
-
percentOfScroller: number;
|
|
672
|
-
percentVisible: number;
|
|
673
|
-
scrollSize: number;
|
|
674
|
-
size: number;
|
|
675
|
-
sizeVisible: number;
|
|
676
|
-
}
|
|
677
|
-
interface ViewabilityConfigCallbackPair<ItemT = any> {
|
|
678
|
-
onViewableItemsChanged?: OnViewableItemsChanged<ItemT>;
|
|
679
|
-
viewabilityConfig: ViewabilityConfig;
|
|
680
|
-
}
|
|
681
|
-
type ViewabilityConfigCallbackPairs<ItemT> = ViewabilityConfigCallbackPair<ItemT>[];
|
|
682
|
-
type OnViewableItemsChanged<ItemT> = ((info: {
|
|
683
|
-
viewableItems: Array<ViewToken<ItemT>>;
|
|
684
|
-
changed: Array<ViewToken<ItemT>>;
|
|
685
|
-
}) => void) | null;
|
|
686
|
-
interface ViewabilityConfig {
|
|
687
|
-
/**
|
|
688
|
-
* A unique ID to identify this viewability config
|
|
689
|
-
*/
|
|
690
|
-
id?: string;
|
|
691
|
-
/**
|
|
692
|
-
* Minimum amount of time (in milliseconds) that an item must be physically viewable before the
|
|
693
|
-
* viewability callback will be fired. A high number means that scrolling through content without
|
|
694
|
-
* stopping will not mark the content as viewable.
|
|
695
|
-
*/
|
|
696
|
-
minimumViewTime?: number | undefined;
|
|
697
|
-
/**
|
|
698
|
-
* Percent of viewport that must be covered for a partially occluded item to count as
|
|
699
|
-
* "viewable", 0-100. Fully visible items are always considered viewable. A value of 0 means
|
|
700
|
-
* that a single pixel in the viewport makes the item viewable, and a value of 100 means that
|
|
701
|
-
* an item must be either entirely visible or cover the entire viewport to count as viewable.
|
|
702
|
-
*/
|
|
703
|
-
viewAreaCoveragePercentThreshold?: number | undefined;
|
|
704
|
-
/**
|
|
705
|
-
* Similar to `viewAreaCoveragePercentThreshold`, but considers the percent of the item that is visible,
|
|
706
|
-
* rather than the fraction of the viewable area it covers.
|
|
707
|
-
*/
|
|
708
|
-
itemVisiblePercentThreshold?: number | undefined;
|
|
709
|
-
/**
|
|
710
|
-
* Nothing is considered viewable until the user scrolls or `recordInteraction` is called after
|
|
711
|
-
* render.
|
|
712
|
-
*/
|
|
713
|
-
waitForInteraction?: boolean | undefined;
|
|
714
|
-
}
|
|
715
|
-
type ViewabilityCallback<ItemT = any> = (viewToken: ViewToken<ItemT>) => void;
|
|
716
|
-
type ViewabilityAmountCallback<ItemT = any> = (viewToken: ViewAmountToken<ItemT>) => void;
|
|
717
|
-
interface LegendListRecyclingState<T> {
|
|
718
|
-
index: number;
|
|
719
|
-
item: T;
|
|
720
|
-
prevIndex: number | undefined;
|
|
721
|
-
prevItem: T | undefined;
|
|
722
|
-
}
|
|
723
|
-
type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode) => (props: P & React.RefAttributes<T>) => React.ReactNode;
|
|
724
|
-
declare const typedForwardRef: TypedForwardRef;
|
|
725
|
-
type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.JSXElementConstructor<T>>, nextProps: Readonly<React.JSXElementConstructor<T>>) => boolean) => T & {
|
|
726
|
-
displayName?: string;
|
|
727
|
-
};
|
|
728
|
-
declare const typedMemo: TypedMemo;
|
|
729
|
-
interface ScrollIndexWithOffset {
|
|
730
|
-
index: number;
|
|
731
|
-
viewOffset?: number;
|
|
732
|
-
viewPosition?: number;
|
|
733
|
-
}
|
|
734
|
-
interface ScrollIndexWithOffsetPosition extends ScrollIndexWithOffset {
|
|
735
|
-
viewPosition?: number;
|
|
736
|
-
}
|
|
737
|
-
interface ScrollIndexWithOffsetAndContentOffset extends ScrollIndexWithOffsetPosition {
|
|
738
|
-
contentOffset?: number;
|
|
739
|
-
}
|
|
740
|
-
interface InitialScrollAnchor extends ScrollIndexWithOffsetPosition {
|
|
741
|
-
attempts?: number;
|
|
742
|
-
lastDelta?: number;
|
|
743
|
-
settledTicks?: number;
|
|
744
|
-
}
|
|
745
|
-
type GetRenderedItemResult<ItemT> = {
|
|
746
|
-
index: number;
|
|
747
|
-
item: ItemT;
|
|
748
|
-
renderedItem: React.ReactNode;
|
|
749
|
-
};
|
|
750
|
-
type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
|
|
751
|
-
|
|
752
|
-
export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type StickyHeaderConfig as S, type ThresholdSnapshot as T, type ViewabilityCallback as V, type LegendListRef as a, type ViewabilityAmountCallback as b, type LegendListRecyclingState as c, type LegendListPropsBase as d, type MaintainVisibleContentPositionNormalized as e, type MaintainScrollAtEndOptions as f, type ScrollTarget as g, type ViewableRange as h, type LegendListRenderItemProps as i, type LegendListState as j, type ViewToken as k, type ViewAmountToken as l, type ViewabilityConfigCallbackPair as m, type ViewabilityConfigCallbackPairs as n, type ViewabilityConfig as o, type TypedForwardRef as p, type TypedMemo as q, typedMemo as r, type ScrollIndexWithOffset as s, typedForwardRef as t, type ScrollIndexWithOffsetPosition as u, type ScrollIndexWithOffsetAndContentOffset as v, type InitialScrollAnchor as w, type GetRenderedItem as x };
|