@pdanpdan/virtual-scroll 0.4.0 → 0.6.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/src/types.ts CHANGED
@@ -1,3 +1,44 @@
1
+ /** Default fallback size for items (VU). */
2
+ export const DEFAULT_ITEM_SIZE = 40;
3
+ /** Default fallback width for columns (VU). */
4
+ export const DEFAULT_COLUMN_WIDTH = 100;
5
+ /** Default number of items to render outside the viewport. */
6
+ export const DEFAULT_BUFFER = 5;
7
+
8
+ /** Represents a point in 2D space. */
9
+ export interface Point {
10
+ /** X coordinate. */
11
+ x: number;
12
+ /** Y coordinate. */
13
+ y: number;
14
+ }
15
+
16
+ /** Represents dimensions in 2D space. */
17
+ export interface Size {
18
+ /** Width dimension. */
19
+ width: number;
20
+ /** Height dimension. */
21
+ height: number;
22
+ }
23
+
24
+ /** Initial empty state for scroll details. */
25
+ export const EMPTY_SCROLL_DETAILS: ScrollDetails<unknown> = {
26
+ items: [],
27
+ currentIndex: 0,
28
+ currentColIndex: 0,
29
+ currentEndIndex: 0,
30
+ currentEndColIndex: 0,
31
+ scrollOffset: { x: 0, y: 0 },
32
+ displayScrollOffset: { x: 0, y: 0 },
33
+ viewportSize: { width: 0, height: 0 },
34
+ displayViewportSize: { width: 0, height: 0 },
35
+ totalSize: { width: 0, height: 0 },
36
+ isScrolling: false,
37
+ isProgrammaticScroll: false,
38
+ range: { start: 0, end: 0 },
39
+ columnRange: { start: 0, end: 0, padStart: 0, padEnd: 0 },
40
+ };
41
+
1
42
  /**
2
43
  * The direction of the virtual scroll.
3
44
  * - 'vertical': Single-column vertical scrolling.
@@ -54,66 +95,60 @@ export interface RenderedItem<T = unknown> {
54
95
  item: T;
55
96
  /** The 0-based index of the item in the original array. */
56
97
  index: number;
57
- /** The calculated pixel offset relative to the items wrapper. */
58
- offset: {
59
- /** Horizontal offset (left). */
60
- x: number;
61
- /** Vertical offset (top). */
62
- y: number;
63
- };
64
- /** The current measured or estimated size of the item. */
65
- size: {
66
- /** Pixel width. */
67
- width: number;
68
- /** Pixel height. */
69
- height: number;
70
- };
71
- /** The original horizontal pixel offset before any sticky adjustments. */
98
+ /** The calculated pixel offset relative to the items wrapper in display pixels (DU). */
99
+ offset: Point;
100
+ /** The current measured or estimated size of the item in virtual units (VU). */
101
+ size: Size;
102
+ /** The original horizontal pixel offset before any sticky adjustments in VU. */
72
103
  originalX: number;
73
- /** The original vertical pixel offset before any sticky adjustments. */
104
+ /** The original vertical pixel offset before any sticky adjustments in VU. */
74
105
  originalY: number;
75
106
  /** Whether this item is configured to be sticky via the `stickyIndices` property. */
76
107
  isSticky?: boolean;
77
108
  /** Whether this item is currently in a stuck state at the viewport edge. */
78
109
  isStickyActive?: boolean;
