virtua 0.36.1 → 0.36.2

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.
@@ -10,15 +10,15 @@ export interface VirtualizerHandle {
10
10
  */
11
11
  readonly cache: CacheSnapshot;
12
12
  /**
13
- * Get current scrollTop or scrollLeft.
13
+ * Get current scrollTop, or scrollLeft if horizontal: true.
14
14
  */
15
15
  readonly scrollOffset: number;
16
16
  /**
17
- * Get current scrollHeight or scrollWidth.
17
+ * Get current scrollHeight, or scrollWidth if horizontal: true.
18
18
  */
19
19
  readonly scrollSize: number;
20
20
  /**
21
- * Get current offsetHeight or offsetWidth.
21
+ * Get current offsetHeight, or offsetWidth if horizontal: true.
22
22
  */
23
23
  readonly viewportSize: number;
24
24
  /**
@@ -106,12 +106,12 @@ export interface VirtualizerProps {
106
106
  */
107
107
  item?: keyof JSX.IntrinsicElements | CustomItemComponent;
108
108
  /**
109
- * Reference to the scrollable element. The default will get the parent element of virtualizer.
109
+ * Reference to the scrollable element. The default will get the direct parent element of virtualizer.
110
110
  */
111
111
  scrollRef?: RefObject<HTMLElement>;
112
112
  /**
113
113
  * Callback invoked whenever scroll offset changes.
114
- * @param offset Current scrollTop or scrollLeft.
114
+ * @param offset Current scrollTop, or scrollLeft if horizontal: true.
115
115
  */
116
116
  onScroll?: (offset: number) => void;
117
117
  /**
@@ -120,16 +120,10 @@ export interface VirtualizerProps {
120
120
  onScrollEnd?: () => void;
121
121
  /**
122
122
  * Callback invoked when visible items range changes.
123
+ * @param startIndex The start index of viewable items.
124
+ * @param endIndex The end index of viewable items.
123
125
  */
124
- onRangeChange?: (
125
- /**
126
- * The start index of viewable items.
127
- */
128
- startIndex: number,
129
- /**
130
- * The end index of viewable items.
131
- */
132
- endIndex: number) => void;
126
+ onRangeChange?: (startIndex: number, endIndex: number) => void;
133
127
  }
134
128
  /**
135
129
  * Customizable list virtualizer for advanced usage. See {@link VirtualizerProps} and {@link VirtualizerHandle}.
@@ -70,16 +70,10 @@ export interface WindowVirtualizerProps {
70
70
  onScrollEnd?: () => void;
71
71
  /**
72
72
  * Callback invoked when visible items range changes.
73
+ * @param startIndex The start index of viewable items.
74
+ * @param endIndex The end index of viewable items.
73
75
  */
74
- onRangeChange?: (
75
- /**
76
- * The start index of viewable items.
77
- */
78
- startIndex: number,
79
- /**
80
- * The end index of viewable items.
81
- */
82
- endIndex: number) => void;
76
+ onRangeChange?: (startIndex: number, endIndex: number) => void;
83
77
  }
84
78
  /**
85
79
  * {@link Virtualizer} controlled by the window scrolling. See {@link WindowVirtualizerProps} and {@link WindowVirtualizerHandle}.
@@ -8,15 +8,15 @@ import { ScrollToIndexOpts } from "../core/types";
8
8
  */
9
9
  export interface VirtualizerHandle {
10
10
  /**
11
- * Get current scrollTop or scrollLeft.
11
+ * Get current scrollTop, or scrollLeft if horizontal: true.
12
12
  */
13
13
  readonly scrollOffset: number;
14
14
  /**
15
- * Get current scrollHeight or scrollWidth.
15
+ * Get current scrollHeight, or scrollWidth if horizontal: true.
16
16
  */
17
17
  readonly scrollSize: number;
18
18
  /**
19
- * Get current offsetHeight or offsetWidth.
19
+ * Get current offsetHeight, or offsetWidth if horizontal: true.
20
20
  */
21
21
  readonly viewportSize: number;
22
22
  /**
@@ -73,7 +73,7 @@ export interface VirtualizerProps<T> {
73
73
  */
74
74
  item?: ValidComponent;
75
75
  /**
76
- * Reference to the scrollable element. The default will get the parent element of virtualizer.
76
+ * Reference to the scrollable element. The default will get the direct parent element of virtualizer.
77
77
  */
78
78
  scrollRef?: HTMLElement;
79
79
  /**
@@ -97,7 +97,7 @@ export interface VirtualizerProps<T> {
97
97
  startMargin?: number;
98
98
  /**
99
99
  * Callback invoked whenever scroll offset changes.
100
- * @param offset Current scrollTop or scrollLeft.
100
+ * @param offset Current scrollTop, or scrollLeft if horizontal: true.
101
101
  */
102
102
  onScroll?: (offset: number) => void;
103
103
  /**
@@ -106,16 +106,10 @@ export interface VirtualizerProps<T> {
106
106
  onScrollEnd?: () => void;
107
107
  /**
108
108
  * Callback invoked when visible items range changes.
109
+ * @param startIndex The start index of viewable items.
110
+ * @param endIndex The end index of viewable items.
109
111
  */
110
- onRangeChange?: (
111
- /**
112
- * The start index of viewable items.
113
- */
114
- startIndex: number,
115
- /**
116
- * The end index of viewable items.
117
- */
118
- endIndex: number) => void;
112
+ onRangeChange?: (startIndex: number, endIndex: number) => void;
119
113
  }
120
114
  /**
121
115
  * Customizable list virtualizer for advanced usage. See {@link VirtualizerProps} and {@link VirtualizerHandle}.
@@ -40,16 +40,10 @@ export interface WindowVirtualizerProps<T> {
40
40
  onScrollEnd?: () => void;
41
41
  /**
42
42
  * Callback invoked when visible items range changes.
43
+ * @param startIndex The start index of viewable items.
44
+ * @param endIndex The end index of viewable items.
43
45
  */
44
- onRangeChange?: (
45
- /**
46
- * The start index of viewable items.
47
- */
48
- startIndex: number,
49
- /**
50
- * The end index of viewable items.
51
- */
52
- endIndex: number) => void;
46
+ onRangeChange?: (startIndex: number, endIndex: number) => void;
53
47
  }
54
48
  /**
55
49
  * {@link Virtualizer} controlled by the window scrolling. See {@link WindowVirtualizerProps} and {@link WindowVirtualizerHandle}.