@legendapp/list 2.0.0-next.1 → 2.0.0-next.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.DS_Store ADDED
Binary file
package/animated.d.mts CHANGED
@@ -14,7 +14,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
14
14
  width: number;
15
15
  };
16
16
  extraData?: any;
17
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
17
+ getEstimatedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
18
18
  initialContainerPoolRatio?: number | undefined;
19
19
  initialScrollOffset?: number;
20
20
  initialScrollIndex?: number | {
@@ -31,7 +31,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
31
31
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
32
32
  ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
33
33
  ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
34
- maintainScrollAtEnd?: boolean;
34
+ maintainScrollAtEnd?: boolean | _legendapp_list.MaintainScrollAtEndOptions;
35
35
  maintainScrollAtEndThreshold?: number;
36
36
  maintainVisibleContentPosition?: boolean;
37
37
  numColumns?: number;
@@ -56,7 +56,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
56
56
  recycleItems?: boolean;
57
57
  refScrollView?: React.Ref<react_native.ScrollView>;
58
58
  refreshing?: boolean;
59
- renderItem?: React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
59
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T, string | undefined>) => React$1.ReactNode) | React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T, string | undefined>> | undefined;
60
60
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
61
61
  suggestEstimatedItemSize?: boolean;
62
62
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
@@ -65,6 +65,10 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
65
65
  onLoad?: (info: {
66
66
  elapsedTimeInMs: number;
67
67
  }) => void;
68
+ snapToIndices?: number[];
69
+ stickyIndices?: number[];
70
+ getItemType?: ((item: T, index: number) => string | undefined) | undefined;
71
+ getFixedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
68
72
  } & React$1.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode)>;
69
73
 
70
74
  export { AnimatedLegendList };
package/animated.d.ts CHANGED
@@ -14,7 +14,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
14
14
  width: number;
15
15
  };
16
16
  extraData?: any;
17
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
17
+ getEstimatedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
18
18
  initialContainerPoolRatio?: number | undefined;
19
19
  initialScrollOffset?: number;
20
20
  initialScrollIndex?: number | {
@@ -31,7 +31,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
31
31
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
32
32
  ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
33
33
  ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
34
- maintainScrollAtEnd?: boolean;
34
+ maintainScrollAtEnd?: boolean | _legendapp_list.MaintainScrollAtEndOptions;
35
35
  maintainScrollAtEndThreshold?: number;
36
36
  maintainVisibleContentPosition?: boolean;
37
37
  numColumns?: number;
@@ -56,7 +56,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
56
56
  recycleItems?: boolean;
57
57
  refScrollView?: React.Ref<react_native.ScrollView>;
58
58
  refreshing?: boolean;
59
- renderItem?: React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
59
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T, string | undefined>) => React$1.ReactNode) | React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T, string | undefined>> | undefined;
60
60
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
61
61
  suggestEstimatedItemSize?: boolean;
62
62
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
@@ -65,6 +65,10 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
65
65
  onLoad?: (info: {
66
66
  elapsedTimeInMs: number;
67
67
  }) => void;
68
+ snapToIndices?: number[];
69
+ stickyIndices?: number[];
70
+ getItemType?: ((item: T, index: number) => string | undefined) | undefined;
71
+ getFixedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
68
72
  } & React$1.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode)>;
69
73
 
70
74
  export { AnimatedLegendList };
package/animated.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var list = require('@legendapp/list');
4
3
  var reactNative = require('react-native');
4
+ var list = require('@legendapp/list');
5
5
 
6
- // src/animated.tsx
6
+ // src/integrations/animated.tsx
7
7
  var AnimatedLegendList = reactNative.Animated.createAnimatedComponent(list.LegendList);
8
8
 
9
9
  exports.AnimatedLegendList = AnimatedLegendList;
package/animated.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { LegendList } from '@legendapp/list';
2
1
  import { Animated } from 'react-native';
2
+ import { LegendList } from '@legendapp/list';
3
3
 
4
- // src/animated.tsx
4
+ // src/integrations/animated.tsx
5
5
  var AnimatedLegendList = Animated.createAnimatedComponent(LegendList);
6
6
 
7
7
  export { AnimatedLegendList };
package/index.d.mts CHANGED
@@ -1,11 +1,11 @@
1
+ import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
1
2
  import * as React$1 from 'react';
2
3
  import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
3
4
  import * as react_native from 'react-native';
