@legendapp/list 1.0.0-beta.2 → 1.0.0-beta.3
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 +13 -3
- package/index.d.ts +13 -3
- package/index.js +286 -188
- package/index.mjs +264 -170
- package/package.json +1 -1
- package/reanimated.d.mts +3 -3
- package/reanimated.d.ts +3 -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';
|
|
@@ -63,6 +64,11 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
63
64
|
renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
|
|
64
65
|
extraData?: any;
|
|
65
66
|
};
|
|
67
|
+
type AnchoredPosition = {
|
|
68
|
+
type: 'top' | 'bottom';
|
|
69
|
+
relativeCoordinate: number;
|
|
70
|
+
top: number;
|
|
71
|
+
};
|
|
66
72
|
type LegendListProps<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
67
73
|
interface InternalState {
|
|
68
74
|
anchorElement?: {
|
|
@@ -76,7 +82,7 @@ interface InternalState {
|
|
|
76
82
|
sizes: Map<string, number>;
|
|
77
83
|
sizesLaidOut: Map<string, number> | undefined;
|
|
78
84
|
pendingAdjust: number;
|
|
79
|
-
|
|
85
|
+
waitingForMicrotask: any;
|
|
80
86
|
isStartReached: boolean;
|
|
81
87
|
isEndReached: boolean;
|
|
82
88
|
isAtBottom: boolean;
|
|
@@ -110,7 +116,6 @@ interface InternalState {
|
|
|
110
116
|
}>;
|
|
111
117
|
scrollTimer: Timer | undefined;
|
|
112
118
|
startReachedBlockedByTimer: boolean;
|
|
113
|
-
layoutsPending: Set<number>;
|
|
114
119
|
scrollForNextCalculateItemsInView: {
|
|
115
120
|
top: number;
|
|
116
121
|
bottom: number;
|
|
@@ -232,4 +237,9 @@ declare const LegendList: <T>(props: LegendListProps<T> & {
|
|
|
232
237
|
ref?: ForwardedRef<LegendListRef>;
|
|
233
238
|
}) => ReactElement;
|
|
234
239
|
|
|
235
|
-
|
|
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';
|
|
@@ -63,6 +64,11 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
63
64
|
renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
|
|
64
65
|
extraData?: any;
|
|
65
66
|
};
|
|
67
|
+
type AnchoredPosition = {
|
|
68
|
+
type: 'top' | 'bottom';
|
|
69
|
+
relativeCoordinate: number;
|
|
70
|
+
top: number;
|
|
71
|
+
};
|
|
66
72
|
type LegendListProps<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
67
73
|
interface InternalState {
|
|
68
74
|
anchorElement?: {
|
|
@@ -76,7 +82,7 @@ interface InternalState {
|
|
|
76
82
|
sizes: Map<string, number>;
|
|
77
83
|
sizesLaidOut: Map<string, number> | undefined;
|
|
78
84
|
pendingAdjust: number;
|
|
79
|
-
|
|
85
|
+
waitingForMicrotask: any;
|
|
80
86
|
isStartReached: boolean;
|
|
81
87
|
isEndReached: boolean;
|
|
82
88
|
isAtBottom: boolean;
|
|
@@ -110,7 +116,6 @@ interface InternalState {
|
|
|
110
116
|
}>;
|
|
111
117
|
scrollTimer: Timer | undefined;
|
|
112
118
|
startReachedBlockedByTimer: boolean;
|
|
113
|
-
layoutsPending: Set<number>;
|
|
114
119
|
scrollForNextCalculateItemsInView: {
|
|
115
120
|
top: number;
|
|
116
121
|
bottom: number;
|
|
@@ -232,4 +237,9 @@ declare const LegendList: <T>(props: LegendListProps<T> & {
|
|
|
232
237
|
ref?: ForwardedRef<LegendListRef>;
|
|
233
238
|
}) => ReactElement;
|
|
234
239
|
|
|
235
|
-
|
|
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 };
|