79
- /** The relative translation applied to the item for the sticky pushing effect. */
80
- stickyOffset: {
81
- /** Horizontal translation. */
82
- x: number;
83
- /** Vertical translation. */
84
- y: number;
85
- };
110
+ /** Whether this item is currently in a stuck state at the horizontal viewport edge. */
111
+ isStickyActiveX?: boolean;
112
+ /** Whether this item is currently in a stuck state at the vertical viewport edge. */
113
+ isStickyActiveY?: boolean;
114
+ /** The relative translation applied to the item for the sticky pushing effect in DU. */
115
+ stickyOffset: Point;
116
+ }
117
+
118
+ /** Information about the currently visible range of columns and their paddings. */
119
+ export interface ColumnRange {
120
+ /** Inclusive start index. */
121
+ start: number;
122
+ /** Exclusive end index. */
123
+ end: number;
124
+ /** Pixel padding to maintain at the start of the row in VU. */
125
+ padStart: number;
126
+ /** Pixel padding to maintain at the end of the row in VU. */
127
+ padEnd: number;
86
128
  }
87
129
 
88
130
  /** Comprehensive state of the virtual scroll system. */
89
131
  export interface ScrollDetails<T = unknown> {
90
132
  /** List of items currently rendered in the DOM buffer. */
91
133
  items: RenderedItem<T>[];
92
- /** Index of the first item partially or fully visible in the viewport. */
134
+ /** Index of the first item visible below any sticky header in the viewport. */
93
135
  currentIndex: number;
94
- /** Index of the first column partially or fully visible (grid mode). */
136
+ /** Index of the first column visible after any sticky column in the viewport (grid mode). */
95
137
  currentColIndex: number;
96
- /** Current relative pixel scroll position from the content start. */
97
- scrollOffset: {
98
- /** Horizontal position (X). */
99
- x: number;
100
- /** Vertical position (Y). */
101
- y: number;
102
- };
103
- /** Current dimensions of the visible viewport area. */
104
- viewportSize: {
105
- /** Pixel width. */
106
- width: number;
107
- /** Pixel height. */
108
- height: number;
109
- };
110
- /** Total calculated or estimated size of all items and gaps. */
111
- totalSize: {
112
- /** Total pixel width. */
113
- width: number;
114
- /** Total pixel height. */
115
- height: number;
116
- };
138
+ /** Index of the last item visible above any sticky footer in the viewport. */
139
+ currentEndIndex: number;
140
+ /** Index of the last column visible before any sticky end column in the viewport (grid mode). */
141
+ currentEndColIndex: number;
142
+ /** Current relative pixel scroll position from the content start in VU. */
143
+ scrollOffset: Point;
144
+ /** Current display pixel scroll position (before scaling) in DU. */
145
+ displayScrollOffset: Point;
146
+ /** Current dimensions of the visible viewport area in VU. */
147
+ viewportSize: Size;
148
+ /** Current dimensions of the visible viewport area in display pixels (DU). */
149
+ displayViewportSize: Size;
150
+ /** Total calculated or estimated size of all items and gaps in VU. */
151
+ totalSize: Size;
117
152
  /** Whether the container is currently being scrolled by the user or an animation. */
118
153
  isScrolling: boolean;
119
154
  /** Whether the current scroll operation was initiated programmatically. */
@@ -126,30 +161,37 @@ export interface ScrollDetails<T = unknown> {
126
161
  end: number;
127
162
  };
128
163
  /** The range of column indices and associated paddings currently being rendered. */
129
- columnRange: {
130
- /** Inclusive start index. */
131
- start: number;
132
- /** Exclusive end index. */
133
- end: number;
134
- /** Pixel padding to maintain at the start of the row. */
135
- padStart: number;
136
- /** Pixel padding to maintain at the end of the row. */
137
- padEnd: number;
138
- };
164
+ columnRange: ColumnRange;
139
165
  }
140
166
 