4
- import { View, ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
5
- import Animated from 'react-native-reanimated';
6
- import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
5
+ import { View, Animated, ScrollView, StyleProp, ViewStyle, ScrollViewProps, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
6
+ import Animated$1 from 'react-native-reanimated';
7
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";
8
+ type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | `containerSticky${number}` | `containerStickyOffset${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize";
9
9
  interface StateContext {
10
10
  listeners: Map<ListenerType, Set<(value: any) => void>>;
11
11
  values: Map<ListenerType, any>;
@@ -15,6 +15,7 @@ interface StateContext {
15
15
  mapViewabilityAmountValues: Map<number, ViewAmountToken>;
16
16
  columnWrapperStyle: ColumnWrapperStyle | undefined;
17
17
  viewRefs: Map<number, React$1.RefObject<View>>;
18
+ animatedScrollY: Animated.Value;
18
19
  }
19
20
 
20
21
  declare class ScrollAdjustHandler {
@@ -26,7 +27,7 @@ declare class ScrollAdjustHandler {
26
27
  setMounted(): void;
27
28
  }
28
29
 
29
- type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
30
+ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Animated$1.ScrollView>, TItemType extends string | undefined = string | undefined> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
30
31
  /**
31
32
  * If true, aligns items at the end of the list.
32
33
  * @default false
@@ -68,7 +69,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
68
69
  * In case you have distinct item sizes, you can provide a function to get the size of an item.
69
70
  * Use instead of FlatList's getItemLayout or FlashList overrideItemLayout if you want to have accurate initialScrollOffset, you should provide this function
70
71
  */
71
- getEstimatedItemSize?: (index: number, item: ItemT) => number;
72
+ getEstimatedItemSize?: (index: number, item: ItemT, type: TItemType) => number;
72
73
  /**
73
74
  * Ratio of initial container pool size to data length (e.g., 0.5 for half).
74
75
  * @default 2
@@ -122,7 +123,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
122
123
  * If true, auto-scrolls to end when new items are added.
123
124
  * @default false
124
125
  */
125
- maintainScrollAtEnd?: boolean;
126
+ maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
126
127
  /**
127
128
  * Distance threshold in percentage of screen size to trigger maintainScrollAtEnd.
128
129
  * @default 0.1
@@ -204,7 +205,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
204
205
  * - A React component: React.ComponentType<LegendListRenderItemProps<ItemT>>
205
206
  * @required
206
207
  */
207
- renderItem?: ((props: LegendListRenderItemProps<ItemT>) => ReactNode) | React.ComponentType<LegendListRenderItemProps<ItemT>>;
208
+ renderItem?: ((props: LegendListRenderItemProps<ItemT, TItemType>) => ReactNode) | React.ComponentType<LegendListRenderItemProps<ItemT, TItemType>>;
208
209
  /**
209
210
  * Render custom ScrollView component.
210
211
  * @default (props) => <ScrollView {...props} />
@@ -232,19 +233,35 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
232
233
  onLoad?: (info: {
233
234
  elapsedTimeInMs: number;
234
235
  }) => void;
236
+ snapToIndices?: number[];
237
+ /**
238
+ * Array of child indices determining which children get docked to the top of the screen when scrolling.
239
+ * For example, passing stickyIndices={[0]} will cause the first child to be fixed to the top of the scroll view.
240
+ * Not supported in conjunction with horizontal={true}.
241
+ * @default undefined
242
+ */
243
+ stickyIndices?: number[];
244
+ getItemType?: (item: ItemT, index: number) => TItemType;
245
+ getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number;
235
246
  };
247
+ interface MaintainScrollAtEndOptions {
248
+ onLayout?: boolean;
249
+ onItemLayout?: boolean;
250
+ onDataChange?: boolean;
251
+ }
236
252
  interface ColumnWrapperStyle {
237
253
  rowGap?: number;
238
254
  gap?: number;
239
255
  columnGap?: number;
240
256
  }
241
- type LegendListProps<ItemT> = LegendListPropsBase<ItemT, Omit<ComponentProps<typeof ScrollView>, "scrollEventThrottle">>;
257
+ type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, Omit<ComponentProps<typeof ScrollView>, "scrollEventThrottle">>;
242
258
  interface InternalState {
243
259
  positions: Map<string, number>;
244
260
  columns: Map<string, number>;
245
261
  sizes: Map<string, number>;
246
262
  sizesKnown: Map<string, number>;
247
263
  containerItemKeys: Set<string>;
264
+ containerItemTypes: Map<number, string>;
248
265
  pendingAdjust: number;
249
266
  isStartReached: boolean;
250
267
  isEndReached: boolean;
@@ -309,48 +326,54 @@ interface InternalState {
309
326
  refScroller: React.RefObject<ScrollView>;
310
327
  loadStartTime: number;
311
328
  initialScroll: ScrollIndexWithOffsetPosition | undefined;
329
+ lastLayout: LayoutRectangle | undefined;
330
+ queuedItemSizeUpdates: {
331
+ itemKey: string;
332
+ sizeObj: {
333
+ width: number;
334
+ height: number;
335
+ };
336
+ }[];
337
+ queuedItemSizeUpdatesWaiting?: boolean;
338
+ timeoutSetPaddingTop?: any;
339
+ activeStickyIndex: number | undefined;
340
+ stickyContainers: Map<number, number>;
341
+ stickyContainerPool: Set<number>;
312
342
  props: {
313
343
  alignItemsAtEnd: boolean;
314
344
  data: readonly any[];
315
345
  estimatedItemSize: number | undefined;
316
- getEstimatedItemSize: ((index: number, item: any) => number) | undefined;
346
+ getEstimatedItemSize: LegendListProps["getEstimatedItemSize"];
347
+ getFixedItemSize: LegendListProps["getFixedItemSize"];
348
+ getItemType: LegendListProps["getItemType"];
317
349
  horizontal: boolean;
318
- keyExtractor: ((item: any, index: number) => string) | undefined;
319
- maintainScrollAtEnd: boolean;
350
+ keyExtractor: LegendListProps["keyExtractor"];
351
+ maintainScrollAtEnd: boolean | MaintainScrollAtEndOptions;
320
352
  maintainScrollAtEndThreshold: number | undefined;
321
353
  maintainVisibleContentPosition: boolean;
322
- onEndReached: (((info: {
323
- distanceFromEnd: number;
324
- }) => void) | null | undefined) | undefined;
354
+ onEndReached: LegendListProps["onEndReached"];
325
355
  onEndReachedThreshold: number | null | undefined;
326
- onItemSizeChanged: ((info: {
327
- size: number;
328
- previous: number;
329
- index: number;
330
- itemKey: string;
331
- itemData: any;
332
- }) => void) | undefined;
333
- onLoad: ((info: {
334
- elapsedTimeInMs: number;
335
- }) => void) | undefined;
336
- onScroll: ((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;
337
- onStartReached: (((info: {
338
- distanceFromStart: number;
339
- }) => void) | null | undefined) | undefined;
356
+ onItemSizeChanged: LegendListProps["onItemSizeChanged"];
357
+ onLoad: LegendListProps["onLoad"];
358
+ onScroll: LegendListProps["onScroll"];
359
+ onStartReached: LegendListProps["onStartReached"];
340
360
  onStartReachedThreshold: number | null | undefined;
361
+ recycleItems: boolean;
341
362
  suggestEstimatedItemSize: boolean;
342
363
  stylePaddingBottom: number | undefined;
343
- renderItem: ((props: LegendListRenderItemProps<any>) => ReactNode) | React.ComponentType<LegendListRenderItemProps<any>>;
364
+ renderItem: LegendListProps["renderItem"];
344
365
  initialScroll: {
345
366
  index: number;
346
367
  viewOffset?: number;
347
368
  viewPosition?: number;
348
369
  } | undefined;
349
370
  scrollBuffer: number;
350
- viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs | undefined;
351
371
  numColumns: number;
352
372
  initialContainerPoolRatio: number;
353
373
  stylePaddingTop: number | undefined;
374
+ snapToIndices: number[] | undefined;
375
+ stickyIndicesSet: Set<number>;
376
+ stickyIndicesArr: number[];
354
377
  };
355
378
  }
356
379
  interface ViewableRange<T> {
@@ -360,8 +383,9 @@ interface ViewableRange<T> {
360
383
  end: number;
361
384
  items: T[];
362
385
  }
363
- interface LegendListRenderItemProps<ItemT> {
386
+ interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
364
387
  item: ItemT;
388
+ type: TItemType;
365
389
  index: number;
366
390
  extraData: any;
367
391
  }
@@ -371,6 +395,7 @@ type ScrollState = {
371
395
  endBuffered: number;
372
396
  isAtEnd: boolean;
373
397
  isAtStart: boolean;
398
+ positions: Map<string, number>;
374
399
  scroll: number;
375
400
  scrollLength: number;
376
401
  start: number;
@@ -423,9 +448,11 @@ type LegendListRef = {
423
448
  * Scrolls to the end of the list.
424
449
  * @param options - Options for scrolling.
425
450
  * @param options.animated - If true, animates the scroll. Default: true.
451
+ * @param options.viewOffset - Offset from the target position.
426
452
  */
427
453
  scrollToEnd(options?: {
428
454
  animated?: boolean | undefined;
455
+ viewOffset?: number | undefined;
429
456
  }): void;
430
457
  /**
431
458
  * Scrolls to a specific index in the list.
@@ -534,7 +561,7 @@ interface LegendListRecyclingState<T> {
534
561
  }
535
562
  type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode) => (props: P & React.RefAttributes<T>) => React.ReactNode;
536
563
  declare const typedForwardRef: TypedForwardRef;
537
- type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean) => T & {
564
+ type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.JSXElementConstructor<T>>, nextProps: Readonly<React.JSXElementConstructor<T>>) => boolean) => T & {
538
565
  displayName?: string;
539
566
  };
540
567
  declare const typedMemo: TypedMemo;
@@ -550,7 +577,11 @@ type GetRenderedItemResult<ItemT> = {
550
577
  };
551
578
  type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
552
579
 
553
- declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
580
+ interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
581
+ children?: React$1.ReactNode | undefined;
582
+ LegendList?: ListT;
583
+ }
584
+ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
554
585
  alignItemsAtEnd?: boolean;
555
586
  columnWrapperStyle?: ColumnWrapperStyle;
556
587
  data: readonly T[];
@@ -561,7 +592,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
561
592
  width: number;
562
593
  };
563
594
  extraData?: any;
564
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
595
+ getEstimatedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
565
596
  initialContainerPoolRatio?: number | undefined;
566
597
  initialScrollOffset?: number;
567
598
  initialScrollIndex?: number | {
@@ -578,7 +609,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
578
609
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
579
610
  ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
580
611
  ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
581
- maintainScrollAtEnd?: boolean;
612
+ maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
582
613
  maintainScrollAtEndThreshold?: number;
583
614
  maintainVisibleContentPosition?: boolean;
584
615
  numColumns?: number;
@@ -601,9 +632,9 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
601
632
  onViewableItemsChanged?: OnViewableItemsChanged | undefined;
602
633
  progressViewOffset?: number;
603
634
  recycleItems?: boolean;
604
- refScrollView?: React$1.Ref<ScrollView>;
635
+ refScrollView?: React$1.Ref<react_native.ScrollView>;
605
636
  refreshing?: boolean;
606
- renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
637
+ renderItem?: ((props: LegendListRenderItemProps<T, string | undefined>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T, string | undefined>> | undefined;
607
638
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
608
639
  suggestEstimatedItemSize?: boolean;
609
640
  viewabilityConfig?: ViewabilityConfig;
@@ -612,13 +643,11 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
612
643
  onLoad?: (info: {
613
644
  elapsedTimeInMs: number;
614
645
  }) => void;
615
- } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
616
-
617
- interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
618
- children?: React$1.ReactNode | undefined;
619
- LegendList?: ListT;
620
- }
621
- declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
646
+ snapToIndices?: number[];
647
+ stickyIndices?: number[];
648
+ getItemType?: ((item: T, index: number) => string | undefined) | undefined;
649
+ getFixedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
650
+ } & 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"> & {
622
651
  alignItemsAtEnd?: boolean;
623
652
  columnWrapperStyle?: ColumnWrapperStyle;
624
653
  data: readonly T[];
@@ -629,7 +658,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
629
658
  width: number;
630
659
  };
631
660
  extraData?: any;
632
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
661
+ getEstimatedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
633
662
  initialContainerPoolRatio?: number | undefined;
634
663
  initialScrollOffset?: number;
635
664
  initialScrollIndex?: number | {
@@ -646,7 +675,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
646
675
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
647
676
  ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
648
677
  ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
649
- maintainScrollAtEnd?: boolean;
678
+ maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
650
679
  maintainScrollAtEndThreshold?: number;
651
680
  maintainVisibleContentPosition?: boolean;
652
681
  numColumns?: number;
@@ -671,7 +700,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
671
700
  recycleItems?: boolean;
672
701
  refScrollView?: React$1.Ref<react_native.ScrollView>;
673
702
  refreshing?: boolean;
674
- renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
703
+ renderItem?: ((props: LegendListRenderItemProps<T, string | undefined>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T, string | undefined>> | undefined;
675
704
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
676
705
  suggestEstimatedItemSize?: boolean;
677
706
  viewabilityConfig?: ViewabilityConfig;
@@ -680,7 +709,13 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
680
709
  onLoad?: (info: {
681
710
  elapsedTimeInMs: number;
682
711
  }) => void;
683
- } & 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"> & {
712
+ snapToIndices?: number[];
713
+ stickyIndices?: number[];
714
+ getItemType?: ((item: T, index: number) => string | undefined) | undefined;
715
+ getFixedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
716
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
717
+ ref?: React$1.Ref<LegendListRef>;
718
+ }) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
684
719
  alignItemsAtEnd?: boolean;
685
720
  columnWrapperStyle?: ColumnWrapperStyle;
686
721
  data: readonly T[];
@@ -691,7 +726,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
691
726
  width: number;
692
727
  };
693
728
  extraData?: any;
694
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
729
+ getEstimatedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
695
730
  initialContainerPoolRatio?: number | undefined;
696
731
  initialScrollOffset?: number;
697
732
  initialScrollIndex?: number | {
@@ -708,7 +743,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
708
743
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
709
744
  ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
710
745
  ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
711
- maintainScrollAtEnd?: boolean;
746
+ maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
712
747
  maintainScrollAtEndThreshold?: number;
713
748
  maintainVisibleContentPosition?: boolean;
714
749
  numColumns?: number;
@@ -733,7 +768,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
733
768
  recycleItems?: boolean;
734
769
  refScrollView?: React$1.Ref<react_native.ScrollView>;
735
770
  refreshing?: boolean;
736
- renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
771
+ renderItem?: ((props: LegendListRenderItemProps<T, string | undefined>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T, string | undefined>> | undefined;
737
772
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
738
773
  suggestEstimatedItemSize?: boolean;
739
774
  viewabilityConfig?: ViewabilityConfig;
@@ -742,9 +777,13 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
742
777
  onLoad?: (info: {
743
778
  elapsedTimeInMs: number;
744
779
  }) => void;
745
- } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
746
- ref?: React$1.Ref<LegendListRef>;
747
- }) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
780
+ snapToIndices?: number[];
781
+ stickyIndices?: number[];
782
+ getItemType?: ((item: T, index: number) => string | undefined) | undefined;
783
+ getFixedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
784
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
785
+
786
+ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
748
787
  alignItemsAtEnd?: boolean;
749
788
  columnWrapperStyle?: ColumnWrapperStyle;
750
789
  data: readonly T[];
@@ -755,7 +794,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
755
794
  width: number;
756
795
  };
757
796
  extraData?: any;
758
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
797
+ getEstimatedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
759
798
  initialContainerPoolRatio?: number | undefined;
760
799
  initialScrollOffset?: number;
761
800
  initialScrollIndex?: number | {
@@ -772,7 +811,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
772
811
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
773
812
  ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
774
813
  ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
775
- maintainScrollAtEnd?: boolean;
814
+ maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
776
815
  maintainScrollAtEndThreshold?: number;
777
816
  maintainVisibleContentPosition?: boolean;
778
817
  numColumns?: number;
@@ -795,9 +834,9 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
795
834
  onViewableItemsChanged?: OnViewableItemsChanged | undefined;
796
835
  progressViewOffset?: number;
797
836
  recycleItems?: boolean;
798
- refScrollView?: React$1.Ref<react_native.ScrollView>;
837
+ refScrollView?: React$1.Ref<ScrollView>;
799
838
  refreshing?: boolean;
800
- renderItem?: React$1.ComponentType<LegendListRenderItemProps<T>> | ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | undefined;
839
+ renderItem?: ((props: LegendListRenderItemProps<T, string | undefined>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T, string | undefined>> | undefined;
801
840
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
802
841
  suggestEstimatedItemSize?: boolean;
803
842
  viewabilityConfig?: ViewabilityConfig;
@@ -806,7 +845,11 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
806
845
  onLoad?: (info: {
807
846
  elapsedTimeInMs: number;
808
847
  }) => void;
809
- } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
848
+ snapToIndices?: number[];
849
+ stickyIndices?: number[];
850
+ getItemType?: ((item: T, index: number) => string | undefined) | undefined;
851
+ getFixedItemSize?: ((index: number, item: T, type: string | undefined) => number) | undefined;
852
+ } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
810
853
 
811
854
  declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
812
855
  declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
@@ -818,4 +861,4 @@ declare function useListScrollSize(): {
818
861
  height: number;
819
862
  };
820
863
 
821
- 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 };
864
+ export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, 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 };