@legendapp/list 1.1.4 → 2.0.0-next.0

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.
Files changed (5) hide show
  1. package/index.d.mts +59 -52
  2. package/index.d.ts +59 -52
  3. package/index.js +686 -949
  4. package/index.mjs +687 -950
  5. package/package.json +1 -1
package/index.d.mts CHANGED
@@ -1,26 +1,29 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
3
3
  import * as react_native from 'react-native';
4
- import { ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
4
+ import { View, ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
5
5
  import Animated from 'react-native-reanimated';
6
6
  import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
7
- import * as _legendapp_list from '@legendapp/list';
8
- import { LegendListProps as LegendListProps$1, LegendListRenderItemProps as LegendListRenderItemProps$1, LegendListRef as LegendListRef$1 } from '@legendapp/list';
7
+
8
+ type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "scrollSize";
9
+ interface StateContext {
10
+ listeners: Map<ListenerType, Set<(value: any) => void>>;
11
+ values: Map<ListenerType, any>;
12
+ mapViewabilityCallbacks: Map<string, ViewabilityCallback>;
13
+ mapViewabilityValues: Map<string, ViewToken>;
14
+ mapViewabilityAmountCallbacks: Map<number, ViewabilityAmountCallback>;
15
+ mapViewabilityAmountValues: Map<number, ViewAmountToken>;
16
+ columnWrapperStyle: ColumnWrapperStyle | undefined;
17
+ viewRefs: Map<number, React$1.RefObject<View>>;
18
+ }
9
19
 
10
20
  declare class ScrollAdjustHandler {
11
- private ctx;
12
21
  private appliedAdjust;
13
- private busy;
14
22
  private context;
15
- private isPaused;
16
- private isDisabled;
17
- constructor(ctx: any);
18
- private doAjdust;
19
- requestAdjust(adjust: number, onAdjusted: (diff: number) => void): void;
20
- getAppliedAdjust(): number;
21
- pauseAdjust(): void;
22
- setDisableAdjust(disable: boolean): void;
23
- unPauseAdjust(): boolean;
23
+ private mounted;
24
+ constructor(ctx: StateContext);
25
+ requestAdjust(add: number): void;
26
+ setMounted(): void;
24
27
  }
25
28
 
26
29
  type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
@@ -235,23 +238,13 @@ interface ColumnWrapperStyle {
235
238
  gap?: number;
236
239
  columnGap?: number;
237
240
  }
238
- type AnchoredPosition = {
239
- type: "top" | "bottom";
240
- relativeCoordinate: number;
241
- top: number;
242
- };
243
241
  type LegendListProps<ItemT> = LegendListPropsBase<ItemT, Omit<ComponentProps<typeof ScrollView>, "scrollEventThrottle">>;
244
242
  interface InternalState {
245
- anchorElement?: {
246
- id: string;
247
- coordinate: number;
248
- };
249
- belowAnchorElementPositions?: Map<string, number>;
250
- rowHeights: Map<number, number>;
251
243
  positions: Map<string, number>;
252
244
  columns: Map<string, number>;
253
245
  sizes: Map<string, number>;
254
246
  sizesKnown: Map<string, number>;
247
+ containerItemKeys: Set<string>;
255
248
  pendingAdjust: number;
256
249
  isStartReached: boolean;
257
250
  isEndReached: boolean;
@@ -265,28 +258,28 @@ interface InternalState {
265
258
  startNoBuffer: number;
266
259
  endBuffered: number;
267
260
  endNoBuffer: number;
261
+ firstFullyOnScreenIndex: number;
262
+ idsInView: string[];
268
263
  scrollPending: number;
269
264
  scroll: number;
270
265
  scrollTime: number;
271
266
  scrollPrev: number;
272
267
  scrollPrevTime: number;
273
- scrollVelocity: number;
274
268
  scrollAdjustHandler: ScrollAdjustHandler;
275
269
  maintainingScrollAtEnd?: boolean;
276
270
  totalSize: number;
277
- totalSizeBelowAnchor: number;
278
271
  otherAxisSize?: number;
279
272
  timeouts: Set<number>;
280
273
  timeoutSizeMessage: any;
281
274
  nativeMarginTop: number;
282
275
  indexByKey: Map<string, number>;
276
+ idCache: Map<number, string>;
283
277
  viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs | undefined;
284
278
  renderItem: ((props: LegendListRenderItemProps<any>) => ReactNode) | React.ComponentType<LegendListRenderItemProps<any>>;
285
279
  scrollHistory: Array<{
286
280
  scroll: number;
287
281
  time: number;
288
282
  }>;
289
- scrollTimer: Timer | undefined;
290
283
  startReachedBlockedByTimer: boolean;
291
284
  endReachedBlockedByTimer: boolean;
292
285
  scrollForNextCalculateItemsInView: {
@@ -298,8 +291,11 @@ interface InternalState {
298
291
  queuedInitialLayout?: boolean | undefined;
299
292
  queuedCalculateItemsInView: number | undefined;
300
293
  lastBatchingAction: number;
301
- ignoreScrollFromCalcTotal?: boolean;
302
- disableScrollJumpsFrom?: number;
294
+ ignoreScrollFromMVCP?: {
295
+ lt?: number;
296
+ gt?: number;
297
+ };
298
+ ignoreScrollFromMVCPTimeout?: any;
303
299
  scrollingTo?: {
304
300
  offset: number;
305
301
  index?: number;
@@ -307,7 +303,6 @@ interface InternalState {
307
303
  viewPosition?: number;
308
304
  animated?: boolean;
309
305
  } | undefined;
310
- previousTotalSize?: number;
311
306
  needsOtherAxisSize?: boolean;
312
307
  averageSizes: Record<string, {
313
308
  num: number;
@@ -428,6 +423,12 @@ type LegendListRef = {
428
423
  offset: number;
429
424
  animated?: boolean | undefined;
430
425
  }): void;
426
+ /**
427
+ * Sets or adds to the offset of the visible content anchor.
428
+ * @param value - The offset to set or add.
429
+ * @param animated - If true, uses Animated to animate the change.
430
+ */
431
+ setVisibleContentAnchorOffset(value: number | ((value: number) => number)): void;
431
432
  };
432
433
  interface ViewToken<ItemT = any> {
433
434
  item: ItemT;
@@ -500,6 +501,12 @@ type ScrollIndexWithOffsetPosition = {
500
501
  viewOffset?: number;
501
502
  viewPosition?: number;
502
503
  };
504
+ type GetRenderedItemResult<ItemT> = {
505
+ index: number;
506
+ item: ItemT;
507
+ renderedItem: React.ReactNode;
508
+ };
509
+ type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
503
510
 
504
511
  declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
505
512
  alignItemsAtEnd?: boolean;
@@ -565,13 +572,13 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
565
572
  }) => void;
566
573
  } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
567
574
 
568
- interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps$1<ItemT>, "data" | "keyExtractor" | "renderItem"> {
575
+ interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
569
576
  children?: React$1.ReactNode | undefined;
570
577
  LegendList?: ListT;
571
578
  }
572
579
  declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
573
580
  alignItemsAtEnd?: boolean;
574
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
581
+ columnWrapperStyle?: ColumnWrapperStyle;
575
582
  data: readonly T[];
576
583
  drawDistance?: number;
577
584
  estimatedItemSize?: number;
@@ -617,23 +624,23 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
617
624
  distanceFromStart: number;
618
625
  }) => void) | null | undefined;
619
626
  onStartReachedThreshold?: number | null | undefined;
620
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
627
+ onViewableItemsChanged?: OnViewableItemsChanged | undefined;
621
628
  progressViewOffset?: number;
622
629
  recycleItems?: boolean;
623
630
  refScrollView?: React$1.Ref<react_native.ScrollView>;
624
631
  refreshing?: boolean;
625
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
632
+ renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
626
633
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
627
634
  suggestEstimatedItemSize?: boolean;
628
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
629
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
635
+ viewabilityConfig?: ViewabilityConfig;
636
+ viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
630
637
  waitForInitialLayout?: boolean;
631
638
  onLoad?: (info: {
632
639
  elapsedTimeInMs: number;
633
640
  }) => void;
634
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
641
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
635
642
  alignItemsAtEnd?: boolean;
636
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
643
+ columnWrapperStyle?: ColumnWrapperStyle;
637
644
  data: readonly T[];
638
645
  drawDistance?: number;
639
646
  estimatedItemSize?: number;
@@ -679,25 +686,25 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
679
686
  distanceFromStart: number;
680
687
  }) => void) | null | undefined;
