react-window 2.2.2 → 2.2.4

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.
@@ -35,28 +35,70 @@ declare type ForbiddenKeys_2 = "ariaAttributes" | "index" | "style";
35
35
 
36
36
  export declare function getScrollbarSize(recalculate?: boolean): number;
37
37
 
38
+ /**
39
+ * Renders data with many rows and columns.
40
+ */
38
41
  export declare function Grid<CellProps extends object, TagName extends TagNames = "div">({ cellComponent: CellComponentProp, cellProps: cellPropsUnstable, children, className, columnCount, columnWidth, defaultHeight, defaultWidth, dir, gridRef, onCellsRendered, onResize, overscanCount, rowCount, rowHeight, style, tagName, ...rest }: GridProps<CellProps, TagName>): ReactElement;
39
42
 
40
- export declare type GridImperativeAPI = {
43
+ /**
44
+ * Ref used to interact with this component's imperative API.
45
+ *
46
+ * This API has imperative methods for scrolling and a getter for the outermost DOM element.
47
+ *
48
+ * ℹ️ The `useGridRef` and `useGridCallbackRef` hooks are exported for convenience use in TypeScript projects.
49
+ */
50
+ export declare interface GridImperativeAPI {
51
+ /**
52
+ * Outermost HTML element for the grid if mounted and null (if not mounted.
53
+ */
41
54
  get element(): HTMLDivElement | null;
42
- scrollToCell({ behavior, columnAlign, columnIndex, rowAlign, rowIndex }: {
55
+ /**
56
+ * Scrolls the grid so that the specified row and column are visible.
57
+ *
58
+ * @param behavior Determines whether scrolling is instant or animates smoothly
59
+ * @param columnAlign Determines the horizontal alignment of the element within the list
60
+ * @param columnIndex Index of the column to scroll to (0-based)
61
+ * @param rowAlign Determines the vertical alignment of the element within the list
62
+ * @param rowIndex Index of the row to scroll to (0-based)
63
+ *
64
+ * @throws RangeError if an invalid row or column index is provided
65
+ */
66
+ scrollToCell: ({ behavior, columnAlign, columnIndex, rowAlign, rowIndex }: {
43
67
  behavior?: "auto" | "instant" | "smooth";
44
68
  columnAlign?: "auto" | "center" | "end" | "smart" | "start";
45
69
  columnIndex: number;
46
70
  rowAlign?: "auto" | "center" | "end" | "smart" | "start";
47
71
  rowIndex: number;
48
- }): void;
49
- scrollToColumn({ align, behavior, index }: {
72
+ }) => void;
73
+ /**
74
+ * Scrolls the grid so that the specified column is visible.
75
+ *
76
+ * @param align Determines the horizontal alignment of the element within the list
77
+ * @param behavior Determines whether scrolling is instant or animates smoothly
78
+ * @param index Index of the column to scroll to (0-based)
79
+ *
80
+ * @throws RangeError if an invalid column index is provided
81
+ */
82
+ scrollToColumn: ({ align, behavior, index }: {
50
83
  align?: "auto" | "center" | "end" | "smart" | "start";
51
84
  behavior?: "auto" | "instant" | "smooth";
52
85
  index: number;
53
- }): void;
54
- scrollToRow({ align, behavior, index }: {
86
+ }) => void;
87
+ /**
88
+ * Scrolls the grid so that the specified row is visible.
89
+ *
90
+ * @param align Determines the vertical alignment of the element within the list
91
+ * @param behavior Determines whether scrolling is instant or animates smoothly
92
+ * @param index Index of the row to scroll to (0-based)
93
+ *
94
+ * @throws RangeError if an invalid row index is provided
95
+ */
96
+ scrollToRow: ({ align, behavior, index }: {
55
97
  align?: "auto" | "center" | "end" | "smart" | "start";
56
98
  behavior?: "auto" | "instant" | "smooth";
57
99
  index: number;
58
- }): void;
59
- };
100
+ }) => void;
101
+ }
60
102
 
