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

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/react.d.ts CHANGED
@@ -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
  /**
@@ -253,6 +257,13 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
253
257
  * Style for the header component.
254
258
  */
255
259
  ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
260
+ /**
261
+ * Estimated height of the ListHeaderComponent. Provide this when the expected header height
262
+ * is known before layout so that only the items actually visible below the header are rendered
263
+ * on the initial frame, rather than a full screen's worth of items that are hidden behind it.
264
+ * The measured header size still replaces this value after layout.
265
+ */
266
+ estimatedHeaderSize?: number;
256
267
  /**
257
268
  * If true, auto-scrolls to end when new items are added.
258
269
  * Use an options object to opt into specific triggers and control whether that scroll is animated.
@@ -287,6 +298,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
287
298
  * @default 1
288
299
  */
289
300
  numColumns?: number;
301
+ /**
302
+ * Force RTL mode for this list instance.
303
+ * When undefined, uses React Native's global I18nManager.isRTL.
304
+ * @default undefined
305
+ */
306
+ rtl?: boolean;
290
307
  /**
291
308
  * Called when scrolling reaches the end within onEndReachedThreshold.
292
309
  */
@@ -383,12 +400,6 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
383
400
  * Array of item indices to use as snap points.
384
401
  */
385
402
  snapToIndices?: number[];
386
- /**
387
- * This will log a suggested estimatedItemSize.
388
- * @required
389
- * @default false
390
- */
391
- suggestEstimatedItemSize?: boolean;
392
403
  /**
393
404
  * Configuration for determining item viewability.
394
405
  */
@@ -477,6 +488,10 @@ interface LegendListMetrics {
477
488
  headerSize: number;
478
489
  footerSize: number;
479
490
  }
491
+ interface LegendListAverageItemSize {
492
+ average: number;
493
+ count: number;
494
+ }
480
495
  interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
481
496
  data: readonly ItemT[];
482
497
  extraData: any;
@@ -498,6 +513,7 @@ type LegendListState$1 = {
498
513
  isEndReached: boolean;
499
514
  isStartReached: boolean;
500
515
  isWithinMaintainScrollAtEndThreshold: boolean;
516
+ getAverageItemSizes: () => Record<string, LegendListAverageItemSize>;
501
517
  listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
502
518
  listenToPosition: (key: string, callback: (value: number) => void) => () => void;
503
519
  positionAtIndex: (index: number) => number;
@@ -777,4 +793,4 @@ declare function useSyncLayout(): () => void;
777
793
 
778
794
  declare const LegendList: LegendListComponent;
779
795
 
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 };
796
+ 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 };