@legendapp/list 1.0.0-beta.43 → 1.0.0-beta.45

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.d.mts CHANGED
@@ -505,7 +505,7 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
505
505
  waitForInitialLayout?: boolean;
506
506
  } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
507
507
 
508
- declare function useViewability(configId: string, callback: ViewabilityCallback): void;
508
+ declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
509
509
  declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
510
510
  declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
511
511
  declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): [any, React$1.Dispatch<any>];
package/index.d.ts CHANGED
@@ -505,7 +505,7 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
505
505
  waitForInitialLayout?: boolean;
506
506
  } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
507
507
 
508
- declare function useViewability(configId: string, callback: ViewabilityCallback): void;
508
+ declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
509
509
  declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
510
510
  declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
511
511
  declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): [any, React$1.Dispatch<any>];
package/index.js CHANGED
@@ -154,10 +154,10 @@ function useInit(cb) {
154
154
 
155
155
  // src/ContextContainer.ts
156
156
  var ContextContainer = React6.createContext(null);
157
- function useViewability(configId, callback) {
157
+ function useViewability(callback, configId) {
158
158
  const ctx = useStateContext();
159
159
  const { containerId } = React6.useContext(ContextContainer);
160
- const key = containerId + configId;
160
+ const key = containerId + (configId != null ? configId : "");
161
161
  useInit(() => {
162
162
  const value = ctx.mapViewabilityValues.get(key);
163
163
  if (value) {
@@ -267,13 +267,20 @@ var Container = ({
267
267
  const refLastSize = React6.useRef();
268
268
  const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
269
269
  const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
270
- let verticalPaddingStyles;
270
+ let paddingStyles;
271
271
  if (columnWrapperStyle) {
272
272
  const { columnGap, rowGap, gap } = columnWrapperStyle;
273
- verticalPaddingStyles = {
274
- paddingBottom: !lastItemKeys.includes(itemKey) ? rowGap || gap || void 0 : void 0,
275
- paddingHorizontal: (columnGap || gap || 0) / 2
276
- };
273
+ if (horizontal) {
274
+ paddingStyles = {
275
+ paddingRight: !lastItemKeys.includes(itemKey) ? columnGap || gap || void 0 : void 0,
276
+ paddingVertical: (rowGap || gap || 0) / 2
277
+ };
278
+ } else {
279
+ paddingStyles = {
280
+ paddingBottom: !lastItemKeys.includes(itemKey) ? rowGap || gap || void 0 : void 0,
281
+ paddingHorizontal: (columnGap || gap || 0) / 2
282
+ };
283
+ }
277
284
  }
278
285
  const style = horizontal ? {
279
286
  flexDirection: ItemSeparatorComponent ? "row" : void 0,
@@ -281,14 +288,15 @@ var Container = ({
281
288
  top: otherAxisPos,
282
289
  bottom: numColumns > 1 ? null : 0,
283
290
  height: otherAxisSize,
284
- left: position.relativeCoordinate
291
+ left: position.relativeCoordinate,
292
+ ...paddingStyles || {}
285
293
  } : {
286
294
  position: "absolute",
287
295
  left: otherAxisPos,
288
296
  right: numColumns > 1 ? null : 0,
289
297
  width: otherAxisSize,
290
298
  top: position.relativeCoordinate,
291
- ...verticalPaddingStyles || {}
299
+ ...paddingStyles || {}
292
300
  };
293
301
  const renderedItemInfo = React6.useMemo(
294
302
  () => itemKey !== void 0 ? getRenderedItem(itemKey) : null,
@@ -386,7 +394,7 @@ var Containers = typedMemo(function Containers2({
386
394
  }) {
387
395
  const ctx = useStateContext();
388
396
  const columnWrapperStyle = ctx.columnWrapperStyle;
389
- const numColumns = use$("numColumns");
397
+ use$("numColumns");
390
398
  const numContainers = use$("numContainersPooled");
391
399
  const animSize = useValue$(
392
400
  "totalSizeWithScrollAdjust",
@@ -413,11 +421,18 @@ var Containers = typedMemo(function Containers2({
413
421
  );
414
422
  }
415
423
  const style = horizontal ? { width: animSize, opacity: animOpacity } : { height: animSize, opacity: animOpacity };
416
- if (columnWrapperStyle && !horizontal && numColumns > 1) {
424
+ if (columnWrapperStyle) {
417
425
  const { columnGap, rowGap, gap } = columnWrapperStyle;
418
- const mx = (columnGap || gap || 0) / 2;
419
- if (mx) {
420
- style.marginHorizontal = -mx;
426
+ if (horizontal) {
427
+ const my = (rowGap || gap || 0) / 2;
428
+ if (my) {
429
+ style.marginVertical = -my;
430
+ }
431
+ } else {
432
+ const mx = (columnGap || gap || 0) / 2;
433
+ if (mx) {
434
+ style.marginHorizontal = -mx;
435
+ }
421
436
  }
422
437
  }
423
438
  return /* @__PURE__ */ React6__namespace.createElement(reactNative.Animated.View, { style }, containers);
@@ -1024,19 +1039,44 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1024
1039
  }
1025
1040
  return void 0;
1026
1041
  };
1027
- const setDidLayout = () => {
1042
+ const scrollToIndex = ({
1043
+ index,
1044
+ viewOffset = 0,
1045
+ animated = true,
1046
+ viewPosition = 0
1047
+ }) => {
1028
1048
  var _a;
1049
+ const state = refState.current;
1050
+ const firstIndexOffset = calculateOffsetForIndex(index);
1051
+ let firstIndexScrollPostion = firstIndexOffset - viewOffset;
1052
+ const diff = Math.abs(state.scroll - firstIndexScrollPostion);
1053
+ const needsReanchoring = maintainVisibleContentPosition && diff > 100;
1054
+ state.scrollForNextCalculateItemsInView = void 0;
1055
+ if (needsReanchoring) {
1056
+ const id = getId(index);
1057
+ state.anchorElement = { id, coordinate: firstIndexOffset };
1058
+ (_a = state.belowAnchorElementPositions) == null ? void 0 : _a.clear();
1059
+ state.positions.clear();
1060
+ calcTotalSizesAndPositions({ forgetPositions: true });
1061
+ state.startBufferedId = id;
1062
+ state.minIndexSizeChanged = index;
1063
+ firstIndexScrollPostion = firstIndexOffset - viewOffset + state.scrollAdjustHandler.getAppliedAdjust();
1064
+ }
1065
+ if (viewPosition) {
1066
+ firstIndexScrollPostion -= viewPosition * (state.scrollLength - getItemSize(getId(index), index, state.data[index]));
1067
+ }
1068
+ state.scrollAdjustHandler.setDisableAdjust(true);
1069
+ state.scrollingToOffset = firstIndexScrollPostion;
1070
+ scrollTo(firstIndexScrollPostion, animated);
1071
+ };
1072
+ const setDidLayout = () => {
1029
1073
  refState.current.queuedInitialLayout = true;
1030
1074
  checkAtBottom();
1031
1075
  if (initialScrollIndex) {
1032
- const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
1033
- (_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler.setDisableAdjust(true);
1034
1076
  queueMicrotask(() => {
1035
- scrollTo(updatedOffset, false);
1077
+ scrollToIndex({ index: initialScrollIndex, animated: false });
1036
1078
  requestAnimationFrame(() => {
1037
- var _a2;
1038
1079
  set$(ctx, "containersDidLayout", true);
1039
- (_a2 = refState.current) == null ? void 0 : _a2.scrollAdjustHandler.setDisableAdjust(false);
1040
1080
  });
1041
1081
  });
1042
1082
  } else {
@@ -1938,36 +1978,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1938
1978
  React6.useImperativeHandle(
1939
1979
  forwardedRef,
1940
1980
  () => {
1941
- const scrollToIndex = ({
1942
- index,
1943
- viewOffset = 0,
1944
- animated = true,
1945
- viewPosition = 0
1946
- }) => {
1947
- var _a;
1948
- const state = refState.current;
1949
- const firstIndexOffset = calculateOffsetForIndex(index);
1950
- let firstIndexScrollPostion = firstIndexOffset - viewOffset;
1951
- const diff = Math.abs(state.scroll - firstIndexScrollPostion);
1952
- const needsReanchoring = maintainVisibleContentPosition && diff > 100;
1953
- state.scrollForNextCalculateItemsInView = void 0;
1954
- if (needsReanchoring) {
1955
- const id = getId(index);
1956
- state.anchorElement = { id, coordinate: firstIndexOffset };
1957
- (_a = state.belowAnchorElementPositions) == null ? void 0 : _a.clear();
1958
- state.positions.clear();
1959
- calcTotalSizesAndPositions({ forgetPositions: true });
1960
- state.startBufferedId = id;
1961
- state.minIndexSizeChanged = index;
1962
- firstIndexScrollPostion = firstIndexOffset - viewOffset + state.scrollAdjustHandler.getAppliedAdjust();
1963
- }
1964
- if (viewPosition) {
1965
- firstIndexScrollPostion -= viewPosition * (state.scrollLength - getItemSize(getId(index), index, state.data[index]));
1966
- }
1967
- state.scrollAdjustHandler.setDisableAdjust(true);
1968
- state.scrollingToOffset = firstIndexScrollPostion;
1969
- scrollTo(firstIndexScrollPostion, animated);
1970
- };
1971
1981
  const scrollIndexIntoView = (options) => {
1972
1982
  if (refState.current) {
1973
1983
  const { index, ...rest2 } = options;
package/index.mjs CHANGED
@@ -133,10 +133,10 @@ function useInit(cb) {
133
133
 
134
134
  // src/ContextContainer.ts
135
135
  var ContextContainer = createContext(null);
136
- function useViewability(configId, callback) {
136
+ function useViewability(callback, configId) {
137
137
  const ctx = useStateContext();
138
138
  const { containerId } = useContext(ContextContainer);
139
- const key = containerId + configId;
139
+ const key = containerId + (configId != null ? configId : "");
140
140
  useInit(() => {
141
141
  const value = ctx.mapViewabilityValues.get(key);
142
142
  if (value) {
@@ -246,13 +246,20 @@ var Container = ({
246
246
  const refLastSize = useRef();
247
247
  const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
248
248
  const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
249
- let verticalPaddingStyles;
249
+ let paddingStyles;
250
250
  if (columnWrapperStyle) {
251
251
  const { columnGap, rowGap, gap } = columnWrapperStyle;
252
- verticalPaddingStyles = {
253
- paddingBottom: !lastItemKeys.includes(itemKey) ? rowGap || gap || void 0 : void 0,
254
- paddingHorizontal: (columnGap || gap || 0) / 2
255
- };
252
+ if (horizontal) {
253
+ paddingStyles = {
254
+ paddingRight: !lastItemKeys.includes(itemKey) ? columnGap || gap || void 0 : void 0,
255
+ paddingVertical: (rowGap || gap || 0) / 2
256
+ };
257
+ } else {
258
+ paddingStyles = {
259
+ paddingBottom: !lastItemKeys.includes(itemKey) ? rowGap || gap || void 0 : void 0,
260
+ paddingHorizontal: (columnGap || gap || 0) / 2
261
+ };
262
+ }
256
263
  }
257
264
  const style = horizontal ? {
258
265
  flexDirection: ItemSeparatorComponent ? "row" : void 0,
@@ -260,14 +267,15 @@ var Container = ({
260
267
  top: otherAxisPos,
261
268
  bottom: numColumns > 1 ? null : 0,
262
269
  height: otherAxisSize,
263
- left: position.relativeCoordinate
270
+ left: position.relativeCoordinate,
271
+ ...paddingStyles || {}
264
272
  } : {
265
273
  position: "absolute",
266
274
  left: otherAxisPos,
267
275
  right: numColumns > 1 ? null : 0,
268
276
  width: otherAxisSize,
269
277
  top: position.relativeCoordinate,
270
- ...verticalPaddingStyles || {}
278
+ ...paddingStyles || {}
271
279
  };
272
280
  const renderedItemInfo = useMemo(
273
281
  () => itemKey !== void 0 ? getRenderedItem(itemKey) : null,
@@ -365,7 +373,7 @@ var Containers = typedMemo(function Containers2({
365
373
  }) {
366
374
  const ctx = useStateContext();
367
375
  const columnWrapperStyle = ctx.columnWrapperStyle;
368
- const numColumns = use$("numColumns");
376
+ use$("numColumns");
369
377
  const numContainers = use$("numContainersPooled");
370
378
  const animSize = useValue$(
371
379
  "totalSizeWithScrollAdjust",
@@ -392,11 +400,18 @@ var Containers = typedMemo(function Containers2({
392
400
  );
393
401
  }
394
402
  const style = horizontal ? { width: animSize, opacity: animOpacity } : { height: animSize, opacity: animOpacity };
395
- if (columnWrapperStyle && !horizontal && numColumns > 1) {
403
+ if (columnWrapperStyle) {
396
404
  const { columnGap, rowGap, gap } = columnWrapperStyle;
397
- const mx = (columnGap || gap || 0) / 2;
398
- if (mx) {
399
- style.marginHorizontal = -mx;
405
+ if (horizontal) {
406
+ const my = (rowGap || gap || 0) / 2;
407
+ if (my) {
408
+ style.marginVertical = -my;
409
+ }
410
+ } else {
411
+ const mx = (columnGap || gap || 0) / 2;
412
+ if (mx) {
413
+ style.marginHorizontal = -mx;
414
+ }
400
415
  }
401
416
  }
402
417
  return /* @__PURE__ */ React6.createElement(Animated.View, { style }, containers);
@@ -1003,19 +1018,44 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1003
1018
  }
1004
1019
  return void 0;
1005
1020
  };
1006
- const setDidLayout = () => {
1021
+ const scrollToIndex = ({
1022
+ index,
1023
+ viewOffset = 0,
1024
+ animated = true,
1025
+ viewPosition = 0
1026
+ }) => {
1007
1027
  var _a;
1028
+ const state = refState.current;
1029
+ const firstIndexOffset = calculateOffsetForIndex(index);
1030
+ let firstIndexScrollPostion = firstIndexOffset - viewOffset;
1031
+ const diff = Math.abs(state.scroll - firstIndexScrollPostion);
1032
+ const needsReanchoring = maintainVisibleContentPosition && diff > 100;
1033
+ state.scrollForNextCalculateItemsInView = void 0;
1034
+ if (needsReanchoring) {
1035
+ const id = getId(index);
1036
+ state.anchorElement = { id, coordinate: firstIndexOffset };
1037
+ (_a = state.belowAnchorElementPositions) == null ? void 0 : _a.clear();
1038
+ state.positions.clear();
1039
+ calcTotalSizesAndPositions({ forgetPositions: true });
1040
+ state.startBufferedId = id;
1041
+ state.minIndexSizeChanged = index;
1042
+ firstIndexScrollPostion = firstIndexOffset - viewOffset + state.scrollAdjustHandler.getAppliedAdjust();
1043
+ }
1044
+ if (viewPosition) {
1045
+ firstIndexScrollPostion -= viewPosition * (state.scrollLength - getItemSize(getId(index), index, state.data[index]));
1046
+ }
1047
+ state.scrollAdjustHandler.setDisableAdjust(true);
1048
+ state.scrollingToOffset = firstIndexScrollPostion;
1049
+ scrollTo(firstIndexScrollPostion, animated);
1050
+ };
1051
+ const setDidLayout = () => {
1008
1052
  refState.current.queuedInitialLayout = true;
1009
1053
  checkAtBottom();
1010
1054
  if (initialScrollIndex) {
1011
- const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
1012
- (_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler.setDisableAdjust(true);
1013
1055
  queueMicrotask(() => {
1014
- scrollTo(updatedOffset, false);
1056
+ scrollToIndex({ index: initialScrollIndex, animated: false });
1015
1057
  requestAnimationFrame(() => {
1016
- var _a2;
1017
1058
  set$(ctx, "containersDidLayout", true);
1018
- (_a2 = refState.current) == null ? void 0 : _a2.scrollAdjustHandler.setDisableAdjust(false);
1019
1059
  });
1020
1060
  });
1021
1061
  } else {
@@ -1917,36 +1957,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
1917
1957
  useImperativeHandle(
1918
1958
  forwardedRef,
1919
1959
  () => {
1920
- const scrollToIndex = ({
1921
- index,
1922
- viewOffset = 0,
1923
- animated = true,
1924
- viewPosition = 0
1925
- }) => {
1926
- var _a;
1927
- const state = refState.current;
1928
- const firstIndexOffset = calculateOffsetForIndex(index);
1929
- let firstIndexScrollPostion = firstIndexOffset - viewOffset;
1930
- const diff = Math.abs(state.scroll - firstIndexScrollPostion);
1931
- const needsReanchoring = maintainVisibleContentPosition && diff > 100;
1932
- state.scrollForNextCalculateItemsInView = void 0;
1933
- if (needsReanchoring) {
1934
- const id = getId(index);
1935
- state.anchorElement = { id, coordinate: firstIndexOffset };
1936
- (_a = state.belowAnchorElementPositions) == null ? void 0 : _a.clear();
1937
- state.positions.clear();
1938
- calcTotalSizesAndPositions({ forgetPositions: true });
1939
- state.startBufferedId = id;
1940
- state.minIndexSizeChanged = index;
1941
- firstIndexScrollPostion = firstIndexOffset - viewOffset + state.scrollAdjustHandler.getAppliedAdjust();
1942
- }
1943
- if (viewPosition) {
1944
- firstIndexScrollPostion -= viewPosition * (state.scrollLength - getItemSize(getId(index), index, state.data[index]));
1945
- }
1946
- state.scrollAdjustHandler.setDisableAdjust(true);
1947
- state.scrollingToOffset = firstIndexScrollPostion;
1948
- scrollTo(firstIndexScrollPostion, animated);
1949
- };
1950
1960
  const scrollIndexIntoView = (options) => {
1951
1961
  if (refState.current) {
1952
1962
  const { index, ...rest2 } = options;
@@ -1,136 +1,15 @@
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';
5
+ import * as react_native_reanimated from 'react-native-reanimated';
6
+ import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
7
7
  import * as React from 'react';
8
8
 
9
- declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
10
- alignItemsAtEnd?: boolean;
11
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
12
- data: readonly T[];
13
- drawDistance?: number;
14
- estimatedItemSize?: number;
15
- extraData?: any;
16
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
17
- initialContainerPoolRatio?: number | undefined;
18
- initialScrollOffset?: number;
19
- initialScrollIndex?: number;
20
- ItemSeparatorComponent?: React.ComponentType<{
21
- leadingItem: T;
22
- }> | undefined;
23
- keyExtractor?: ((item: T, index: number) => string) | undefined;
24
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
25
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
26
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
27
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
28
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
29
- maintainScrollAtEnd?: boolean;
30
- maintainScrollAtEndThreshold?: number;
31
- maintainVisibleContentPosition?: boolean;
32
- numColumns?: number;
33
- onEndReached?: ((info: {
34
- distanceFromEnd: number;
35
- }) => void) | null | undefined;
36
- onEndReachedThreshold?: number | null | undefined;
37
- onItemSizeChanged?: ((info: {
38
- size: number;
39
- previous: number;
40
- index: number;
41
- itemKey: string;
42
- itemData: T;
43
- }) => void) | undefined;
44
- onRefresh?: () => void;
45
- onStartReached?: ((info: {
46
- distanceFromStart: number;
47
- }) => void) | null | undefined;
48
- onStartReachedThreshold?: number | null | undefined;
49
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
50
- progressViewOffset?: number;
51
- recycleItems?: boolean;
52
- refScrollView?: React.Ref<react_native.ScrollView>;
53
- refreshing?: boolean;
54
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
55
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
56
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
57
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
58
- waitForInitialLayout?: boolean;
59
- } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
60
- alignItemsAtEnd?: boolean;
61
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
62
- data: readonly T[];
63
- drawDistance?: number;
64
- estimatedItemSize?: number;
65
- extraData?: any;
66
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
67
- initialContainerPoolRatio?: number | undefined;
68
- initialScrollOffset?: number;
69
- initialScrollIndex?: number;
70
- ItemSeparatorComponent?: React.ComponentType<{
71
- leadingItem: T;
72
- }> | undefined;
73
- keyExtractor?: ((item: T, index: number) => string) | undefined;
74
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
75
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
76
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
77
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
78
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
79
- maintainScrollAtEnd?: boolean;
80
- maintainScrollAtEndThreshold?: number;
81
- maintainVisibleContentPosition?: boolean;
82
- numColumns?: number;
83
- onEndReached?: ((info: {
84
- distanceFromEnd: number;
85
- }) => void) | null | undefined;
86
- onEndReachedThreshold?: number | null | undefined;
87
- onItemSizeChanged?: ((info: {
88
- size: number;
89
- previous: number;
90
- index: number;
91
- itemKey: string;
92
- itemData: T;
93
- }) => void) | undefined;
94
- onRefresh?: () => void;
95
- onStartReached?: ((info: {
96
- distanceFromStart: number;
97
- }) => void) | null | undefined;
98
- onStartReachedThreshold?: number | null | undefined;
99
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
100
- progressViewOffset?: number;
101
- recycleItems?: boolean;
102
- refScrollView?: React.Ref<react_native.ScrollView>;
103
- refreshing?: boolean;
104
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
105
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
106
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
107
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
108
- waitForInitialLayout?: boolean;
109
- } & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
9
+ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
110
10
  getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
111
- ItemSeparatorComponent?: React.ComponentType<{
112
- leadingItem: ItemT_1;
113
- }> | undefined;
114
11
  keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
115
- onItemSizeChanged?: ((info: {
116
- size: number;
117
- previous: number;
118
- index: number;
119
- itemKey: string;
120
- itemData: ItemT_1;
121
- }) => void) | undefined;
122
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
123
12
  animatedProps?: Partial<{
124
- contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
125
- contentInset?: react_native.Insets | react_native_reanimated.SharedValue<react_native.Insets | undefined> | undefined;
126
- maintainVisibleContentPosition?: {
127
- autoscrollToTopThreshold?: number | null | undefined;
128
- minIndexForVisible: number;
129
- } | react_native_reanimated.SharedValue<{
130
- autoscrollToTopThreshold?: number | null | undefined;
131
- minIndexForVisible: number;
132
- } | null | undefined> | null | undefined;
133
- stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
134
13
  decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
135
14
  horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
136
15
  invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -153,6 +32,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
153
32
  snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
154
33
  snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
155
34
  snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
35
+ stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
156
36
  disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
157
37
  disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
158
38
  StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
@@ -256,8 +136,17 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
256
136
  bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
257
137
  canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
258
138
  centerContent?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
139
+ contentInset?: react_native.Insets | react_native_reanimated.SharedValue<react_native.Insets | undefined> | undefined;
140
+ contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
259
141
  contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
260
142
  directionalLockEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
143
+ maintainVisibleContentPosition?: {
144
+ autoscrollToTopThreshold?: number | null | undefined;
145
+ minIndexForVisible: number;
146
+ } | react_native_reanimated.SharedValue<{
147
+ autoscrollToTopThreshold?: number | null | undefined;
148
+ minIndexForVisible: number;
149
+ } | null | undefined> | null | undefined;
261
150
  maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
262
151
  minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
263
152
  onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
@@ -266,7 +155,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
266
155
  scrollIndicatorInsets?: react_native.Insets | react_native_reanimated.SharedValue<react_native.Insets | undefined> | undefined;
267
156
  scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
268
157
  scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
269
- snapToAlignment?: "end" | "start" | "center" | react_native_reanimated.SharedValue<"end" | "start" | "center" | undefined> | undefined;
158
+ snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
270
159
  onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
271
160
  zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
272
161
  endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
@@ -276,8 +165,8 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
276
165
  fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
277
166
  persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
278
167
  } & {
279
- contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
280
168
  style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
169
+ contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
281
170
  indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
282
171
  } & {
283
172
  layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
@@ -287,9 +176,120 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
287
176
  sharedTransitionTag?: string;
288
177
  sharedTransitionStyle?: react_native_reanimated.SharedTransition;
289
178
  }> | undefined;
179
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
180
+ onItemSizeChanged?: ((info: {
181
+ size: number;
182
+ previous: number;
183
+ index: number;
184
+ itemKey: string;
185
+ itemData: ItemT_1;
186
+ }) => void) | undefined;
187
+ ItemSeparatorComponent?: React.ComponentType<{
188
+ leadingItem: ItemT_1;
189
+ }> | undefined;
290
190
  } & {
291
191
  ref?: React.Ref<LegendListRef>;
292
- }) => React.ReactElement | null) = <T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
192
+ }) => React.ReactElement | null) | (<T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
193
+ alignItemsAtEnd?: boolean;
194
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
195
+ data: readonly T[];
196
+ drawDistance?: number;
197
+ estimatedItemSize?: number;
198
+ extraData?: any;
199
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
200
+ initialContainerPoolRatio?: number | undefined;
201
+ initialScrollOffset?: number;
202
+ initialScrollIndex?: number;
203
+ ItemSeparatorComponent?: React.ComponentType<{
204
+ leadingItem: T;
205
+ }> | undefined;
206
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
207
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
208
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
209
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
210
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
211
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
212
+ maintainScrollAtEnd?: boolean;
213
+ maintainScrollAtEndThreshold?: number;
214
+ maintainVisibleContentPosition?: boolean;
215
+ numColumns?: number;
216
+ onEndReached?: ((info: {
217
+ distanceFromEnd: number;
218
+ }) => void) | null | undefined;
219
+ onEndReachedThreshold?: number | null | undefined;
220
+ onItemSizeChanged?: ((info: {
221
+ size: number;
222
+ previous: number;
223
+ index: number;
224
+ itemKey: string;
225
+ itemData: T;
226
+ }) => void) | undefined;
227
+ onRefresh?: () => void;
228
+ onStartReached?: ((info: {
229
+ distanceFromStart: number;
230
+ }) => void) | null | undefined;
231
+ onStartReachedThreshold?: number | null | undefined;
232
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
233
+ progressViewOffset?: number;
234
+ recycleItems?: boolean;
235
+ refScrollView?: React.Ref<react_native.ScrollView>;
236
+ refreshing?: boolean;
237
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
238
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
239
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
240
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
241
+ waitForInitialLayout?: boolean;
242
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
243
+ alignItemsAtEnd?: boolean;
244
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
245
+ data: readonly T[];
246
+ drawDistance?: number;
247
+ estimatedItemSize?: number;
248
+ extraData?: any;
249
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
250
+ initialContainerPoolRatio?: number | undefined;
251
+ initialScrollOffset?: number;
252
+ initialScrollIndex?: number;
253
+ ItemSeparatorComponent?: React.ComponentType<{
254
+ leadingItem: T;
255
+ }> | undefined;
256
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
257
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
258
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
259
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
260
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
261
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
262
+ maintainScrollAtEnd?: boolean;
263
+ maintainScrollAtEndThreshold?: number;
264
+ maintainVisibleContentPosition?: boolean;
265
+ numColumns?: number;
266
+ onEndReached?: ((info: {
267
+ distanceFromEnd: number;
268
+ }) => void) | null | undefined;
269
+ onEndReachedThreshold?: number | null | undefined;
270
+ onItemSizeChanged?: ((info: {
271
+ size: number;
272
+ previous: number;
273
+ index: number;
274
+ itemKey: string;
275
+ itemData: T;
276
+ }) => void) | undefined;
277
+ onRefresh?: () => void;
278
+ onStartReached?: ((info: {
279
+ distanceFromStart: number;
280
+ }) => void) | null | undefined;
281
+ onStartReachedThreshold?: number | null | undefined;
282
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
283
+ progressViewOffset?: number;
284
+ recycleItems?: boolean;
285
+ refScrollView?: React.Ref<react_native.ScrollView>;
286
+ refreshing?: boolean;
287
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
288
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
289
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
290
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
291
+ waitForInitialLayout?: boolean;
292
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
293
293
  alignItemsAtEnd?: boolean;
294
294
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
295
295
  data: readonly T[];
@@ -339,7 +339,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
339
339
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
340
340
  viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
341
341
  waitForInitialLayout?: boolean;
342
- } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
342
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
343
343
  alignItemsAtEnd?: boolean;
344
344
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
345
345
  data: readonly ItemT[];
@@ -1,136 +1,15 @@
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';
5
+ import * as react_native_reanimated from 'react-native-reanimated';
6
+ import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
7
7
  import * as React from 'react';
8
8
 
9
- declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
10
- alignItemsAtEnd?: boolean;
11
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
12
- data: readonly T[];
13
- drawDistance?: number;
14
- estimatedItemSize?: number;
15
- extraData?: any;
16
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
17
- initialContainerPoolRatio?: number | undefined;
18
- initialScrollOffset?: number;
19
- initialScrollIndex?: number;
20
- ItemSeparatorComponent?: React.ComponentType<{
21
- leadingItem: T;
22
- }> | undefined;
23
- keyExtractor?: ((item: T, index: number) => string) | undefined;
24
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
25
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
26
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
27
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
28
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
29
- maintainScrollAtEnd?: boolean;
30
- maintainScrollAtEndThreshold?: number;
31
- maintainVisibleContentPosition?: boolean;
32
- numColumns?: number;
33
- onEndReached?: ((info: {
34
- distanceFromEnd: number;
35
- }) => void) | null | undefined;
36
- onEndReachedThreshold?: number | null | undefined;
37
- onItemSizeChanged?: ((info: {
38
- size: number;
39
- previous: number;
40
- index: number;
41
- itemKey: string;
42
- itemData: T;
43
- }) => void) | undefined;
44
- onRefresh?: () => void;
45
- onStartReached?: ((info: {
46
- distanceFromStart: number;
47
- }) => void) | null | undefined;
48
- onStartReachedThreshold?: number | null | undefined;
49
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
50
- progressViewOffset?: number;
51
- recycleItems?: boolean;
52
- refScrollView?: React.Ref<react_native.ScrollView>;
53
- refreshing?: boolean;
54
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
55
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
56
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
57
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
58
- waitForInitialLayout?: boolean;
59
- } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
60
- alignItemsAtEnd?: boolean;
61
- columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
62
- data: readonly T[];
63
- drawDistance?: number;
64
- estimatedItemSize?: number;
65
- extraData?: any;
66
- getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
67
- initialContainerPoolRatio?: number | undefined;
68
- initialScrollOffset?: number;
69
- initialScrollIndex?: number;
70
- ItemSeparatorComponent?: React.ComponentType<{
71
- leadingItem: T;
72
- }> | undefined;
73
- keyExtractor?: ((item: T, index: number) => string) | undefined;
74
- ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
75
- ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
76
- ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
77
- ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
78
- ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
79
- maintainScrollAtEnd?: boolean;
80
- maintainScrollAtEndThreshold?: number;
81
- maintainVisibleContentPosition?: boolean;
82
- numColumns?: number;
83
- onEndReached?: ((info: {
84
- distanceFromEnd: number;
85
- }) => void) | null | undefined;
86
- onEndReachedThreshold?: number | null | undefined;
87
- onItemSizeChanged?: ((info: {
88
- size: number;
89
- previous: number;
90
- index: number;
91
- itemKey: string;
92
- itemData: T;
93
- }) => void) | undefined;
94
- onRefresh?: () => void;
95
- onStartReached?: ((info: {
96
- distanceFromStart: number;
97
- }) => void) | null | undefined;
98
- onStartReachedThreshold?: number | null | undefined;
99
- onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
100
- progressViewOffset?: number;
101
- recycleItems?: boolean;
102
- refScrollView?: React.Ref<react_native.ScrollView>;
103
- refreshing?: boolean;
104
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
105
- renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
106
- viewabilityConfig?: _legendapp_list.ViewabilityConfig;
107
- viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
108
- waitForInitialLayout?: boolean;
109
- } & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
9
+ declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
110
10
  getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
111
- ItemSeparatorComponent?: React.ComponentType<{
112
- leadingItem: ItemT_1;
113
- }> | undefined;
114
11
  keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
115
- onItemSizeChanged?: ((info: {
116
- size: number;
117
- previous: number;
118
- index: number;
119
- itemKey: string;
120
- itemData: ItemT_1;
121
- }) => void) | undefined;
122
- renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
123
12
  animatedProps?: Partial<{
124
- contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
125
- contentInset?: react_native.Insets | react_native_reanimated.SharedValue<react_native.Insets | undefined> | undefined;
126
- maintainVisibleContentPosition?: {
127
- autoscrollToTopThreshold?: number | null | undefined;
128
- minIndexForVisible: number;
129
- } | react_native_reanimated.SharedValue<{
130
- autoscrollToTopThreshold?: number | null | undefined;
131
- minIndexForVisible: number;
132
- } | null | undefined> | null | undefined;
133
- stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
134
13
  decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
135
14
  horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
136
15
  invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
@@ -153,6 +32,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
153
32
  snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
154
33
  snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
155
34
  snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
35
+ stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
156
36
  disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
157
37
  disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
158
38
  StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
@@ -256,8 +136,17 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
256
136
  bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
257
137
  canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
258
138
  centerContent?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
139
+ contentInset?: react_native.Insets | react_native_reanimated.SharedValue<react_native.Insets | undefined> | undefined;
140
+ contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
259
141
  contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
260
142
  directionalLockEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
143
+ maintainVisibleContentPosition?: {
144
+ autoscrollToTopThreshold?: number | null | undefined;
145
+ minIndexForVisible: number;
146
+ } | react_native_reanimated.SharedValue<{
147
+ autoscrollToTopThreshold?: number | null | undefined;
148
+ minIndexForVisible: number;
149
+ } | null | undefined> | null | undefined;
261
150
  maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
262
151
  minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
263
152
  onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
@@ -266,7 +155,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
266
155
  scrollIndicatorInsets?: react_native.Insets | react_native_reanimated.SharedValue<react_native.Insets | undefined> | undefined;
267
156
  scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
268
157
  scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
269
- snapToAlignment?: "end" | "start" | "center" | react_native_reanimated.SharedValue<"end" | "start" | "center" | undefined> | undefined;
158
+ snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
270
159
  onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
271
160
  zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
272
161
  endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
@@ -276,8 +165,8 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
276
165
  fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
277
166
  persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
278
167
  } & {
279
- contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
280
168
  style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
169
+ contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
281
170
  indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
282
171
  } & {
283
172
  layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
@@ -287,9 +176,120 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
287
176
  sharedTransitionTag?: string;
288
177
  sharedTransitionStyle?: react_native_reanimated.SharedTransition;
289
178
  }> | undefined;
179
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
180
+ onItemSizeChanged?: ((info: {
181
+ size: number;
182
+ previous: number;
183
+ index: number;
184
+ itemKey: string;
185
+ itemData: ItemT_1;
186
+ }) => void) | undefined;
187
+ ItemSeparatorComponent?: React.ComponentType<{
188
+ leadingItem: ItemT_1;
189
+ }> | undefined;
290
190
  } & {
291
191
  ref?: React.Ref<LegendListRef>;
292
- }) => React.ReactElement | null) = <T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
192
+ }) => React.ReactElement | null) | (<T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
193
+ alignItemsAtEnd?: boolean;
194
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
195
+ data: readonly T[];
196
+ drawDistance?: number;
197
+ estimatedItemSize?: number;
198
+ extraData?: any;
199
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
200
+ initialContainerPoolRatio?: number | undefined;
201
+ initialScrollOffset?: number;
202
+ initialScrollIndex?: number;
203
+ ItemSeparatorComponent?: React.ComponentType<{
204
+ leadingItem: T;
205
+ }> | undefined;
206
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
207
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
208
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
209
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
210
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
211
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
212
+ maintainScrollAtEnd?: boolean;
213
+ maintainScrollAtEndThreshold?: number;
214
+ maintainVisibleContentPosition?: boolean;
215
+ numColumns?: number;
216
+ onEndReached?: ((info: {
217
+ distanceFromEnd: number;
218
+ }) => void) | null | undefined;
219
+ onEndReachedThreshold?: number | null | undefined;
220
+ onItemSizeChanged?: ((info: {
221
+ size: number;
222
+ previous: number;
223
+ index: number;
224
+ itemKey: string;
225
+ itemData: T;
226
+ }) => void) | undefined;
227
+ onRefresh?: () => void;
228
+ onStartReached?: ((info: {
229
+ distanceFromStart: number;
230
+ }) => void) | null | undefined;
231
+ onStartReachedThreshold?: number | null | undefined;
232
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
233
+ progressViewOffset?: number;
234
+ recycleItems?: boolean;
235
+ refScrollView?: React.Ref<react_native.ScrollView>;
236
+ refreshing?: boolean;
237
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
238
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
239
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
240
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
241
+ waitForInitialLayout?: boolean;
242
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
243
+ alignItemsAtEnd?: boolean;
244
+ columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
245
+ data: readonly T[];
246
+ drawDistance?: number;
247
+ estimatedItemSize?: number;
248
+ extraData?: any;
249
+ getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
250
+ initialContainerPoolRatio?: number | undefined;
251
+ initialScrollOffset?: number;
252
+ initialScrollIndex?: number;
253
+ ItemSeparatorComponent?: React.ComponentType<{
254
+ leadingItem: T;
255
+ }> | undefined;
256
+ keyExtractor?: ((item: T, index: number) => string) | undefined;
257
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
258
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
259
+ ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
260
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
261
+ ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
262
+ maintainScrollAtEnd?: boolean;
263
+ maintainScrollAtEndThreshold?: number;
264
+ maintainVisibleContentPosition?: boolean;
265
+ numColumns?: number;
266
+ onEndReached?: ((info: {
267
+ distanceFromEnd: number;
268
+ }) => void) | null | undefined;
269
+ onEndReachedThreshold?: number | null | undefined;
270
+ onItemSizeChanged?: ((info: {
271
+ size: number;
272
+ previous: number;
273
+ index: number;
274
+ itemKey: string;
275
+ itemData: T;
276
+ }) => void) | undefined;
277
+ onRefresh?: () => void;
278
+ onStartReached?: ((info: {
279
+ distanceFromStart: number;
280
+ }) => void) | null | undefined;
281
+ onStartReachedThreshold?: number | null | undefined;
282
+ onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
283
+ progressViewOffset?: number;
284
+ recycleItems?: boolean;
285
+ refScrollView?: React.Ref<react_native.ScrollView>;
286
+ refreshing?: boolean;
287
+ renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
288
+ renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
289
+ viewabilityConfig?: _legendapp_list.ViewabilityConfig;
290
+ viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
291
+ waitForInitialLayout?: boolean;
292
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
293
293
  alignItemsAtEnd?: boolean;
294
294
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
295
295
  data: readonly T[];
@@ -339,7 +339,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
339
339
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
340
340
  viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
341
341
  waitForInitialLayout?: boolean;
342
- } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
342
+ } & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
343
343
  alignItemsAtEnd?: boolean;
344
344
  columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
345
345
  data: readonly ItemT[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "1.0.0-beta.43",
3
+ "version": "1.0.0-beta.45",
4
4
  "description": "Legend List aims to be a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
5
5
  "sideEffects": false,
6
6
  "private": false,