141
- /** Configuration properties for the `useVirtualScroll` composable. */
142
- export interface VirtualScrollProps<T = unknown> {
143
- /**
144
- * Array of data items to virtualize.
145
- */
167
+ /**
168
+ * Configuration for Server-Side Rendering.
169
+ * Defines which items are rendered statically on the server.
170
+ */
171
+ export interface SSRRange {
172
+ /** First row index (for list or grid). */
173
+ start: number;
174
+ /** Exclusive last row index (for list or grid). */
175
+ end: number;
176
+ /** First column index (for grid mode). */
177
+ colStart?: number;
178
+ /** Exclusive last column index (for grid mode). */
179
+ colEnd?: number;
180
+ }
181
+
182
+ /** Pixel padding configuration in display pixels (DU). */
183
+ export type PaddingValue = number | { x?: number; y?: number; };
184
+
185
+ /** Base configuration properties shared between the component and the composable. */
186
+ export interface VirtualScrollBaseProps<T = unknown> {
187
+ /** Array of data items to virtualize. */
146
188
  items: T[];
147
189
 
148
190
  /**
149
- * Fixed size of each item (in pixels) or a function that returns the size of an item.
191
+ * Fixed size of each item in virtual units (VU) or a function that returns the size of an item.
150
192
  * Pass `0`, `null` or `undefined` for automatic dynamic size detection via `ResizeObserver`.
151
193
  */
152
- itemSize?: number | ((item: T, index: number) => number) | undefined;
194
+ itemSize?: number | ((item: T, index: number) => number) | null | undefined;
153
195
 
154
196
  /**
155
197
  * Direction of the virtual scroll.
@@ -171,30 +213,15 @@ export interface VirtualScrollProps<T = unknown> {
171
213
 
172
214
  /**
173
215
  * The scrollable element or window object.
174
- * If not provided, virtualization usually happens relative to the `hostElement`.
216
+ * If not provided, virtualization usually happens relative to the `hostRef`.
175
217
  */
176
218
  container?: HTMLElement | Window | null | undefined;
177
219
 
178
- /**
179
- * The host element that directly wraps the absolute-positioned items.
180
- * Used for calculating relative offsets.
181
- */
182
- hostElement?: HTMLElement | null | undefined;
183
-
184
220
  /**
185
221
  * Configuration for Server-Side Rendering.
186
222
  * Defines which items are rendered statically on the server.
187
223
  */
188
- ssrRange?: {
189
- /** First row index. */
190
- start: number;
191
- /** Exclusive last row index. */
192
- end: number;
193
- /** First column index (grid mode). */
194
- colStart?: number;
195
- /** Exclusive last column index (grid mode). */
196
- colEnd?: number;
197
- } | undefined;
224
+ ssrRange?: SSRRange | undefined;
198
225
 
199
226
  /**
200
227
  * Number of columns for bidirectional grid scrolling.
@@ -202,29 +229,29 @@ export interface VirtualScrollProps<T = unknown> {
202
229
  columnCount?: number | undefined;
203
230
 
204
231
  /**
205
- * Fixed width of columns (in pixels), an array of widths, or a function returning widths.
232
+ * Fixed width of columns in VU, an array of widths, or a function returning widths.
206
233
  * Pass `0`, `null` or `undefined` for dynamic column detection.
207
234
  */
208
- columnWidth?: number | number[] | ((index: number) => number) | undefined;
235
+ columnWidth?: number | number[] | ((index: number) => number) | null | undefined;
209
236
 
210
237
  /**
211
- * Pixel padding at the start of the scroll container.
238
+ * Pixel padding at the start of the scroll container in display pixels (DU).
212
239
  */
213
- scrollPaddingStart?: number | { x?: number; y?: number; } | undefined;
240
+ scrollPaddingStart?: PaddingValue | undefined;
214
241
 
215
242
  /**
216
- * Pixel padding at the end of the scroll container.
243
+ * Pixel padding at the end of the scroll container in DU.
217
244
  */
218
- scrollPaddingEnd?: number | { x?: number; y?: number; } | undefined;
245
+ scrollPaddingEnd?: PaddingValue | undefined;
219
246
 
220
247
  /**
221
- * Gap between items in pixels.
248
+ * Gap between items in virtual units (VU).
222
249
  * Applied vertically in list/grid mode, horizontally in horizontal list mode.
223
250
  */
224
251
  gap?: number | undefined;
225
252
 
226
253
  /**
227
- * Gap between columns in pixels.
254
+ * Gap between columns in VU.
228
255
  * Applied in horizontal and bidirectional grid modes.
229
256
  */
230
257
  columnGap?: number | undefined;
@@ -235,7 +262,7 @@ export interface VirtualScrollProps<T = unknown> {
235
262
  stickyIndices?: number[] | undefined;
236
263
 
237
264
  /**
238
- * Threshold distance from the end (in pixels) to emit the 'load' event.
265
+ * Threshold distance from the end in display pixels (DU) to emit the 'load' event.
239
266
  * @default 200
240
267
  */
241
268
  loadDistance?: number | undefined;
@@ -246,7 +273,7 @@ export interface VirtualScrollProps<T = unknown> {
246
273
  loading?: boolean | undefined;
247
274
 
248
275
  /**
249
- * Whether to automatically restore and lock scroll position when items are prepended to the array.
276
+ * Whether to automatically restore and maintain scroll position when items are prepended to the array.
250
277
  */
251
278
  restoreScrollOnPrepend?: boolean | undefined;
252
279
 
@@ -262,12 +289,12 @@ export interface VirtualScrollProps<T = unknown> {
262
289
  initialScrollAlign?: ScrollAlignment | ScrollAlignmentOptions | undefined;
263
290
 
264
291
  /**
265
- * Default fallback size for items before they are measured.
292
+ * Default fallback size for items before they are measured in VU.
266
293
  */
267
294
  defaultItemSize?: number | undefined;
268
295
 
269
296
  /**
270
- * Default fallback width for columns before they are measured.
297
+ * Default fallback width for columns before they are measured in VU.
271
298
  */
272
299
  defaultColumnWidth?: number | undefined;
273
300
 
@@ -277,6 +304,124 @@ export interface VirtualScrollProps<T = unknown> {
277
304
  debug?: boolean | undefined;
278
305
  }
279
306
 
307
+ /** Configuration properties for the `useVirtualScroll` composable. */
308
+ export interface VirtualScrollProps<T = unknown> extends VirtualScrollBaseProps<T> {
309
+ /**
310
+ * The host element that directly wraps the absolute-positioned items.
311
+ * Used for calculating relative offsets in display pixels (DU).
312
+ */
313
+ hostElement?: HTMLElement | null | undefined;
314
+
315
+ /**
316
+ * The root element of the VirtualScroll component.
317
+ * Used for calculating relative offsets in display pixels (DU).
318
+ */
319
+ hostRef?: HTMLElement | null | undefined;
320
+
321
+ /**
322
+ * Size of sticky elements at the start of the viewport (top or left) in DU.
323
+ * Used to adjust the visible range and item positioning without increasing content size.
324
+ */
325
+ stickyStart?: PaddingValue | undefined;
326
+
327
+ /**
328
+ * Size of sticky elements at the end of the viewport (bottom or right) in DU.
329
+ * Used to adjust the visible range without increasing content size.
330
+ */
331
+ stickyEnd?: PaddingValue | undefined;
332
+
333
+ /**
334
+ * Extra padding (display pixels - DU) at the start of the flow (e.g. non-sticky header).
335
+ */
336
+ flowPaddingStart?: PaddingValue | undefined;
337
+
338
+ /**
339
+ * Extra padding (DU) at the end of the flow (e.g. non-sticky footer).
340
+ */
341
+ flowPaddingEnd?: PaddingValue | undefined;
342
+ }
343
+
344
+ /** Help provide axis specific information to the scrollbar. */
345
+ export type ScrollAxis = 'vertical' | 'horizontal';
346
+
347
+ /** Properties for the `VirtualScrollbar` component. */
348
+ export interface VirtualScrollbarProps {
349
+ /**
350
+ * The axis for this scrollbar.
351
+ * - 'vertical': Vertical scrollbar.
352
+ * - 'horizontal': Horizontal scrollbar.
353
+ * @default 'vertical'
354
+ */
355
+ axis?: ScrollAxis;
356
+
357
+ /**
358
+ * Total size of the scrollable content in pixels.
359
+ */
360
+ totalSize: number;
361
+
362
+ /**
363
+ * Current scroll position in pixels.
364
+ */
365
+ position: number;
366
+
367
+ /**
368
+ * Viewport size in pixels.
369
+ */
370
+ viewportSize: number;
371
+
372
+ /**
373
+ * Function to scroll to a specific pixel offset on this axis.
374
+ * @param offset - The pixel offset to scroll to.
375
+ */
376
+ scrollToOffset?: (offset: number) => void;
377
+
378
+ /**
379
+ * The ID of the container element this scrollbar controls.
380
+ */
381
+ containerId?: string;
382
+
383
+ /**
384
+ * Whether the scrollbar is in Right-to-Left (RTL) mode.
385
+ * @default false
386
+ */
387
+ isRtl?: boolean;
388
+ }
389
+
390
+ /** Properties passed to the 'scrollbar' scoped slot. */
391
+ export interface ScrollbarSlotProps {
392
+ /** The axis for this scrollbar. */
393
+ axis: ScrollAxis;
394
+ /** Current scroll position as a percentage (0 to 1). */
395
+ positionPercent: number;
396
+ /** Viewport size as a percentage of total size (0 to 1). */
397
+ viewportPercent: number;
398
+ /** Calculated thumb size as a percentage of the track size (0 to 100). */
399
+ thumbSizePercent: number;
400
+ /** Calculated thumb position as a percentage of the track size (0 to 100). */
401
+ thumbPositionPercent: number;
402
+
403
+ /**
404
+ * Attributes and event listeners to be bound to the scrollbar track element.
405
+ * Use `v-bind="trackProps"` on your track element.
406
+ */
407
+ trackProps: Record<string, unknown>;
408
+
409
+ /**
410
+ * Attributes and event listeners to be bound to the scrollbar thumb element.
411
+ * Use `v-bind="thumbProps"` on your thumb element.
412
+ */
413
+ thumbProps: Record<string, unknown>;
414
+
415
+ /**
416
+ * Grouped props for the `VirtualScrollbar` component.
417
+ * Useful for passing directly to `<VirtualScrollbar v-bind="scrollbarProps" />`.
418
+ */
419
+ scrollbarProps: VirtualScrollbarProps;
420
+
421
+ /** Whether the thumb is currently being dragged. */
422
+ isDragging: boolean;
423
+ }
424
+
280
425
  /** Properties passed to the 'item' scoped slot. */
281
426
  export interface ItemSlotProps<T = unknown> {
282
427
  /** The original data item being rendered. */
@@ -284,22 +429,92 @@ export interface ItemSlotProps<T = unknown> {
284
429
  /** The 0-based index of the item. */
285
430
  index: number;
286
431
  /** Information about the currently visible range of columns. */
287
- columnRange: {
288
- /** First rendered column. */
289
- start: number;
290
- /** Last rendered column (exclusive). */
291
- end: number;
292
- /** Pixel space before first column. */
293
- padStart: number;
294
- /** Pixel space after last column. */
295
- padEnd: number;
296
- };
432
+ columnRange: ColumnRange;
297
433
  /** Helper to get the current calculated width of any column index. */
298
434
  getColumnWidth: (index: number) => number;
435
+ /** Vertical gap between items. */
436
+ gap: number;
437
+ /** Horizontal gap between columns. */
438
+ columnGap: number;
299
439
  /** Whether this item index is configured as sticky. */
300
440
  isSticky?: boolean | undefined;
301
441
  /** Whether this item is currently in a sticky state at the edge. */
302
442
  isStickyActive?: boolean | undefined;
443
+ /** Whether this item is currently in a sticky state at the horizontal edge. */
444
+ isStickyActiveX?: boolean | undefined;
445
+ /** Whether this item is currently in a sticky state at the vertical edge. */
446
+ isStickyActiveY?: boolean | undefined;
447
+ /** The calculated pixel offset relative to the items wrapper in display pixels (DU). */
448
+ offset: {
449
+ /** Horizontal offset (left) in DU. */
450
+ x: number;
451
+ /** Vertical offset (top) in DU. */
452
+ y: number;
453
+ };
454
+ }
455
+
456
+ /** Configuration properties for the `VirtualScroll` component. */
457
+ export interface VirtualScrollComponentProps<T = unknown> extends VirtualScrollBaseProps<T> {
458
+ /** The HTML tag to use for the root container. */
459
+ containerTag?: string;
460
+ /** The HTML tag to use for the items wrapper. */
461
+ wrapperTag?: string;
462
+ /** The HTML tag to use for each item. */
463
+ itemTag?: string;
464
+ /** Whether the content in the 'header' slot is sticky. */
465
+ stickyHeader?: boolean;
466
+ /** Whether the content in the 'footer' slot is sticky. */
467
+ stickyFooter?: boolean;
468
+ /** Whether to use virtual scrollbars for styling purposes. */
469
+ virtualScrollbar?: boolean;
470
+ }
471
+
472
+ /** Exposed methods and properties of the `VirtualScroll` component instance. */
473
+ export interface VirtualScrollInstance<T = unknown> extends VirtualScrollComponentProps<T> {
474
+ /** Detailed information about the current scroll state. */
475
+ scrollDetails: ScrollDetails<T>;
476
+ /** Information about the current visible range of columns. */
477
+ columnRange: ScrollDetails<T>[ 'columnRange' ];
478
+ /** Helper to get the width of a specific column. */
479
+ getColumnWidth: (index: number) => number;
480
+ /** Helper to get the height of a specific row. */
481
+ getRowHeight: (index: number) => number;
482
+ /** Helper to get the virtual offset of a specific row. */
483
+ getRowOffset: (index: number) => number;
484
+ /** Helper to get the virtual offset of a specific column. */
485
+ getColumnOffset: (index: number) => number;
486
+ /** Helper to get the virtual offset of a specific item. */
487
+ getItemOffset: (index: number) => number;
488
+ /** Helper to get the size of a specific item along the scroll axis. */
489
+ getItemSize: (index: number) => number;
490
+ /** Programmatically scroll to a specific row and/or column. */
491
+ scrollToIndex: (rowIndex: number | null | undefined, colIndex: number | null | undefined, options?: ScrollAlignment | ScrollAlignmentOptions | ScrollToIndexOptions) => void;
492
+ /** Programmatically scroll to a specific pixel offset. */
493
+ scrollToOffset: (x?: number | null, y?: number | null, options?: { behavior?: 'auto' | 'smooth'; }) => void;
494
+ /** Resets all dynamic measurements and re-initializes from props. */
495
+ refresh: () => void;
496
+ /** Immediately stops any currently active smooth scroll animation and clears pending corrections. */
497
+ stopProgrammaticScroll: () => void;
498
+ /** Detects the current direction (LTR/RTL) of the scroll container. */
499
+ updateDirection: () => void;
500
+ /** Whether the scroll container is in Right-to-Left (RTL) mode. */
501
+ isRtl: boolean;
502
+ /** Whether the component has finished its first client - side mount and hydration. */
503
+ isHydrated: boolean;
504
+ /** Coordinate scaling factor for X axis. */
505
+ scaleX: number;
506
+ /** Coordinate scaling factor for Y axis. */
507
+ scaleY: number;
508
+ /** Physical width of the content in the DOM (clamped to browser limits). */
509
+ renderedWidth: number;
510
+ /** Physical height of the content in the DOM (clamped to browser limits). */
511
+ renderedHeight: number;
512
+ /** Absolute offset of the component within its container. */
513
+ componentOffset: Point;
514
+ /** Properties for the vertical scrollbar. */
515
+ scrollbarPropsVertical: ScrollbarSlotProps | null;
516
+ /** Properties for the horizontal scrollbar. */
517
+ scrollbarPropsHorizontal: ScrollbarSlotProps | null;
303
518
  }
304
519
 
305
520
  /** Parameters for calculating the scroll target position. */
@@ -310,16 +525,12 @@ export interface ScrollTargetParams {
310
525
  colIndex: number | null | undefined;
311
526
  /** Scroll options. */
312
527
  options?: ScrollAlignment | ScrollAlignmentOptions | ScrollToIndexOptions | undefined;
313
- /** Total items count. */
314
- itemsLength: number;
315
- /** Total columns count. */
316
- columnCount: number;
317
528
  /** Current scroll direction. */
318
529
  direction: ScrollDirection;
319
- /** Usable viewport width (excluding padding). */
320
- usableWidth: number;
321
- /** Usable viewport height (excluding padding). */
322
- usableHeight: number;
530
+ /** Current viewport width. */
531
+ viewportWidth: number;
532
+ /** Current viewport height. */
533
+ viewportHeight: number;
323
534
  /** Current total estimated width. */
324
535
  totalWidth: number;
325
536
  /** Current total estimated height. */
@@ -348,8 +559,36 @@ export interface ScrollTargetParams {
348
559
  getColumnSize: (index: number) => number;
349
560
  /** Prefix sum resolver for column width. */
350
561
  getColumnQuery: (index: number) => number;
562
+ /** Coordinate scaling factor for X axis. */
563
+ scaleX: number;
564
+ /** Coordinate scaling factor for Y axis. */
565
+ scaleY: number;
566
+ /** Host offset on X axis in display pixels. */
567
+ hostOffsetX: number;
568
+ /** Host offset on Y axis in display pixels. */
569
+ hostOffsetY: number;
351
570
  /** List of sticky indices. */
352
571
  stickyIndices?: number[] | undefined;
572
+ /** Sticky start offset on X axis. */
573
+ stickyStartX?: number | undefined;
574
+ /** Sticky start offset on Y axis. */
575
+ stickyStartY?: number | undefined;
576
+ /** Sticky end offset on X axis. */
577
+ stickyEndX?: number | undefined;
578
+ /** Sticky end offset on Y axis. */
579
+ stickyEndY?: number | undefined;
580
+ /** Flow padding start on X axis. */
581
+ flowPaddingStartX?: number | undefined;
582
+ /** Flow padding start on Y axis. */
583
+ flowPaddingStartY?: number | undefined;
584
+ /** Scroll padding start on X axis. */
585
+ paddingStartX?: number | undefined;
586
+ /** Scroll padding start on Y axis. */
587
+ paddingStartY?: number | undefined;
588
+ /** Scroll padding end on X axis. */
589
+ paddingEndX?: number | undefined;
590
+ /** Scroll padding end on Y axis. */
591
+ paddingEndY?: number | undefined;
353
592
  }
354
593
 
355
594
  /** Calculated scroll target result. */
@@ -486,6 +725,8 @@ export interface ItemPositionParams {
486
725
  getSizeY: (idx: number) => number;
487
726
  /** Width resolver. */
488
727
  getSizeX: (idx: number) => number;
728
+ /** Current column range (for grid mode). */
729
+ columnRange?: ColumnRange | undefined;
489
730
  }
490
731
 
491
732
  /** Parameters for calculating an item's style object. */
@@ -504,6 +745,8 @@ export interface ItemStyleParams<T = unknown> {
504
745
  paddingStartY: number;
505
746
  /** Hydration state. */
506
747
  isHydrated: boolean;
748
+ /** Whether the container is in Right-to-Left (RTL) mode. */
749
+ isRtl: boolean;
507
750
  }
508
751
 
509
752
  /** Parameters for calculating the total size of the scrollable area. */