681
688
  onStartReachedThreshold?: number | null | undefined;
682
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
689
+ onViewableItemsChanged?: OnViewableItemsChanged | undefined;
683
690
  progressViewOffset?: number;
684
691
  recycleItems?: boolean;
685
692
  refScrollView?: React$1.Ref<react_native.ScrollView>;
686
693
  refreshing?: boolean;
687
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
694
+ renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
688
695
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
689
696
  suggestEstimatedItemSize?: boolean;
690
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
691
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
697
+ viewabilityConfig?: ViewabilityConfig;
698
+ viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
692
699
  waitForInitialLayout?: boolean;
693
700
  onLoad?: (info: {
694
701
  elapsedTimeInMs: number;
695
702
  }) => void;
696
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
697
- ref?: React$1.Ref<LegendListRef$1>;
703
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
704
+ ref?: React$1.Ref<LegendListRef>;
698
705
  }) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
699
706
  alignItemsAtEnd?: boolean;
700
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
707
+ columnWrapperStyle?: ColumnWrapperStyle;
701
708
  data: readonly T[];
702
709
  drawDistance?: number;
703
710
  estimatedItemSize?: number;
@@ -743,21 +750,21 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
743
750
  distanceFromStart: number;
744
751
  }) => void) | null | undefined;
