@legendapp/list 2.0.13 → 2.1.0-beta.1
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 +14 -6
- package/index.d.ts +14 -6
- package/index.js +753 -455
- package/index.mjs +700 -402
- package/package.json +6 -3
package/index.d.mts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
|
-
import { View,
|
|
3
|
+
import { View, ScrollView, Animated, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, ScrollViewProps } from 'react-native';
|
|
4
4
|
import Animated$1 from 'react-native-reanimated';
|
|
5
5
|
|
|
6
|
-
type
|
|
6
|
+
type AnimatedValue = number;
|
|
7
|
+
|
|
8
|
+
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | `containerSticky${number}` | `containerStickyOffset${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "lastPositionUpdate" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize";
|
|
7
9
|
interface StateContext {
|
|
8
10
|
internalState: InternalState | undefined;
|
|
9
11
|
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
@@ -21,7 +23,7 @@ interface StateContext {
|
|
|
21
23
|
}>;
|
|
22
24
|
columnWrapperStyle: ColumnWrapperStyle | undefined;
|
|
23
25
|
viewRefs: Map<number, React$1.RefObject<View>>;
|
|
24
|
-
animatedScrollY:
|
|
26
|
+
animatedScrollY: AnimatedValue;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
declare class ScrollAdjustHandler {
|
|
@@ -290,6 +292,12 @@ interface ColumnWrapperStyle {
|
|
|
290
292
|
columnGap?: number;
|
|
291
293
|
}
|
|
292
294
|
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
295
|
+
interface ThresholdSnapshot {
|
|
296
|
+
scrollPosition: number;
|
|
297
|
+
contentSize?: number;
|
|
298
|
+
dataLength?: number;
|
|
299
|
+
atThreshold: boolean;
|
|
300
|
+
}
|
|
293
301
|
interface InternalState {
|
|
294
302
|
positions: Map<string, number>;
|
|
295
303
|
columns: Map<string, number>;
|
|
@@ -330,8 +338,8 @@ interface InternalState {
|
|
|
330
338
|
time: number;
|
|
331
339
|
}>;
|
|
332
340
|
lastScrollAdjustForHistory?: number;
|
|
333
|
-
|
|
334
|
-
|
|
341
|
+
startReachedSnapshot: ThresholdSnapshot | undefined;
|
|
342
|
+
endReachedSnapshot: ThresholdSnapshot | undefined;
|
|
335
343
|
scrollForNextCalculateItemsInView: {
|
|
336
344
|
top: number;
|
|
337
345
|
bottom: number;
|
|
@@ -632,4 +640,4 @@ declare function useListScrollSize(): {
|
|
|
632
640
|
};
|
|
633
641
|
declare function useSyncLayout(): () => void;
|
|
634
642
|
|
|
635
|
-
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffset, 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, useSyncLayout, useViewability, useViewabilityAmount };
|
|
643
|
+
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetPosition, type ScrollState, type ThresholdSnapshot, 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, useSyncLayout, useViewability, useViewabilityAmount };
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
|
-
import { View,
|
|
3
|
+
import { View, ScrollView, Animated, LayoutRectangle, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, ScrollViewProps } from 'react-native';
|
|
4
4
|
import Animated$1 from 'react-native-reanimated';
|
|
5
5
|
|
|
6
|
-
type
|
|
6
|
+
type AnimatedValue = number;
|
|
7
|
+
|
|
8
|
+
type ListenerType = "numContainers" | "numContainersPooled" | `containerItemKey${number}` | `containerItemData${number}` | `containerPosition${number}` | `containerColumn${number}` | `containerSticky${number}` | `containerStickyOffset${number}` | "containersDidLayout" | "extraData" | "numColumns" | "lastItemKeys" | "totalSize" | "alignItemsPaddingTop" | "lastPositionUpdate" | "stylePaddingTop" | "scrollAdjust" | "scrollAdjustUserOffset" | "headerSize" | "footerSize" | "maintainVisibleContentPosition" | "debugRawScroll" | "debugComputedScroll" | "otherAxisSize" | "snapToOffsets" | "scrollSize";
|
|
7
9
|
interface StateContext {
|
|
8
10
|
internalState: InternalState | undefined;
|
|
9
11
|
listeners: Map<ListenerType, Set<(value: any) => void>>;
|
|
@@ -21,7 +23,7 @@ interface StateContext {
|
|
|
21
23
|
}>;
|
|
22
24
|
columnWrapperStyle: ColumnWrapperStyle | undefined;
|
|
23
25
|
viewRefs: Map<number, React$1.RefObject<View>>;
|
|
24
|
-
animatedScrollY:
|
|
26
|
+
animatedScrollY: AnimatedValue;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
declare class ScrollAdjustHandler {
|
|
@@ -290,6 +292,12 @@ interface ColumnWrapperStyle {
|
|
|
290
292
|
columnGap?: number;
|
|
291
293
|
}
|
|
292
294
|
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
295
|
+
interface ThresholdSnapshot {
|
|
296
|
+
scrollPosition: number;
|
|
297
|
+
contentSize?: number;
|
|
298
|
+
dataLength?: number;
|
|
299
|
+
atThreshold: boolean;
|
|
300
|
+
}
|
|
293
301
|
interface InternalState {
|
|
294
302
|
positions: Map<string, number>;
|
|
295
303
|
columns: Map<string, number>;
|
|
@@ -330,8 +338,8 @@ interface InternalState {
|
|
|
330
338
|
time: number;
|
|
331
339
|
}>;
|
|
332
340
|
lastScrollAdjustForHistory?: number;
|
|
333
|
-
|
|
334
|
-
|
|
341
|
+
startReachedSnapshot: ThresholdSnapshot | undefined;
|
|
342
|
+
endReachedSnapshot: ThresholdSnapshot | undefined;
|
|
335
343
|
scrollForNextCalculateItemsInView: {
|
|
336
344
|
top: number;
|
|
337
345
|
bottom: number;
|
|
@@ -632,4 +640,4 @@ declare function useListScrollSize(): {
|
|
|
632
640
|
};
|
|
633
641
|
declare function useSyncLayout(): () => void;
|
|
634
642
|
|
|
635
|
-
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffset, 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, useSyncLayout, useViewability, useViewabilityAmount };
|
|
643
|
+
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type MaintainScrollAtEndOptions, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetPosition, type ScrollState, type ThresholdSnapshot, 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, useSyncLayout, useViewability, useViewabilityAmount };
|