@legendapp/list 1.0.16 → 1.0.18

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/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.0.18
2
+ - Feat: Add a useListScrollSize hook
3
+ - Fix: Support renderItem being a function component
4
+ - Fix: scrollToEnd being incorrect by the amount of the bottom padding
5
+
6
+ ## 1.0.17
7
+ - Fix: initialScrollIndex not taking header component size into account
8
+ - Fix: PaddingAndAdjust for ListHeaderComponent
9
+ - Fix: ignore alignItemsAtEnd when the list is empty
10
+
1
11
  ## 1.0.16
2
12
  - Fix: isAtEnd was going to false when overscrolling
3
13
  - Fix: refreshControl not being top padded correctly
package/index.d.mts CHANGED
@@ -260,6 +260,7 @@ interface InternalState {
260
260
  maintainingScrollAtEnd?: boolean;
261
261
  totalSize: number;
262
262
  totalSizeBelowAnchor: number;
263
+ otherAxisSize?: number;
263
264
  timeouts: Set<number>;
264
265
  timeoutSizeMessage: any;
265
266
  nativeMarginTop: number;
@@ -298,6 +299,7 @@ interface InternalState {
298
299
  avg: number;
299
300
  }>;
300
301
  onScroll: ((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;
302
+ stylePaddingBottom?: number;
301
303
  }
302
304
  interface ViewableRange<T> {
303
305
  startBuffered: number;
@@ -538,5 +540,9 @@ declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void
538
540
  declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
539
541
  declare function useRecyclingState<ItemT>(valueOrFun: ((info: LegendListRecyclingState<ItemT>) => ItemT) | ItemT): readonly [ItemT | null, Dispatch<SetStateAction<ItemT>>];
540
542
  declare function useIsLastItem(): boolean;
543
+ declare function useListScrollSize(): {
544
+ width: number;
545
+ height: number;
546
+ };
541
547
 
542
- export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, 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, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
548
+ export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, 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
@@ -260,6 +260,7 @@ interface InternalState {
260
260
  maintainingScrollAtEnd?: boolean;
261
261
  totalSize: number;
262
262
  totalSizeBelowAnchor: number;
263
+ otherAxisSize?: number;
263
264
  timeouts: Set<number>;
264
265
  timeoutSizeMessage: any;
265
266
  nativeMarginTop: number;
@@ -298,6 +299,7 @@ interface InternalState {
298
299
  avg: number;
299
300
  }>;
300
301
  onScroll: ((event: NativeSyntheticEvent<NativeScrollEvent>) => void) | undefined;
302
+ stylePaddingBottom?: number;
301
303
  }
302
304
  interface ViewableRange<T> {
303
305
  startBuffered: number;
@@ -538,5 +540,9 @@ declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void
538
540
  declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
539
541
  declare function useRecyclingState<ItemT>(valueOrFun: ((info: LegendListRecyclingState<ItemT>) => ItemT) | ItemT): readonly [ItemT | null, Dispatch<SetStateAction<ItemT>>];
540
542
  declare function useIsLastItem(): boolean;
543
+ declare function useListScrollSize(): {
544
+ width: number;
545
+ height: number;
546
+ };
541
547
 
542
- export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, 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, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
548
+ export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, 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.js CHANGED
@@ -209,12 +209,12 @@ function comparatorByDistance(a, b) {
209
209
  function comparatorDefault(a, b) {
210
210
  return a - b;
211
211
  }
212
- function getPadding(s) {
212
+ function getPadding(s, type) {
213
213
  var _a, _b, _c;
214
- return (_c = (_b = (_a = s.paddingTop) != null ? _a : s.paddingVertical) != null ? _b : s.padding) != null ? _c : 0;
214
+ return (_c = (_b = (_a = s[`padding${type}`]) != null ? _a : s.paddingVertical) != null ? _b : s.padding) != null ? _c : 0;
215
215
  }
216
- function extractPaddingTop(style, contentContainerStyle) {
217
- return getPadding(style) + getPadding(contentContainerStyle);
216
+ function extractPadding(style, contentContainerStyle, type) {
217
+ return getPadding(style, type) + getPadding(contentContainerStyle, type);
218
218
  }
219
219
  var symbolFirst = Symbol();
220
220
  function useInit(cb) {
@@ -316,6 +316,10 @@ function useIsLastItem() {
316
316
  const isLast = useSelector$("lastItemKeys", (lastItemKeys) => (lastItemKeys == null ? void 0 : lastItemKeys.includes(itemKey)) || false);
317
317
  return isLast;
318
318
  }
319
+ function useListScrollSize() {
320
+ const [scrollSize] = useArr$(["scrollSize"]);
321
+ return scrollSize;
322
+ }
319
323
  var LeanViewComponent = React2__namespace.forwardRef((props, ref) => {
320
324
  return React2__namespace.createElement("RCTView", { ...props, ref });
321
325
  });
@@ -691,7 +695,7 @@ var ListComponent = typedMemo(function ListComponent2({
691
695
  contentOffset: initialContentOffset ? horizontal ? { x: initialContentOffset, y: 0 } : { x: 0, y: initialContentOffset } : void 0,
692
696
  ref: refScrollView
693
697
  },
694
- !ListEmptyComponent && (ENABLE_DEVMODE ? /* @__PURE__ */ React2__namespace.createElement(PaddingAndAdjustDevMode, null) : /* @__PURE__ */ React2__namespace.createElement(PaddingAndAdjust, null)),
698
+ ENABLE_DEVMODE ? /* @__PURE__ */ React2__namespace.createElement(PaddingAndAdjustDevMode, null) : /* @__PURE__ */ React2__namespace.createElement(PaddingAndAdjust, null),
695
699
  ListHeaderComponent && /* @__PURE__ */ React2__namespace.createElement(
696
700
  ListHeaderComponentContainer,
697
701
  {
@@ -1021,6 +1025,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1021
1025
  estimatedItemSize: estimatedItemSizeProp,
1022
1026
  getEstimatedItemSize,
1023
1027
  suggestEstimatedItemSize,
1028
+ ListHeaderComponent,
1024
1029
  ListEmptyComponent,
1025
1030
  onItemSizeChanged,
1026
1031
  refScrollView,
@@ -1048,7 +1053,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1048
1053
  callbacks.current.onEndReached = rest.onEndReached;
1049
1054
  const contentContainerStyle = { ...reactNative.StyleSheet.flatten(contentContainerStyleProp) };
1050
1055
  const style = { ...reactNative.StyleSheet.flatten(styleProp) };
1051
- const stylePaddingTopState = extractPaddingTop(style, contentContainerStyle);
1056
+ const stylePaddingTopState = extractPadding(style, contentContainerStyle, "Top");
1057
+ const stylePaddingBottomState = extractPadding(style, contentContainerStyle, "Bottom");
1052
1058
  if (style == null ? void 0 : style.paddingTop) {
1053
1059
  style.paddingTop = void 0;
1054
1060
  }
@@ -1732,10 +1738,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1732
1738
  };
1733
1739
  const updateAlignItemsPaddingTop = () => {
1734
1740
  if (alignItemsAtEnd) {
1735
- const { scrollLength } = refState.current;
1736
- const contentSize = getContentSize(ctx);
1737
- const paddingTop = Math.max(0, Math.floor(scrollLength - contentSize));
1738
- setPaddingTop({ alignItemsPaddingTop: paddingTop });
1741
+ const { data, scrollLength } = refState.current;
1742
+ let alignItemsPaddingTop = 0;
1743
+ if ((data == null ? void 0 : data.length) > 0) {
1744
+ const contentSize = getContentSize(ctx);
1745
+ alignItemsPaddingTop = Math.max(0, Math.floor(scrollLength - contentSize));
1746
+ }
1747
+ setPaddingTop({ alignItemsPaddingTop });
1739
1748
  }
1740
1749
  };
1741
1750
  const finishScrollTo = () => {
@@ -2063,6 +2072,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2063
2072
  set$(ctx, "numColumns", numColumnsProp);
2064
2073
  const prevPaddingTop = peek$(ctx, "stylePaddingTop");
2065
2074
  setPaddingTop({ stylePaddingTop: stylePaddingTopState });
2075
+ refState.current.stylePaddingBottom = stylePaddingBottomState;
2066
2076
  const paddingDiff = stylePaddingTopState - prevPaddingTop;
2067
2077
  if (paddingDiff && prevPaddingTop !== void 0 && reactNative.Platform.OS === "ios") {
2068
2078
  queueMicrotask(() => {
@@ -2086,6 +2096,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2086
2096
  refState.current.previousTotalSize = peek$(ctx, "totalSize");
2087
2097
  calcTotalSizesAndPositions({ forgetPositions: false });
2088
2098
  }
2099
+ React2.useEffect(() => {
2100
+ if (initialScrollIndex && ListHeaderComponent) {
2101
+ const dispose = listen$(ctx, "headerSize", (size) => {
2102
+ if (size > 0) {
2103
+ scrollToIndex({ index: initialScrollIndex, animated: false });
2104
+ dispose == null ? void 0 : dispose();
2105
+ }
2106
+ });
2107
+ setTimeout(dispose, 0);
2108
+ return dispose;
2109
+ }
2110
+ }, []);
2089
2111
  React2.useEffect(() => {
2090
2112
  const didAllocateContainers = doInitialAllocateContainers();
2091
2113
  if (!didAllocateContainers) {
@@ -2099,7 +2121,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2099
2121
  set$(ctx, "extraData", extraData);
2100
2122
  }, [extraData]);
2101
2123
  refState.current.renderItem = renderItem;
2102
- React2.useEffect(initalizeStateVars, [memoizedLastItemKeys.join(","), numColumnsProp, stylePaddingTopState]);
2124
+ React2.useEffect(initalizeStateVars, [
2125
+ memoizedLastItemKeys.join(","),
2126
+ numColumnsProp,
2127
+ stylePaddingTopState,
2128
+ stylePaddingBottomState
2129
+ ]);
2103
2130
  const getRenderedItem = React2.useCallback((key) => {
2104
2131
  const state = refState.current;
2105
2132
  if (!state) {
@@ -2118,7 +2145,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2118
2145
  index,
2119
2146
  extraData: peek$(ctx, "extraData")
2120
2147
  };
2121
- renderedItem = isFunction(renderItemProp) ? renderItemProp(itemProps) : React2__namespace.createElement(renderItemProp, itemProps);
2148
+ renderedItem = React2__namespace.createElement(renderItemProp, itemProps);
2122
2149
  }
2123
2150
  return { index, item: data[index], renderedItem };
2124
2151
  }, []);
@@ -2285,10 +2312,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2285
2312
  },
2286
2313
  []
2287
2314
  );
2288
- const handleLayout = React2.useCallback((scrollLength) => {
2315
+ const handleLayout = React2.useCallback((size) => {
2316
+ const scrollLength = size[horizontal ? "width" : "height"];
2317
+ const otherAxisSize = size[horizontal ? "height" : "width"];
2289
2318
  const state = refState.current;
2290
2319
  const didChange = scrollLength !== state.scrollLength;
2320
+ const prevOtherAxisSize = state.otherAxisSize;
2291
2321
  state.scrollLength = scrollLength;
2322
+ state.otherAxisSize = otherAxisSize;
2292
2323
  state.lastBatchingAction = Date.now();
2293
2324
  state.scrollForNextCalculateItemsInView = void 0;
2294
2325
  doInitialAllocateContainers();
@@ -2299,11 +2330,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2299
2330
  if (didChange) {
2300
2331
  calculateItemsInView();
2301
2332
  }
2302
- }, []);
2303
- const onLayout = React2.useCallback((event) => {
2304
- const scrollLength = event.nativeEvent.layout[horizontal ? "width" : "height"];
2305
- handleLayout(scrollLength);
2306
- const otherAxisSize = event.nativeEvent.layout[horizontal ? "height" : "width"];
2333
+ if (didChange || otherAxisSize !== prevOtherAxisSize) {
2334
+ set$(ctx, "scrollSize", { width: size.width, height: size.height });
2335
+ }
2307
2336
  if (refState.current) {
2308
2337
  refState.current.needsOtherAxisSize = otherAxisSize - (stylePaddingTopState || 0) < 10;
2309
2338
  }
@@ -2313,6 +2342,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2313
2342
  `List ${horizontal ? "width" : "height"} is 0. You may need to set a style or \`flex: \` for the list, because children are absolutely positioned.`
2314
2343
  );
2315
2344
  }
2345
+ }, []);
2346
+ const onLayout = React2.useCallback((event) => {
2347
+ const layout = event.nativeEvent.layout;
2348
+ handleLayout(layout);
2349
+ layout[horizontal ? "width" : "height"];
2350
+ layout[horizontal ? "height" : "width"];
2316
2351
  if (onLayoutProp) {
2317
2352
  onLayoutProp(event);
2318
2353
  }
@@ -2324,7 +2359,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2324
2359
  if (measured) {
2325
2360
  const size = Math.floor(measured[horizontal ? "width" : "height"] * 8) / 8;
2326
2361
  if (size) {
2327
- handleLayout(size);
2362
+ handleLayout(measured);
2328
2363
  }
2329
2364
  }
2330
2365
  }, []);
@@ -2454,10 +2489,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2454
2489
  },
2455
2490
  scrollToOffset: (params) => scrollTo(params),
2456
2491
  scrollToEnd: (options) => {
2457
- const { data } = refState.current;
2492
+ const { data, stylePaddingBottom } = refState.current;
2458
2493
  const index = data.length - 1;
2459
2494
  if (index !== -1) {
2460
- scrollToIndex({ index, ...options });
2495
+ const paddingBottom = stylePaddingBottom || 0;
2496
+ scrollToIndex({ index, viewOffset: -paddingBottom, ...options });
2461
2497
  }
2462
2498
  }
2463
2499
  };
@@ -2513,6 +2549,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2513
2549
  recycleItems,
2514
2550
  alignItemsAtEnd,
2515
2551
  ListEmptyComponent: dataProp.length === 0 ? ListEmptyComponent : void 0,
2552
+ ListHeaderComponent,
2516
2553
  maintainVisibleContentPosition,
2517
2554
  scrollEventThrottle: reactNative.Platform.OS === "web" ? 16 : void 0,
2518
2555
  waitForInitialLayout,
@@ -2534,6 +2571,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2534
2571
 
2535
2572
  exports.LegendList = LegendList;
2536
2573
  exports.useIsLastItem = useIsLastItem;
2574
+ exports.useListScrollSize = useListScrollSize;
2537
2575
  exports.useRecyclingEffect = useRecyclingEffect;
2538
2576
  exports.useRecyclingState = useRecyclingState;
2539
2577
  exports.useViewability = useViewability;
package/index.mjs CHANGED
@@ -188,12 +188,12 @@ function comparatorByDistance(a, b) {
188
188
  function comparatorDefault(a, b) {
189
189
  return a - b;
190
190
  }
191
- function getPadding(s) {
191
+ function getPadding(s, type) {
192
192
  var _a, _b, _c;
193
- return (_c = (_b = (_a = s.paddingTop) != null ? _a : s.paddingVertical) != null ? _b : s.padding) != null ? _c : 0;
193
+ return (_c = (_b = (_a = s[`padding${type}`]) != null ? _a : s.paddingVertical) != null ? _b : s.padding) != null ? _c : 0;
194
194
  }
195
- function extractPaddingTop(style, contentContainerStyle) {
196
- return getPadding(style) + getPadding(contentContainerStyle);
195
+ function extractPadding(style, contentContainerStyle, type) {
196
+ return getPadding(style, type) + getPadding(contentContainerStyle, type);
197
197
  }
198
198
  var symbolFirst = Symbol();
199
199
  function useInit(cb) {
@@ -295,6 +295,10 @@ function useIsLastItem() {
295
295
  const isLast = useSelector$("lastItemKeys", (lastItemKeys) => (lastItemKeys == null ? void 0 : lastItemKeys.includes(itemKey)) || false);
296
296
  return isLast;
297
297
  }
298
+ function useListScrollSize() {
299
+ const [scrollSize] = useArr$(["scrollSize"]);
300
+ return scrollSize;
301
+ }
298
302
  var LeanViewComponent = React2.forwardRef((props, ref) => {
299
303
  return React2.createElement("RCTView", { ...props, ref });
300
304
  });
@@ -670,7 +674,7 @@ var ListComponent = typedMemo(function ListComponent2({
670
674
  contentOffset: initialContentOffset ? horizontal ? { x: initialContentOffset, y: 0 } : { x: 0, y: initialContentOffset } : void 0,
671
675
  ref: refScrollView
672
676
  },
673
- !ListEmptyComponent && (ENABLE_DEVMODE ? /* @__PURE__ */ React2.createElement(PaddingAndAdjustDevMode, null) : /* @__PURE__ */ React2.createElement(PaddingAndAdjust, null)),
677
+ ENABLE_DEVMODE ? /* @__PURE__ */ React2.createElement(PaddingAndAdjustDevMode, null) : /* @__PURE__ */ React2.createElement(PaddingAndAdjust, null),
674
678
  ListHeaderComponent && /* @__PURE__ */ React2.createElement(
675
679
  ListHeaderComponentContainer,
676
680
  {
@@ -1000,6 +1004,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1000
1004
  estimatedItemSize: estimatedItemSizeProp,
1001
1005
  getEstimatedItemSize,
1002
1006
  suggestEstimatedItemSize,
1007
+ ListHeaderComponent,
1003
1008
  ListEmptyComponent,
1004
1009
  onItemSizeChanged,
1005
1010
  refScrollView,
@@ -1027,7 +1032,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1027
1032
  callbacks.current.onEndReached = rest.onEndReached;
1028
1033
  const contentContainerStyle = { ...StyleSheet.flatten(contentContainerStyleProp) };
1029
1034
  const style = { ...StyleSheet.flatten(styleProp) };
1030
- const stylePaddingTopState = extractPaddingTop(style, contentContainerStyle);
1035
+ const stylePaddingTopState = extractPadding(style, contentContainerStyle, "Top");
1036
+ const stylePaddingBottomState = extractPadding(style, contentContainerStyle, "Bottom");
1031
1037
  if (style == null ? void 0 : style.paddingTop) {
1032
1038
  style.paddingTop = void 0;
1033
1039
  }
@@ -1711,10 +1717,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1711
1717
  };
1712
1718
  const updateAlignItemsPaddingTop = () => {
1713
1719
  if (alignItemsAtEnd) {
1714
- const { scrollLength } = refState.current;
1715
- const contentSize = getContentSize(ctx);
1716
- const paddingTop = Math.max(0, Math.floor(scrollLength - contentSize));
1717
- setPaddingTop({ alignItemsPaddingTop: paddingTop });
1720
+ const { data, scrollLength } = refState.current;
1721
+ let alignItemsPaddingTop = 0;
1722
+ if ((data == null ? void 0 : data.length) > 0) {
1723
+ const contentSize = getContentSize(ctx);
1724
+ alignItemsPaddingTop = Math.max(0, Math.floor(scrollLength - contentSize));
1725
+ }
1726
+ setPaddingTop({ alignItemsPaddingTop });
1718
1727
  }
1719
1728
  };
1720
1729
  const finishScrollTo = () => {
@@ -2042,6 +2051,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2042
2051
  set$(ctx, "numColumns", numColumnsProp);
2043
2052
  const prevPaddingTop = peek$(ctx, "stylePaddingTop");
2044
2053
  setPaddingTop({ stylePaddingTop: stylePaddingTopState });
2054
+ refState.current.stylePaddingBottom = stylePaddingBottomState;
2045
2055
  const paddingDiff = stylePaddingTopState - prevPaddingTop;
2046
2056
  if (paddingDiff && prevPaddingTop !== void 0 && Platform.OS === "ios") {
2047
2057
  queueMicrotask(() => {
@@ -2065,6 +2075,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2065
2075
  refState.current.previousTotalSize = peek$(ctx, "totalSize");
2066
2076
  calcTotalSizesAndPositions({ forgetPositions: false });
2067
2077
  }
2078
+ useEffect(() => {
2079
+ if (initialScrollIndex && ListHeaderComponent) {
2080
+ const dispose = listen$(ctx, "headerSize", (size) => {
2081
+ if (size > 0) {
2082
+ scrollToIndex({ index: initialScrollIndex, animated: false });
2083
+ dispose == null ? void 0 : dispose();
2084
+ }
2085
+ });
2086
+ setTimeout(dispose, 0);
2087
+ return dispose;
2088
+ }
2089
+ }, []);
2068
2090
  useEffect(() => {
2069
2091
  const didAllocateContainers = doInitialAllocateContainers();
2070
2092
  if (!didAllocateContainers) {
@@ -2078,7 +2100,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2078
2100
  set$(ctx, "extraData", extraData);
2079
2101
  }, [extraData]);
2080
2102
  refState.current.renderItem = renderItem;
2081
- useEffect(initalizeStateVars, [memoizedLastItemKeys.join(","), numColumnsProp, stylePaddingTopState]);
2103
+ useEffect(initalizeStateVars, [
2104
+ memoizedLastItemKeys.join(","),
2105
+ numColumnsProp,
2106
+ stylePaddingTopState,
2107
+ stylePaddingBottomState
2108
+ ]);
2082
2109
  const getRenderedItem = useCallback((key) => {
2083
2110
  const state = refState.current;
2084
2111
  if (!state) {
@@ -2097,7 +2124,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2097
2124
  index,
2098
2125
  extraData: peek$(ctx, "extraData")
2099
2126
  };
2100
- renderedItem = isFunction(renderItemProp) ? renderItemProp(itemProps) : React2.createElement(renderItemProp, itemProps);
2127
+ renderedItem = React2.createElement(renderItemProp, itemProps);
2101
2128
  }
2102
2129
  return { index, item: data[index], renderedItem };
2103
2130
  }, []);
@@ -2264,10 +2291,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2264
2291
  },
2265
2292
  []
2266
2293
  );
2267
- const handleLayout = useCallback((scrollLength) => {
2294
+ const handleLayout = useCallback((size) => {
2295
+ const scrollLength = size[horizontal ? "width" : "height"];
2296
+ const otherAxisSize = size[horizontal ? "height" : "width"];
2268
2297
  const state = refState.current;
2269
2298
  const didChange = scrollLength !== state.scrollLength;
2299
+ const prevOtherAxisSize = state.otherAxisSize;
2270
2300
  state.scrollLength = scrollLength;
2301
+ state.otherAxisSize = otherAxisSize;
2271
2302
  state.lastBatchingAction = Date.now();
2272
2303
  state.scrollForNextCalculateItemsInView = void 0;
2273
2304
  doInitialAllocateContainers();
@@ -2278,11 +2309,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2278
2309
  if (didChange) {
2279
2310
  calculateItemsInView();
2280
2311
  }
2281
- }, []);
2282
- const onLayout = useCallback((event) => {
2283
- const scrollLength = event.nativeEvent.layout[horizontal ? "width" : "height"];
2284
- handleLayout(scrollLength);
2285
- const otherAxisSize = event.nativeEvent.layout[horizontal ? "height" : "width"];
2312
+ if (didChange || otherAxisSize !== prevOtherAxisSize) {
2313
+ set$(ctx, "scrollSize", { width: size.width, height: size.height });
2314
+ }
2286
2315
  if (refState.current) {
2287
2316
  refState.current.needsOtherAxisSize = otherAxisSize - (stylePaddingTopState || 0) < 10;
2288
2317
  }
@@ -2292,6 +2321,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2292
2321
  `List ${horizontal ? "width" : "height"} is 0. You may need to set a style or \`flex: \` for the list, because children are absolutely positioned.`
2293
2322
  );
2294
2323
  }
2324
+ }, []);
2325
+ const onLayout = useCallback((event) => {
2326
+ const layout = event.nativeEvent.layout;
2327
+ handleLayout(layout);
2328
+ layout[horizontal ? "width" : "height"];
2329
+ layout[horizontal ? "height" : "width"];
2295
2330
  if (onLayoutProp) {
2296
2331
  onLayoutProp(event);
2297
2332
  }
@@ -2303,7 +2338,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2303
2338
  if (measured) {
2304
2339
  const size = Math.floor(measured[horizontal ? "width" : "height"] * 8) / 8;
2305
2340
  if (size) {
2306
- handleLayout(size);
2341
+ handleLayout(measured);
2307
2342
  }
2308
2343
  }
2309
2344
  }, []);
@@ -2433,10 +2468,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2433
2468
  },
2434
2469
  scrollToOffset: (params) => scrollTo(params),
2435
2470
  scrollToEnd: (options) => {
2436
- const { data } = refState.current;
2471
+ const { data, stylePaddingBottom } = refState.current;
2437
2472
  const index = data.length - 1;
2438
2473
  if (index !== -1) {
2439
- scrollToIndex({ index, ...options });
2474
+ const paddingBottom = stylePaddingBottom || 0;
2475
+ scrollToIndex({ index, viewOffset: -paddingBottom, ...options });
2440
2476
  }
2441
2477
  }
2442
2478
  };
@@ -2492,6 +2528,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2492
2528
  recycleItems,
2493
2529
  alignItemsAtEnd,
2494
2530
  ListEmptyComponent: dataProp.length === 0 ? ListEmptyComponent : void 0,
2531
+ ListHeaderComponent,
2495
2532
  maintainVisibleContentPosition,
2496
2533
  scrollEventThrottle: Platform.OS === "web" ? 16 : void 0,
2497
2534
  waitForInitialLayout,
@@ -2511,4 +2548,4 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2511
2548
  ), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */ React2.createElement(DebugView, { state: refState.current }));
2512
2549
  });
2513
2550
 
2514
- export { LegendList, useIsLastItem, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
2551
+ export { LegendList, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
@@ -1,147 +1,16 @@
1
- import * as react_native_reanimated_lib_typescript_layoutReanimation_animationBuilder_Keyframe from 'react-native-reanimated/lib/typescript/layoutReanimation/animationBuilder/Keyframe';
2
- import * as react_native_reanimated from 'react-native-reanimated';
3
- import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
4
1
  import * as _legendapp_list from '@legendapp/list';
5
2
  import { LegendListRef } from '@legendapp/list';
3
+ import * as react_native_reanimated_lib_typescript_layoutReanimation_animationBuilder_Keyframe from 'react-native-reanimated/lib/typescript/layoutReanimation/animationBuilder/Keyframe';
6
4
  import * as react_native from 'react-native';
7
5
  import { Insets } from 'react-native';
6
+ import * as react_native_reanimated from 'react-native-reanimated';
7
+ import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
8
8
  import * as React from 'react';
9
9
 
10
- declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
11
- alignItemsAtEnd?: boolean;
12
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
13
- data: readonly T[];
14
- drawDistance?: number;
15
- estimatedItemSize?: number;
16
- extraData?: any;
17
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
18
- initialContainerPoolRatio?: number | undefined;
19
- initialScrollOffset?: number;
20
- initialScrollIndex?: number;
21
- ItemSeparatorComponent?: React.ComponentType<{
22
- leadingItem: T;
23
- }> | undefined;
24
- keyExtractor?: ((item: T, index: number) => string) | undefined;
25
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
26
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
27
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
28
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
29
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
30
- maintainScrollAtEnd?: boolean;
31
- maintainScrollAtEndThreshold?: number;
32
- maintainVisibleContentPosition?: boolean;
33
- numColumns?: number;
34
- onEndReached?: ((info: {
35
- distanceFromEnd: number;
36
- }) => void) | null | undefined;
37
- onEndReachedThreshold?: number | null | undefined;
38
- onItemSizeChanged?: ((info: {
39
- size: number;
40
- previous: number;
41
- index: number;
42
- itemKey: string;
43
- itemData: T;
44
- }) => void) | undefined;
45
- onRefresh?: () => void;
46
- onStartReached?: ((info: {
47
- distanceFromStart: number;
48
- }) => void) | null | undefined;
49
- onStartReachedThreshold?: number | null | undefined;
50
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
51
- progressViewOffset?: number;
52
- recycleItems?: boolean;
53
- refScrollView?: React.Ref<react_native.ScrollView>;
54
- refreshing?: boolean;
55
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
56
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
57
- suggestEstimatedItemSize?: boolean;
58
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
59
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
60
- waitForInitialLayout?: boolean;
61
- onLoad?: (info: {
62
- elapsedTimeInMs: number;
63
- }) => void;
64
- } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
65
- alignItemsAtEnd?: boolean;
66
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
67
- data: readonly T[];
68
- drawDistance?: number;
69
- estimatedItemSize?: number;
70
- extraData?: any;
71
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
72
- initialContainerPoolRatio?: number | undefined;
73
- initialScrollOffset?: number;
74
- initialScrollIndex?: number;
75
- ItemSeparatorComponent?: React.ComponentType<{
76
- leadingItem: T;
77
- }> | undefined;
78
- keyExtractor?: ((item: T, index: number) => string) | undefined;
79
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
80
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
81
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
82
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
83
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
84
- maintainScrollAtEnd?: boolean;
85
- maintainScrollAtEndThreshold?: number;
86
- maintainVisibleContentPosition?: boolean;
87
- numColumns?: number;
88
- onEndReached?: ((info: {
89
- distanceFromEnd: number;
90
- }) => void) | null | undefined;
91
- onEndReachedThreshold?: number | null | undefined;
92
- onItemSizeChanged?: ((info: {
93
- size: number;
94
- previous: number;
95
- index: number;
96
- itemKey: string;
97
- itemData: T;
98
- }) => void) | undefined;
99
- onRefresh?: () => void;
100
- onStartReached?: ((info: {
101
- distanceFromStart: number;
102
- }) => void) | null | undefined;
103
- onStartReachedThreshold?: number | null | undefined;
104
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
105
- progressViewOffset?: number;
106
- recycleItems?: boolean;
107
- refScrollView?: React.Ref<react_native.ScrollView>;
108
- refreshing?: boolean;
109
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
110
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
111
- suggestEstimatedItemSize?: boolean;
112
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
113
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
114
- waitForInitialLayout?: boolean;
115
- onLoad?: (info: {
116
- elapsedTimeInMs: number;
117
- }) => void;
118
- } & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
10
+ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
119
11
  getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
120
- ItemSeparatorComponent?: React.ComponentType<{
121
- leadingItem: ItemT_1;
122
- }> | undefined;
123
12
  keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
124
- onItemSizeChanged?: ((info: {
125
- size: number;
126
- previous: number;
127
- index: number;
128
- itemKey: string;
129
- itemData: ItemT_1;
130
- }) => void) | undefined;
131
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<ItemT_1>> | undefined;
132
13
  animatedProps?: Partial<{
133
- contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
134
- contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
135
- maintainVisibleContentPosition?: {
136
- autoscrollToTopThreshold?: number | null | undefined;
137
- minIndexForVisible: number;
138
- } | react_native_reanimated.SharedValue<{
139
- autoscrollToTopThreshold?: number | null | undefined;
140
- minIndexForVisible: number;
141
- } | null | undefined> | null | undefined;
142
- stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
143
- removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
144
- scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
145
14
  decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
146
15
  horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
147
16
  invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -155,6 +24,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
155
24
  onMomentumScrollBegin?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
156
25
  pagingEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
157
26
  scrollEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
27
+ removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
158
28
  showsHorizontalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
159
29
  showsVerticalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
160
30
  stickyHeaderHiddenOnScroll?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -163,6 +33,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
163
33
  snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
164
34
  snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
165
35
  snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
36
+ stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
166
37
  disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
167
38
  disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
168
39
  StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
@@ -266,16 +137,26 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
266
137
  bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
267
138
  canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
268
139
  centerContent?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
140
+ contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
141
+ contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
269
142
  contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
270
143
  directionalLockEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
144
+ maintainVisibleContentPosition?: {
145
+ autoscrollToTopThreshold?: number | null | undefined;
146
+ minIndexForVisible: number;
147
+ } | react_native_reanimated.SharedValue<{
148
+ autoscrollToTopThreshold?: number | null | undefined;
149
+ minIndexForVisible: number;
150
+ } | null | undefined> | null | undefined;
271
151
  maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
272
152
  minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
273
153
  onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
274
154
  pinchGestureEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
155
+ scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
275
156
  scrollIndicatorInsets?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
276
157
  scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
277
158
  scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
278
- snapToAlignment?: "end" | "start" | "center" | react_native_reanimated.SharedValue<"end" | "start" | "center" | undefined> | undefined;
159
+ snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
279
160
  onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
280
161
  zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
281
162
  endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
@@ -285,8 +166,8 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
285
166
  fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
286
167
  persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
287
168
  } & {
288
- contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
289
169
  style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
170
+ contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
290
171
  indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
291
172
  } & {
292
173
  layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
@@ -296,9 +177,128 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
296
177
  sharedTransitionTag?: string;
297
178
  sharedTransitionStyle?: react_native_reanimated.SharedTransition;
298
179
  }> | undefined;
180
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<ItemT_1>> | undefined;
181
+ onItemSizeChanged?: ((info: {
182
+ size: number;
183
+ previous: number;
184
+ index: number;
185
+ itemKey: string;
186
+ itemData: ItemT_1;
187
+ }) => void) | undefined;
188
+ ItemSeparatorComponent?: React.ComponentType<{
189
+ leadingItem: ItemT_1;
190
+ }> | undefined;
299
191
  } & {
300
192
  ref?: React.Ref<LegendListRef>;
301
- }) => React.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
193
+ }) => React.ReactElement | null) | (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
194
+ alignItemsAtEnd?: boolean;
195
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
196
+ data: readonly T[];
197
+ drawDistance?: number;
198
+ estimatedItemSize?: number;
199
+ extraData?: any;
200
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
201
+ initialContainerPoolRatio?: number | undefined;
202
+ initialScrollOffset?: number;
203
+ initialScrollIndex?: number;
204
+ ItemSeparatorComponent?: React.ComponentType<{
205
+ leadingItem: T;
206
+ }> | undefined;
207
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
208
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
209
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
210
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
211
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
212
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
213
+ maintainScrollAtEnd?: boolean;
214
+ maintainScrollAtEndThreshold?: number;
215
+ maintainVisibleContentPosition?: boolean;
216
+ numColumns?: number;
217
+ onEndReached?: ((info: {
218
+ distanceFromEnd: number;
219
+ }) => void) | null | undefined;
220
+ onEndReachedThreshold?: number | null | undefined;
221
+ onItemSizeChanged?: ((info: {
222
+ size: number;
223
+ previous: number;
224
+ index: number;
225
+ itemKey: string;
226
+ itemData: T;
227
+ }) => void) | undefined;
228
+ onRefresh?: () => void;
229
+ onStartReached?: ((info: {
230
+ distanceFromStart: number;
231
+ }) => void) | null | undefined;
232
+ onStartReachedThreshold?: number | null | undefined;
233
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
234
+ progressViewOffset?: number;
235
+ recycleItems?: boolean;
236
+ refScrollView?: React.Ref<react_native.ScrollView>;
237
+ refreshing?: boolean;
238
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
239
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
240
+ suggestEstimatedItemSize?: boolean;
241
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
242
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
243
+ waitForInitialLayout?: boolean;
244
+ onLoad?: (info: {
245
+ elapsedTimeInMs: number;
246
+ }) => void;
247
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
248
+ alignItemsAtEnd?: boolean;
249
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
250
+ data: readonly T[];
251
+ drawDistance?: number;
252
+ estimatedItemSize?: number;
253
+ extraData?: any;
254
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
255
+ initialContainerPoolRatio?: number | undefined;
256
+ initialScrollOffset?: number;
257
+ initialScrollIndex?: number;
258
+ ItemSeparatorComponent?: React.ComponentType<{
259
+ leadingItem: T;
260
+ }> | undefined;
261
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
262
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
263
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
264
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
265
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
266
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
267
+ maintainScrollAtEnd?: boolean;
268
+ maintainScrollAtEndThreshold?: number;
269
+ maintainVisibleContentPosition?: boolean;
270
+ numColumns?: number;
271
+ onEndReached?: ((info: {
272
+ distanceFromEnd: number;
273
+ }) => void) | null | undefined;
274
+ onEndReachedThreshold?: number | null | undefined;
275
+ onItemSizeChanged?: ((info: {
276
+ size: number;
277
+ previous: number;
278
+ index: number;
279
+ itemKey: string;
280
+ itemData: T;
281
+ }) => void) | undefined;
282
+ onRefresh?: () => void;
283
+ onStartReached?: ((info: {
284
+ distanceFromStart: number;
285
+ }) => void) | null | undefined;
286
+ onStartReachedThreshold?: number | null | undefined;
287
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
288
+ progressViewOffset?: number;
289
+ recycleItems?: boolean;
290
+ refScrollView?: React.Ref<react_native.ScrollView>;
291
+ refreshing?: boolean;
292
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
293
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
294
+ suggestEstimatedItemSize?: boolean;
295
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
296
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
297
+ waitForInitialLayout?: boolean;
298
+ onLoad?: (info: {
299
+ elapsedTimeInMs: number;
300
+ }) => void;
301
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
302
302
  alignItemsAtEnd?: boolean;
303
303
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
304
304
  data: readonly T[];
@@ -352,7 +352,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
352
352
  onLoad?: (info: {
353
353
  elapsedTimeInMs: number;
354
354
  }) => void;
355
- } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
355
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
356
356
  alignItemsAtEnd?: boolean;
357
357
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
358
358
  data: readonly ItemT[];
@@ -1,147 +1,16 @@
1
- import * as react_native_reanimated_lib_typescript_layoutReanimation_animationBuilder_Keyframe from 'react-native-reanimated/lib/typescript/layoutReanimation/animationBuilder/Keyframe';
2
- import * as react_native_reanimated from 'react-native-reanimated';
3
- import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
4
1
  import * as _legendapp_list from '@legendapp/list';
5
2
  import { LegendListRef } from '@legendapp/list';
3
+ import * as react_native_reanimated_lib_typescript_layoutReanimation_animationBuilder_Keyframe from 'react-native-reanimated/lib/typescript/layoutReanimation/animationBuilder/Keyframe';
6
4
  import * as react_native from 'react-native';
7
5
  import { Insets } from 'react-native';
6
+ import * as react_native_reanimated from 'react-native-reanimated';
7
+ import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
8
8
  import * as React from 'react';
9
9
 
10
- declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
11
- alignItemsAtEnd?: boolean;
12
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
13
- data: readonly T[];
14
- drawDistance?: number;
15
- estimatedItemSize?: number;
16
- extraData?: any;
17
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
18
- initialContainerPoolRatio?: number | undefined;
19
- initialScrollOffset?: number;
20
- initialScrollIndex?: number;
21
- ItemSeparatorComponent?: React.ComponentType<{
22
- leadingItem: T;
23
- }> | undefined;
24
- keyExtractor?: ((item: T, index: number) => string) | undefined;
25
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
26
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
27
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
28
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
29
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
30
- maintainScrollAtEnd?: boolean;
31
- maintainScrollAtEndThreshold?: number;
32
- maintainVisibleContentPosition?: boolean;
33
- numColumns?: number;
34
- onEndReached?: ((info: {
35
- distanceFromEnd: number;
36
- }) => void) | null | undefined;
37
- onEndReachedThreshold?: number | null | undefined;
38
- onItemSizeChanged?: ((info: {
39
- size: number;
40
- previous: number;
41
- index: number;
42
- itemKey: string;
43
- itemData: T;
44
- }) => void) | undefined;
45
- onRefresh?: () => void;
46
- onStartReached?: ((info: {
47
- distanceFromStart: number;
48
- }) => void) | null | undefined;
49
- onStartReachedThreshold?: number | null | undefined;
50
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
51
- progressViewOffset?: number;
52
- recycleItems?: boolean;
53
- refScrollView?: React.Ref<react_native.ScrollView>;
54
- refreshing?: boolean;
55
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
56
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
57
- suggestEstimatedItemSize?: boolean;
58
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
59
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
60
- waitForInitialLayout?: boolean;
61
- onLoad?: (info: {
62
- elapsedTimeInMs: number;
63
- }) => void;
64
- } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
65
- alignItemsAtEnd?: boolean;
66
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
67
- data: readonly T[];
68
- drawDistance?: number;
69
- estimatedItemSize?: number;
70
- extraData?: any;
71
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
72
- initialContainerPoolRatio?: number | undefined;
73
- initialScrollOffset?: number;
74
- initialScrollIndex?: number;
75
- ItemSeparatorComponent?: React.ComponentType<{
76
- leadingItem: T;
77
- }> | undefined;
78
- keyExtractor?: ((item: T, index: number) => string) | undefined;
79
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
80
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
81
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
82
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
83
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
84
- maintainScrollAtEnd?: boolean;
85
- maintainScrollAtEndThreshold?: number;
86
- maintainVisibleContentPosition?: boolean;
87
- numColumns?: number;
88
- onEndReached?: ((info: {
89
- distanceFromEnd: number;
90
- }) => void) | null | undefined;
91
- onEndReachedThreshold?: number | null | undefined;
92
- onItemSizeChanged?: ((info: {
93
- size: number;
94
- previous: number;
95
- index: number;
96
- itemKey: string;
97
- itemData: T;
98
- }) => void) | undefined;
99
- onRefresh?: () => void;
100
- onStartReached?: ((info: {
101
- distanceFromStart: number;
102
- }) => void) | null | undefined;
103
- onStartReachedThreshold?: number | null | undefined;
104
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
105
- progressViewOffset?: number;
106
- recycleItems?: boolean;
107
- refScrollView?: React.Ref<react_native.ScrollView>;
108
- refreshing?: boolean;
109
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
110
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
111
- suggestEstimatedItemSize?: boolean;
112
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
113
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
114
- waitForInitialLayout?: boolean;
115
- onLoad?: (info: {
116
- elapsedTimeInMs: number;
117
- }) => void;
118
- } & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
10
+ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
119
11
  getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
120
- ItemSeparatorComponent?: React.ComponentType<{
121
- leadingItem: ItemT_1;
122
- }> | undefined;
123
12
  keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
124
- onItemSizeChanged?: ((info: {
125
- size: number;
126
- previous: number;
127
- index: number;
128
- itemKey: string;
129
- itemData: ItemT_1;
130
- }) => void) | undefined;
131
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<ItemT_1>> | undefined;
132
13
  animatedProps?: Partial<{
133
- contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
134
- contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
135
- maintainVisibleContentPosition?: {
136
- autoscrollToTopThreshold?: number | null | undefined;
137
- minIndexForVisible: number;
138
- } | react_native_reanimated.SharedValue<{
139
- autoscrollToTopThreshold?: number | null | undefined;
140
- minIndexForVisible: number;
141
- } | null | undefined> | null | undefined;
142
- stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
143
- removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
144
- scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
145
14
  decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
146
15
  horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
147
16
  invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -155,6 +24,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
155
24
  onMomentumScrollBegin?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
156
25
  pagingEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
157
26
  scrollEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
27
+ removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
158
28
  showsHorizontalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
159
29
  showsVerticalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
160
30
  stickyHeaderHiddenOnScroll?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -163,6 +33,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
163
33
  snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
164
34
  snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
165
35
  snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
36
+ stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
166
37
  disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
167
38
  disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
168
39
  StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
@@ -266,16 +137,26 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
266
137
  bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
267
138
  canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
268
139
  centerContent?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
140
+ contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
141
+ contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
269
142
  contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
270
143
  directionalLockEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
144
+ maintainVisibleContentPosition?: {
145
+ autoscrollToTopThreshold?: number | null | undefined;
146
+ minIndexForVisible: number;
147
+ } | react_native_reanimated.SharedValue<{
148
+ autoscrollToTopThreshold?: number | null | undefined;
149
+ minIndexForVisible: number;
150
+ } | null | undefined> | null | undefined;
271
151
  maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
272
152
  minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
273
153
  onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
274
154
  pinchGestureEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
155
+ scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
275
156
  scrollIndicatorInsets?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
276
157
  scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
277
158
  scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
278
- snapToAlignment?: "end" | "start" | "center" | react_native_reanimated.SharedValue<"end" | "start" | "center" | undefined> | undefined;
159
+ snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
279
160
  onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
280
161
  zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
281
162
  endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
@@ -285,8 +166,8 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
285
166
  fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
286
167
  persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
287
168
  } & {
288
- contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
289
169
  style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
170
+ contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
290
171
  indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
291
172
  } & {
292
173
  layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
@@ -296,9 +177,128 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
296
177
  sharedTransitionTag?: string;
297
178
  sharedTransitionStyle?: react_native_reanimated.SharedTransition;
298
179
  }> | undefined;
180
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<ItemT_1>> | undefined;
181
+ onItemSizeChanged?: ((info: {
182
+ size: number;
183
+ previous: number;
184
+ index: number;
185
+ itemKey: string;
186
+ itemData: ItemT_1;
187
+ }) => void) | undefined;
188
+ ItemSeparatorComponent?: React.ComponentType<{
189
+ leadingItem: ItemT_1;
190
+ }> | undefined;
299
191
  } & {
300
192
  ref?: React.Ref<LegendListRef>;
301
- }) => React.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
193
+ }) => React.ReactElement | null) | (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
194
+ alignItemsAtEnd?: boolean;
195
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
196
+ data: readonly T[];
197
+ drawDistance?: number;
198
+ estimatedItemSize?: number;
199
+ extraData?: any;
200
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
201
+ initialContainerPoolRatio?: number | undefined;
202
+ initialScrollOffset?: number;
203
+ initialScrollIndex?: number;
204
+ ItemSeparatorComponent?: React.ComponentType<{
205
+ leadingItem: T;
206
+ }> | undefined;
207
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
208
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
209
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
210
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
211
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
212
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
213
+ maintainScrollAtEnd?: boolean;
214
+ maintainScrollAtEndThreshold?: number;
215
+ maintainVisibleContentPosition?: boolean;
216
+ numColumns?: number;
217
+ onEndReached?: ((info: {
218
+ distanceFromEnd: number;
219
+ }) => void) | null | undefined;
220
+ onEndReachedThreshold?: number | null | undefined;
221
+ onItemSizeChanged?: ((info: {
222
+ size: number;
223
+ previous: number;
224
+ index: number;
225
+ itemKey: string;
226
+ itemData: T;
227
+ }) => void) | undefined;
228
+ onRefresh?: () => void;
229
+ onStartReached?: ((info: {
230
+ distanceFromStart: number;
231
+ }) => void) | null | undefined;
232
+ onStartReachedThreshold?: number | null | undefined;
233
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
234
+ progressViewOffset?: number;
235
+ recycleItems?: boolean;
236
+ refScrollView?: React.Ref<react_native.ScrollView>;
237
+ refreshing?: boolean;
238
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
239
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
240
+ suggestEstimatedItemSize?: boolean;
241
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
242
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
243
+ waitForInitialLayout?: boolean;
244
+ onLoad?: (info: {
245
+ elapsedTimeInMs: number;
246
+ }) => void;
247
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
248
+ alignItemsAtEnd?: boolean;
249
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
250
+ data: readonly T[];
251
+ drawDistance?: number;
252
+ estimatedItemSize?: number;
253
+ extraData?: any;
254
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
255
+ initialContainerPoolRatio?: number | undefined;
256
+ initialScrollOffset?: number;
257
+ initialScrollIndex?: number;
258
+ ItemSeparatorComponent?: React.ComponentType<{
259
+ leadingItem: T;
260
+ }> | undefined;
261
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
262
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
263
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
264
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
265
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
266
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
267
+ maintainScrollAtEnd?: boolean;
268
+ maintainScrollAtEndThreshold?: number;
269
+ maintainVisibleContentPosition?: boolean;
270
+ numColumns?: number;
271
+ onEndReached?: ((info: {
272
+ distanceFromEnd: number;
273
+ }) => void) | null | undefined;
274
+ onEndReachedThreshold?: number | null | undefined;
275
+ onItemSizeChanged?: ((info: {
276
+ size: number;
277
+ previous: number;
278
+ index: number;
279
+ itemKey: string;
280
+ itemData: T;
281
+ }) => void) | undefined;
282
+ onRefresh?: () => void;
283
+ onStartReached?: ((info: {
284
+ distanceFromStart: number;
285
+ }) => void) | null | undefined;
286
+ onStartReachedThreshold?: number | null | undefined;
287
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
288
+ progressViewOffset?: number;
289
+ recycleItems?: boolean;
290
+ refScrollView?: React.Ref<react_native.ScrollView>;
291
+ refreshing?: boolean;
292
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | React.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
293
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
294
+ suggestEstimatedItemSize?: boolean;
295
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
296
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
297
+ waitForInitialLayout?: boolean;
298
+ onLoad?: (info: {
299
+ elapsedTimeInMs: number;
300
+ }) => void;
301
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
302
302
  alignItemsAtEnd?: boolean;
303
303
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
304
304
  data: readonly T[];
@@ -352,7 +352,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
352
352
  onLoad?: (info: {
353
353
  elapsedTimeInMs: number;
354
354
  }) => void;
355
- } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
355
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
356
356
  alignItemsAtEnd?: boolean;
357
357
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
358
358
  data: readonly ItemT[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Legend List is a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
5
5
  "sideEffects": false,
6
6
  "private": false,