@legendapp/list 3.0.0-beta.44 → 3.0.0-beta.46
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/animated.d.ts +84 -42
- package/index.d.ts +381 -316
- package/index.js +1061 -662
- package/index.mjs +1061 -662
- package/index.native.js +1225 -852
- package/index.native.mjs +1226 -853
- package/keyboard-chat.d.ts +228 -0
- package/keyboard-chat.js +97 -0
- package/keyboard-chat.mjs +76 -0
- package/keyboard-test.d.ts +18 -8
- package/keyboard-test.js +8 -3
- package/keyboard-test.mjs +9 -4
- package/keyboard.d.ts +17 -7
- package/keyboard.js +5 -4
- package/keyboard.mjs +5 -4
- package/package.json +7 -1
- package/react-native.d.ts +83 -341
- package/react-native.js +1227 -853
- package/react-native.mjs +1229 -853
- package/react-native.web.d.ts +90 -342
- package/react-native.web.js +1081 -657
- package/react-native.web.mjs +1082 -656
- package/react.d.ts +90 -342
- package/react.js +1081 -657
- package/react.mjs +1082 -656
- package/reanimated.d.ts +96 -44
- package/reanimated.js +97 -22
- package/reanimated.mjs +98 -23
- package/section-list.d.ts +88 -42
- package/section-list.js +16 -4
- package/section-list.mjs +15 -3
package/react-native.d.ts
CHANGED
|
@@ -2,23 +2,28 @@ import * as React from 'react';
|
|
|
2
2
|
import { Key, Dispatch, SetStateAction } from 'react';
|
|
3
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';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
measure?: (callback: LooseMeasureCallback) => void;
|
|
5
|
+
interface MaintainVisibleContentPositionNormalized<ItemT = any> {
|
|
6
|
+
data: boolean;
|
|
7
|
+
size: boolean;
|
|
8
|
+
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
type ListenerType = "activeStickyIndex" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
|
|
13
|
-
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">;
|
|
14
13
|
type ListenerTypeValueMap = {
|
|
15
14
|
activeStickyIndex: number;
|
|
15
|
+
anchoredEndSpaceSize: number;
|
|
16
16
|
animatedScrollY: any;
|
|
17
17
|
debugComputedScroll: number;
|
|
18
18
|
debugRawScroll: number;
|
|
19
19
|
extraData: any;
|
|
20
20
|
footerSize: number;
|
|
21
21
|
headerSize: number;
|
|
22
|
+
isAtEnd: boolean;
|
|
23
|
+
isAtStart: boolean;
|
|
24
|
+
isNearEnd: boolean;
|
|
25
|
+
isNearStart: boolean;
|
|
26
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
22
27
|
lastItemKeys: string[];
|
|
23
28
|
lastPositionUpdate: number;
|
|
24
29
|
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
@@ -50,44 +55,6 @@ type ListenerTypeValueMap = {
|
|
|
50
55
|
} & {
|
|
51
56
|
[K in ListenerType as K extends `containerSticky${number}` ? K : never]: boolean;
|
|
52
57
|
};
|
|
53
|
-
interface StateContext {
|
|
54
|
-
animatedScrollY: AnimatedValue;
|
|
55
|
-
columnWrapperStyle: ColumnWrapperStyle | undefined;
|
|
56
|
-
contextNum: number;
|
|
57
|
-
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
58
|
-
mapViewabilityCallbacks: Map<string, ViewabilityCallback>;
|
|
59
|
-
mapViewabilityValues: Map<string, ViewToken>;
|
|
60
|
-
mapViewabilityAmountCallbacks: Map<number, ViewabilityAmountCallback>;
|
|
61
|
-
mapViewabilityAmountValues: Map<number, ViewAmountToken>;
|
|
62
|
-
mapViewabilityConfigStates: Map<string, {
|
|
63
|
-
viewableItems: ViewToken[];
|
|
64
|
-
start: number;
|
|
65
|
-
end: number;
|
|
66
|
-
previousStart: number;
|
|
67
|
-
previousEnd: number;
|
|
68
|
-
}>;
|
|
69
|
-
positionListeners: Map<string, Set<(value: any) => void>>;
|
|
70
|
-
state: InternalState;
|
|
71
|
-
values: Map<ListenerType, any>;
|
|
72
|
-
viewRefs: Map<number, React.RefObject<LooseView | null>>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
declare class ScrollAdjustHandler {
|
|
76
|
-
private appliedAdjust;
|
|
77
|
-
private pendingAdjust;
|
|
78
|
-
private ctx;
|
|
79
|
-
constructor(ctx: StateContext);
|
|
80
|
-
requestAdjust(add: number): void;
|
|
81
|
-
getAdjust(): number;
|
|
82
|
-
commitPendingAdjust(scrollTarget: ScrollTarget): void;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
type BaseSharedValue<T = number> = {
|
|
86
|
-
get: () => T;
|
|
87
|
-
};
|
|
88
|
-
type StylesAsSharedValue<Style> = {
|
|
89
|
-
[key in keyof Style]: Style[key] | BaseSharedValue<Style[key]>;
|
|
90
|
-
};
|
|
91
58
|
|
|
92
59
|
interface Insets {
|
|
93
60
|
top: number;
|
|
@@ -122,29 +89,6 @@ interface NativeSyntheticEvent<T> {
|
|
|
122
89
|
}
|
|
123
90
|
type ViewStyle = Record<string, unknown>;
|
|
124
91
|
type StyleProp<T> = T | T[] | null | undefined | false;
|
|
125
|
-
interface ScrollEventTargetLike {
|
|
126
|
-
addEventListener(type: string, listener: (...args: any[]) => void): void;
|
|
127
|
-
removeEventListener(type: string, listener: (...args: any[]) => void): void;
|
|
128
|
-
}
|
|
129
|
-
interface ScrollableNodeLike {
|
|
130
|
-
scrollLeft?: number;
|
|
131
|
-
scrollTop?: number;
|
|
132
|
-
}
|
|
133
|
-
interface LegendListScrollerRef {
|
|
134
|
-
flashScrollIndicators(): void;
|
|
135
|
-
getCurrentScrollOffset?(): number;
|
|
136
|
-
getScrollEventTarget(): ScrollEventTargetLike | null;
|
|
137
|
-
getScrollableNode(): ScrollableNodeLike | null;
|
|
138
|
-
getScrollResponder(): unknown;
|
|
139
|
-
scrollTo(options: {
|
|
140
|
-
animated?: boolean;
|
|
141
|
-
x?: number;
|
|
142
|
-
y?: number;
|
|
143
|
-
}): void;
|
|
144
|
-
scrollToEnd(options?: {
|
|
145
|
-
animated?: boolean;
|
|
146
|
-
}): void;
|
|
147
|
-
}
|
|
148
92
|
type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
|
|
149
93
|
interface DataModeProps<ItemT, TItemType extends string | undefined> {
|
|
150
94
|
/**
|
|
@@ -187,6 +131,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
187
131
|
* Style applied to each column's wrapper view.
|
|
188
132
|
*/
|
|
189
133
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
134
|
+
/**
|
|
135
|
+
* Version token that forces the list to treat data as updated even when the array reference is stable.
|
|
136
|
+
* Increment or change this when mutating the data array in place.
|
|
137
|
+
*/
|
|
138
|
+
dataVersion?: Key;
|
|
190
139
|
/**
|
|
191
140
|
* Distance in pixels to pre-render items ahead of the visible area.
|
|
192
141
|
* @default 250
|
|
@@ -210,33 +159,35 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
210
159
|
* Extra data to trigger re-rendering when changed.
|
|
211
160
|
*/
|
|
212
161
|
extraData?: any;
|
|
213
|
-
/**
|
|
214
|
-
* Version token that forces the list to treat data as updated even when the array reference is stable.
|
|
215
|
-
* Increment or change this when mutating the data array in place.
|
|
216
|
-
*/
|
|
217
|
-
dataVersion?: Key;
|
|
218
162
|
/**
|
|
219
163
|
* In case you have distinct item sizes, you can provide a function to get the size of an item.
|
|
220
|
-
* Use instead of FlatList's getItemLayout or FlashList overrideItemLayout if you want to have accurate initialScrollOffset, you should provide this function
|
|
221
164
|
*/
|
|
222
165
|
getEstimatedItemSize?: (item: ItemT, index: number, type: TItemType) => number;
|
|
223
166
|
/**
|
|
224
|
-
*
|
|
225
|
-
* Similar to FlashList's overrideItemLayout.
|
|
167
|
+
* In case items always have a fixed size, you can provide a function to return it.
|
|
226
168
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
169
|
+
getFixedItemSize?: (item: ItemT, index: number, type: TItemType) => number | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Returns a stable item type used for pooling and size estimation.
|
|
172
|
+
*/
|
|
173
|
+
getItemType?: (item: ItemT, index: number) => TItemType;
|
|
174
|
+
/**
|
|
175
|
+
* Component to render between items, receiving the leading item as prop.
|
|
176
|
+
*/
|
|
177
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
178
|
+
leadingItem: ItemT;
|
|
179
|
+
}>;
|
|
230
180
|
/**
|
|
231
181
|
* Ratio of initial container pool size to data length (e.g., 0.5 for half).
|
|
232
182
|
* @default 2
|
|
233
183
|
*/
|
|
234
184
|
initialContainerPoolRatio?: number | undefined;
|
|
235
185
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
186
|
+
* When true, the list initializes scrolled to the last item.
|
|
187
|
+
* Overrides `initialScrollIndex` and `initialScrollOffset` when data is available.
|
|
188
|
+
* @default false
|
|
238
189
|
*/
|
|
239
|
-
|
|
190
|
+
initialScrollAtEnd?: boolean;
|
|
240
191
|
/**
|
|
241
192
|
* Index to scroll to initially.
|
|
242
193
|
* @default 0
|
|
@@ -247,17 +198,14 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
247
198
|
viewPosition?: number | undefined;
|
|
248
199
|
};
|
|
249
200
|
/**
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* @default false
|
|
201
|
+
* Initial scroll position in pixels.
|
|
202
|
+
* @default 0
|
|
253
203
|
*/
|
|
254
|
-
|
|
204
|
+
initialScrollOffset?: number;
|
|
255
205
|
/**
|
|
256
|
-
*
|
|
206
|
+
* Custom equality function to detect semantically unchanged items.
|
|
257
207
|
*/
|
|
258
|
-
|
|
259
|
-
leadingItem: ItemT;
|
|
260
|
-
}>;
|
|
208
|
+
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
261
209
|
/**
|
|
262
210
|
* Function to extract a unique key for each item.
|
|
263
211
|
*/
|
|
@@ -303,10 +251,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
303
251
|
*/
|
|
304
252
|
maintainVisibleContentPosition?: boolean | MaintainVisibleContentPositionConfig<ItemT>;
|
|
305
253
|
/**
|
|
306
|
-
*
|
|
307
|
-
* @default false
|
|
254
|
+
* Keeps an item visually anchored to the start by adding trailing space when the content below it underflows.
|
|
308
255
|
*/
|
|
309
|
-
|
|
256
|
+
anchoredEndSpace?: AnchoredEndSpaceConfig;
|
|
310
257
|
/**
|
|
311
258
|
* Number of columns to render items in.
|
|
312
259
|
* @default 1
|
|
@@ -333,6 +280,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
333
280
|
itemKey: string;
|
|
334
281
|
itemData: ItemT;
|
|
335
282
|
}) => void;
|
|
283
|
+
/**
|
|
284
|
+
* Called after the initial render work completes.
|
|
285
|
+
*/
|
|
286
|
+
onLoad?: (info: {
|
|
287
|
+
elapsedTimeInMs: number;
|
|
288
|
+
}) => void;
|
|
336
289
|
/**
|
|
337
290
|
* Called when list layout metrics change.
|
|
338
291
|
*/
|
|
@@ -341,6 +294,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
341
294
|
* Function to call when the user pulls to refresh.
|
|
342
295
|
*/
|
|
343
296
|
onRefresh?: () => void;
|
|
297
|
+
/**
|
|
298
|
+
* Called when the list scrolls.
|
|
299
|
+
*/
|
|
344
300
|
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
345
301
|
/**
|
|
346
302
|
* Called when scrolling reaches the start within onStartReachedThreshold.
|
|
@@ -364,6 +320,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
364
320
|
* Called when the viewability of items changes.
|
|
365
321
|
*/
|
|
366
322
|
onViewableItemsChanged?: OnViewableItemsChanged<ItemT> | undefined;
|
|
323
|
+
/**
|
|
324
|
+
* Customize layout for multi-column lists, such as allowing items to span multiple columns.
|
|
325
|
+
*/
|
|
326
|
+
overrideItemLayout?: (layout: {
|
|
327
|
+
span?: number;
|
|
328
|
+
}, item: ItemT, index: number, maxColumns: number, extraData?: any) => void;
|
|
367
329
|
/**
|
|
368
330
|
* Offset in pixels for the refresh indicator.
|
|
369
331
|
* @default 0
|
|
@@ -389,6 +351,10 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
389
351
|
* @default (props) => <ScrollView {...props} />
|
|
390
352
|
*/
|
|
391
353
|
renderScrollComponent?: (props: any) => React.ReactElement | null;
|
|
354
|
+
/**
|
|
355
|
+
* Array of item indices to use as snap points.
|
|
356
|
+
*/
|
|
357
|
+
snapToIndices?: number[];
|
|
392
358
|
/**
|
|
393
359
|
* This will log a suggested estimatedItemSize.
|
|
394
360
|
* @required
|
|
@@ -403,10 +369,6 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
403
369
|
* Pairs of viewability configs and their callbacks for tracking visibility.
|
|
404
370
|
*/
|
|
405
371
|
viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs<ItemT> | undefined;
|
|
406
|
-
onLoad?: (info: {
|
|
407
|
-
elapsedTimeInMs: number;
|
|
408
|
-
}) => void;
|
|
409
|
-
snapToIndices?: number[];
|
|
410
372
|
/**
|
|
411
373
|
* Array of child indices determining which children get docked to the top of the screen when scrolling.
|
|
412
374
|
* For example, passing stickyHeaderIndices={[0]} will cause the first child to be fixed to the top of the scroll view.
|
|
@@ -423,21 +385,24 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
423
385
|
* @default undefined
|
|
424
386
|
*/
|
|
425
387
|
stickyHeaderConfig?: StickyHeaderConfig;
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
388
|
+
/**
|
|
389
|
+
* Web only: when true, listens to window/body scrolling instead of rendering a scrollable list container.
|
|
390
|
+
* @default false
|
|
391
|
+
*/
|
|
392
|
+
useWindowScroll?: boolean;
|
|
429
393
|
}
|
|
430
394
|
type LegendListPropsBase<ItemT, TScrollViewProps = Record<string, any>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollViewProps> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
431
|
-
type LegendListPropsInternal = LegendListSpecificProps<any, string | undefined> & DataModeProps<any, string | undefined>;
|
|
432
395
|
interface MaintainVisibleContentPositionConfig<ItemT = any> {
|
|
433
396
|
data?: boolean;
|
|
434
397
|
size?: boolean;
|
|
435
398
|
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
436
399
|
}
|
|
437
|
-
interface
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
400
|
+
interface AnchoredEndSpaceConfig {
|
|
401
|
+
anchorIndex: number;
|
|
402
|
+
anchorOffset?: number;
|
|
403
|
+
anchorMaxSize?: number;
|
|
404
|
+
includeInEndInset?: boolean;
|
|
405
|
+
onSizeChanged?: (size: number) => void;
|
|
441
406
|
}
|
|
442
407
|
interface StickyHeaderConfig {
|
|
443
408
|
/**
|
|
@@ -484,225 +449,6 @@ interface LegendListMetrics {
|
|
|
484
449
|
headerSize: number;
|
|
485
450
|
footerSize: number;
|
|
486
451
|
}
|
|
487
|
-
interface ThresholdSnapshot {
|
|
488
|
-
scrollPosition: number;
|
|
489
|
-
contentSize?: number;
|
|
490
|
-
dataLength?: number;
|
|
491
|
-
atThreshold: boolean;
|
|
492
|
-
}
|
|
493
|
-
interface ScrollTarget {
|
|
494
|
-
animated?: boolean;
|
|
495
|
-
index?: number;
|
|
496
|
-
isInitialScroll?: boolean;
|
|
497
|
-
itemSize?: number;
|
|
498
|
-
offset: number;
|
|
499
|
-
precomputedWithViewOffset?: boolean;
|
|
500
|
-
targetOffset?: number;
|
|
501
|
-
viewOffset?: number;
|
|
502
|
-
viewPosition?: number;
|
|
503
|
-
}
|
|
504
|
-
type BootstrapInitialScrollSession = {
|
|
505
|
-
frameHandle?: number;
|
|
506
|
-
mountFrameCount: number;
|
|
507
|
-
passCount: number;
|
|
508
|
-
previousResolvedOffset?: number;
|
|
509
|
-
scroll: number;
|
|
510
|
-
seedContentOffset: number;
|
|
511
|
-
targetIndexSeed?: number;
|
|
512
|
-
visibleIndices?: readonly number[];
|
|
513
|
-
};
|
|
514
|
-
type InternalScrollTarget = ScrollTarget & {
|
|
515
|
-
waitForInitialScrollCompletionFrame?: boolean;
|
|
516
|
-
};
|
|
517
|
-
type InitialScrollSessionCompletion = {
|
|
518
|
-
didDispatchNativeScroll?: boolean;
|
|
519
|
-
didRetrySilentInitialScroll?: boolean;
|
|
520
|
-
watchdog?: {
|
|
521
|
-
startScroll: number;
|
|
522
|
-
targetOffset: number;
|
|
523
|
-
};
|
|
524
|
-
};
|
|
525
|
-
interface InternalInitialScrollTarget extends ScrollIndexWithOffsetAndContentOffset {
|
|
526
|
-
preserveForBottomPadding?: boolean;
|
|
527
|
-
preserveForFooterLayout?: boolean;
|
|
528
|
-
}
|
|
529
|
-
type InternalInitialScrollSessionBase = {
|
|
530
|
-
completion?: InitialScrollSessionCompletion;
|
|
531
|
-
previousDataLength: number;
|
|
532
|
-
};
|
|
533
|
-
type OffsetInitialScrollSession = InternalInitialScrollSessionBase & {
|
|
534
|
-
kind: "offset";
|
|
535
|
-
};
|
|
536
|
-
type BootstrapOwnedInitialScrollSession = InternalInitialScrollSessionBase & {
|
|
537
|
-
bootstrap?: BootstrapInitialScrollSession;
|
|
538
|
-
kind: "bootstrap";
|
|
539
|
-
};
|
|
540
|
-
type InternalInitialScrollSession = OffsetInitialScrollSession | BootstrapOwnedInitialScrollSession;
|
|
541
|
-
interface InternalState {
|
|
542
|
-
activeStickyIndex: number | undefined;
|
|
543
|
-
adjustingFromInitialMount?: number;
|
|
544
|
-
animFrameCheckFinishedScroll?: any;
|
|
545
|
-
averageSizes: Record<string, {
|
|
546
|
-
num: number;
|
|
547
|
-
avg: number;
|
|
548
|
-
}>;
|
|
549
|
-
columns: Array<number | undefined>;
|
|
550
|
-
columnSpans: Array<number | undefined>;
|
|
551
|
-
containerItemKeys: Map<string, number>;
|
|
552
|
-
containerItemTypes: Map<number, string>;
|
|
553
|
-
dataChangeEpoch: number;
|
|
554
|
-
dataChangeNeedsScrollUpdate: boolean;
|
|
555
|
-
deferredPublicOnScrollEvent?: NativeSyntheticEvent<NativeScrollEvent>;
|
|
556
|
-
didColumnsChange?: boolean;
|
|
557
|
-
didDataChange?: boolean;
|
|
558
|
-
didFinishInitialScroll?: boolean;
|
|
559
|
-
didContainersLayout?: boolean;
|
|
560
|
-
enableScrollForNextCalculateItemsInView: boolean;
|
|
561
|
-
endBuffered: number;
|
|
562
|
-
endNoBuffer: number;
|
|
563
|
-
endReachedSnapshot: ThresholdSnapshot | undefined;
|
|
564
|
-
firstFullyOnScreenIndex: number;
|
|
565
|
-
hasScrolled?: boolean;
|
|
566
|
-
idCache: string[];
|
|
567
|
-
idsInView: string[];
|
|
568
|
-
ignoreScrollFromMVCP?: {
|
|
569
|
-
lt?: number;
|
|
570
|
-
gt?: number;
|
|
571
|
-
};
|
|
572
|
-
ignoreScrollFromMVCPIgnored?: boolean;
|
|
573
|
-
ignoreScrollFromMVCPTimeout?: any;
|
|
574
|
-
indexByKey: Map<string, number>;
|
|
575
|
-
initialScrollSession?: InternalInitialScrollSession;
|
|
576
|
-
initialScroll: InternalInitialScrollTarget | undefined;
|
|
577
|
-
isAtEnd: boolean;
|
|
578
|
-
isAtStart: boolean;
|
|
579
|
-
isEndReached: boolean | null;
|
|
580
|
-
isFirst?: boolean;
|
|
581
|
-
isStartReached: boolean | null;
|
|
582
|
-
lastBatchingAction: number;
|
|
583
|
-
lastLayout: LayoutRectangle | undefined;
|
|
584
|
-
lastScrollAdjustForHistory?: number;
|
|
585
|
-
lastScrollDelta: number;
|
|
586
|
-
loadStartTime: number;
|
|
587
|
-
maintainingScrollAtEnd?: boolean;
|
|
588
|
-
minIndexSizeChanged: number | undefined;
|
|
589
|
-
mvcpAnchorLock?: {
|
|
590
|
-
id: string;
|
|
591
|
-
position: number;
|
|
592
|
-
quietPasses: number;
|
|
593
|
-
expiresAt: number;
|
|
594
|
-
};
|
|
595
|
-
contentInsetOverride?: Partial<Insets> | null;
|
|
596
|
-
nativeContentInset?: Insets;
|
|
597
|
-
nativeMarginTop: number;
|
|
598
|
-
needsOtherAxisSize?: boolean;
|
|
599
|
-
otherAxisSize?: number;
|
|
600
|
-
pendingNativeMVCPAdjust?: {
|
|
601
|
-
amount: number;
|
|
602
|
-
furthestProgressTowardAmount: number;
|
|
603
|
-
manualApplied: number;
|
|
604
|
-
startScroll: number;
|
|
605
|
-
};
|
|
606
|
-
pendingMaintainScrollAtEnd?: boolean;
|
|
607
|
-
pendingTotalSize?: number;
|
|
608
|
-
pendingScrollResolve?: (() => void) | undefined;
|
|
609
|
-
positions: Array<number | undefined>;
|
|
610
|
-
previousData?: readonly unknown[];
|
|
611
|
-
queuedCalculateItemsInView: number | undefined;
|
|
612
|
-
queuedMVCPRecalculate?: number;
|
|
613
|
-
queuedInitialLayout?: boolean | undefined;
|
|
614
|
-
reprocessCurrentScroll?: () => void;
|
|
615
|
-
refScroller: React.RefObject<LegendListScrollerRef | null>;
|
|
616
|
-
scroll: number;
|
|
617
|
-
scrollAdjustHandler: ScrollAdjustHandler;
|
|
618
|
-
scrollForNextCalculateItemsInView: {
|
|
619
|
-
top: number | null;
|
|
620
|
-
bottom: number | null;
|
|
621
|
-
} | undefined;
|
|
622
|
-
scrollHistory: Array<{
|
|
623
|
-
scroll: number;
|
|
624
|
-
time: number;
|
|
625
|
-
}>;
|
|
626
|
-
scrollingTo?: InternalScrollTarget | undefined;
|
|
627
|
-
scrollLastCalculate?: number;
|
|
628
|
-
scrollLength: number;
|
|
629
|
-
scrollPending: number;
|
|
630
|
-
scrollPrev: number;
|
|
631
|
-
scrollPrevTime: number;
|
|
632
|
-
scrollProcessingEnabled: boolean;
|
|
633
|
-
scrollTime: number;
|
|
634
|
-
sizes: Map<string, number>;
|
|
635
|
-
sizesKnown: Map<string, number>;
|
|
636
|
-
startBuffered: number;
|
|
637
|
-
startBufferedId?: string;
|
|
638
|
-
startNoBuffer: number;
|
|
639
|
-
startReachedSnapshotDataChangeEpoch: number | undefined;
|
|
640
|
-
startReachedSnapshot: ThresholdSnapshot | undefined;
|
|
641
|
-
stickyContainerPool: Set<number>;
|
|
642
|
-
stickyContainers: Map<number, number>;
|
|
643
|
-
timeouts: Set<number>;
|
|
644
|
-
timeoutSetPaddingTop?: any;
|
|
645
|
-
timeoutSizeMessage: any;
|
|
646
|
-
timeoutCheckFinishedScrollFallback?: any;
|
|
647
|
-
totalSize: number;
|
|
648
|
-
triggerCalculateItemsInView?: (params?: {
|
|
649
|
-
doMVCP?: boolean;
|
|
650
|
-
dataChanged?: boolean;
|
|
651
|
-
forceFullItemPositions?: boolean;
|
|
652
|
-
}) => void;
|
|
653
|
-
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
654
|
-
props: {
|
|
655
|
-
alignItemsAtEnd: boolean;
|
|
656
|
-
animatedProps: StylesAsSharedValue<Record<string, any>>;
|
|
657
|
-
alwaysRender: AlwaysRenderConfig | undefined;
|
|
658
|
-
alwaysRenderIndicesArr: number[];
|
|
659
|
-
alwaysRenderIndicesSet: Set<number>;
|
|
660
|
-
contentInset: Insets | undefined;
|
|
661
|
-
data: readonly any[];
|
|
662
|
-
dataVersion: Key | undefined;
|
|
663
|
-
drawDistance: number;
|
|
664
|
-
estimatedItemSize: number | undefined;
|
|
665
|
-
getEstimatedItemSize: LegendListPropsInternal["getEstimatedItemSize"];
|
|
666
|
-
getFixedItemSize: LegendListPropsInternal["getFixedItemSize"];
|
|
667
|
-
getItemType: LegendListPropsInternal["getItemType"];
|
|
668
|
-
horizontal: boolean;
|
|
669
|
-
initialContainerPoolRatio: number;
|
|
670
|
-
itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
|
|
671
|
-
keyExtractor: LegendListPropsInternal["keyExtractor"];
|
|
672
|
-
maintainScrollAtEnd: MaintainScrollAtEndNormalized | undefined;
|
|
673
|
-
maintainScrollAtEndThreshold: number | undefined;
|
|
674
|
-
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
675
|
-
numColumns: number;
|
|
676
|
-
onEndReached: LegendListPropsInternal["onEndReached"];
|
|
677
|
-
onEndReachedThreshold: number | null | undefined;
|
|
678
|
-
onItemSizeChanged: LegendListPropsInternal["onItemSizeChanged"];
|
|
679
|
-
onLoad: LegendListPropsInternal["onLoad"];
|
|
680
|
-
onScroll: LegendListPropsInternal["onScroll"];
|
|
681
|
-
onStartReached: LegendListPropsInternal["onStartReached"];
|
|
682
|
-
onStartReachedThreshold: number | null | undefined;
|
|
683
|
-
onStickyHeaderChange: LegendListPropsInternal["onStickyHeaderChange"];
|
|
684
|
-
overrideItemLayout: LegendListPropsInternal["overrideItemLayout"];
|
|
685
|
-
recycleItems: boolean;
|
|
686
|
-
renderItem: LegendListPropsInternal["renderItem"];
|
|
687
|
-
scrollBuffer?: number;
|
|
688
|
-
snapToIndices: number[] | undefined;
|
|
689
|
-
positionComponentInternal: React.ComponentType<any> | undefined;
|
|
690
|
-
stickyPositionComponentInternal: React.ComponentType<any> | undefined;
|
|
691
|
-
stickyIndicesArr: number[];
|
|
692
|
-
stickyIndicesSet: Set<number>;
|
|
693
|
-
stylePaddingBottom: number | undefined;
|
|
694
|
-
stylePaddingTop: number | undefined;
|
|
695
|
-
suggestEstimatedItemSize: boolean;
|
|
696
|
-
useWindowScroll: boolean;
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
interface ViewableRange<T> {
|
|
700
|
-
end: number;
|
|
701
|
-
endBuffered: number;
|
|
702
|
-
items: T[];
|
|
703
|
-
start: number;
|
|
704
|
-
startBuffered: number;
|
|
705
|
-
}
|
|
706
452
|
interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
|
|
707
453
|
data: readonly ItemT[];
|
|
708
454
|
extraData: any;
|
|
@@ -719,8 +465,11 @@ type LegendListState$1 = {
|
|
|
719
465
|
endBuffered: number;
|
|
720
466
|
isAtEnd: boolean;
|
|
721
467
|
isAtStart: boolean;
|
|
468
|
+
isNearEnd: boolean;
|
|
469
|
+
isNearStart: boolean;
|
|
722
470
|
isEndReached: boolean;
|
|
723
471
|
isStartReached: boolean;
|
|
472
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
724
473
|
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
725
474
|
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
726
475
|
positionAtIndex: (index: number) => number;
|
|
@@ -866,10 +615,15 @@ interface ViewabilityConfigCallbackPair<ItemT = any> {
|
|
|
866
615
|
viewabilityConfig: ViewabilityConfig;
|
|
867
616
|
}
|
|
868
617
|
type ViewabilityConfigCallbackPairs<ItemT> = ViewabilityConfigCallbackPair<ItemT>[];
|
|
869
|
-
|
|
870
|
-
viewableItems: Array<ViewToken<ItemT>>;
|
|
618
|
+
interface OnViewableItemsChangedInfo<ItemT> {
|
|
871
619
|
changed: Array<ViewToken<ItemT>>;
|
|
872
|
-
|
|
620
|
+
end: number;
|
|
621
|
+
endBuffered: number;
|
|
622
|
+
start: number;
|
|
623
|
+
startBuffered: number;
|
|
624
|
+
viewableItems: Array<ViewToken<ItemT>>;
|
|
625
|
+
}
|
|
626
|
+
type OnViewableItemsChanged<ItemT> = ((info: OnViewableItemsChangedInfo<ItemT>) => void) | null;
|
|
873
627
|
interface ViewabilityConfig {
|
|
874
628
|
/**
|
|
875
629
|
* A unique ID to identify this viewability config
|
|
@@ -907,12 +661,6 @@ interface LegendListRecyclingState<T> {
|
|
|
907
661
|
prevIndex: number | undefined;
|
|
908
662
|
prevItem: T | undefined;
|
|
909
663
|
}
|
|
910
|
-
type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null) => (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
|
911
|
-
declare const typedForwardRef: TypedForwardRef;
|
|
912
|
-
type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.ComponentProps<T>>, nextProps: Readonly<React.ComponentProps<T>>) => boolean) => T & {
|
|
913
|
-
displayName?: string;
|
|
914
|
-
};
|
|
915
|
-
declare const typedMemo: TypedMemo;
|
|
916
664
|
interface ScrollIndexWithOffset {
|
|
917
665
|
index: number;
|
|
918
666
|
viewOffset?: number;
|
|
@@ -930,14 +678,8 @@ interface InitialScrollAnchor extends ScrollIndexWithOffsetPosition {
|
|
|
930
678
|
lastDelta?: number;
|
|
931
679
|
settledTicks?: number;
|
|
932
680
|
}
|
|
933
|
-
type GetRenderedItemResult<ItemT> = {
|
|
934
|
-
index: number;
|
|
935
|
-
item: ItemT;
|
|
936
|
-
renderedItem: React.ReactNode;
|
|
937
|
-
};
|
|
938
|
-
type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
|
|
939
681
|
|
|
940
|
-
type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewProps, TItemType>, "onScroll" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
|
|
682
|
+
type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewProps, TItemType>, "anchoredEndSpace" | "onScroll" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
|
|
941
683
|
onScroll?: (event: NativeSyntheticEvent$1<NativeScrollEvent$1>) => void;
|
|
942
684
|
refScrollView?: React.Ref<ScrollView>;
|
|
943
685
|
renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
|
|
@@ -968,4 +710,4 @@ declare function useSyncLayout(): () => void;
|
|
|
968
710
|
|
|
969
711
|
declare const LegendList: LegendListComponent;
|
|
970
712
|
|
|
971
|
-
export { type AlwaysRenderConfig, type
|
|
713
|
+
export { type AlwaysRenderConfig, type ColumnWrapperStyle, type InitialScrollAnchor, type Insets, type LayoutRectangle, LegendList, 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 };
|