@legendapp/list 1.0.0-beta.16 → 1.0.0-beta.18

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
@@ -34,7 +34,9 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<re
34
34
  ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
35
35
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
36
36
  ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
37
- ItemSeparatorComponent?: React.ComponentType<any>;
37
+ ItemSeparatorComponent?: React$1.ComponentType<{
38
+ leadingItem: T;
39
+ }> | undefined;
38
40
  viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
39
41
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
40
42
  onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
@@ -47,6 +49,9 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<re
47
49
  }) => void) | undefined;
48
50
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
49
51
  extraData?: any;
52
+ refreshing?: boolean;
53
+ onRefresh?: () => void;
54
+ progressViewOffset?: number;
50
55
  } & React$1.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode)>;
51
56
 
52
57
  export { AnimatedLegendList };
package/animated.d.ts CHANGED
@@ -34,7 +34,9 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<re
34
34
  ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
35
35
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
36
36
  ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
37
- ItemSeparatorComponent?: React.ComponentType<any>;
37
+ ItemSeparatorComponent?: React$1.ComponentType<{
38
+ leadingItem: T;
39
+ }> | undefined;
38
40
  viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
39
41
  viewabilityConfig?: _legendapp_list.ViewabilityConfig;
40
42
  onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
@@ -47,6 +49,9 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<re
47
49
  }) => void) | undefined;
48
50
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
49
51
  extraData?: any;
52
+ refreshing?: boolean;
53
+ onRefresh?: () => void;
54
+ progressViewOffset?: number;
50
55
  } & React$1.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode)>;
51
56
 
52
57
  export { AnimatedLegendList };
package/index.d.mts CHANGED
@@ -49,7 +49,9 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
49
49
  ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
50
50
  ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
51
51
  ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
52
- ItemSeparatorComponent?: React.ComponentType<any>;
52
+ ItemSeparatorComponent?: React.ComponentType<{
53
+ leadingItem: ItemT;
54
+ }>;
53
55
  viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
54
56
  viewabilityConfig?: ViewabilityConfig;
55
57
  onViewableItemsChanged?: OnViewableItemsChanged | undefined;
@@ -66,6 +68,9 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
66
68
  */
67
69
  renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
68
70
  extraData?: any;
71
+ refreshing?: boolean;
72
+ onRefresh?: () => void;
73
+ progressViewOffset?: number;
69
74
  };
70
75
  interface ColumnWrapperStyle {
71
76
  rowGap?: number;
@@ -90,13 +95,11 @@ interface InternalState {
90
95
  sizes: Map<string, number>;
91
96
  sizesLaidOut: Map<string, number> | undefined;
92
97
  pendingAdjust: number;
93
- waitingForMicrotask: any;
94
98
  isStartReached: boolean;
95
99
  isEndReached: boolean;
96
100
  isAtBottom: boolean;
97
101
  isAtTop: boolean;
98
102
  data: readonly any[];
99
- idsInFirstRender: Set<string>;
100
103
  hasScrolled: boolean;
101
104
  scrollLength: number;
102
105
  startBuffered: number;
@@ -124,12 +127,14 @@ interface InternalState {
124
127
  }>;
125
128
  scrollTimer: Timer | undefined;
126
129
  startReachedBlockedByTimer: boolean;
130
+ endReachedBlockedByTimer: boolean;
127
131
  scrollForNextCalculateItemsInView: {
128
132
  top: number;
129
133
  bottom: number;
130
134
  } | undefined;
131
135
  enableScrollForNextCalculateItemsInView: boolean;
132
136
  minIndexSizeChanged: number | undefined;
137
+ numPendingInitialLayout: number;
133
138
  }
134
139
  interface ViewableRange<T> {
135
140
  startBuffered: number;
@@ -243,6 +248,10 @@ interface LegendListRecyclingState<T> {
243
248
  }
244
249
  type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode) => (props: P & React.RefAttributes<T>) => React.ReactNode;
245
250
  declare const typedForwardRef: TypedForwardRef;
251
+ type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean) => T & {
252
+ displayName?: string;
253
+ };
254
+ declare const typedMemo: TypedMemo;
246
255
 
247
256
  declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
248
257
  data: readonly T[];
@@ -275,7 +284,9 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
275
284
  ListFooterComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
276
285
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
277
286
  ListEmptyComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
278
- ItemSeparatorComponent?: React$1.ComponentType<any>;
287
+ ItemSeparatorComponent?: React$1.ComponentType<{
288
+ leadingItem: T;
289
+ }> | undefined;
279
290
  viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
