@legendapp/list 1.0.0-beta.1 → 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 CHANGED
@@ -1,9 +1,9 @@
1
- import * as React from 'react';
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?: React.ForwardedRef<_legendapp_list.LegendListRef>;
7
- }) => React.ReactElement)>;
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 React from 'react';
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?: React.ForwardedRef<_legendapp_list.LegendListRef>;
7
- }) => React.ReactElement)>;
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';
@@ -61,6 +62,12 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
61
62
  * @default (props) => <ScrollView {...props} />
62
63
  */
63
64
  renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
65
+ extraData?: any;
66
+ };
67
+ type AnchoredPosition = {
68
+ type: 'top' | 'bottom';
69
+ relativeCoordinate: number;
70
+ top: number;
64
71
  };
65
72
  type LegendListProps<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
66
73
  interface InternalState {
@@ -75,7 +82,7 @@ interface InternalState {
75
82
  sizes: Map<string, number>;
76
83
  sizesLaidOut: Map<string, number> | undefined;
77
84
  pendingAdjust: number;
78
- animFrameLayout: any;
85
+ waitingForMicrotask: any;
79
86
  isStartReached: boolean;
80
87
  isEndReached: boolean;
81
88
  isAtBottom: boolean;
@@ -109,7 +116,6 @@ interface InternalState {
109
116
  }>;
110
117
  scrollTimer: Timer | undefined;
111
118
  startReachedBlockedByTimer: boolean;
112
- layoutsPending: Set<number>;
113
119
  scrollForNextCalculateItemsInView: {
114
120
  top: number;
115
121
  bottom: number;
@@ -231,4 +237,9 @@ declare const LegendList: <T>(props: LegendListProps<T> & {
231
237
  ref?: ForwardedRef<LegendListRef>;
232
238
  }) => ReactElement;
233
239
 
234
- export { 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 };
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';
@@ -61,6 +62,12 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
61
62
  * @default (props) => <ScrollView {...props} />
62
63
  */
63
64
  renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
65
+ extraData?: any;
66
+ };
67
+ type AnchoredPosition = {
68
+ type: 'top' | 'bottom';
69
+ relativeCoordinate: number;
70
+ top: number;
64
71
  };
65
72
  type LegendListProps<ItemT> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
66
73
  interface InternalState {
@@ -75,7 +82,7 @@ interface InternalState {
75
82
  sizes: Map<string, number>;
76
83
  sizesLaidOut: Map<string, number> | undefined;
77
84
  pendingAdjust: number;
78
- animFrameLayout: any;
85
+ waitingForMicrotask: any;
79
86
  isStartReached: boolean;
80
87
  isEndReached: boolean;
81
88
  isAtBottom: boolean;
@@ -109,7 +116,6 @@ interface InternalState {
109
116
  }>;
110
117
  scrollTimer: Timer | undefined;
111
118
  startReachedBlockedByTimer: boolean;
112
- layoutsPending: Set<number>;
113
119
  scrollForNextCalculateItemsInView: {
114
120
  top: number;
115
121
  bottom: number;
@@ -231,4 +237,9 @@ declare const LegendList: <T>(props: LegendListProps<T> & {
231
237
  ref?: ForwardedRef<LegendListRef>;
232
238
  }) => ReactElement;
233
239
 
234
- export { 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 };
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 };