@legendapp/list 1.0.0-beta.0 → 1.0.0-beta.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 -3
- package/animated.d.ts +3 -3
- package/index.d.mts +18 -6
- package/index.d.ts +18 -6
- package/index.js +405 -251
- package/index.mjs +384 -234
- package/package.json +1 -1
- package/reanimated.d.mts +6 -3
- package/reanimated.d.ts +6 -3
package/animated.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import * as _legendapp_list from '@legendapp/list';
|
|
3
3
|
import { Animated } from 'react-native';
|
|
4
4
|
|
|
5
5
|
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: _legendapp_list.LegendListProps<T> & {
|
|
6
|
-
ref?:
|
|
7
|
-
}) =>
|
|
6
|
+
ref?: react.ForwardedRef<_legendapp_list.LegendListRef>;
|
|
7
|
+
}) => react.ReactElement)>;
|
|
8
8
|
|
|
9
9
|
export { AnimatedLegendList };
|
package/animated.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import * as _legendapp_list from '@legendapp/list';
|
|
3
3
|
import { Animated } from 'react-native';
|
|
4
4
|
|
|
5
5
|
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: _legendapp_list.LegendListProps<T> & {
|
|
6
|
-
ref?:
|
|
7
|
-
}) =>
|
|
6
|
+
ref?: react.ForwardedRef<_legendapp_list.LegendListRef>;
|
|
7
|
+
}) => react.ReactElement)>;
|
|
8
8
|
|
|
9
9
|
export { AnimatedLegendList };
|
package/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
1
2
|
import { ComponentProps, ReactNode, ForwardedRef, ReactElement } from 'react';
|
|
2
3
|
import { ScrollView, StyleProp, ViewStyle, ScrollViewProps, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
|
|
3
4
|
import Animated from 'react-native-reanimated';
|
|
@@ -15,7 +16,7 @@ declare class ScrollAdjustHandler {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView>> = Omit<TScrollView, 'contentOffset' | 'contentInset' | 'maintainVisibleContentPosition' | 'stickyHeaderIndices'> & {
|
|
18
|
-
data:
|
|
19
|
+
data: ReadonlyArray<ItemT>;
|
|
19
20
|
initialScrollOffset?: number;
|
|
20
21
|
initialScrollIndex?: number;
|
|
21
22
|
drawDistance?: number;
|
|
@@ -44,7 +45,6 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
44
45
|
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
45
46
|
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
46
47
|
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
47
|
-
ListEmptyComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
48
48
|
ItemSeparatorComponent?: React.ComponentType<any>;
|
|
49
49
|
viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
|
|
50
50
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -61,6 +61,12 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
61
61
|
* @default (props) => <ScrollView {...props} />
|
|
62
62
|
*/
|
|
63
63
|
renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
|
|
64
|
+
extraData?: any;
|
|
65
|
+
};
|
|
66
|
+
type AnchoredPosition = {
|
|
67
|
+
type: 'top' | 'bottom';
|
|
68
|
+
relativeCoordinate: number;
|
|
69
|
+
top: number;
|
|
64
70
|
};
|
|
65
71
|
type LegendListProps<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
66
72
|
interface InternalState {
|
|
@@ -75,12 +81,12 @@ interface InternalState {
|
|
|
75
81
|
sizes: Map<string, number>;
|
|
76
82
|
sizesLaidOut: Map<string, number> | undefined;
|
|
77
83
|
pendingAdjust: number;
|
|
78
|
-
|
|
84
|
+
waitingForMicrotask: any;
|
|
79
85
|
isStartReached: boolean;
|
|
80
86
|
isEndReached: boolean;
|
|
81
87
|
isAtBottom: boolean;
|
|
82
88
|
isAtTop: boolean;
|
|
83
|
-
data: any[];
|
|
89
|
+
data: readonly any[];
|
|
84
90
|
idsInFirstRender: Set<string>;
|
|
85
91
|
hasScrolled: boolean;
|
|
86
92
|
scrollLength: number;
|
|
@@ -109,11 +115,12 @@ interface InternalState {
|
|
|
109
115
|
}>;
|
|
110
116
|
scrollTimer: Timer | undefined;
|
|
111
117
|
startReachedBlockedByTimer: boolean;
|
|
112
|
-
layoutsPending: Set<number>;
|
|
113
118
|
scrollForNextCalculateItemsInView: {
|
|
114
119
|
top: number;
|
|
115
120
|
bottom: number;
|
|
116
121
|
} | undefined;
|
|
122
|
+
enableScrollForNextCalculateItemsInView: boolean;
|
|
123
|
+
minIndexSizeChanged: number | undefined;
|
|
117
124
|
}
|
|
118
125
|
interface ViewableRange<T> {
|
|
119
126
|
startBuffered: number;
|
|
@@ -230,4 +237,9 @@ declare const LegendList: <T>(props: LegendListProps<T> & {
|
|
|
230
237
|
ref?: ForwardedRef<LegendListRef>;
|
|
231
238
|
}) => ReactElement;
|
|
232
239
|
|
|
233
|
-
|
|
240
|
+
declare function useViewability(configId: string, callback: ViewabilityCallback): void;
|
|
241
|
+
declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
|
|
242
|
+
declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
|
|
243
|
+
declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): [any, react.Dispatch<any>];
|
|
244
|
+
|
|
245
|
+
export { type AnchoredPosition, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
1
2
|
import { ComponentProps, ReactNode, ForwardedRef, ReactElement } from 'react';
|
|
2
3
|
import { ScrollView, StyleProp, ViewStyle, ScrollViewProps, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
|
|
3
4
|
import Animated from 'react-native-reanimated';
|
|
@@ -15,7 +16,7 @@ declare class ScrollAdjustHandler {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView>> = Omit<TScrollView, 'contentOffset' | 'contentInset' | 'maintainVisibleContentPosition' | 'stickyHeaderIndices'> & {
|
|
18
|
-
data:
|
|
19
|
+
data: ReadonlyArray<ItemT>;
|
|
19
20
|
initialScrollOffset?: number;
|
|
20
21
|
initialScrollIndex?: number;
|
|
21
22
|
drawDistance?: number;
|
|
@@ -44,7 +45,6 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
44
45
|
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
45
46
|
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
46
47
|
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
47
|
-
ListEmptyComponentStyle?: StyleProp<ViewStyle> | undefined;
|
|
48
48
|
ItemSeparatorComponent?: React.ComponentType<any>;
|
|
49
49
|
viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
|
|
50
50
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -61,6 +61,12 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
61
61
|
* @default (props) => <ScrollView {...props} />
|
|
62
62
|
*/
|
|
63
63
|
renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
|
|
64
|
+
extraData?: any;
|
|
65
|
+
};
|
|
66
|
+
type AnchoredPosition = {
|
|
67
|
+
type: 'top' | 'bottom';
|
|
68
|
+
relativeCoordinate: number;
|
|
69
|
+
top: number;
|
|
64
70
|
};
|
|
65
71
|
type LegendListProps<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
66
72
|
interface InternalState {
|
|
@@ -75,12 +81,12 @@ interface InternalState {
|
|
|
75
81
|
sizes: Map<string, number>;
|
|
76
82
|
sizesLaidOut: Map<string, number> | undefined;
|
|
77
83
|
pendingAdjust: number;
|
|
78
|
-
|
|
84
|
+
waitingForMicrotask: any;
|
|
79
85
|
isStartReached: boolean;
|
|
80
86
|
isEndReached: boolean;
|
|
81
87
|
isAtBottom: boolean;
|
|
82
88
|
isAtTop: boolean;
|
|
83
|
-
data: any[];
|
|
89
|
+
data: readonly any[];
|
|
84
90
|
idsInFirstRender: Set<string>;
|
|
85
91
|
hasScrolled: boolean;
|
|
86
92
|
scrollLength: number;
|
|
@@ -109,11 +115,12 @@ interface InternalState {
|
|
|
109
115
|
}>;
|
|
110
116
|
scrollTimer: Timer | undefined;
|
|
111
117
|
startReachedBlockedByTimer: boolean;
|
|
112
|
-
layoutsPending: Set<number>;
|
|
113
118
|
scrollForNextCalculateItemsInView: {
|
|
114
119
|
top: number;
|
|
115
120
|
bottom: number;
|
|
116
121
|
} | undefined;
|
|
122
|
+
enableScrollForNextCalculateItemsInView: boolean;
|
|
123
|
+
minIndexSizeChanged: number | undefined;
|
|
117
124
|
}
|
|
118
125
|
interface ViewableRange<T> {
|
|
119
126
|
startBuffered: number;
|
|
@@ -230,4 +237,9 @@ declare const LegendList: <T>(props: LegendListProps<T> & {
|
|
|
230
237
|
ref?: ForwardedRef<LegendListRef>;
|
|
231
238
|
}) => ReactElement;
|
|
232
239
|
|
|
233
|
-
|
|
240
|
+
declare function useViewability(configId: string, callback: ViewabilityCallback): void;
|
|
241
|
+
declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
|
|
242
|
+
declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
|
|
243
|
+
declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): [any, react.Dispatch<any>];
|
|
244
|
+
|
|
245
|
+
export { type AnchoredPosition, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
|