@legendapp/list 3.0.0-beta.44 → 3.0.0-beta.45

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.
@@ -26,18 +26,28 @@ interface ScrollViewMethods {
26
26
  }): void;
27
27
  }
28
28
 
29
- type AnimatedValue = number;
29
+ interface MaintainVisibleContentPositionNormalized<ItemT = any> {
30
+ data: boolean;
31
+ size: boolean;
32
+ shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
33
+ }
30
34
 
31
- 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}`;
32
- type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
35
+ 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}`;
36
+ type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
33
37
  type ListenerTypeValueMap = {
34
38
  activeStickyIndex: number;
39
+ anchoredEndSpaceSize: number;
35
40
  animatedScrollY: any;
36
41
  debugComputedScroll: number;
37
42
  debugRawScroll: number;
38
43
  extraData: any;
39
44
  footerSize: number;
40
45
  headerSize: number;
46
+ isAtEnd: boolean;
47
+ isAtStart: boolean;
48
+ isNearEnd: boolean;
49
+ isNearStart: boolean;
50
+ isWithinMaintainScrollAtEndThreshold: boolean;
41
51
  lastItemKeys: string[];
42
52
  lastPositionUpdate: number;
43
53
  maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
@@ -69,44 +79,6 @@ type ListenerTypeValueMap = {
69
79
  } & {
70
80
  [K in ListenerType as K extends `containerSticky${number}` ? K : never]: boolean;
71
81
  };
72
- interface StateContext {
73
- animatedScrollY: AnimatedValue;
74
- columnWrapperStyle: ColumnWrapperStyle | undefined;
75
- contextNum: number;
76
- listeners: Map<ListenerType, Set<(value: any) => void>>;
77
- mapViewabilityCallbacks: Map<string, ViewabilityCallback>;
78
- mapViewabilityValues: Map<string, ViewToken>;
79
- mapViewabilityAmountCallbacks: Map<number, ViewabilityAmountCallback>;
80
- mapViewabilityAmountValues: Map<number, ViewAmountToken>;
81
- mapViewabilityConfigStates: Map<string, {
82
- viewableItems: ViewToken[];
83
- start: number;
84
- end: number;
85
- previousStart: number;
86
- previousEnd: number;
87
- }>;
88
- positionListeners: Map<string, Set<(value: any) => void>>;
89
- state: InternalState;
90
- values: Map<ListenerType, any>;
91
- viewRefs: Map<number, React.RefObject<LooseView | null>>;
92
- }
93
-
94
- declare class ScrollAdjustHandler {
95
- private appliedAdjust;
96
- private pendingAdjust;
97
- private ctx;
98
- constructor(ctx: StateContext);
99
- requestAdjust(add: number): void;
100
- getAdjust(): number;
101
- commitPendingAdjust(scrollTarget: ScrollTarget): void;
102
- }
103
-
104
- type BaseSharedValue<T = number> = {
105
- get: () => T;
106
- };
107
- type StylesAsSharedValue<Style> = {
108
- [key in keyof Style]: Style[key] | BaseSharedValue<Style[key]>;
109
- };
110
82
 
111
83
  interface Insets {
112
84
  top: number;
@@ -141,29 +113,6 @@ interface NativeSyntheticEvent<T> {
141
113
  }
142
114
  type ViewStyle = Record<string, unknown>;
143
115
  type StyleProp<T> = T | T[] | null | undefined | false;
144
- interface ScrollEventTargetLike {
145
- addEventListener(type: string, listener: (...args: any[]) => void): void;
146
- removeEventListener(type: string, listener: (...args: any[]) => void): void;
147
- }
148
- interface ScrollableNodeLike {
149
- scrollLeft?: number;
150
- scrollTop?: number;
151
- }
152
- interface LegendListScrollerRef {
153
- flashScrollIndicators(): void;
154
- getCurrentScrollOffset?(): number;
155
- getScrollEventTarget(): ScrollEventTargetLike | null;
156
- getScrollableNode(): ScrollableNodeLike | null;
157
- getScrollResponder(): unknown;
158
- scrollTo(options: {
159
- animated?: boolean;
160
- x?: number;
161
- y?: number;
162
- }): void;
163
- scrollToEnd(options?: {
164
- animated?: boolean;
165
- }): void;
166
- }
167
116
  type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
168
117
  interface DataModeProps<ItemT, TItemType extends string | undefined> {
169
118
  /**
@@ -206,6 +155,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
206
155
  * Style applied to each column's wrapper view.
207
156
  */
208
157
  columnWrapperStyle?: ColumnWrapperStyle;
158
+ /**
159
+ * Version token that forces the list to treat data as updated even when the array reference is stable.
160
+ * Increment or change this when mutating the data array in place.
161
+ */
162
+ dataVersion?: Key;
209
163
  /**
210
164
  * Distance in pixels to pre-render items ahead of the visible area.
211
165
  * @default 250
@@ -229,33 +183,35 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
229
183
  * Extra data to trigger re-rendering when changed.
230
184
  */
231
185
  extraData?: any;
232
- /**
233
- * Version token that forces the list to treat data as updated even when the array reference is stable.
234
- * Increment or change this when mutating the data array in place.
235
- */
236
- dataVersion?: Key;
237
186
  /**
238
187
  * In case you have distinct item sizes, you can provide a function to get the size of an item.
239
- * Use instead of FlatList's getItemLayout or FlashList overrideItemLayout if you want to have accurate initialScrollOffset, you should provide this function
240
188
  */
241
189
  getEstimatedItemSize?: (item: ItemT, index: number, type: TItemType) => number;
242
190
  /**
243
- * Customize layout for multi-column lists, such as allowing items to span multiple columns.
244
- * Similar to FlashList's overrideItemLayout.
191
+ * In case items always have a fixed size, you can provide a function to return it.
245
192
  */
246
- overrideItemLayout?: (layout: {
247
- span?: number;
248
- }, item: ItemT, index: number, maxColumns: number, extraData?: any) => void;
193
+ getFixedItemSize?: (item: ItemT, index: number, type: TItemType) => number | undefined;
194
+ /**
195
+ * Returns a stable item type used for pooling and size estimation.
196
+ */
197
+ getItemType?: (item: ItemT, index: number) => TItemType;
198
+ /**
199
+ * Component to render between items, receiving the leading item as prop.
200
+ */
201
+ ItemSeparatorComponent?: React.ComponentType<{
202
+ leadingItem: ItemT;
203
+ }>;
249
204
  /**
250
205
  * Ratio of initial container pool size to data length (e.g., 0.5 for half).
251
206
  * @default 2
252
207
  */
253
208
  initialContainerPoolRatio?: number | undefined;
254
209
  /**
255
- * Initial scroll position in pixels.
256
- * @default 0
210
+ * When true, the list initializes scrolled to the last item.
211
+ * Overrides `initialScrollIndex` and `initialScrollOffset` when data is available.
212
+ * @default false
257
213
  */
258
- initialScrollOffset?: number;
214
+ initialScrollAtEnd?: boolean;
259
215
  /**
260
216
  * Index to scroll to initially.
261
217
  * @default 0
@@ -266,17 +222,14 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
266
222
  viewPosition?: number | undefined;
267
223
  };
268
224
  /**
269
- * When true, the list initializes scrolled to the last item.
270
- * Overrides `initialScrollIndex` and `initialScrollOffset` when data is available.
271
- * @default false
225
+ * Initial scroll position in pixels.
226
+ * @default 0
272
227
  */
273
- initialScrollAtEnd?: boolean;
228
+ initialScrollOffset?: number;
274
229
  /**
275
- * Component to render between items, receiving the leading item as prop.
230
+ * Custom equality function to detect semantically unchanged items.
276
231
  */
277
- ItemSeparatorComponent?: React.ComponentType<{
278
- leadingItem: ItemT;
279
- }>;
232
+ itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
280
233
  /**
281
234
  * Function to extract a unique key for each item.
282
235
  */
@@ -322,10 +275,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
322
275
  */
323
276
  maintainVisibleContentPosition?: boolean | MaintainVisibleContentPositionConfig<ItemT>;
324
277
  /**
325
- * Web only: when true, listens to window/body scrolling instead of rendering a scrollable list container.
326
- * @default false
278
+ * Keeps an item visually anchored to the start by adding trailing space when the content below it underflows.
327
279
  */
328
- useWindowScroll?: boolean;
280
+ anchoredEndSpace?: AnchoredEndSpaceConfig$1;
329
281
  /**
330
282
  * Number of columns to render items in.
331
283
  * @default 1
@@ -352,6 +304,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
352
304
  itemKey: string;
353
305
  itemData: ItemT;
354
306
  }) => void;
307
+ /**
308
+ * Called after the initial render work completes.
309
+ */
310
+ onLoad?: (info: {
311
+ elapsedTimeInMs: number;
312
+ }) => void;
355
313
  /**
356
314
  * Called when list layout metrics change.
357
315
  */
@@ -360,6 +318,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
360
318
  * Function to call when the user pulls to refresh.
361
319
  */
362
320
  onRefresh?: () => void;
321
+ /**
322
+ * Called when the list scrolls.
323
+ */
363
324
  onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
364
325
  /**
365
326
  * Called when scrolling reaches the start within onStartReachedThreshold.
@@ -383,6 +344,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
383
344
  * Called when the viewability of items changes.
384
345
  */
385
346
  onViewableItemsChanged?: OnViewableItemsChanged<ItemT> | undefined;
347
+ /**
348
+ * Customize layout for multi-column lists, such as allowing items to span multiple columns.
349
+ */
350
+ overrideItemLayout?: (layout: {
351
+ span?: number;
352
+ }, item: ItemT, index: number, maxColumns: number, extraData?: any) => void;
386
353
  /**
387
354
  * Offset in pixels for the refresh indicator.
388
355
  * @default 0
@@ -408,6 +375,10 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
408
375
  * @default (props) => <ScrollView {...props} />
409
376
  */
410
377
  renderScrollComponent?: (props: any) => React.ReactElement | null;
378
+ /**
379
+ * Array of item indices to use as snap points.
380
+ */
381
+ snapToIndices?: number[];
411
382
  /**
412
383
  * This will log a suggested estimatedItemSize.
413
384
  * @required
@@ -422,10 +393,6 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
422
393
  * Pairs of viewability configs and their callbacks for tracking visibility.
423
394
  */
424
395
  viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs<ItemT> | undefined;
425
- onLoad?: (info: {
426
- elapsedTimeInMs: number;
427
- }) => void;
428
- snapToIndices?: number[];
429
396
  /**
430
397
  * Array of child indices determining which children get docked to the top of the screen when scrolling.
431
398
  * For example, passing stickyHeaderIndices={[0]} will cause the first child to be fixed to the top of the scroll view.
@@ -442,21 +409,24 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
442
409
  * @default undefined
443
410
  */
444
411
  stickyHeaderConfig?: StickyHeaderConfig;
445
- getItemType?: (item: ItemT, index: number) => TItemType;
446
- getFixedItemSize?: (item: ItemT, index: number, type: TItemType) => number | undefined;
447
- itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
412
+ /**
413
+ * Web only: when true, listens to window/body scrolling instead of rendering a scrollable list container.
414
+ * @default false
415
+ */
416
+ useWindowScroll?: boolean;
448
417
  }
449
418
  type LegendListPropsBase<ItemT, TScrollViewProps = Record<string, any>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollViewProps> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
450
- type LegendListPropsInternal = LegendListSpecificProps<any, string | undefined> & DataModeProps<any, string | undefined>;
451
419
  interface MaintainVisibleContentPositionConfig<ItemT = any> {
452
420
  data?: boolean;
453
421
  size?: boolean;
454
422
  shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
455
423
  }
456
- interface MaintainVisibleContentPositionNormalized<ItemT = any> {
457
- data: boolean;
458
- size: boolean;
459
- shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
424
+ interface AnchoredEndSpaceConfig$1 {
425
+ anchorIndex: number;
426
+ anchorOffset?: number;
427
+ anchorMaxSize?: number;
428
+ includeInEndInset?: boolean;
429
+ onSizeChanged?: (size: number) => void;
460
430
  }
461
431
  interface StickyHeaderConfig {
462
432
  /**
@@ -503,225 +473,6 @@ interface LegendListMetrics {
503
473
  headerSize: number;
504
474
  footerSize: number;
505
475
  }
506
- interface ThresholdSnapshot {
507
- scrollPosition: number;
508
- contentSize?: number;
509
- dataLength?: number;
510
- atThreshold: boolean;
511
- }
512
- interface ScrollTarget {
513
- animated?: boolean;
514
- index?: number;
515
- isInitialScroll?: boolean;
516
- itemSize?: number;
517
- offset: number;
518
- precomputedWithViewOffset?: boolean;
519
- targetOffset?: number;
520
- viewOffset?: number;
521
- viewPosition?: number;
522
- }
523
- type BootstrapInitialScrollSession = {
524
- frameHandle?: number;
525
- mountFrameCount: number;
526
- passCount: number;
527
- previousResolvedOffset?: number;
528
- scroll: number;
529
- seedContentOffset: number;
530
- targetIndexSeed?: number;
531
- visibleIndices?: readonly number[];
532
- };
533
- type InternalScrollTarget = ScrollTarget & {
534
- waitForInitialScrollCompletionFrame?: boolean;
535
- };
536
- type InitialScrollSessionCompletion = {
537
- didDispatchNativeScroll?: boolean;
538
- didRetrySilentInitialScroll?: boolean;
539
- watchdog?: {
540
- startScroll: number;
541
- targetOffset: number;
542
- };
543
- };
544
- interface InternalInitialScrollTarget extends ScrollIndexWithOffsetAndContentOffset {
545
- preserveForBottomPadding?: boolean;
546
- preserveForFooterLayout?: boolean;
547
- }
548
- type InternalInitialScrollSessionBase = {
549
- completion?: InitialScrollSessionCompletion;
550
- previousDataLength: number;
551
- };
552
- type OffsetInitialScrollSession = InternalInitialScrollSessionBase & {
553
- kind: "offset";
554
- };
555
- type BootstrapOwnedInitialScrollSession = InternalInitialScrollSessionBase & {
556
- bootstrap?: BootstrapInitialScrollSession;
557
- kind: "bootstrap";
558
- };
559
- type InternalInitialScrollSession = OffsetInitialScrollSession | BootstrapOwnedInitialScrollSession;
560
- interface InternalState {
561
- activeStickyIndex: number | undefined;
562
- adjustingFromInitialMount?: number;
563
- animFrameCheckFinishedScroll?: any;
564
- averageSizes: Record<string, {
565
- num: number;
566
- avg: number;
567
- }>;
568
- columns: Array<number | undefined>;
569
- columnSpans: Array<number | undefined>;
570
- containerItemKeys: Map<string, number>;
571
- containerItemTypes: Map<number, string>;
572
- dataChangeEpoch: number;
573
- dataChangeNeedsScrollUpdate: boolean;
574
- deferredPublicOnScrollEvent?: NativeSyntheticEvent<NativeScrollEvent>;
575
- didColumnsChange?: boolean;
576
- didDataChange?: boolean;
577
- didFinishInitialScroll?: boolean;
578
- didContainersLayout?: boolean;
579
- enableScrollForNextCalculateItemsInView: boolean;
580
- endBuffered: number;
581
- endNoBuffer: number;
582
- endReachedSnapshot: ThresholdSnapshot | undefined;
583
- firstFullyOnScreenIndex: number;
584
- hasScrolled?: boolean;
585
- idCache: string[];
586
- idsInView: string[];
587
- ignoreScrollFromMVCP?: {
588
- lt?: number;
589
- gt?: number;
590
- };
591
- ignoreScrollFromMVCPIgnored?: boolean;
592
- ignoreScrollFromMVCPTimeout?: any;
593
- indexByKey: Map<string, number>;
594
- initialScrollSession?: InternalInitialScrollSession;
595
- initialScroll: InternalInitialScrollTarget | undefined;
596
- isAtEnd: boolean;
597
- isAtStart: boolean;
598
- isEndReached: boolean | null;
599
- isFirst?: boolean;
600
- isStartReached: boolean | null;
601
- lastBatchingAction: number;
602
- lastLayout: LayoutRectangle | undefined;
603
- lastScrollAdjustForHistory?: number;
604
- lastScrollDelta: number;
605
- loadStartTime: number;
606
- maintainingScrollAtEnd?: boolean;
607
- minIndexSizeChanged: number | undefined;
608
- mvcpAnchorLock?: {
609
- id: string;
610
- position: number;
611
- quietPasses: number;
612
- expiresAt: number;
613
- };
614
- contentInsetOverride?: Partial<Insets> | null;
615
- nativeContentInset?: Insets;
616
- nativeMarginTop: number;
617
- needsOtherAxisSize?: boolean;
618
- otherAxisSize?: number;
619
- pendingNativeMVCPAdjust?: {
620
- amount: number;
621
- furthestProgressTowardAmount: number;
622
- manualApplied: number;
623
- startScroll: number;
624
- };
625
- pendingMaintainScrollAtEnd?: boolean;
626
- pendingTotalSize?: number;
627
- pendingScrollResolve?: (() => void) | undefined;
628
- positions: Array<number | undefined>;
629
- previousData?: readonly unknown[];
630
- queuedCalculateItemsInView: number | undefined;
631
- queuedMVCPRecalculate?: number;
632
- queuedInitialLayout?: boolean | undefined;
633
- reprocessCurrentScroll?: () => void;
634
- refScroller: React.RefObject<LegendListScrollerRef | null>;
635
- scroll: number;
636
- scrollAdjustHandler: ScrollAdjustHandler;
637
- scrollForNextCalculateItemsInView: {
638
- top: number | null;
639
- bottom: number | null;
640
- } | undefined;
641
- scrollHistory: Array<{
642
- scroll: number;
643
- time: number;
644
- }>;
645
- scrollingTo?: InternalScrollTarget | undefined;
646
- scrollLastCalculate?: number;
647
- scrollLength: number;
648
- scrollPending: number;
649
- scrollPrev: number;
650
- scrollPrevTime: number;
651
- scrollProcessingEnabled: boolean;
652
- scrollTime: number;
653
- sizes: Map<string, number>;
654
- sizesKnown: Map<string, number>;
655
- startBuffered: number;
656
- startBufferedId?: string;
657
- startNoBuffer: number;
658
- startReachedSnapshotDataChangeEpoch: number | undefined;
659
- startReachedSnapshot: ThresholdSnapshot | undefined;
660
- stickyContainerPool: Set<number>;
661
- stickyContainers: Map<number, number>;
662
- timeouts: Set<number>;
663
- timeoutSetPaddingTop?: any;
664
- timeoutSizeMessage: any;
665
- timeoutCheckFinishedScrollFallback?: any;
666
- totalSize: number;
667
- triggerCalculateItemsInView?: (params?: {
668
- doMVCP?: boolean;
669
- dataChanged?: boolean;
670
- forceFullItemPositions?: boolean;
671
- }) => void;
672
- viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
673
- props: {
674
- alignItemsAtEnd: boolean;
675
- animatedProps: StylesAsSharedValue<Record<string, any>>;
676
- alwaysRender: AlwaysRenderConfig | undefined;
677
- alwaysRenderIndicesArr: number[];
678
- alwaysRenderIndicesSet: Set<number>;
679
- contentInset: Insets | undefined;
680
- data: readonly any[];
681
- dataVersion: Key | undefined;
682
- drawDistance: number;
683
- estimatedItemSize: number | undefined;
684
- getEstimatedItemSize: LegendListPropsInternal["getEstimatedItemSize"];
685
- getFixedItemSize: LegendListPropsInternal["getFixedItemSize"];
686
- getItemType: LegendListPropsInternal["getItemType"];
687
- horizontal: boolean;
688
- initialContainerPoolRatio: number;
689
- itemsAreEqual: LegendListPropsInternal["itemsAreEqual"];
690
- keyExtractor: LegendListPropsInternal["keyExtractor"];
691
- maintainScrollAtEnd: MaintainScrollAtEndNormalized | undefined;
692
- maintainScrollAtEndThreshold: number | undefined;
693
- maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
694
- numColumns: number;
695
- onEndReached: LegendListPropsInternal["onEndReached"];
696
- onEndReachedThreshold: number | null | undefined;
697
- onItemSizeChanged: LegendListPropsInternal["onItemSizeChanged"];
698
- onLoad: LegendListPropsInternal["onLoad"];
699
- onScroll: LegendListPropsInternal["onScroll"];
700
- onStartReached: LegendListPropsInternal["onStartReached"];
701
- onStartReachedThreshold: number | null | undefined;
702
- onStickyHeaderChange: LegendListPropsInternal["onStickyHeaderChange"];
703
- overrideItemLayout: LegendListPropsInternal["overrideItemLayout"];
704
- recycleItems: boolean;
705
- renderItem: LegendListPropsInternal["renderItem"];
706
- scrollBuffer?: number;
707
- snapToIndices: number[] | undefined;
708
- positionComponentInternal: React.ComponentType<any> | undefined;
709
- stickyPositionComponentInternal: React.ComponentType<any> | undefined;
710
- stickyIndicesArr: number[];
711
- stickyIndicesSet: Set<number>;
712
- stylePaddingBottom: number | undefined;
713
- stylePaddingTop: number | undefined;
714
- suggestEstimatedItemSize: boolean;
715
- useWindowScroll: boolean;
716
- };
717
- }
718
- interface ViewableRange<T> {
719
- end: number;
720
- endBuffered: number;
721
- items: T[];
722
- start: number;
723
- startBuffered: number;
724
- }
725
476
  interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
726
477
  data: readonly ItemT[];
727
478
  extraData: any;
@@ -738,8 +489,11 @@ type LegendListState$1 = {
738
489
  endBuffered: number;
739
490
  isAtEnd: boolean;
740
491
  isAtStart: boolean;
492
+ isNearEnd: boolean;
493
+ isNearStart: boolean;
741
494
  isEndReached: boolean;
742
495
  isStartReached: boolean;
496
+ isWithinMaintainScrollAtEndThreshold: boolean;
743
497
  listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
744
498
  listenToPosition: (key: string, callback: (value: number) => void) => () => void;
745
499
  positionAtIndex: (index: number) => number;
@@ -885,10 +639,15 @@ interface ViewabilityConfigCallbackPair<ItemT = any> {
885
639
  viewabilityConfig: ViewabilityConfig;
886
640
  }
887
641
  type ViewabilityConfigCallbackPairs<ItemT> = ViewabilityConfigCallbackPair<ItemT>[];
888
- type OnViewableItemsChanged<ItemT> = ((info: {
889
- viewableItems: Array<ViewToken<ItemT>>;
642
+ interface OnViewableItemsChangedInfo<ItemT> {
890
643
  changed: Array<ViewToken<ItemT>>;
891
- }) => void) | null;
644
+ end: number;
645
+ endBuffered: number;
646
+ start: number;
647
+ startBuffered: number;
648
+ viewableItems: Array<ViewToken<ItemT>>;
649
+ }
650
+ type OnViewableItemsChanged<ItemT> = ((info: OnViewableItemsChangedInfo<ItemT>) => void) | null;
892
651
  interface ViewabilityConfig {
893
652
  /**
894
653
  * A unique ID to identify this viewability config
@@ -926,12 +685,6 @@ interface LegendListRecyclingState<T> {
926
685
  prevIndex: number | undefined;
927
686
  prevItem: T | undefined;
928
687
  }
929
- type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null) => (props: P & React.RefAttributes<T>) => React.ReactElement | null;
930
- declare const typedForwardRef: TypedForwardRef;
931
- type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.ComponentProps<T>>, nextProps: Readonly<React.ComponentProps<T>>) => boolean) => T & {
932
- displayName?: string;
933
- };
934
- declare const typedMemo: TypedMemo;
935
688
  interface ScrollIndexWithOffset {
936
689
  index: number;
937
690
  viewOffset?: number;
@@ -949,23 +702,14 @@ interface InitialScrollAnchor extends ScrollIndexWithOffsetPosition {
949
702
  lastDelta?: number;
950
703
  settledTicks?: number;
951
704
  }
952
- type GetRenderedItemResult<ItemT> = {
953
- index: number;
954
- item: ItemT;
955
- renderedItem: React.ReactNode;
956
- };
957
- type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
958
705
 
959
706
  type LooseLayoutChangeEvent = {
960
707
  nativeEvent: {
961
708
  layout: LayoutRectangle;
962
709
  };
963
710
  };
964
- type LooseMeasureCallback = (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void;
965
- interface LooseView {
966
- measure?: (callback: LooseMeasureCallback) => void;
967
- }
968
711
  interface LooseScrollViewProps {
712
+ contentContainerClassName?: string;
969
713
  contentContainerStyle?: StyleProp<ViewStyle>;
970
714
  contentInset?: Insets;
971
715
  contentOffset?: {
@@ -990,13 +734,17 @@ interface LooseScrollViewProps {
990
734
  style?: StyleProp<ViewStyle>;
991
735
  }
992
736
 
993
- type ScrollViewPropsWeb = Omit<LooseScrollViewProps, "style" | "contentContainerStyle" | "onScroll" | "onLayout" | "pagingEnabled" | "snapToInterval"> & Omit<HTMLAttributes<HTMLDivElement>, "onScroll" | "onLayout" | "style"> & {
737
+ interface AnchoredEndSpaceConfig extends Omit<AnchoredEndSpaceConfig$1, "includeInEndInset"> {
738
+ }
739
+ type ScrollViewPropsWeb = Omit<LooseScrollViewProps, "style" | "contentContainerStyle" | "onScroll" | "onLayout" | "onMomentumScrollBegin" | "onMomentumScrollEnd" | "pagingEnabled" | "snapToInterval"> & Omit<HTMLAttributes<HTMLDivElement>, "onScroll" | "onLayout" | "style"> & {
994
740
  style?: CSSProperties;
741
+ contentContainerClassName?: string;
995
742
  contentContainerStyle?: CSSProperties;
996
743
  onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
997
744
  onLayout?: (event: LooseLayoutChangeEvent) => void;
998
745
  };
999
- type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewPropsWeb, TItemType>, "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
746
+ type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewPropsWeb, TItemType>, "anchoredEndSpace" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle" | "onRefresh" | "progressViewOffset" | "refreshing"> & {
747
+ anchoredEndSpace?: AnchoredEndSpaceConfig;
1000
748
  refScrollView?: Ref<HTMLElement | ScrollViewMethods>;
1001
749
  ListHeaderComponentStyle?: CSSProperties | undefined;
1002
750
  ListFooterComponentStyle?: CSSProperties | undefined;
@@ -1025,4 +773,4 @@ declare function useSyncLayout(): () => void;
1025
773
 
1026
774
  declare const LegendList: LegendListComponent;
1027
775
 
1028
- export { type AlwaysRenderConfig, type BaseScrollViewProps, type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type Insets, type InternalState, type LayoutRectangle, LegendList, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListScrollerRef, type LegendListState, type MaintainScrollAtEndOnOptions, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type NativeScrollEvent, type NativeSyntheticEvent, type OnViewableItemsChanged, type ScrollEventTargetLike, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type ScrollableNodeLike, type StickyHeaderConfig, type StyleProp, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewStyle, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
776
+ export { type AlwaysRenderConfig, type AnchoredEndSpaceConfig, 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 };