745
752
  onStartReachedThreshold?: number | null | undefined;
746
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
753
+ onViewableItemsChanged?: OnViewableItemsChanged | undefined;
747
754
  progressViewOffset?: number;
748
755
  recycleItems?: boolean;
749
756
  refScrollView?: React$1.Ref<react_native.ScrollView>;
750
757
  refreshing?: boolean;
751
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
758
+ renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
752
759
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
753
760
  suggestEstimatedItemSize?: boolean;
754
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
755
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
761
+ viewabilityConfig?: ViewabilityConfig;
762
+ viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
756
763
  waitForInitialLayout?: boolean;
757
764
  onLoad?: (info: {
758
765
  elapsedTimeInMs: number;
759
766
  }) => void;
760
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode;
767
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
761
768
 
762
769
  declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
763
770
  declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
@@ -769,4 +776,4 @@ declare function useListScrollSize(): {
769
776
  height: number;
770
777
  };
771
778
 
772
- export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
779
+ export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
package/index.d.ts CHANGED
@@ -1,26 +1,29 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
3
3
  import * as react_native from 'react-native';
4
- import { ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
4
+ import { View, ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
5
5
  import Animated from 'react-native-reanimated';
6
6
  import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
7
- import * as _legendapp_list from '@legendapp/list';
8
- import { LegendListProps as LegendListProps$1, LegendListRenderItemProps as LegendListRenderItemProps$1, LegendListRef as LegendListRef$1 } from '@legendapp/list';
7
+
8
+ type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "scrollSize";
9
+ interface StateContext {
10
+ listeners: Map<ListenerType, Set<(value: any) => void>>;
11
+ values: Map<ListenerType, any>;
12
+ mapViewabilityCallbacks: Map<string, ViewabilityCallback>;
13
+ mapViewabilityValues: Map<string, ViewToken>;
14
+ mapViewabilityAmountCallbacks: Map<number, ViewabilityAmountCallback>;
15
+ mapViewabilityAmountValues: Map<number, ViewAmountToken>;
16
+ columnWrapperStyle: ColumnWrapperStyle | undefined;
17
+ viewRefs: Map<number, React$1.RefObject<View>>;
18
+ }
9
19
 
10
20
  declare class ScrollAdjustHandler {
11
- private ctx;
12
21
  private appliedAdjust;
13
- private busy;
14
22
  private context;
15
- private isPaused;
16
- private isDisabled;
17
- constructor(ctx: any);
18
- private doAjdust;
19
- requestAdjust(adjust: number, onAdjusted: (diff: number) => void): void;
20
- getAppliedAdjust(): number;
21
- pauseAdjust(): void;
22
- setDisableAdjust(disable: boolean): void;
23
- unPauseAdjust(): boolean;
23
+ private mounted;
24
+ constructor(ctx: StateContext);
25
+ requestAdjust(add: number): void;
26
+ setMounted(): void;
24
27
  }
25
28
 
26
29
  type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
@@ -235,23 +238,13 @@ interface ColumnWrapperStyle {
235
238
  gap?: number;
236
239
  columnGap?: number;
237
240
  }
238
- type AnchoredPosition = {
239
- type: "top" | "bottom";
240
- relativeCoordinate: number;
241
- top: number;
242
- };
243
241
  type LegendListProps<ItemT> = LegendListPropsBase<ItemT, Omit<ComponentProps<typeof ScrollView>, "scrollEventThrottle">>;
244
242
  interface InternalState {
245
- anchorElement?: {
246
- id: string;
247
- coordinate: number;
248
- };
249
- belowAnchorElementPositions?: Map<string, number>;
250
- rowHeights: Map<number, number>;
251
243
  positions: Map<string, number>;
252
244
  columns: Map<string, number>;
253
245
  sizes: Map<string, number>;
254
246
  sizesKnown: Map<string, number>;
247
+ containerItemKeys: Set<string>;
255
248
  pendingAdjust: number;
256
249
  isStartReached: boolean;
257
250
  isEndReached: boolean;
@@ -265,28 +258,28 @@ interface InternalState {
265
258
  startNoBuffer: number;
266
259
  endBuffered: number;
267
260
  endNoBuffer: number;
261
+ firstFullyOnScreenIndex: number;
262
+ idsInView: string[];
268
263
  scrollPending: number;
269
264
  scroll: number;
270
265
  scrollTime: number;
271
266
  scrollPrev: number;
272
267
  scrollPrevTime: number;
273
- scrollVelocity: number;
274
268
  scrollAdjustHandler: ScrollAdjustHandler;
275
269
  maintainingScrollAtEnd?: boolean;
276
270
  totalSize: number;
277
- totalSizeBelowAnchor: number;
278
271
  otherAxisSize?: number;
279
272
  timeouts: Set<number>;
280
273
  timeoutSizeMessage: any;
281
274
  nativeMarginTop: number;
282
275
  indexByKey: Map<string, number>;
276
+ idCache: Map<number, string>;
283
277
  viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs | undefined;
284
278
  renderItem: ((props: LegendListRenderItemProps<any>) => ReactNode) | React.ComponentType<LegendListRenderItemProps<any>>;
285
279
  scrollHistory: Array<{
286
280
  scroll: number;
287
281
  time: number;
288
282
  }>;
289
- scrollTimer: Timer | undefined;
290
283
  startReachedBlockedByTimer: boolean;
291
284
  endReachedBlockedByTimer: boolean;
292
285
  scrollForNextCalculateItemsInView: {
@@ -298,8 +291,11 @@ interface InternalState {
298
291
  queuedInitialLayout?: boolean | undefined;
299
292
  queuedCalculateItemsInView: number | undefined;
300
293
  lastBatchingAction: number;
301
- ignoreScrollFromCalcTotal?: boolean;
302
- disableScrollJumpsFrom?: number;
294
+ ignoreScrollFromMVCP?: {
295
+ lt?: number;
296
+ gt?: number;
297
+ };
298
+ ignoreScrollFromMVCPTimeout?: any;
303
299
  scrollingTo?: {
304
300
  offset: number;
305
301
  index?: number;
@@ -307,7 +303,6 @@ interface InternalState {
307
303
  viewPosition?: number;
308
304
  animated?: boolean;
309
305
  } | undefined;
310
- previousTotalSize?: number;
311
306
  needsOtherAxisSize?: boolean;
312
307
  averageSizes: Record<string, {
313
308
  num: number;
@@ -428,6 +423,12 @@ type LegendListRef = {
428
423
  offset: number;
429
424
  animated?: boolean | undefined;
430
425
  }): void;
426
+ /**
427
+ * Sets or adds to the offset of the visible content anchor.
428
+ * @param value - The offset to set or add.
429
+ * @param animated - If true, uses Animated to animate the change.
430
+ */
431
+ setVisibleContentAnchorOffset(value: number | ((value: number) => number)): void;
431
432
  };
432
433
  interface ViewToken<ItemT = any> {
433
434
  item: ItemT;
@@ -500,6 +501,12 @@ type ScrollIndexWithOffsetPosition = {
500
501
  viewOffset?: number;
501
502
  viewPosition?: number;
502
503
  };
504
+ type GetRenderedItemResult<ItemT> = {
505
+ index: number;
506
+ item: ItemT;
507
+ renderedItem: React.ReactNode;
508
+ };
509
+ type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
503
510
 
504
511
  declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
505
512
  alignItemsAtEnd?: boolean;
@@ -565,13 +572,13 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
565
572
  }) => void;
566
573
  } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
567
574
 
568
- interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps$1<ItemT>, "data" | "keyExtractor" | "renderItem"> {
575
+ interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
569
576
  children?: React$1.ReactNode | undefined;
570
577
  LegendList?: ListT;
571
578
  }
572
579
  declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
573
580
  alignItemsAtEnd?: boolean;
574
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
581
+ columnWrapperStyle?: ColumnWrapperStyle;
575
582
  data: readonly T[];
576
583
  drawDistance?: number;
577
584
  estimatedItemSize?: number;
@@ -617,23 +624,23 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
617
624
  distanceFromStart: number;
618
625
  }) => void) | null | undefined;
619
626
  onStartReachedThreshold?: number | null | undefined;
620
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
627
+ onViewableItemsChanged?: OnViewableItemsChanged | undefined;
621
628
  progressViewOffset?: number;
622
629
  recycleItems?: boolean;
623
630
  refScrollView?: React$1.Ref<react_native.ScrollView>;
624
631
  refreshing?: boolean;
625
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
632
+ renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
626
633
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
627
634
  suggestEstimatedItemSize?: boolean;
628
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
629
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
635
+ viewabilityConfig?: ViewabilityConfig;
636
+ viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
630
637
  waitForInitialLayout?: boolean;
631
638
  onLoad?: (info: {
632
639
  elapsedTimeInMs: number;
633
640
  }) => void;
634
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
641
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
635
642
  alignItemsAtEnd?: boolean;
636
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
643
+ columnWrapperStyle?: ColumnWrapperStyle;
637
644
  data: readonly T[];
638
645
  drawDistance?: number;
639
646
  estimatedItemSize?: number;
@@ -679,25 +686,25 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
679
686
  distanceFromStart: number;
680
687
  }) => void) | null | undefined;