280
291
  viewabilityConfig?: ViewabilityConfig;
281
292
  onViewableItemsChanged?: OnViewableItemsChanged | undefined;
@@ -288,6 +299,9 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
288
299
  }) => void) | undefined;
289
300
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
290
301
  extraData?: any;
302
+ refreshing?: boolean;
303
+ onRefresh?: () => void;
304
+ progressViewOffset?: number;
291
305
  } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
292
306
 
293
307
  declare function useViewability(configId: string, callback: ViewabilityCallback): void;
@@ -295,4 +309,4 @@ declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void
295
309
  declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
296
310
  declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): [any, React$1.Dispatch<any>];
297
311
 
298
- export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type TypedForwardRef, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
312
+ export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
package/index.d.ts CHANGED
@@ -49,7 +49,9 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
49
49
  ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
50
50
  ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
51
51
  ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
52
- ItemSeparatorComponent?: React.ComponentType<any>;
52
+ ItemSeparatorComponent?: React.ComponentType<{
53
+ leadingItem: ItemT;
54
+ }>;
53
55
  viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
54
56
  viewabilityConfig?: ViewabilityConfig;
55
57
  onViewableItemsChanged?: OnViewableItemsChanged | undefined;
@@ -66,6 +68,9 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
66
68
  */
67
69
  renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
68
70
  extraData?: any;
71
+ refreshing?: boolean;
72
+ onRefresh?: () => void;
73
+ progressViewOffset?: number;
69
74
  };
70
75
  interface ColumnWrapperStyle {
71
76
  rowGap?: number;
@@ -90,13 +95,11 @@ interface InternalState {
90
95
  sizes: Map<string, number>;
91
96
  sizesLaidOut: Map<string, number> | undefined;
92
97
  pendingAdjust: number;
93
- waitingForMicrotask: any;
94
98
  isStartReached: boolean;
95
99
  isEndReached: boolean;
96
100
  isAtBottom: boolean;
97
101
  isAtTop: boolean;
98
102
  data: readonly any[];
99
- idsInFirstRender: Set<string>;
100
103
  hasScrolled: boolean;
101
104
  scrollLength: number;
102
105
  startBuffered: number;
@@ -124,12 +127,14 @@ interface InternalState {
124
127
  }>;
125
128
  scrollTimer: Timer | undefined;
126
129
  startReachedBlockedByTimer: boolean;
130
+ endReachedBlockedByTimer: boolean;
127
131
  scrollForNextCalculateItemsInView: {
128
132
  top: number;
129
133
  bottom: number;
130
134
  } | undefined;
131
135
  enableScrollForNextCalculateItemsInView: boolean;
132
136
  minIndexSizeChanged: number | undefined;
137
+ numPendingInitialLayout: number;
133
138
  }
134
139
  interface ViewableRange<T> {
135
140
  startBuffered: number;
@@ -243,6 +248,10 @@ interface LegendListRecyclingState<T> {
243
248
  }
244
249
  type TypedForwardRef = <T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactNode) => (props: P & React.RefAttributes<T>) => React.ReactNode;
245
250
  declare const typedForwardRef: TypedForwardRef;
251
+ type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean) => T & {
252
+ displayName?: string;
253
+ };
254
+ declare const typedMemo: TypedMemo;
246
255
 
247
256
  declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
248
257
  data: readonly T[];
@@ -275,7 +284,9 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
275
284
  ListFooterComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
276
285
  ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
277
286
  ListEmptyComponent?: React$1.ComponentType<any> | React$1.ReactElement | null | undefined;
278
- ItemSeparatorComponent?: React$1.ComponentType<any>;
287
+ ItemSeparatorComponent?: React$1.ComponentType<{
288
+ leadingItem: T;
289
+ }> | undefined;
279
290
  viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
280
291
  viewabilityConfig?: ViewabilityConfig;
281
292
  onViewableItemsChanged?: OnViewableItemsChanged | undefined;
@@ -288,6 +299,9 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
288
299
  }) => void) | undefined;
289
300
  renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
290
301
  extraData?: any;
302
+ refreshing?: boolean;
303
+ onRefresh?: () => void;
304
+ progressViewOffset?: number;
291
305
  } & React$1.RefAttributes<LegendListRef>) => React$1.ReactNode;
292
306
 
293
307
  declare function useViewability(configId: string, callback: ViewabilityCallback): void;
@@ -295,4 +309,4 @@ declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void
295
309
  declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
296
310
  declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): [any, React$1.Dispatch<any>];
297
311
 
298
- export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type TypedForwardRef, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
312
+ export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };