@legendapp/list 3.4.0 → 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;
@@ -836,6 +839,13 @@ type ScrollViewPropsWeb = Omit<LooseScrollViewProps, "style" | "contentContainer
836
839
  onLayout?: (event: LooseLayoutChangeEvent) => void;
837
840
  };
838
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;
839
849
  anchoredEndSpace?: AnchoredEndSpaceConfig;
840
850
  refScrollView?: Ref<HTMLElement | ScrollViewMethods>;
841
851
  ListHeaderComponentStyle?: CSSProperties | undefined;
@@ -845,7 +855,7 @@ type LegendListProps<ItemT = any, TItemType extends string | undefined = string
845
855
  type LegendListRef = Omit<LegendListRef$1, "getAnimatableRef" | "getNativeScrollRef" | "getScrollableNode" | "getScrollResponder"> & {
846
856
  getAnimatableRef(): HTMLElement | ScrollViewMethods;
847
857
  getNativeScrollRef(): HTMLElement | ScrollViewMethods;
848
- getScrollableNode(): HTMLElement;
858
+ getScrollableNode(): HTMLElement | null;
849
859
  getScrollResponder(): HTMLElement | null;
850
860
  };
851
861
  type LegendListState = Omit<LegendListState$1, "elementAtIndex"> & {