681
688
  onStartReachedThreshold?: number | null | undefined;
682
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
689
+ onViewableItemsChanged?: OnViewableItemsChanged | undefined;
683
690
  progressViewOffset?: number;
684
691
  recycleItems?: boolean;
685
692
  refScrollView?: React$1.Ref<react_native.ScrollView>;
686
693
  refreshing?: boolean;
687
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
694
+ renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
688
695
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
689
696
  suggestEstimatedItemSize?: boolean;
690
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
691
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
697
+ viewabilityConfig?: ViewabilityConfig;
698
+ viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
692
699
  waitForInitialLayout?: boolean;
693
700
  onLoad?: (info: {
694
701
  elapsedTimeInMs: number;
695
702
  }) => void;
696
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
697
- ref?: React$1.Ref<LegendListRef$1>;
703
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
704
+ ref?: React$1.Ref<LegendListRef>;
698
705
  }) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
699
706
  alignItemsAtEnd?: boolean;
700
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
707
+ columnWrapperStyle?: ColumnWrapperStyle;
701
708
  data: readonly T[];
702
709
  drawDistance?: number;
703
710
  estimatedItemSize?: number;
@@ -743,21 +750,21 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
743
750
  distanceFromStart: number;
744
751
  }) => void) | null | undefined;
745
752
  onStartReachedThreshold?: number | null | undefined;
746
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
753
+ onViewableItemsChanged?: OnViewableItemsChanged | undefined;
747
754
  progressViewOffset?: number;
748
755
  recycleItems?: boolean;
749
756
  refScrollView?: React$1.Ref<react_native.ScrollView>;
750
757
  refreshing?: boolean;
751
- renderItem?: React$1.ComponentType<LegendListRenderItemProps$1<T>> | ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | undefined;
758
+ renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
752
759
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
753
760
  suggestEstimatedItemSize?: boolean;
754
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
755
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
761
+ viewabilityConfig?: ViewabilityConfig;
762
+ viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
756
763
  waitForInitialLayout?: boolean;
757
764
  onLoad?: (info: {
758
765
  elapsedTimeInMs: number;
759
766
  }) => void;
760
- } & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode;
767
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
761
768
 
762
769
  declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
763
770
  declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
@@ -769,4 +776,4 @@ declare function useListScrollSize(): {
769
776
  height: number;
770
777
  };
771
778
 
772
- export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
779
+ export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };