@legendapp/list 2.0.0-next.1 → 2.0.0-next.10
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/animated.d.mts +3 -2
- package/animated.d.ts +3 -2
- package/animated.js +2 -2
- package/animated.mjs +2 -2
- package/index.d.mts +56 -33
- package/index.d.ts +56 -33
- package/index.js +1064 -993
- package/index.mjs +1063 -992
- package/keyboard-controller.d.mts +8 -4
- package/keyboard-controller.d.ts +8 -4
- package/keyboard-controller.js +4 -4
- package/keyboard-controller.mjs +4 -4
- package/package.json +1 -1
- package/reanimated.d.mts +1 -1
- package/reanimated.d.ts +1 -1
- package/reanimated.js +7 -7
- package/reanimated.mjs +7 -7
package/animated.d.mts
CHANGED
|
@@ -31,7 +31,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
31
31
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
32
32
|
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
33
33
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
34
|
-
maintainScrollAtEnd?: boolean;
|
|
34
|
+
maintainScrollAtEnd?: boolean | _legendapp_list.MaintainScrollAtEndOptions;
|
|
35
35
|
maintainScrollAtEndThreshold?: number;
|
|
36
36
|
maintainVisibleContentPosition?: boolean;
|
|
37
37
|
numColumns?: number;
|
|
@@ -56,7 +56,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
56
56
|
recycleItems?: boolean;
|
|
57
57
|
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
58
58
|
refreshing?: boolean;
|
|
59
|
-
renderItem?:
|
|
59
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
|
|
60
60
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
61
61
|
suggestEstimatedItemSize?: boolean;
|
|
62
62
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
@@ -65,6 +65,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
65
65
|
onLoad?: (info: {
|
|
66
66
|
elapsedTimeInMs: number;
|
|
67
67
|
}) => void;
|
|
68
|
+
snapToIndices?: number[];
|
|
68
69
|
} & React$1.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode)>;
|
|
69
70
|
|
|
70
71
|
export { AnimatedLegendList };
|
package/animated.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
31
31
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
32
32
|
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
33
33
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
34
|
-
maintainScrollAtEnd?: boolean;
|
|
34
|
+
maintainScrollAtEnd?: boolean | _legendapp_list.MaintainScrollAtEndOptions;
|
|
35
35
|
maintainScrollAtEndThreshold?: number;
|
|
36
36
|
maintainVisibleContentPosition?: boolean;
|
|
37
37
|
numColumns?: number;
|
|
@@ -56,7 +56,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
56
56
|
recycleItems?: boolean;
|
|
57
57
|
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
58
58
|
refreshing?: boolean;
|
|
59
|
-
renderItem?:
|
|
59
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
|
|
60
60
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
61
61
|
suggestEstimatedItemSize?: boolean;
|
|
62
62
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
@@ -65,6 +65,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
65
65
|
onLoad?: (info: {
|
|
66
66
|
elapsedTimeInMs: number;
|
|
67
67
|
}) => void;
|
|
68
|
+
snapToIndices?: number[];
|
|
68
69
|
} & React$1.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode)>;
|
|
69
70
|
|
|
70
71
|
export { AnimatedLegendList };
|
package/animated.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var list = require('@legendapp/list');
|
|
4
3
|
var reactNative = require('react-native');
|
|
4
|
+
var list = require('@legendapp/list');
|
|
5
5
|
|
|
6
|
-
// src/animated.tsx
|
|
6
|
+
// src/integrations/animated.tsx
|
|
7
7
|
var AnimatedLegendList = reactNative.Animated.createAnimatedComponent(list.LegendList);
|
|
8
8
|
|
|
9
9
|
exports.AnimatedLegendList = AnimatedLegendList;
|
package/animated.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LegendList } from '@legendapp/list';
|
|
2
1
|
import { Animated } from 'react-native';
|
|
2
|
+
import { LegendList } from '@legendapp/list';
|
|
3
3
|
|
|
4
|
-
// src/animated.tsx
|
|
4
|
+
// src/integrations/animated.tsx
|
|
5
5
|
var AnimatedLegendList = Animated.createAnimatedComponent(LegendList);
|
|
6
6
|
|
|
7
7
|
export { AnimatedLegendList };
|
package/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
1
2
|
import * as React$1 from 'react';
|
|
2
3
|
import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
4
|
import * as react_native from 'react-native';
|
|
4
|
-
import { View, ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
|
|
5
|
-
import Animated from 'react-native-reanimated';
|
|
6
|
-
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
5
|
+
import { View, ScrollView, Animated, StyleProp, ViewStyle, ScrollViewProps, LayoutRectangle, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
|
|
6
|
+
import Animated$1 from 'react-native-reanimated';
|
|
7
7
|
|
|
8
|
-
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "scrollSize";
|
|
8
|
+
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize";
|
|
9
9
|
interface StateContext {
|
|
10
10
|
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
11
11
|
values: Map<ListenerType, any>;
|
|
@@ -26,7 +26,7 @@ declare class ScrollAdjustHandler {
|
|
|
26
26
|
setMounted(): void;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
29
|
+
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Animated$1.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
30
30
|
/**
|
|
31
31
|
* If true, aligns items at the end of the list.
|
|
32
32
|
* @default false
|
|
@@ -122,7 +122,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
122
122
|
* If true, auto-scrolls to end when new items are added.
|
|
123
123
|
* @default false
|
|
124
124
|
*/
|
|
125
|
-
maintainScrollAtEnd?: boolean;
|
|
125
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
126
126
|
/**
|
|
127
127
|
* Distance threshold in percentage of screen size to trigger maintainScrollAtEnd.
|
|
128
128
|
* @default 0.1
|
|
@@ -232,7 +232,13 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
232
232
|
onLoad?: (info: {
|
|
233
233
|
elapsedTimeInMs: number;
|
|
234
234
|
}) => void;
|
|
235
|
+
snapToIndices?: number[];
|
|
235
236
|
};
|
|
237
|
+
interface MaintainScrollAtEndOptions {
|
|
238
|
+
onLayout?: boolean;
|
|
239
|
+
onItemLayout?: boolean;
|
|
240
|
+
onDataChange?: boolean;
|
|
241
|
+
}
|
|
236
242
|
interface ColumnWrapperStyle {
|
|
237
243
|
rowGap?: number;
|
|
238
244
|
gap?: number;
|
|
@@ -309,6 +315,16 @@ interface InternalState {
|
|
|
309
315
|
refScroller: React.RefObject<ScrollView>;
|
|
310
316
|
loadStartTime: number;
|
|
311
317
|
initialScroll: ScrollIndexWithOffsetPosition | undefined;
|
|
318
|
+
lastLayout: LayoutRectangle | undefined;
|
|
319
|
+
queuedItemSizeUpdates: {
|
|
320
|
+
itemKey: string;
|
|
321
|
+
sizeObj: {
|
|
322
|
+
width: number;
|
|
323
|
+
height: number;
|
|
324
|
+
};
|
|
325
|
+
}[];
|
|
326
|
+
queuedItemSizeUpdatesWaiting?: boolean;
|
|
327
|
+
timeoutSetPaddingTop?: any;
|
|
312
328
|
props: {
|
|
313
329
|
alignItemsAtEnd: boolean;
|
|
314
330
|
data: readonly any[];
|
|
@@ -316,7 +332,7 @@ interface InternalState {
|
|
|
316
332
|
getEstimatedItemSize: ((index: number, item: any) => number) | undefined;
|
|
317
333
|
horizontal: boolean;
|
|
318
334
|
keyExtractor: ((item: any, index: number) => string) | undefined;
|
|
319
|
-
maintainScrollAtEnd: boolean;
|
|
335
|
+
maintainScrollAtEnd: boolean | MaintainScrollAtEndOptions;
|
|
320
336
|
maintainScrollAtEndThreshold: number | undefined;
|
|
321
337
|
maintainVisibleContentPosition: boolean;
|
|
322
338
|
onEndReached: (((info: {
|
|
@@ -347,10 +363,10 @@ interface InternalState {
|
|
|
347
363
|
viewPosition?: number;
|
|
348
364
|
} | undefined;
|
|
349
365
|
scrollBuffer: number;
|
|
350
|
-
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs | undefined;
|
|
351
366
|
numColumns: number;
|
|
352
367
|
initialContainerPoolRatio: number;
|
|
353
368
|
stylePaddingTop: number | undefined;
|
|
369
|
+
snapToIndices: number[] | undefined;
|
|
354
370
|
};
|
|
355
371
|
}
|
|
356
372
|
interface ViewableRange<T> {
|
|
@@ -371,6 +387,7 @@ type ScrollState = {
|
|
|
371
387
|
endBuffered: number;
|
|
372
388
|
isAtEnd: boolean;
|
|
373
389
|
isAtStart: boolean;
|
|
390
|
+
positions: Map<string, number>;
|
|
374
391
|
scroll: number;
|
|
375
392
|
scrollLength: number;
|
|
376
393
|
start: number;
|
|
@@ -423,9 +440,11 @@ type LegendListRef = {
|
|
|
423
440
|
* Scrolls to the end of the list.
|
|
424
441
|
* @param options - Options for scrolling.
|
|
425
442
|
* @param options.animated - If true, animates the scroll. Default: true.
|
|
443
|
+
* @param options.viewOffset - Offset from the target position.
|
|
426
444
|
*/
|
|
427
445
|
scrollToEnd(options?: {
|
|
428
446
|
animated?: boolean | undefined;
|
|
447
|
+
viewOffset?: number | undefined;
|
|
429
448
|
}): void;
|
|
430
449
|
/**
|
|
431
450
|
* Scrolls to a specific index in the list.
|
|
@@ -534,7 +553,7 @@ interface LegendListRecyclingState<T> {
|
|
|
534
553
|
}
|
|
535
554
|
type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode) => (props: P & React.RefAttributes<T>) => React.ReactNode;
|
|
536
555
|
declare const typedForwardRef: TypedForwardRef;
|
|
537
|
-
type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<
|
|
556
|
+
type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.JSXElementConstructor<T>>, nextProps: Readonly<React.JSXElementConstructor<T>>) => boolean) => T & {
|
|
538
557
|
displayName?: string;
|
|
539
558
|
};
|
|
540
559
|
declare const typedMemo: TypedMemo;
|
|
@@ -550,7 +569,11 @@ type GetRenderedItemResult<ItemT> = {
|
|
|
550
569
|
};
|
|
551
570
|
type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
|
|
552
571
|
|
|
553
|
-
|
|
572
|
+
interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
|
|
573
|
+
children?: React$1.ReactNode | undefined;
|
|
574
|
+
LegendList?: ListT;
|
|
575
|
+
}
|
|
576
|
+
declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
554
577
|
alignItemsAtEnd?: boolean;
|
|
555
578
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
556
579
|
data: readonly T[];
|
|
@@ -578,7 +601,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
578
601
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
579
602
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
580
603
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
581
|
-
maintainScrollAtEnd?: boolean;
|
|
604
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
582
605
|
maintainScrollAtEndThreshold?: number;
|
|
583
606
|
maintainVisibleContentPosition?: boolean;
|
|
584
607
|
numColumns?: number;
|
|
@@ -601,9 +624,9 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
601
624
|
onViewableItemsChanged?: OnViewableItemsChanged | undefined;
|
|
602
625
|
progressViewOffset?: number;
|
|
603
626
|
recycleItems?: boolean;
|
|
604
|
-
refScrollView?: React$1.Ref<ScrollView>;
|
|
627
|
+
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
605
628
|
refreshing?: boolean;
|
|
606
|
-
renderItem?:
|
|
629
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
607
630
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
608
631
|
suggestEstimatedItemSize?: boolean;
|
|
609
632
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -612,13 +635,8 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
612
635
|
onLoad?: (info: {
|
|
613
636
|
elapsedTimeInMs: number;
|
|
614
637
|
}) => void;
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
|
|
618
|
-
children?: React$1.ReactNode | undefined;
|
|
619
|
-
LegendList?: ListT;
|
|
620
|
-
}
|
|
621
|
-
declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
638
|
+
snapToIndices?: number[];
|
|
639
|
+
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
622
640
|
alignItemsAtEnd?: boolean;
|
|
623
641
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
624
642
|
data: readonly T[];
|
|
@@ -646,7 +664,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
646
664
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
647
665
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
648
666
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
649
|
-
maintainScrollAtEnd?: boolean;
|
|
667
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
650
668
|
maintainScrollAtEndThreshold?: number;
|
|
651
669
|
maintainVisibleContentPosition?: boolean;
|
|
652
670
|
numColumns?: number;
|
|
@@ -671,7 +689,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
671
689
|
recycleItems?: boolean;
|
|
672
690
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
673
691
|
refreshing?: boolean;
|
|
674
|
-
renderItem?:
|
|
692
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
675
693
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
676
694
|
suggestEstimatedItemSize?: boolean;
|
|
677
695
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -680,7 +698,10 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
680
698
|
onLoad?: (info: {
|
|
681
699
|
elapsedTimeInMs: number;
|
|
682
700
|
}) => void;
|
|
683
|
-
|
|
701
|
+
snapToIndices?: number[];
|
|
702
|
+
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
|
|
703
|
+
ref?: React$1.Ref<LegendListRef>;
|
|
704
|
+
}) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
684
705
|
alignItemsAtEnd?: boolean;
|
|
685
706
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
686
707
|
data: readonly T[];
|
|
@@ -708,7 +729,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
708
729
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
709
730
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
710
731
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
711
|
-
maintainScrollAtEnd?: boolean;
|
|
732
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
712
733
|
maintainScrollAtEndThreshold?: number;
|
|
713
734
|
maintainVisibleContentPosition?: boolean;
|
|
714
735
|
numColumns?: number;
|
|
@@ -733,7 +754,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
733
754
|
recycleItems?: boolean;
|
|
734
755
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
735
756
|
refreshing?: boolean;
|
|
736
|
-
renderItem?:
|
|
757
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
737
758
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
738
759
|
suggestEstimatedItemSize?: boolean;
|
|
739
760
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -742,9 +763,10 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
742
763
|
onLoad?: (info: {
|
|
743
764
|
elapsedTimeInMs: number;
|
|
744
765
|
}) => void;
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
766
|
+
snapToIndices?: number[];
|
|
767
|
+
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
|
|
768
|
+
|
|
769
|
+
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
748
770
|
alignItemsAtEnd?: boolean;
|
|
749
771
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
750
772
|
data: readonly T[];
|
|
@@ -772,7 +794,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
772
794
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
773
795
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
774
796
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
775
|
-
maintainScrollAtEnd?: boolean;
|
|
797
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
776
798
|
maintainScrollAtEndThreshold?: number;
|
|
777
799
|
maintainVisibleContentPosition?: boolean;
|
|
778
800
|
numColumns?: number;
|
|
@@ -795,9 +817,9 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
795
817
|
onViewableItemsChanged?: OnViewableItemsChanged | undefined;
|
|
796
818
|
progressViewOffset?: number;
|
|
797
819
|
recycleItems?: boolean;
|
|
798
|
-
refScrollView?: React$1.Ref<
|
|
820
|
+
refScrollView?: React$1.Ref<ScrollView>;
|
|
799
821
|
refreshing?: boolean;
|
|
800
|
-
renderItem?:
|
|
822
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
801
823
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
802
824
|
suggestEstimatedItemSize?: boolean;
|
|
803
825
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -806,7 +828,8 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
806
828
|
onLoad?: (info: {
|
|
807
829
|
elapsedTimeInMs: number;
|
|
808
830
|
}) => void;
|
|
809
|
-
|
|
831
|
+
snapToIndices?: number[];
|
|
832
|
+
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
|
|
810
833
|
|
|
811
834
|
declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
|
|
812
835
|
declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
|
|
@@ -818,4 +841,4 @@ declare function useListScrollSize(): {
|
|
|
818
841
|
height: number;
|
|
819
842
|
};
|
|
820
843
|
|
|
821
|
-
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
|
|
844
|
+
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
|
package/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
1
2
|
import * as React$1 from 'react';
|
|
2
3
|
import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
4
|
import * as react_native from 'react-native';
|
|
4
|
-
import { View, ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
|
|
5
|
-
import Animated from 'react-native-reanimated';
|
|
6
|
-
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
5
|
+
import { View, ScrollView, Animated, StyleProp, ViewStyle, ScrollViewProps, LayoutRectangle, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
|
|
6
|
+
import Animated$1 from 'react-native-reanimated';
|
|
7
7
|
|
|
8
|
-
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "scrollSize";
|
|
8
|
+
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize";
|
|
9
9
|
interface StateContext {
|
|
10
10
|
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
11
11
|
values: Map<ListenerType, any>;
|
|
@@ -26,7 +26,7 @@ declare class ScrollAdjustHandler {
|
|
|
26
26
|
setMounted(): void;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
29
|
+
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Animated$1.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
30
30
|
/**
|
|
31
31
|
* If true, aligns items at the end of the list.
|
|
32
32
|
* @default false
|
|
@@ -122,7 +122,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
122
122
|
* If true, auto-scrolls to end when new items are added.
|
|
123
123
|
* @default false
|
|
124
124
|
*/
|
|
125
|
-
maintainScrollAtEnd?: boolean;
|
|
125
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
126
126
|
/**
|
|
127
127
|
* Distance threshold in percentage of screen size to trigger maintainScrollAtEnd.
|
|
128
128
|
* @default 0.1
|
|
@@ -232,7 +232,13 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
232
232
|
onLoad?: (info: {
|
|
233
233
|
elapsedTimeInMs: number;
|
|
234
234
|
}) => void;
|
|
235
|
+
snapToIndices?: number[];
|
|
235
236
|
};
|
|
237
|
+
interface MaintainScrollAtEndOptions {
|
|
238
|
+
onLayout?: boolean;
|
|
239
|
+
onItemLayout?: boolean;
|
|
240
|
+
onDataChange?: boolean;
|
|
241
|
+
}
|
|
236
242
|
interface ColumnWrapperStyle {
|
|
237
243
|
rowGap?: number;
|
|
238
244
|
gap?: number;
|
|
@@ -309,6 +315,16 @@ interface InternalState {
|
|
|
309
315
|
refScroller: React.RefObject<ScrollView>;
|
|
310
316
|
loadStartTime: number;
|
|
311
317
|
initialScroll: ScrollIndexWithOffsetPosition | undefined;
|
|
318
|
+
lastLayout: LayoutRectangle | undefined;
|
|
319
|
+
queuedItemSizeUpdates: {
|
|
320
|
+
itemKey: string;
|
|
321
|
+
sizeObj: {
|
|
322
|
+
width: number;
|
|
323
|
+
height: number;
|
|
324
|
+
};
|
|
325
|
+
}[];
|
|
326
|
+
queuedItemSizeUpdatesWaiting?: boolean;
|
|
327
|
+
timeoutSetPaddingTop?: any;
|
|
312
328
|
props: {
|
|
313
329
|
alignItemsAtEnd: boolean;
|
|
314
330
|
data: readonly any[];
|
|
@@ -316,7 +332,7 @@ interface InternalState {
|
|
|
316
332
|
getEstimatedItemSize: ((index: number, item: any) => number) | undefined;
|
|
317
333
|
horizontal: boolean;
|
|
318
334
|
keyExtractor: ((item: any, index: number) => string) | undefined;
|
|
319
|
-
maintainScrollAtEnd: boolean;
|
|
335
|
+
maintainScrollAtEnd: boolean | MaintainScrollAtEndOptions;
|
|
320
336
|
maintainScrollAtEndThreshold: number | undefined;
|
|
321
337
|
maintainVisibleContentPosition: boolean;
|
|
322
338
|
onEndReached: (((info: {
|
|
@@ -347,10 +363,10 @@ interface InternalState {
|
|
|
347
363
|
viewPosition?: number;
|
|
348
364
|
} | undefined;
|
|
349
365
|
scrollBuffer: number;
|
|
350
|
-
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs | undefined;
|
|
351
366
|
numColumns: number;
|
|
352
367
|
initialContainerPoolRatio: number;
|
|
353
368
|
stylePaddingTop: number | undefined;
|
|
369
|
+
snapToIndices: number[] | undefined;
|
|
354
370
|
};
|
|
355
371
|
}
|
|
356
372
|
interface ViewableRange<T> {
|
|
@@ -371,6 +387,7 @@ type ScrollState = {
|
|
|
371
387
|
endBuffered: number;
|
|
372
388
|
isAtEnd: boolean;
|
|
373
389
|
isAtStart: boolean;
|
|
390
|
+
positions: Map<string, number>;
|
|
374
391
|
scroll: number;
|
|
375
392
|
scrollLength: number;
|
|
376
393
|
start: number;
|
|
@@ -423,9 +440,11 @@ type LegendListRef = {
|
|
|
423
440
|
* Scrolls to the end of the list.
|
|
424
441
|
* @param options - Options for scrolling.
|
|
425
442
|
* @param options.animated - If true, animates the scroll. Default: true.
|
|
443
|
+
* @param options.viewOffset - Offset from the target position.
|
|
426
444
|
*/
|
|
427
445
|
scrollToEnd(options?: {
|
|
428
446
|
animated?: boolean | undefined;
|
|
447
|
+
viewOffset?: number | undefined;
|
|
429
448
|
}): void;
|
|
430
449
|
/**
|
|
431
450
|
* Scrolls to a specific index in the list.
|
|
@@ -534,7 +553,7 @@ interface LegendListRecyclingState<T> {
|
|
|
534
553
|
}
|
|
535
554
|
type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode) => (props: P & React.RefAttributes<T>) => React.ReactNode;
|
|
536
555
|
declare const typedForwardRef: TypedForwardRef;
|
|
537
|
-
type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<
|
|
556
|
+
type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.JSXElementConstructor<T>>, nextProps: Readonly<React.JSXElementConstructor<T>>) => boolean) => T & {
|
|
538
557
|
displayName?: string;
|
|
539
558
|
};
|
|
540
559
|
declare const typedMemo: TypedMemo;
|
|
@@ -550,7 +569,11 @@ type GetRenderedItemResult<ItemT> = {
|
|
|
550
569
|
};
|
|
551
570
|
type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
|
|
552
571
|
|
|
553
|
-
|
|
572
|
+
interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
|
|
573
|
+
children?: React$1.ReactNode | undefined;
|
|
574
|
+
LegendList?: ListT;
|
|
575
|
+
}
|
|
576
|
+
declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
554
577
|
alignItemsAtEnd?: boolean;
|
|
555
578
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
556
579
|
data: readonly T[];
|
|
@@ -578,7 +601,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
578
601
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
579
602
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
580
603
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
581
|
-
maintainScrollAtEnd?: boolean;
|
|
604
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
582
605
|
maintainScrollAtEndThreshold?: number;
|
|
583
606
|
maintainVisibleContentPosition?: boolean;
|
|
584
607
|
numColumns?: number;
|
|
@@ -601,9 +624,9 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
601
624
|
onViewableItemsChanged?: OnViewableItemsChanged | undefined;
|
|
602
625
|
progressViewOffset?: number;
|
|
603
626
|
recycleItems?: boolean;
|
|
604
|
-
refScrollView?: React$1.Ref<ScrollView>;
|
|
627
|
+
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
605
628
|
refreshing?: boolean;
|
|
606
|
-
renderItem?:
|
|
629
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
607
630
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
608
631
|
suggestEstimatedItemSize?: boolean;
|
|
609
632
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -612,13 +635,8 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
612
635
|
onLoad?: (info: {
|
|
613
636
|
elapsedTimeInMs: number;
|
|
614
637
|
}) => void;
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps<ItemT>, "data" | "keyExtractor" | "renderItem"> {
|
|
618
|
-
children?: React$1.ReactNode | undefined;
|
|
619
|
-
LegendList?: ListT;
|
|
620
|
-
}
|
|
621
|
-
declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
638
|
+
snapToIndices?: number[];
|
|
639
|
+
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
622
640
|
alignItemsAtEnd?: boolean;
|
|
623
641
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
624
642
|
data: readonly T[];
|
|
@@ -646,7 +664,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
646
664
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
647
665
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
648
666
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
649
|
-
maintainScrollAtEnd?: boolean;
|
|
667
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
650
668
|
maintainScrollAtEndThreshold?: number;
|
|
651
669
|
maintainVisibleContentPosition?: boolean;
|
|
652
670
|
numColumns?: number;
|
|
@@ -671,7 +689,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
671
689
|
recycleItems?: boolean;
|
|
672
690
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
673
691
|
refreshing?: boolean;
|
|
674
|
-
renderItem?:
|
|
692
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
675
693
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
676
694
|
suggestEstimatedItemSize?: boolean;
|
|
677
695
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -680,7 +698,10 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
680
698
|
onLoad?: (info: {
|
|
681
699
|
elapsedTimeInMs: number;
|
|
682
700
|
}) => void;
|
|
683
|
-
|
|
701
|
+
snapToIndices?: number[];
|
|
702
|
+
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode)> | (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
|
|
703
|
+
ref?: React$1.Ref<LegendListRef>;
|
|
704
|
+
}) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
684
705
|
alignItemsAtEnd?: boolean;
|
|
685
706
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
686
707
|
data: readonly T[];
|
|
@@ -708,7 +729,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
708
729
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
709
730
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
710
731
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
711
|
-
maintainScrollAtEnd?: boolean;
|
|
732
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
712
733
|
maintainScrollAtEndThreshold?: number;
|
|
713
734
|
maintainVisibleContentPosition?: boolean;
|
|
714
735
|
numColumns?: number;
|
|
@@ -733,7 +754,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
733
754
|
recycleItems?: boolean;
|
|
734
755
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
735
756
|
refreshing?: boolean;
|
|
736
|
-
renderItem?:
|
|
757
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
737
758
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
738
759
|
suggestEstimatedItemSize?: boolean;
|
|
739
760
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -742,9 +763,10 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
742
763
|
onLoad?: (info: {
|
|
743
764
|
elapsedTimeInMs: number;
|
|
744
765
|
}) => void;
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
766
|
+
snapToIndices?: number[];
|
|
767
|
+
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode>(props: LazyLegendListProps<ItemT, ListT> & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
|
|
768
|
+
|
|
769
|
+
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
748
770
|
alignItemsAtEnd?: boolean;
|
|
749
771
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
750
772
|
data: readonly T[];
|
|
@@ -772,7 +794,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
772
794
|
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
773
795
|
ListHeaderComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
|
|
774
796
|
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
775
|
-
maintainScrollAtEnd?: boolean;
|
|
797
|
+
maintainScrollAtEnd?: boolean | MaintainScrollAtEndOptions;
|
|
776
798
|
maintainScrollAtEndThreshold?: number;
|
|
777
799
|
maintainVisibleContentPosition?: boolean;
|
|
778
800
|
numColumns?: number;
|
|
@@ -795,9 +817,9 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
795
817
|
onViewableItemsChanged?: OnViewableItemsChanged | undefined;
|
|
796
818
|
progressViewOffset?: number;
|
|
797
819
|
recycleItems?: boolean;
|
|
798
|
-
refScrollView?: React$1.Ref<
|
|
820
|
+
refScrollView?: React$1.Ref<ScrollView>;
|
|
799
821
|
refreshing?: boolean;
|
|
800
|
-
renderItem?:
|
|
822
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
801
823
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
802
824
|
suggestEstimatedItemSize?: boolean;
|
|
803
825
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -806,7 +828,8 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
806
828
|
onLoad?: (info: {
|
|
807
829
|
elapsedTimeInMs: number;
|
|
808
830
|
}) => void;
|
|
809
|
-
|
|
831
|
+
snapToIndices?: number[];
|
|
832
|
+
} & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
|
|
810
833
|
|
|
811
834
|
declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
|
|
812
835
|
declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
|
|
@@ -818,4 +841,4 @@ declare function useListScrollSize(): {
|
|
|
818
841
|
height: number;
|
|
819
842
|
};
|
|
820
843
|
|
|
821
|
-
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
|
|
844
|
+
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LazyLegendList, type LazyLegendListProps, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffsetPosition, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
|