@legendapp/list 1.0.8 → 1.0.9

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/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  var React2 = require('react');
4
4
  var reactNative = require('react-native');
5
+ var shim = require('use-sync-external-store/shim');
5
6
 
6
7
  function _interopNamespace(e) {
7
8
  if (e && e.__esModule) return e;
@@ -82,7 +83,7 @@ function createSelectorFunctionsArr(ctx, signalNames) {
82
83
  function useArr$(signalNames) {
83
84
  const ctx = React2__namespace.useContext(ContextState);
84
85
  const { subscribe, get } = React2__namespace.useMemo(() => createSelectorFunctionsArr(ctx, signalNames), [ctx, signalNames]);
85
- const value = React2.useSyncExternalStore(subscribe, get);
86
+ const value = shim.useSyncExternalStore(subscribe, get);
86
87
  return value;
87
88
  }
88
89
  function listen$(ctx, signalName, cb) {
@@ -1293,6 +1294,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1293
1294
  const state = refState.current;
1294
1295
  if (state.scrollingToOffset === void 0) {
1295
1296
  state.disableScrollJumpsFrom = state.scroll - state.scrollAdjustHandler.getAppliedAdjust();
1297
+ state.scrollHistory.length = 0;
1296
1298
  setTimeout(() => {
1297
1299
  state.disableScrollJumpsFrom = void 0;
1298
1300
  }, timeout);
@@ -1388,7 +1390,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1388
1390
  }
1389
1391
  return false;
1390
1392
  }, []);
1391
- const calculateItemsInView = React2.useCallback(() => {
1393
+ const calculateItemsInView = React2.useCallback((isReset) => {
1392
1394
  var _a;
1393
1395
  const state = refState.current;
1394
1396
  const {
@@ -1414,7 +1416,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1414
1416
  const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
1415
1417
  scrollState = updatedOffset;
1416
1418
  }
1417
- let scroll = scrollState + scrollExtra - previousScrollAdjust - topPad;
1419
+ const scrollAdjustPad = -previousScrollAdjust - topPad;
1420
+ let scroll = scrollState + scrollExtra + scrollAdjustPad;
1418
1421
  if (scroll + scrollLength > totalSize) {
1419
1422
  scroll = totalSize - scrollLength;
1420
1423
  }
@@ -1424,13 +1427,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1424
1427
  }
1425
1428
  let scrollBufferTop = scrollBuffer;
1426
1429
  let scrollBufferBottom = scrollBuffer;
1427
- if (speed > 0) {
1428
- scrollBufferTop = scrollBuffer * 0.1;
1429
- scrollBufferBottom = scrollBuffer * 1.9;
1430
- }
1431
- if (speed < 0) {
1432
- scrollBufferTop = scrollBuffer * 1.9;
1433
- scrollBufferBottom = scrollBuffer * 0.1;
1430
+ if (Math.abs(speed) > 4) {
1431
+ if (speed > 0) {
1432
+ scrollBufferTop = scrollBuffer * 0.1;
1433
+ scrollBufferBottom = scrollBuffer * 1.9;
1434
+ } else {
1435
+ scrollBufferTop = scrollBuffer * 1.9;
1436
+ scrollBufferBottom = scrollBuffer * 0.1;
1437
+ }
1434
1438
  }
1435
1439
  if (state.scrollForNextCalculateItemsInView) {
1436
1440
  const { top: top2, bottom } = state.scrollForNextCalculateItemsInView;
@@ -1490,7 +1494,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1490
1494
  return topOffset;
1491
1495
  };
1492
1496
  let foundEnd = false;
1493
- let lastSize;
1497
+ let nextTop;
1498
+ let nextBottom;
1494
1499
  const prevNumContainers = ctx.values.get("numContainers");
1495
1500
  let maxIndexRendered = 0;
1496
1501
  for (let i = 0; i < prevNumContainers; i++) {
@@ -1520,6 +1525,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1520
1525
  if (startBuffered === null && top + size > scroll - scrollBufferTop) {
1521
1526
  startBuffered = i;
1522
1527
  startBufferedId = id;
1528
+ nextTop = top;
1523
1529
  }
1524
1530
  if (startNoBuffer !== null) {
1525
1531
  if (top <= scrollBottom) {
@@ -1527,7 +1533,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1527
1533
  }
1528
1534
  if (top <= scrollBottom + scrollBufferBottom) {
1529
1535
  endBuffered = i;
1530
- lastSize = maxSizeInRow;
1536
+ nextBottom = top + maxSizeInRow - scrollLength;
1531
1537
  } else {
1532
1538
  foundEnd = true;
1533
1539
  }
@@ -1549,15 +1555,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1549
1555
  endBuffered,
1550
1556
  endNoBuffer
1551
1557
  });
1552
- if (state.enableScrollForNextCalculateItemsInView && lastSize) {
1553
- const aboveFirst = startBuffered - 1;
1554
- let nextTop = 0;
1555
- if (aboveFirst >= 0) {
1556
- const aboveFirstSize = getItemSize(getId(aboveFirst), aboveFirst, data[aboveFirst], useAverageSize);
1557
- nextTop = scroll - aboveFirstSize;
1558
- }
1559
- const nextBottom = scroll + lastSize;
1560
- state.scrollForNextCalculateItemsInView = nextTop >= 0 && nextBottom >= 0 ? {
1558
+ if (state.enableScrollForNextCalculateItemsInView && nextTop !== void 0 && nextBottom !== void 0 && state.disableScrollJumpsFrom === void 0) {
1559
+ state.scrollForNextCalculateItemsInView = nextTop !== void 0 && nextBottom !== void 0 ? {
1561
1560
  top: nextTop,
1562
1561
  bottom: nextBottom
1563
1562
  } : void 0;
@@ -1565,7 +1564,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1565
1564
  if (startBuffered !== null && endBuffered !== null) {
1566
1565
  let numContainers = prevNumContainers;
1567
1566
  const needNewContainers = [];
1568
- if (startBuffered < prevStartBuffered || endBuffered > prevEndBuffered) {
1567
+ if (isReset || startBuffered < prevStartBuffered || endBuffered > prevEndBuffered) {
1569
1568
  const isContained = (i) => {
1570
1569
  const id = getId(i);
1571
1570
  for (let j = 0; j < numContainers; j++) {
@@ -1575,14 +1574,22 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1575
1574
  }
1576
1575
  }
1577
1576
  };
1578
- for (let i = startBuffered; i < prevStartBuffered; i++) {
1579
- if (!isContained(i)) {
1580
- needNewContainers.push(i);
1577
+ if (isReset) {
1578
+ for (let i = startBuffered; i <= endBuffered; i++) {
1579
+ if (!isContained(i)) {
1580
+ needNewContainers.push(i);
1581
+ }
1581
1582
  }
1582
- }
1583
- for (let i = Math.max(prevEndBuffered + 1, startBuffered); i <= endBuffered; i++) {
1584
- if (!isContained(i)) {
1585
- needNewContainers.push(i);
1583
+ } else {
1584
+ for (let i = startBuffered; i < prevStartBuffered; i++) {
1585
+ if (!isContained(i)) {
1586
+ needNewContainers.push(i);
1587
+ }
1588
+ }
1589
+ for (let i = Math.max(prevEndBuffered + 1, startBuffered); i <= endBuffered; i++) {
1590
+ if (!isContained(i)) {
1591
+ needNewContainers.push(i);
1592
+ }
1586
1593
  }
1587
1594
  }
1588
1595
  }
@@ -1831,7 +1838,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1831
1838
  if (!keyExtractorProp) {
1832
1839
  state.positions.clear();
1833
1840
  }
1834
- calculateItemsInView();
1841
+ calculateItemsInView(
1842
+ /*isReset*/
1843
+ true
1844
+ );
1835
1845
  const didMaintainScrollAtEnd = doMaintainScrollAtEnd(false);
1836
1846
  if (!didMaintainScrollAtEnd && dataProp.length > state.data.length) {
1837
1847
  state.isEndReached = false;
@@ -1884,7 +1894,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1884
1894
  (_b = state.belowAnchorElementPositions) == null ? void 0 : _b.clear();
1885
1895
  scrollTo(0, false);
1886
1896
  setTimeout(() => {
1887
- calculateItemsInView();
1897
+ calculateItemsInView(
1898
+ /*reset*/
1899
+ true
1900
+ );
1888
1901
  }, 0);
1889
1902
  } else {
1890
1903
  state.startBufferedId = void 0;
@@ -1899,7 +1912,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1899
1912
  }
1900
1913
  scrollTo(0, false);
1901
1914
  setTimeout(() => {
1902
- calculateItemsInView();
1915
+ calculateItemsInView(
1916
+ /*reset*/
1917
+ true
1918
+ );
1903
1919
  }, 0);
1904
1920
  }
1905
1921
  }
@@ -2059,10 +2075,16 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2059
2075
  set$(ctx, "numContainersPooled", numContainers * initialContainerPoolRatio);
2060
2076
  if (initialScrollIndex) {
2061
2077
  requestAnimationFrame(() => {
2062
- calculateItemsInView();
2078
+ calculateItemsInView(
2079
+ /*isReset*/
2080
+ true
2081
+ );
2063
2082
  });
2064
2083
  } else {
2065
- calculateItemsInView();
2084
+ calculateItemsInView(
2085
+ /*isReset*/
2086
+ true
2087
+ );
2066
2088
  }
2067
2089
  return true;
2068
2090
  }
@@ -2098,6 +2120,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2098
2120
  }
2099
2121
  const index = indexByKey.get(itemKey);
2100
2122
  const numColumns = peek$(ctx, "numColumns");
2123
+ state.scrollForNextCalculateItemsInView = void 0;
2101
2124
  state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
2102
2125
  const prevSize = getItemSize(itemKey, index, data);
2103
2126
  const prevSizeKnown = sizesKnown.get(itemKey);
package/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React2 from 'react';
2
- import React2__default, { useReducer, useEffect, createContext, useMemo, useRef, useCallback, useImperativeHandle, useSyncExternalStore, useContext, useState, forwardRef, memo, useLayoutEffect } from 'react';
2
+ import React2__default, { useReducer, useEffect, createContext, useMemo, useRef, useCallback, useImperativeHandle, useContext, useState, forwardRef, memo, useLayoutEffect } from 'react';
3
3
  import { View, Text, Platform, Animated, ScrollView, StyleSheet, Dimensions, RefreshControl } from 'react-native';
4
+ import { useSyncExternalStore } from 'use-sync-external-store/shim';
4
5
 
5
6
  // src/LegendList.tsx
6
7
  var ContextState = React2.createContext(null);
@@ -1272,6 +1273,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1272
1273
  const state = refState.current;
1273
1274
  if (state.scrollingToOffset === void 0) {
1274
1275
  state.disableScrollJumpsFrom = state.scroll - state.scrollAdjustHandler.getAppliedAdjust();
1276
+ state.scrollHistory.length = 0;
1275
1277
  setTimeout(() => {
1276
1278
  state.disableScrollJumpsFrom = void 0;
1277
1279
  }, timeout);
@@ -1367,7 +1369,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1367
1369
  }
1368
1370
  return false;
1369
1371
  }, []);
1370
- const calculateItemsInView = useCallback(() => {
1372
+ const calculateItemsInView = useCallback((isReset) => {
1371
1373
  var _a;
1372
1374
  const state = refState.current;
1373
1375
  const {
@@ -1393,7 +1395,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1393
1395
  const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
1394
1396
  scrollState = updatedOffset;
1395
1397
  }
1396
- let scroll = scrollState + scrollExtra - previousScrollAdjust - topPad;
1398
+ const scrollAdjustPad = -previousScrollAdjust - topPad;
1399
+ let scroll = scrollState + scrollExtra + scrollAdjustPad;
1397
1400
  if (scroll + scrollLength > totalSize) {
1398
1401
  scroll = totalSize - scrollLength;
1399
1402
  }
@@ -1403,13 +1406,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1403
1406
  }
1404
1407
  let scrollBufferTop = scrollBuffer;
1405
1408
  let scrollBufferBottom = scrollBuffer;
1406
- if (speed > 0) {
1407
- scrollBufferTop = scrollBuffer * 0.1;
1408
- scrollBufferBottom = scrollBuffer * 1.9;
1409
- }
1410
- if (speed < 0) {
1411
- scrollBufferTop = scrollBuffer * 1.9;
1412
- scrollBufferBottom = scrollBuffer * 0.1;
1409
+ if (Math.abs(speed) > 4) {
1410
+ if (speed > 0) {
1411
+ scrollBufferTop = scrollBuffer * 0.1;
1412
+ scrollBufferBottom = scrollBuffer * 1.9;
1413
+ } else {
1414
+ scrollBufferTop = scrollBuffer * 1.9;
1415
+ scrollBufferBottom = scrollBuffer * 0.1;
1416
+ }
1413
1417
  }
1414
1418
  if (state.scrollForNextCalculateItemsInView) {
1415
1419
  const { top: top2, bottom } = state.scrollForNextCalculateItemsInView;
@@ -1469,7 +1473,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1469
1473
  return topOffset;
1470
1474
  };
1471
1475
  let foundEnd = false;
1472
- let lastSize;
1476
+ let nextTop;
1477
+ let nextBottom;
1473
1478
  const prevNumContainers = ctx.values.get("numContainers");
1474
1479
  let maxIndexRendered = 0;
1475
1480
  for (let i = 0; i < prevNumContainers; i++) {
@@ -1499,6 +1504,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1499
1504
  if (startBuffered === null && top + size > scroll - scrollBufferTop) {
1500
1505
  startBuffered = i;
1501
1506
  startBufferedId = id;
1507
+ nextTop = top;
1502
1508
  }
1503
1509
  if (startNoBuffer !== null) {
1504
1510
  if (top <= scrollBottom) {
@@ -1506,7 +1512,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1506
1512
  }
1507
1513
  if (top <= scrollBottom + scrollBufferBottom) {
1508
1514
  endBuffered = i;
1509
- lastSize = maxSizeInRow;
1515
+ nextBottom = top + maxSizeInRow - scrollLength;
1510
1516
  } else {
1511
1517
  foundEnd = true;
1512
1518
  }
@@ -1528,15 +1534,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1528
1534
  endBuffered,
1529
1535
  endNoBuffer
1530
1536
  });
1531
- if (state.enableScrollForNextCalculateItemsInView && lastSize) {
1532
- const aboveFirst = startBuffered - 1;
1533
- let nextTop = 0;
1534
- if (aboveFirst >= 0) {
1535
- const aboveFirstSize = getItemSize(getId(aboveFirst), aboveFirst, data[aboveFirst], useAverageSize);
1536
- nextTop = scroll - aboveFirstSize;
1537
- }
1538
- const nextBottom = scroll + lastSize;
1539
- state.scrollForNextCalculateItemsInView = nextTop >= 0 && nextBottom >= 0 ? {
1537
+ if (state.enableScrollForNextCalculateItemsInView && nextTop !== void 0 && nextBottom !== void 0 && state.disableScrollJumpsFrom === void 0) {
1538
+ state.scrollForNextCalculateItemsInView = nextTop !== void 0 && nextBottom !== void 0 ? {
1540
1539
  top: nextTop,
1541
1540
  bottom: nextBottom
1542
1541
  } : void 0;
@@ -1544,7 +1543,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1544
1543
  if (startBuffered !== null && endBuffered !== null) {
1545
1544
  let numContainers = prevNumContainers;
1546
1545
  const needNewContainers = [];
1547
- if (startBuffered < prevStartBuffered || endBuffered > prevEndBuffered) {
1546
+ if (isReset || startBuffered < prevStartBuffered || endBuffered > prevEndBuffered) {
1548
1547
  const isContained = (i) => {
1549
1548
  const id = getId(i);
1550
1549
  for (let j = 0; j < numContainers; j++) {
@@ -1554,14 +1553,22 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1554
1553
  }
1555
1554
  }
1556
1555
  };
1557
- for (let i = startBuffered; i < prevStartBuffered; i++) {
1558
- if (!isContained(i)) {
1559
- needNewContainers.push(i);
1556
+ if (isReset) {
1557
+ for (let i = startBuffered; i <= endBuffered; i++) {
1558
+ if (!isContained(i)) {
1559
+ needNewContainers.push(i);
1560
+ }
1560
1561
  }
1561
- }
1562
- for (let i = Math.max(prevEndBuffered + 1, startBuffered); i <= endBuffered; i++) {
1563
- if (!isContained(i)) {
1564
- needNewContainers.push(i);
1562
+ } else {
1563
+ for (let i = startBuffered; i < prevStartBuffered; i++) {
1564
+ if (!isContained(i)) {
1565
+ needNewContainers.push(i);
1566
+ }
1567
+ }
1568
+ for (let i = Math.max(prevEndBuffered + 1, startBuffered); i <= endBuffered; i++) {
1569
+ if (!isContained(i)) {
1570
+ needNewContainers.push(i);
1571
+ }
1565
1572
  }
1566
1573
  }
1567
1574
  }
@@ -1810,7 +1817,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1810
1817
  if (!keyExtractorProp) {
1811
1818
  state.positions.clear();
1812
1819
  }
1813
- calculateItemsInView();
1820
+ calculateItemsInView(
1821
+ /*isReset*/
1822
+ true
1823
+ );
1814
1824
  const didMaintainScrollAtEnd = doMaintainScrollAtEnd(false);
1815
1825
  if (!didMaintainScrollAtEnd && dataProp.length > state.data.length) {
1816
1826
  state.isEndReached = false;
@@ -1863,7 +1873,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1863
1873
  (_b = state.belowAnchorElementPositions) == null ? void 0 : _b.clear();
1864
1874
  scrollTo(0, false);
1865
1875
  setTimeout(() => {
1866
- calculateItemsInView();
1876
+ calculateItemsInView(
1877
+ /*reset*/
1878
+ true
1879
+ );
1867
1880
  }, 0);
1868
1881
  } else {
1869
1882
  state.startBufferedId = void 0;
@@ -1878,7 +1891,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1878
1891
  }
1879
1892
  scrollTo(0, false);
1880
1893
  setTimeout(() => {
1881
- calculateItemsInView();
1894
+ calculateItemsInView(
1895
+ /*reset*/
1896
+ true
1897
+ );
1882
1898
  }, 0);
1883
1899
  }
1884
1900
  }
@@ -2038,10 +2054,16 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2038
2054
  set$(ctx, "numContainersPooled", numContainers * initialContainerPoolRatio);
2039
2055
  if (initialScrollIndex) {
2040
2056
  requestAnimationFrame(() => {
2041
- calculateItemsInView();
2057
+ calculateItemsInView(
2058
+ /*isReset*/
2059
+ true
2060
+ );
2042
2061
  });
2043
2062
  } else {
2044
- calculateItemsInView();
2063
+ calculateItemsInView(
2064
+ /*isReset*/
2065
+ true
2066
+ );
2045
2067
  }
2046
2068
  return true;
2047
2069
  }
@@ -2077,6 +2099,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
2077
2099
  }
2078
2100
  const index = indexByKey.get(itemKey);
2079
2101
  const numColumns = peek$(ctx, "numColumns");
2102
+ state.scrollForNextCalculateItemsInView = void 0;
2080
2103
  state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
2081
2104
  const prevSize = getItemSize(itemKey, index, data);
2082
2105
  const prevSizeKnown = sizesKnown.get(itemKey);
@@ -1,16 +1,141 @@
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';
1
4
  import * as _legendapp_list from '@legendapp/list';
2
5
  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';
4
6
  import * as react_native from 'react-native';
5
7
  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 (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
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) | 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
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
62
+ alignItemsAtEnd?: boolean;
63
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
64
+ data: readonly T[];
65
+ drawDistance?: number;
66
+ estimatedItemSize?: number;
67
+ extraData?: any;
68
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
69
+ initialContainerPoolRatio?: number | undefined;
70
+ initialScrollOffset?: number;
71
+ initialScrollIndex?: number;
72
+ ItemSeparatorComponent?: React.ComponentType<{
73
+ leadingItem: T;
74
+ }> | undefined;
75
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
76
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
77
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
78
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
79
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
80
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
81
+ maintainScrollAtEnd?: boolean;
82
+ maintainScrollAtEndThreshold?: number;
83
+ maintainVisibleContentPosition?: boolean;
84
+ numColumns?: number;
85
+ onEndReached?: ((info: {
86
+ distanceFromEnd: number;
87
+ }) => void) | null | undefined;
88
+ onEndReachedThreshold?: number | null | undefined;
89
+ onItemSizeChanged?: ((info: {
90
+ size: number;
91
+ previous: number;
92
+ index: number;
93
+ itemKey: string;
94
+ itemData: T;
95
+ }) => void) | undefined;
96
+ onRefresh?: () => void;
97
+ onStartReached?: ((info: {
98
+ distanceFromStart: number;
99
+ }) => void) | null | undefined;
100
+ onStartReachedThreshold?: number | null | undefined;
101
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
102
+ progressViewOffset?: number;
103
+ recycleItems?: boolean;
104
+ refScrollView?: React.Ref<react_native.ScrollView>;
105
+ refreshing?: boolean;
106
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
107
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
108
+ suggestEstimatedItemSize?: boolean;
109
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
110
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
111
+ waitForInitialLayout?: boolean;
112
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
11
113
  getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
114
+ ItemSeparatorComponent?: React.ComponentType<{
115
+ leadingItem: ItemT_1;
116
+ }> | undefined;
12
117
  keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
118
+ onItemSizeChanged?: ((info: {
119
+ size: number;
120
+ previous: number;
121
+ index: number;
122
+ itemKey: string;
123
+ itemData: ItemT_1;
124
+ }) => void) | undefined;
125
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
13
126
  animatedProps?: Partial<{
127
+ contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
128
+ contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
129
+ maintainVisibleContentPosition?: {
130
+ autoscrollToTopThreshold?: number | null | undefined;
131
+ minIndexForVisible: number;
132
+ } | react_native_reanimated.SharedValue<{
133
+ autoscrollToTopThreshold?: number | null | undefined;
134
+ minIndexForVisible: number;
135
+ } | null | undefined> | null | undefined;
136
+ stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
137
+ removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
138
+ scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
14
139
  decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
15
140
  horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
16
141
  invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -24,7 +149,6 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
24
149
  onMomentumScrollBegin?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
25
150
  pagingEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
26
151
  scrollEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
27
- removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
28
152
  showsHorizontalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
29
153
  showsVerticalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
30
154
  stickyHeaderHiddenOnScroll?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -33,7 +157,6 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
33
157
  snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
34
158
  snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
35
159
  snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
36
- stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
37
160
  disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
38
161
  disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
39
162
  StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
@@ -137,26 +260,16 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
137
260
  bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
138
261
  canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
139
262
  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;
142
263
  contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
143
264
  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;
151
265
  maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
152
266
  minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
153
267
  onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
154
268
  pinchGestureEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
155
- scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
156
269
  scrollIndicatorInsets?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
157
270
  scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
158
271
  scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
159
- snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
272
+ snapToAlignment?: "end" | "start" | "center" | react_native_reanimated.SharedValue<"end" | "start" | "center" | undefined> | undefined;
160
273
  onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
161
274
  zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
162
275
  endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
@@ -166,8 +279,8 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
166
279
  fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
167
280
  persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
168
281
  } & {
169
- style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
170
282
  contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
283
+ style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
171
284
  indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
172
285
  } & {
173
286
  layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
@@ -177,122 +290,9 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
177
290
  sharedTransitionTag?: string;
178
291
  sharedTransitionStyle?: react_native_reanimated.SharedTransition;
179
292
  }> | undefined;
180
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | 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;
191
293
  } & {
192
294
  ref?: React.Ref<LegendListRef>;
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) | 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
- } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
245
- alignItemsAtEnd?: boolean;
246
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
247
- data: readonly T[];
248
- drawDistance?: number;
249
- estimatedItemSize?: number;
250
- extraData?: any;
251
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
252
- initialContainerPoolRatio?: number | undefined;
253
- initialScrollOffset?: number;
254
- initialScrollIndex?: number;
255
- ItemSeparatorComponent?: React.ComponentType<{
256
- leadingItem: T;
257
- }> | undefined;
258
- keyExtractor?: ((item: T, index: number) => string) | undefined;
259
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
260
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
261
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
262
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
263
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
264
- maintainScrollAtEnd?: boolean;
265
- maintainScrollAtEndThreshold?: number;
266
- maintainVisibleContentPosition?: boolean;
267
- numColumns?: number;
268
- onEndReached?: ((info: {
269
- distanceFromEnd: number;
270
- }) => void) | null | undefined;
271
- onEndReachedThreshold?: number | null | undefined;
272
- onItemSizeChanged?: ((info: {
273
- size: number;
274
- previous: number;
275
- index: number;
276
- itemKey: string;
277
- itemData: T;
278
- }) => void) | undefined;
279
- onRefresh?: () => void;
280
- onStartReached?: ((info: {
281
- distanceFromStart: number;
282
- }) => void) | null | undefined;
283
- onStartReachedThreshold?: number | null | undefined;
284
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
285
- progressViewOffset?: number;
286
- recycleItems?: boolean;
287
- refScrollView?: React.Ref<react_native.ScrollView>;
288
- refreshing?: boolean;
289
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
290
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
291
- suggestEstimatedItemSize?: boolean;
292
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
293
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
294
- waitForInitialLayout?: boolean;
295
- } & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
295
+ }) => React.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
296
296
  alignItemsAtEnd?: boolean;
297
297
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
298
298
  data: readonly T[];
@@ -343,7 +343,7 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
343
343
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
344
344
  viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
345
345
  waitForInitialLayout?: boolean;
346
- } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
346
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
347
347
  alignItemsAtEnd?: boolean;
348
348
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
349
349
  data: readonly ItemT[];
@@ -1,16 +1,141 @@
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';
1
4
  import * as _legendapp_list from '@legendapp/list';
2
5
  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';
4
6
  import * as react_native from 'react-native';
5
7
  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 (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
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) | 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
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
62
+ alignItemsAtEnd?: boolean;
63
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
64
+ data: readonly T[];
65
+ drawDistance?: number;
66
+ estimatedItemSize?: number;
67
+ extraData?: any;
68
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
69
+ initialContainerPoolRatio?: number | undefined;
70
+ initialScrollOffset?: number;
71
+ initialScrollIndex?: number;
72
+ ItemSeparatorComponent?: React.ComponentType<{
73
+ leadingItem: T;
74
+ }> | undefined;
75
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
76
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
77
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
78
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
79
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
80
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
81
+ maintainScrollAtEnd?: boolean;
82
+ maintainScrollAtEndThreshold?: number;
83
+ maintainVisibleContentPosition?: boolean;
84
+ numColumns?: number;
85
+ onEndReached?: ((info: {
86
+ distanceFromEnd: number;
87
+ }) => void) | null | undefined;
88
+ onEndReachedThreshold?: number | null | undefined;
89
+ onItemSizeChanged?: ((info: {
90
+ size: number;
91
+ previous: number;
92
+ index: number;
93
+ itemKey: string;
94
+ itemData: T;
95
+ }) => void) | undefined;
96
+ onRefresh?: () => void;
97
+ onStartReached?: ((info: {
98
+ distanceFromStart: number;
99
+ }) => void) | null | undefined;
100
+ onStartReachedThreshold?: number | null | undefined;
101
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
102
+ progressViewOffset?: number;
103
+ recycleItems?: boolean;
104
+ refScrollView?: React.Ref<react_native.ScrollView>;
105
+ refreshing?: boolean;
106
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
107
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
108
+ suggestEstimatedItemSize?: boolean;
109
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
110
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
111
+ waitForInitialLayout?: boolean;
112
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
11
113
  getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
114
+ ItemSeparatorComponent?: React.ComponentType<{
115
+ leadingItem: ItemT_1;
116
+ }> | undefined;
12
117
  keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
118
+ onItemSizeChanged?: ((info: {
119
+ size: number;
120
+ previous: number;
121
+ index: number;
122
+ itemKey: string;
123
+ itemData: ItemT_1;
124
+ }) => void) | undefined;
125
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
13
126
  animatedProps?: Partial<{
127
+ contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
128
+ contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
129
+ maintainVisibleContentPosition?: {
130
+ autoscrollToTopThreshold?: number | null | undefined;
131
+ minIndexForVisible: number;
132
+ } | react_native_reanimated.SharedValue<{
133
+ autoscrollToTopThreshold?: number | null | undefined;
134
+ minIndexForVisible: number;
135
+ } | null | undefined> | null | undefined;
136
+ stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
137
+ removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
138
+ scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
14
139
  decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
15
140
  horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
16
141
  invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -24,7 +149,6 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
24
149
  onMomentumScrollBegin?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
25
150
  pagingEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
26
151
  scrollEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
27
- removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
28
152
  showsHorizontalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
29
153
  showsVerticalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
30
154
  stickyHeaderHiddenOnScroll?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -33,7 +157,6 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
33
157
  snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
34
158
  snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
35
159
  snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
36
- stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
37
160
  disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
38
161
  disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
39
162
  StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
@@ -137,26 +260,16 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
137
260
  bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
138
261
  canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
139
262
  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;
142
263
  contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
143
264
  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;
151
265
  maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
152
266
  minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
153
267
  onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
154
268
  pinchGestureEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
155
- scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
156
269
  scrollIndicatorInsets?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
157
270
  scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
158
271
  scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
159
- snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
272
+ snapToAlignment?: "end" | "start" | "center" | react_native_reanimated.SharedValue<"end" | "start" | "center" | undefined> | undefined;
160
273
  onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
161
274
  zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
162
275
  endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
@@ -166,8 +279,8 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
166
279
  fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
167
280
  persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
168
281
  } & {
169
- style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
170
282
  contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
283
+ style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
171
284
  indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
172
285
  } & {
173
286
  layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
@@ -177,122 +290,9 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
177
290
  sharedTransitionTag?: string;
178
291
  sharedTransitionStyle?: react_native_reanimated.SharedTransition;
179
292
  }> | undefined;
180
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | 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;
191
293
  } & {
192
294
  ref?: React.Ref<LegendListRef>;
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) | 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
- } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
245
- alignItemsAtEnd?: boolean;
246
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
247
- data: readonly T[];
248
- drawDistance?: number;
249
- estimatedItemSize?: number;
250
- extraData?: any;
251
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
252
- initialContainerPoolRatio?: number | undefined;
253
- initialScrollOffset?: number;
254
- initialScrollIndex?: number;
255
- ItemSeparatorComponent?: React.ComponentType<{
256
- leadingItem: T;
257
- }> | undefined;
258
- keyExtractor?: ((item: T, index: number) => string) | undefined;
259
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
260
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
261
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
262
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
263
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
264
- maintainScrollAtEnd?: boolean;
265
- maintainScrollAtEndThreshold?: number;
266
- maintainVisibleContentPosition?: boolean;
267
- numColumns?: number;
268
- onEndReached?: ((info: {
269
- distanceFromEnd: number;
270
- }) => void) | null | undefined;
271
- onEndReachedThreshold?: number | null | undefined;
272
- onItemSizeChanged?: ((info: {
273
- size: number;
274
- previous: number;
275
- index: number;
276
- itemKey: string;
277
- itemData: T;
278
- }) => void) | undefined;
279
- onRefresh?: () => void;
280
- onStartReached?: ((info: {
281
- distanceFromStart: number;
282
- }) => void) | null | undefined;
283
- onStartReachedThreshold?: number | null | undefined;
284
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
285
- progressViewOffset?: number;
286
- recycleItems?: boolean;
287
- refScrollView?: React.Ref<react_native.ScrollView>;
288
- refreshing?: boolean;
289
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
290
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
291
- suggestEstimatedItemSize?: boolean;
292
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
293
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
294
- waitForInitialLayout?: boolean;
295
- } & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
295
+ }) => React.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
296
296
  alignItemsAtEnd?: boolean;
297
297
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
298
298
  data: readonly T[];
@@ -343,7 +343,7 @@ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendap
343
343
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
344
344
  viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
345
345
  waitForInitialLayout?: boolean;
346
- } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
346
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
347
347
  alignItemsAtEnd?: boolean;
348
348
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
349
349
  data: readonly ItemT[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
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,
@@ -28,5 +28,8 @@
28
28
  "homepage": "https://github.com/LegendApp/legend-list#readme",
29
29
  "publishConfig": {
30
30
  "registry": "https://registry.npmjs.org/"
31
+ },
32
+ "dependencies": {
33
+ "use-sync-external-store": "^1.5.0"
31
34
  }
32
35
  }