@legendapp/list 3.3.11 → 3.5.0

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/react.d.ts CHANGED
@@ -6,11 +6,14 @@ type ScrollEventTarget = Window | HTMLElement;
6
6
  interface ScrollViewMethods {
7
7
  getBoundingClientRect(): DOMRect | null | undefined;
8
8
  getCurrentScrollOffset(): number;
9
+ getRawScrollOffset(): number;
9
10
  getMaxScrollOffset(): number;
10
- getScrollableNode(): HTMLElement;
11
+ getScrollableNode(): HTMLElement | null;
11
12
  getScrollEventTarget(): ScrollEventTarget | null;
12
13
  getScrollResponder(): HTMLElement | null;
13
14
  isWindowScroll?(): boolean;
15
+ getContentNode?(): HTMLElement | null;
16
+ isScrollInRange?(): boolean;
14
17
  scrollBy(x: number, y: number): void;
15
18
  scrollTo(options: {
16
19
  x?: number;
@@ -357,6 +360,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
357
360
  onLoad?: (info: {
358
361
  elapsedTimeInMs: number;
359
362
  }) => void;
363
+ /**
364
+ * Called after layout and initial scrolling complete, including after a
365
+ * dataKey reset. Unlike onLoad, this runs for each initial placement cycle.
366
+ * Ordinary data updates do not trigger it unless they restart initial placement.
367
+ */
368
+ onReady?: () => void;
360
369
  /**
361
370
  * Called when list layout metrics change.
362
371
  */
@@ -812,6 +821,7 @@ interface LooseScrollViewProps {
812
821
  onMomentumScrollEnd?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
813
822
  onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
814
823
  onScrollBeginDrag?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
824
+ onScrollEndDrag?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
815
825
  refreshControl?: ReactElement | null;
816
826
  removeClippedSubviews?: boolean;
817
827
  scrollEventThrottle?: number;
@@ -829,6 +839,13 @@ type ScrollViewPropsWeb = Omit<LooseScrollViewProps, "style" | "contentContainer
829
839
  onLayout?: (event: LooseLayoutChangeEvent) => void;
830
840
  };
831
841
  type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewPropsWeb, TItemType>, "anchoredEndSpace" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle" | "onRefresh" | "progressViewOffset" | "refreshing"> & {
842
+ /**
843
+ * Web only: use an ancestor element's scrollbar instead of creating a scrollable list.
844
+ * Pass a state-backed callback ref value so changes to the element are observed.
845
+ * null waits for the element to mount; undefined uses the list's own scrollbar.
846
+ * Takes precedence over useWindowScroll. Not supported with renderScrollComponent.
847
+ */
848
+ scrollElement?: HTMLElement | null;
832
849
  anchoredEndSpace?: AnchoredEndSpaceConfig;
833
850
  refScrollView?: Ref<HTMLElement | ScrollViewMethods>;
834
851
  ListHeaderComponentStyle?: CSSProperties | undefined;
@@ -838,7 +855,7 @@ type LegendListProps<ItemT = any, TItemType extends string | undefined = string
838
855
  type LegendListRef = Omit<LegendListRef$1, "getAnimatableRef" | "getNativeScrollRef" | "getScrollableNode" | "getScrollResponder"> & {
839
856
  getAnimatableRef(): HTMLElement | ScrollViewMethods;
840
857
  getNativeScrollRef(): HTMLElement | ScrollViewMethods;
841
- getScrollableNode(): HTMLElement;
858
+ getScrollableNode(): HTMLElement | null;
842
859
  getScrollResponder(): HTMLElement | null;
843
860
  };
844
861
  type LegendListState = Omit<LegendListState$1, "elementAtIndex"> & {