61
103
  export declare type GridProps<CellProps extends object, TagName extends TagNames = "div"> = Omit<HTMLAttributes<HTMLDivElement>, "onResize"> & {
62
104
  /**
@@ -114,19 +156,32 @@ export declare type GridProps<CellProps extends object, TagName extends TagNames
114
156
  */
115
157
  defaultWidth?: number;
116
158
  /**
117
- * Corresponds to the HTML dir attribute:
118
- * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir
159
+ * Indicates the directionality of grid cells.
160
+ *
161
+ * ℹ️ See HTML `dir` [global attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir) for more information.
119
162
  */
120
163
  dir?: "ltr" | "rtl";
121
164
  /**
122
- * Ref used to interact with this component's imperative API.
123
- *
124
- * This API has imperative methods for scrolling and a getter for the outermost DOM element.
165
+ * Imperative Grid API.
125
166
  *
126
167
  * ℹ️ The `useGridRef` and `useGridCallbackRef` hooks are exported for convenience use in TypeScript projects.
127
168
  */
128
169
  gridRef?: Ref<{
170
+ /**
171
+ * Outermost HTML element for the grid if mounted and null (if not mounted.
172
+ */
129
173
  get element(): HTMLDivElement | null;
174
+ /**
175
+ * Scrolls the grid so that the specified row and column are visible.
176
+ *
177
+ * @param behavior Determines whether scrolling is instant or animates smoothly
178
+ * @param columnAlign Determines the horizontal alignment of the element within the list
179
+ * @param columnIndex Index of the column to scroll to (0-based)
180
+ * @param rowAlign Determines the vertical alignment of the element within the list
181
+ * @param rowIndex Index of the row to scroll to (0-based)
182
+ *
183
+ * @throws RangeError if an invalid row or column index is provided
184
+ */
130
185
  scrollToCell(config: {
131
186
  behavior?: "auto" | "instant" | "smooth";
132
187
  columnAlign?: "auto" | "center" | "end" | "smart" | "start";
@@ -134,11 +189,29 @@ export declare type GridProps<CellProps extends object, TagName extends TagNames
134
189
  rowAlign?: "auto" | "center" | "end" | "smart" | "start";
135
190
  rowIndex: number;
136
191
  }): void;
192
+ /**
193
+ * Scrolls the grid so that the specified column is visible.
194
+ *
195
+ * @param align Determines the horizontal alignment of the element within the list
196
+ * @param behavior Determines whether scrolling is instant or animates smoothly
197
+ * @param index Index of the column to scroll to (0-based)
198
+ *
199
+ * @throws RangeError if an invalid column index is provided
200
+ */
137
201
  scrollToColumn(config: {
138
202
  align?: "auto" | "center" | "end" | "smart" | "start";
139
203
  behavior?: "auto" | "instant" | "smooth";
140
204
  index: number;
141
205
  }): void;
206
+ /**
207
+ * Scrolls the grid so that the specified row is visible.
208
+ *
209
+ * @param align Determines the vertical alignment of the element within the list
210
+ * @param behavior Determines whether scrolling is instant or animates smoothly
211
+ * @param index Index of the row to scroll to (0-based)
212
+ *
213
+ * @throws RangeError if an invalid row index is provided
214
+ */
142
215
  scrollToRow(config: {
143
216
  align?: "auto" | "center" | "end" | "smart" | "start";
144
217
  behavior?: "auto" | "instant" | "smooth";
@@ -200,16 +273,36 @@ export declare type GridProps<CellProps extends object, TagName extends TagNames
200
273
  tagName?: TagName;
201
274
  };
202
275
 
276
+ /**
277
+ * Renders data with many rows.
278
+ */
203
279
  export declare function List<RowProps extends object, TagName extends TagNames = "div">({ children, className, defaultHeight, listRef, onResize, onRowsRendered, overscanCount, rowComponent: RowComponentProp, rowCount, rowHeight: rowHeightProp, rowProps: rowPropsUnstable, tagName, style, ...rest }: ListProps<RowProps, TagName>): ReactElement;
204
280
 
205
- export declare type ListImperativeAPI = {
281
+ /**
282
+ * Imperative List API.
283
+ *
284
+ * ℹ️ The `useListRef` and `useListCallbackRef` hooks are exported for convenience use in TypeScript projects.
285
+ */
286
+ export declare interface ListImperativeAPI {
287
+ /**
288
+ * Outermost HTML element for the list if mounted and null (if not mounted.
289
+ */
206
290
  get element(): HTMLDivElement | null;
207
- scrollToRow({ align, behavior, index }: {
291
+ /**
292
+ * Scrolls the list so that the specified row is visible.
293
+ *
294
+ * @param align Determines the vertical alignment of the element within the list
295
+ * @param behavior Determines whether scrolling is instant or animates smoothly
296
+ * @param index Index of the row to scroll to (0-based)
297
+ *
298
+ * @throws RangeError if an invalid row index is provided
299
+ */
300
+ scrollToRow: ({ align, behavior, index }: {
208
301
  align?: "auto" | "center" | "end" | "smart" | "start";
209
302
  behavior?: "auto" | "instant" | "smooth";
210
303
  index: number;
211
- }): void;
212
- };
304
+ }) => void;
305
+ }
213
306
 
214
307
  export declare type ListProps<RowProps extends object, TagName extends TagNames = "div"> = Omit<HTMLAttributes<HTMLDivElement>, "onResize"> & {
215
308
  /**
@@ -234,7 +327,19 @@ export declare type ListProps<RowProps extends object, TagName extends TagNames
234
327
  * ℹ️ The `useListRef` and `useListCallbackRef` hooks are exported for convenience use in TypeScript projects.
235
328
  */
236
329
  listRef?: Ref<{
330
+ /**
331
+ * Outermost HTML element for the list if mounted and null (if not mounted.
332
+ */
237
333
  get element(): HTMLDivElement | null;
334
+ /**
335
+ * Scrolls the list so that the specified row is visible.
336
+ *
337
+ * @param align Determines the vertical alignment of the element within the list
338
+ * @param behavior Determines whether scrolling is instant or animates smoothly
339
+ * @param index Index of the row to scroll to (0-based)
340
+ *
341
+ * @throws RangeError if an invalid row index is provided
342
+ */
238
343
  scrollToRow(config: {
239
344
  align?: "auto" | "center" | "end" | "smart" | "start";
240
345
  behavior?: "auto" | "instant" | "smooth";