@legendapp/list 3.0.0-beta.53 → 3.0.0-beta.54

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.
@@ -183,7 +183,10 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
183
183
  */
184
184
  extraData?: any;
185
185
  /**
186
- * In case you have distinct item sizes, you can provide a function to get the size of an item.
186
+ * Optional per-item size estimate used before a row is measured.
187
+ *
188
+ * @deprecated Prefer a single `estimatedItemSize` for initial size hints, or `getFixedItemSize`
189
+ * when item sizes are known exactly.
187
190
  */
188
191
  getEstimatedItemSize?: (item: ItemT, index: number, type: TItemType) => number;
189
192
  /**
@@ -201,8 +204,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
201
204
  leadingItem: ItemT;
202
205
  }>;
203
206
  /**
204
- * Ratio of initial container pool size to data length (e.g., 0.5 for half).
205
- * @default 2
207
+ * Ratio used to size the initial recycled container pool.
208
+ * @deprecated The list now manages spare container capacity automatically.
209
+ * @default 3
206
210
  */
207
211
  initialContainerPoolRatio?: number | undefined;
208
212
  /**
@@ -383,12 +387,6 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
383
387
  * Array of item indices to use as snap points.
384
388
  */
385
389
  snapToIndices?: number[];
386
- /**
387
- * This will log a suggested estimatedItemSize.
388
- * @required
389
- * @default false
390
- */
391
- suggestEstimatedItemSize?: boolean;
392
390
  /**
393
391
  * Configuration for determining item viewability.
394
392
  */
@@ -477,6 +475,10 @@ interface LegendListMetrics {
477
475
  headerSize: number;
478
476
  footerSize: number;
479
477
  }
478
+ interface LegendListAverageItemSize {
479
+ average: number;
480
+ count: number;
481
+ }
480
482
  interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
481
483
  data: readonly ItemT[];
482
484
  extraData: any;
@@ -498,6 +500,7 @@ type LegendListState$1 = {
498
500
  isEndReached: boolean;
499
501
  isStartReached: boolean;
500
502
  isWithinMaintainScrollAtEndThreshold: boolean;
503
+ getAverageItemSizes: () => Record<string, LegendListAverageItemSize>;
501
504
  listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
502
505
  listenToPosition: (key: string, callback: (value: number) => void) => () => void;
503
506
  positionAtIndex: (index: number) => number;
@@ -777,4 +780,4 @@ declare function useSyncLayout(): () => void;
777
780
 
778
781
  declare const LegendList: LegendListComponent;
779
782
 
780
- 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 };
783
+ export { type AlwaysRenderConfig, type AnchoredEndSpaceConfig, type ColumnWrapperStyle, type InitialScrollAnchor, type Insets, type LayoutRectangle, LegendList, type LegendListAverageItemSize, 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 };