@rickcedwhat/playwright-smart-table 6.24.0 → 6.25.0-next.3dfcc94

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.
@@ -1,1133 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TYPE_CONTEXT = void 0;
4
- /**
5
- * 🤖 AUTO-GENERATED FILE. DO NOT EDIT.
6
- * This file is generated by scripts/embed-types.mjs
7
- * It contains the raw text of types.ts to provide context for LLM prompts.
8
- */
9
- exports.TYPE_CONTEXT = `
10
- /**
11
- * Selector used by strategies (e.g. pagination buttons, spinners): a CSS string resolved
12
- * relative to the parent, or a function that receives the parent and returns a Locator.
13
- * @example
14
- * nextButton: 'button.next'
15
- * nextButton: (root) => root.getByRole('button', { name: 'Next' })
16
- */
17
- export type Selector = string | ((root: Locator | Page) => Locator) | ((root: Locator) => Locator);
18
-
19
- /**
20
- * Selector for \`headerSelector\`, \`rowSelector\`, and \`cellSelector\`: a CSS string resolved
21
- * relative to the parent, or a function that receives the parent Locator (the table root for
22
- * headers/rows, the row for cells) and returns a Locator.
23
- *
24
- * Some features evaluate selectors in the browser and need a CSS string. Given a function,
25
- * the \`dataAttribute\` viewport strategy warns once and skips the step that needs the string.
26
- * The MUI DataGrid viewport instead uses \`[data-rowindex]\` for row scrolling and ranges,
27
- * and \`.MuiDataGrid-columnHeader\` for header scrolling. Its overscan filtering warns and
28
- * includes every mounted row because it needs the configured row selector.
29
- * @example
30
- * rowSelector: 'tbody tr'
31
- * rowSelector: (root) => root.getByRole('row').filter({ has: root.getByRole('cell') })
32
- * // Headers rendered as a separate table outside the root:
33
- * headerSelector: (root) => root.page().locator('#header-table th')
34
- */
35
- export type TableSelector = string | ((parent: Locator) => Locator);
36
-
37
- /**
38
- * Return type for \`resolveRowIndex\`. A plain number gives the logical index only;
39
- * \`{ index, selector }\` additionally provides a CSS selector the library uses to
40
- * build a self-healing row locator that survives virtual-scroll DOM recycling.
41
- */
42
- export type RowIndexResult = number | { index: number; selector: string };
43
-
44
- /**
45
- * Value used to filter rows.
46
- * - string/number/RegExp: filter by text content of the cell.
47
- * - function: filter by custom locator logic within the cell.
48
- * @example
49
- * // Text filter
50
- * { Name: 'John' }
51
- *
52
- * // Custom locator filter (e.g. checkbox is checked)
53
- * { Status: (cell) => cell.locator('input:checked') }
54
- */
55
- export type FilterValue = string | RegExp | number | ((cell: Locator) => Locator);
56
-
57
- /**
58
- * Function to get a cell locator given row, column info.
59
- * Replaces the old cellResolver.
60
- */
61
- export type GetCellLocatorFn = (args: {
62
- row: Locator;
63
- /** The root locator passed to useTable(). Useful for re-querying stale row locators. */
64
- root: Locator;
65
- columnName: string;
66
- columnIndex: number;
67
- rowIndex?: number;
68
- page: Page;
69
- config: FinalTableConfig<any>;
70
- }) => Locator;
71
-
72
- /**
73
- * Hook called before each cell value is read in \`toJSON\` (and \`columnOverrides.read\`).
74
- *
75
- * Use this to scroll off-screen columns into view in **horizontally** virtualized tables,
76
- * wait for lazy-rendered content (popovers, tooltips, async cell renderers), or perform
77
- * any other pre-read setup that doesn't involve Y-axis scrolling.
78
- *
79
- * ---
80
- *
81
- * **⚠️ Y-scroll footgun — do NOT call \`scrollIntoViewIfNeeded()\` on row-virtualized grids.**
82
- *
83
- * \`scrollIntoViewIfNeeded\` adjusts *both* scroll axes. On grids that recycle DOM nodes
84
- * based on the Y position (MUI DataGrid, AG Grid, react-window, etc.) calling it will
85
- * shift the viewport vertically, unmounting the row you are currently reading and
86
- * silently returning stale or empty cell values for the remainder of the row.
87
- *
88
- * Safe uses:
89
- * - Column-only (X-axis) virtualization where rows are always in the DOM.
90
- * - Calling \`scrollIntoViewIfNeeded\` on the **header cell** only, when that header is
91
- * guaranteed not to trigger a Y-scroll (e.g. sticky header grids).
92
- *
93
- * For grids with **both** row and column virtualization, use the \`viewport\` strategy
94
- * instead — it drives explicit \`scrollToRow\` / \`scrollToColumn\` calls and is aware of
95
- * the virtualization lifecycle.
96
- *
97
- * @example
98
- * // Safe: column-only horizontal virtualization (rows always in DOM)
99
- * strategies: {
100
- * beforeCellRead: async ({ columnName, getHeaderCell }) => {
101
- * const header = await getHeaderCell(columnName);
102
- * await header.scrollIntoViewIfNeeded(); // only scrolls X — rows stay mounted
103
- * }
104
- * }
105
- *
106
- * @example
107
- * // Safe: wait for a lazy-rendered popover/tooltip before reading its text
108
- * strategies: {
109
- * beforeCellRead: async ({ cell }) => {
110
- * await cell.hover();
111
- * await cell.page().waitForSelector('.cell-tooltip', { state: 'visible' });
112
- * }
113
- * }
114
- */
115
- export type BeforeCellReadFn = (args: {
116
- /** The resolved cell locator */
117
- cell: Locator;
118
- columnName: string;
119
- columnIndex: number;
120
- row: Locator;
121
- page: Page;
122
- root: Locator;
123
- /** Resolves a column name to its header cell locator */
124
- getHeaderCell: (columnName: string) => Promise<Locator>;
125
- }) => Promise<void>;
126
-
127
- /**
128
- * Function to get the currently active/focused cell.
129
- * Returns null if no cell is active.
130
- */
131
- export type GetActiveCellFn = (args: TableContext) => Promise<{
132
- rowIndex: number;
133
- columnIndex: number;
134
- columnName?: string;
135
- locator: Locator;
136
- } | null>;
137
-
138
- /**
139
- * Viewport oracle strategies for virtualized tables.
140
- *
141
- * These tell the library *what is currently in the DOM* rather than *how to move*.
142
- * When present, the cell-reading engine uses them to jump directly to a target
143
- * row/column instead of stepping blindly with navigation primitives.
144
- *
145
- * This is the primary fix for the 2D scroll hazard: scrolling right to bring a
146
- * column into view can knock rows out of the vertical viewport (and vice versa).
147
- * With \`getVisibleRowRange\` the engine detects this and calls \`scrollToRow\` to
148
- * restore the row before reading — eliminating the hazard without polling loops.
149
- *
150
- * All members are optional. Supply whichever the underlying grid exposes:
151
- * - Range oracles alone enable hazard detection with graceful fallback to navigation primitives.
152
- * - Scroll primitives alone enable direct jumps without range awareness.
153
- * - Both together give the most reliable, fastest path.
154
- *
155
- * @example
156
- * // MUI DataGrid via apiRef
157
- * strategies: {
158
- * viewport: {
159
- * getVisibleRowRange: async ({ root }) =>
160
- * root.evaluate(el => {
161
- * const api = (el as any).__muiDataGrid__;
162
- * return { first: api.getFirstVisibleRow(), last: api.getLastVisibleRow() };
163
- * }),
164
- * scrollToRow: async ({ root }, rowIndex) =>
165
- * root.evaluate((el, idx) =>
166
- * (el as any).__muiDataGrid__.scrollToIndexes({ rowIndex: idx }), rowIndex),
167
- * scrollToColumn: async ({ root }, colIndex) =>
168
- * root.evaluate((el, idx) =>
169
- * (el as any).__muiDataGrid__.scrollToIndexes({ colIndex: idx }), colIndex),
170
- * }
171
- * }
172
- *
173
- * @example
174
- * // aria-rowindex / aria-colindex DOM fallback (works without internal API access)
175
- * strategies: {
176
- * viewport: {
177
- * getVisibleRowRange: async ({ root }) =>
178
- * root.evaluate(el => {
179
- * const rows = [...el.querySelectorAll('[role="row"][aria-rowindex]')];
180
- * const idxs = rows.map(r => Number(r.getAttribute('aria-rowindex')) - 1);
181
- * return { first: Math.min(...idxs), last: Math.max(...idxs) };
182
- * }),
183
- * }
184
- * }
185
- */
186
- export interface ViewportStrategy {
187
- /**
188
- * Returns the 0-based index range of rows currently rendered in the DOM.
189
- * Used to detect when a target row has been scrolled out of view and needs recovery.
190
- */
191
- getVisibleRowRange?: (context: TableContext) => Promise<{ first: number; last: number }>;
192
-
193
- /**
194
- * Returns the DOM positions (0-based, document order — indices into the resolved
195
- * \`rowSelector\` set) of rows currently within the scroll container's visible bounds.
196
- * Unlike \`getVisibleRowRange\` (a logical min/max), this identifies the exact rows, so
197
- * \`map\`/\`forEach\`/\`filter\` can skip overscan rows during collection (see #353 / #357).
198
- * Geometry-based and inclusive (any overlap counts as visible). When the container can't
199
- * be measured, return all positions so no rows are filtered.
200
- */
201
- getVisibleRowIndices?: (context: TableContext) => Promise<number[]>;
202
-
203
- /**
204
- * Returns the 0-based index range of columns currently rendered in the DOM.
205
- * Used to detect when a target column is not yet mounted before reading.
206
- */
207
- getVisibleColumnRange?: (context: TableContext) => Promise<{ first: number; last: number }>;
208
-
209
- /**
210
- * Scrolls or jumps directly to make a row visible by 0-based index.
211
- * Replaces blind goDown()/goUp() step loops for grids that expose a scroll API.
212
- */
213
- scrollToRow?: (context: TableContext, rowIndex: number) => Promise<void>;
214
-
215
- /**
216
- * Scrolls or jumps directly to make a column visible by 0-based index.
217
- * Replaces blind goRight()/goLeft() step loops for grids that expose a scroll API.
218
- */
219
- scrollToColumn?: (context: TableContext, colIndex: number) => Promise<void>;
220
-
221
- /**
222
- * When true, disables the automatic memoization of getVisibleColumnRange and
223
- * getVisibleRowRange results. By default the library caches each range value and
224
- * invalidates it after the corresponding scroll call, eliminating redundant DOM
225
- * evaluate() round-trips between scrolls.
226
- */
227
- disableCache?: boolean;
228
- }
229
-
230
-
231
- /**
232
- * SmartCell - A Playwright Locator with table-aware methods for single-cell operations.
233
- *
234
- * Extends all standard Locator methods (click, isVisible, etc.).
235
- */
236
- export type SmartCell = Locator & {
237
- /**
238
- * Scrolls/paginates to bring this specific cell into view using the configured strategies.
239
- * Useful when the grid is horizontally virtualized and the column must be scrolled
240
- * into view before it can be interacted with or read.
241
- */
242
- bringIntoView(): Promise<void>;
243
- };
244
-
245
-
246
- /**
247
- * SmartRow - A Playwright Locator with table-aware methods.
248
- *
249
- * Extends all standard Locator methods (click, isVisible, etc.) with table-specific functionality.
250
- *
251
- * @example
252
- * const row = table.getRow({ Name: 'John Doe' });
253
- * await row.click(); // Standard Locator method
254
- * const email = row.getCell('Email'); // Table-aware method
255
- * const data = await row.toJSON(); // Extract all row data
256
- * await row.smartFill({ Name: 'Jane', Status: 'Active' }); // Fill form fields
257
- */
258
- export type SmartRow<T = any> = Locator & {
259
- /** Optional row index (0-based) if known */
260
- rowIndex?: number;
261
-
262
- /** Optional page index this row was found on (0-based) */
263
- tablePageIndex?: number;
264
-
265
- /** Reference to the parent TableResult */
266
- table: TableResult<T>;
267
-
268
- /**
269
- * Get a cell locator by column name.
270
- * @param column - Column name (case-sensitive)
271
- * @returns SmartCell (Locator + bringIntoView)
272
- * @example
273
- * const emailCell = row.getCell('Email');
274
- * await emailCell.bringIntoView();
275
- * await expect(emailCell).toHaveText('john@example.com');
276
- */
277
- getCell(column: string): SmartCell;
278
-
279
- /**
280
- * Extract all cell data as a key-value object.
281
- * @param options - Optional configuration
282
- * @param options.columns - Specific columns to extract (extracts all if not specified)
283
- * @returns Promise resolving to row data
284
- * @example
285
- * const data = await row.toJSON();
286
- * // { Name: 'John', Email: 'john@example.com', ... }
287
- *
288
- * const partial = await row.toJSON({ columns: ['Name', 'Email'] });
289
- * // { Name: 'John', Email: 'john@example.com' }
290
- *
291
- * // Atomic: snapshot all cell values in a single evaluate — zero inter-column stagger.
292
- * // Requires cellSelector to be a CSS string (not a function).
293
- * // Column overrides ARE supported (run against a frozen off-screen reconstruction).
294
- * // Uses textContent (not layout-dependent innerText) for non-override columns.
295
- * const coherent = await row.toJSON({ atomic: true });
296
- */
297
- toJSON(options?: { columns?: string[]; atomic?: boolean }): Promise<T>;
298
-
299
- /**
300
- * Scrolls/paginates to bring this row into view.
301
- * Works when row position metadata is known (e.g., from getRowByIndex, findRow,
302
- * findRows, filter, or async iteration).
303
- *
304
- * Prefers \`strategies.viewport.scrollToRow\` when configured; otherwise falls back to
305
- * Playwright \`scrollIntoViewIfNeeded()\`.
306
- * @throws Error if row position metadata is unknown
307
- */
308
- bringIntoView(): Promise<void>;
309
-
310
- /**
311
- * Intelligently fills form fields in the row.
312
- * Automatically detects input types (text, select, checkbox, contenteditable).
313
- *
314
- * @param data - Column-value pairs to fill
315
- * @param options - Optional configuration
316
- * @param options.inputMappers - Custom input selectors per column
317
- * @example
318
- * // Auto-detection
319
- * await row.smartFill({ Name: 'John', Status: 'Active', Subscribe: true });
320
- *
321
- * // Custom input mappers
322
- * await row.smartFill(
323
- * { Name: 'John' },
324
- * { inputMappers: { Name: (cell) => cell.locator('.custom-input') } }
325
- * );
326
- */
327
- smartFill: (data: Partial<T> | Record<string, any>, options?: FillOptions) => Promise<void>;
328
-
329
- /**
330
- * Get the resolved value of any column — real, override, or synthetic.
331
- *
332
- * When \`strategies.viewport\` or \`strategies.navigation\` is configured, runs the same
333
- * cell-navigation pipeline as \`toJSON\` / \`getCell().bringIntoView()\` so off-screen
334
- * virtualized cells are mounted before reading. Without those strategies, reads the
335
- * current DOM cell (Playwright auto-wait).
336
- *
337
- * @param column - Column name (case-sensitive)
338
- * @returns The column value as a string
339
- */
340
- getValue(column: string): Promise<string>;
341
-
342
- /**
343
- * Returns whether the row exists in the DOM (i.e. is not a sentinel row).
344
- */
345
- wasFound(): boolean;
346
- };
347
-
348
- export type StrategyContext = TableContext & {
349
- rowLocator?: Locator;
350
- rowIndex?: number;
351
- };
352
-
353
- /**
354
- * Defines the contract for a sorting strategy.
355
- */
356
- export interface SortingStrategy {
357
- /**
358
- * Performs the sort action on a column.
359
- */
360
- doSort(options: {
361
- columnName: string;
362
- direction: 'asc' | 'desc';
363
- context: StrategyContext;
364
- }): Promise<void>;
365
-
366
- /**
367
- * Retrieves the current sort state of a column.
368
- */
369
- getSortState(options: {
370
- columnName: string;
371
- context: StrategyContext;
372
- }): Promise<'asc' | 'desc' | 'none'>;
373
- }
374
-
375
- /**
376
- * Debug configuration for development and troubleshooting
377
- */
378
- export type DebugConfig = {
379
- /**
380
- * Slow down operations for debugging
381
- * - number: Apply same delay to all operations (ms)
382
- * - object: Granular delays per operation type
383
- */
384
- slow?: number | {
385
- pagination?: number;
386
- getCell?: number;
387
- findRow?: number;
388
- default?: number;
389
- };
390
- /**
391
- * Log level for debug output
392
- * - 'verbose': All logs (verbose, info, error)
393
- * - 'info': Info and error logs only
394
- * - 'error': Error logs only
395
- * - 'none': No logs
396
- */
397
- logLevel?: 'verbose' | 'info' | 'error' | 'none';
398
- };
399
-
400
- export interface TableContext<T = any> {
401
- root: Locator;
402
- config: FinalTableConfig<T>;
403
- page: Page;
404
- resolve: (selector: Selector, parent: Locator | Page) => Locator;
405
- /** Resolves a column name to its header cell locator. Available after table is initialized. */
406
- getHeaderCell?: (columnName: string) => Promise<Locator>;
407
- /** Returns all column names in order. Available after table is initialized. */
408
- getHeaders?: () => Promise<string[]>;
409
- /** Scrolls the table horizontally to bring the given column's header into view. */
410
- scrollToColumn?: (columnName: string) => Promise<void>;
411
- }
412
-
413
- export interface PaginationPrimitives {
414
- /** Classic "Next Page" or "Scroll Down" */
415
- goNext?: (context: TableContext) => Promise<boolean>;
416
-
417
- /** Classic "Previous Page" or "Scroll Up" */
418
- goPrevious?: (context: TableContext) => Promise<boolean>;
419
-
420
- /** Bulk skip forward multiple pages at once. Returns number of pages skipped. */
421
- goNextBulk?: (context: TableContext) => Promise<boolean | number>;
422
-
423
- /** Bulk skip backward multiple pages at once. Returns number of pages skipped. */
424
- goPreviousBulk?: (context: TableContext) => Promise<boolean | number>;
425
-
426
- /** Jump to first page / scroll to top */
427
- goToFirst?: (context: TableContext) => Promise<boolean>;
428
-
429
- /** Jump to last page / scroll to bottom */
430
- goToLast?: (context: TableContext) => Promise<boolean>;
431
-
432
- /**
433
- * Fetch the total number of pages currently available.
434
- * Can be used to optimize pagination paths (e.g. jumping to last page and going backwards).
435
- */
436
- getTotalPages?: (context: TableContext) => Promise<number | null>;
437
-
438
- /**
439
- * Jump to specific page index (0-indexed).
440
- * Can be full-range (e.g. page number input: any page works) or windowed (e.g. only visible links 6–14).
441
- * Return false when the page is not reachable in the current UI; the library will step toward the target (goNextBulk/goNext or goPreviousBulk/goPrevious) and retry goToPage until it succeeds.
442
- */
443
- goToPage?: (pageIndex: number, context: TableContext) => Promise<boolean>;
444
-
445
- /** How many pages one goNextBulk() advances. Used by navigation path planner for optimal bringIntoView. */
446
- nextBulkPages?: number;
447
-
448
- /** How many pages one goPreviousBulk() goes back. Used by navigation path planner for optimal bringIntoView. */
449
- previousBulkPages?: number;
450
-
451
- /**
452
- * Called once during init() to sync the library's page counter with the actual DOM state.
453
- * Use when a table may open on a page other than the first (e.g. a deep-linked URL that
454
- * lands on page 5). Returns a 0-indexed page number.
455
- * @example
456
- * detectCurrentPage: async (root) => {
457
- * const text = await root.locator('[aria-current="page"]').textContent();
458
- * return parseInt(text ?? '1') - 1;
459
- * }
460
- */
461
- detectCurrentPage?: (root: import('@playwright/test').Locator) => number | Promise<number>;
462
- }
463
-
464
- export type PaginationStrategy = PaginationPrimitives;
465
-
466
- export type DedupeStrategy = (row: SmartRow) => string | number | Promise<string | number>;
467
-
468
- export type ContentReadyStrategy = (row: Locator, page: Page) => Promise<void>;
469
-
470
-
471
-
472
- export type FillStrategy = (options: {
473
- row: SmartRow;
474
- columnName: string;
475
- value: any;
476
- index: number;
477
- page: Page;
478
- rootLocator: Locator;
479
- config: FinalTableConfig<any>;
480
- table: TableResult; // The parent table instance
481
- fillOptions?: FillOptions;
482
- }) => Promise<void>;
483
-
484
- /** Context passed as the second argument to {@link ColumnOverride.read}. */
485
- export interface ColumnOverrideReadContext {
486
- /**
487
- * The parent row. Use for multi-cell or row-derived values — e.g. a synthetic column
488
- * that reads an \`a[href]\` or a \`data-*\` attribute from the row rather than a cell:
489
- * \`read: (_cell, { row }) => row.evaluate(el => el.querySelector('a')?.href)\`.
490
- */
491
- row: SmartRow;
492
- /** The column being read. */
493
- columnName: string;
494
- /** The column's 0-based index in the resolved header map. */
495
- columnIndex: number;
496
- /**
497
- * Get a Locator for another cell in the same row by column name.
498
- * Returns raw cell Locators, not override-processed values.
499
- *
500
- * In atomic mode, the Locator points at the frozen reconstructed cell — coherent with
501
- * every other cell from the same snapshot. In non-atomic mode, it points at the live cell.
502
- *
503
- * @example
504
- * read: async (_cell, { getCell }) => {
505
- * const name = (await getCell('Name').innerText()).trim();
506
- * const href = await getCell('Name').locator('a').getAttribute('href') || '';
507
- * return \`\${name} | \${href}\`;
508
- * }
509
- */
510
- getCell: (columnName: string) => Locator;
511
- }
512
-
513
- export interface SyntheticColumnDef<T = any> {
514
- compute: (row: SmartRow<T>) => Promise<string | number> | string | number;
515
- }
516
-
517
- export interface ColumnOverride<TValue = any> {
518
- /**
519
- * How to extract the value from the cell.
520
- * The second \`context\` argument provides the parent \`row\` (for multi-cell or row-derived
521
- * values), plus \`columnName\` and \`columnIndex\`. Backwards-compatible: existing
522
- * single-argument \`read(cell)\` implementations keep working.
523
- */
524
- read?: (cell: Locator, context: ColumnOverrideReadContext) => Promise<TValue> | TValue;
525
-
526
- /**
527
- * How to fill the cell with a new value. (Replaces smartFill default logic)
528
- * Provides the current value (via \`read\`) if a \`write\` wants to check state first.
529
- */
530
- write?: (params: {
531
- cell: Locator;
532
- targetValue: TValue;
533
- currentValue?: TValue;
534
- row: SmartRow<any>;
535
- }) => Promise<void>;
536
- }
537
-
538
- export type { HeaderStrategy } from './strategies/headers';
539
- export type { NavigationPrimitives, CellNavigationStrategy } from './strategies/columns';
540
-
541
- /**
542
- * Strategy to resolve column names (string or regex) to their index.
543
- */
544
- // fallow-ignore-next-line unused-type
545
- export type { ColumnResolutionStrategy } from './strategies/resolution';
546
-
547
- /**
548
- * Strategy to filter rows based on criteria. Applied when using getRow/findRow/findRows with filters.
549
- * The default engine handles string, RegExp, number, and function (cell) => Locator filters.
550
- */
551
- export interface FilterStrategy {
552
- apply(options: {
553
- rows: Locator;
554
- filter: { column: string, value: FilterValue };
555
- colIndex: number;
556
- tableContext: TableContext;
557
- }): Locator;
558
- }
559
-
560
- /**
561
- * Strategy to check if the table or rows are loading. Used after pagination/sort to wait for content.
562
- * E.g. isHeaderLoading for init stability; isTableLoading after sort/pagination.
563
- */
564
- export interface LoadingStrategy {
565
- isTableLoading?: (context: TableContext) => Promise<boolean>;
566
- isRowLoading?: (row: SmartRow) => Promise<boolean>;
567
- isHeaderLoading?: (context: TableContext) => Promise<boolean>;
568
-
569
- /**
570
- * How long (ms) to wait for a loading row to resolve before applying onRowLoadingTimeout.
571
- * Honored by findRows AND by map/forEach/filter, where the wait runs before the dedupe
572
- * strategy so content-based dedupe keys see the row's final loaded state.
573
- * When not set (backward-compatible behavior): findRows skips loading rows immediately;
574
- * map/forEach/filter process them as-is.
575
- */
576
- rowLoadingTimeout?: number;
577
-
578
- /**
579
- * What to do when a row is still loading after rowLoadingTimeout ms.
580
- * - 'skip': drop the row from results (matches legacy skip behavior)
581
- * - 'read-as-is': include the row even though it's still loading (default)
582
- * - 'throw': throw an error with row index and timeout info
583
- * Defaults to 'read-as-is' when rowLoadingTimeout is set.
584
- */
585
- onRowLoadingTimeout?: 'skip' | 'read-as-is' | 'throw';
586
-
587
- /**
588
- * Predicate called before reading each cell. Return true if the cell is still loading.
589
- * When cellLoadingTimeout is also set, the engine waits up to that many ms for the
590
- * cell to resolve before applying onCellLoadingTimeout.
591
- */
592
- isCellLoading?: (cell: import('@playwright/test').Locator, columnName: string, row: SmartRow) => Promise<boolean>;
593
-
594
- /**
595
- * How long (ms) to wait for a loading cell to resolve before applying onCellLoadingTimeout.
596
- * When not set and isCellLoading returns true, the cell is read as-is immediately.
597
- */
598
- cellLoadingTimeout?: number;
599
-
600
- /**
601
- * What to do when a cell is still loading after cellLoadingTimeout ms.
602
- * - 'skip': use empty string for this cell value
603
- * - 'read-as-is': read the cell content even though it's still loading (default)
604
- * - 'throw': throw an error with column name, row index and timeout info
605
- * - callback: called with (cell, columnName, row); its return value becomes the cell's string value
606
- * Defaults to 'read-as-is' when cellLoadingTimeout is set.
607
- */
608
- onCellLoadingTimeout?:
609
- | 'skip'
610
- | 'read-as-is'
611
- | 'throw'
612
- | ((cell: import('@playwright/test').Locator, columnName: string, row: SmartRow) => Promise<string>);
613
-
614
- /**
615
- * Max ms to wait while \`isTableLoading\` returns true (countRows, findRow(s),
616
- * page-ready gates, and sort when \`sortStabilizationTimeout\` is unset).
617
- * @default 10000
618
- */
619
- loadingTimeout?: number;
620
-
621
- /** Max ms to wait for sort stabilization when isTableLoading is set. Overrides \`loadingTimeout\` for sort only. @default 10000 */
622
- sortStabilizationTimeout?: number;
623
- /** Polling interval (ms) while waiting for sort / table-ready stabilization. @default 100 (sort) / 200 (table-ready) */
624
- sortStabilizationPollInterval?: number;
625
- /** Fallback delay (ms) after sort when no isTableLoading is configured. @default 200 */
626
- sortStabilizationFallbackDelay?: number;
627
- }
628
-
629
- /**
630
- * Organized container for all table interaction strategies.
631
- */
632
- export interface TableStrategies {
633
- /** Strategy for discovering/scanning headers */
634
- header?: HeaderStrategy;
635
- /** Primitive navigation functions (goUp, goDown, goLeft, goRight, goHome) */
636
- navigation?: NavigationPrimitives;
637
-
638
- /** Strategy for filling form inputs */
639
- fill?: FillStrategy;
640
- /** Strategy for paginating through data */
641
- pagination?: PaginationStrategy;
642
- /** Strategy for sorting columns */
643
- sorting?: SortingStrategy;
644
- /** Strategy for deduplicating rows during iteration/scrolling */
645
- dedupe?: DedupeStrategy;
646
- /** Function to get a cell locator */
647
- getCellLocator?: GetCellLocatorFn;
648
- /** Function to get the currently active/focused cell */
649
- getActiveCell?: GetActiveCellFn;
650
- /**
651
- * Strategy for filtering rows. If present, FilterEngine will delegate filter application
652
- * to this pluggable strategy.
653
- */
654
- filter?: FilterStrategy;
655
- /**
656
- * Hook called before each cell value is read in toJSON and columnOverrides.read.
657
- * Fires for both the default innerText extraction and custom read mappers.
658
- * Useful for scrolling off-screen columns into view in horizontally virtualized tables.
659
- */
660
- beforeCellRead?: BeforeCellReadFn;
661
- /**
662
- * Strategy for detecting loading states. Use this for table-, row-, and header-level readiness.
663
- * E.g. after sort/pagination, the engine uses loading.isTableLoading when present.
664
- */
665
- loading?: LoadingStrategy;
666
-
667
- /**
668
- * Resolve the stable data-model index for a row locator.
669
- *
670
- * Called by \`findRow\` / \`findRows\` to convert a DOM row into the index used for
671
- * virtual-scroll positioning. Useful for grids where DOM position resets to 0 on
672
- * each page while the grid itself maintains a monotone counter (e.g. MUI DataGrid's
673
- * \`data-rowindex\` attribute).
674
- *
675
- * Return \`undefined\` to fall back to DOM position.
676
- *
677
- * When the index maps to a DOM attribute, return \`{ index, selector }\` instead of
678
- * a plain number. The library uses the CSS selector to build a **self-healing row
679
- * locator** that re-queries the DOM on every action — surviving virtual-scroll
680
- * recycling for \`getCell\`, \`smartFill\`, and \`toJSON\` without manual re-pinning.
681
- *
682
- * @example
683
- * // MUI DataGrid: self-healing via data-rowindex attribute
684
- * resolveRowIndex: async (row) => {
685
- * const v = await row.getAttribute('data-rowindex').catch(() => null);
686
- * if (v === null || isNaN(Number(v))) return undefined;
687
- * return { index: Number(v), selector: \`[data-rowindex="\${v}"]\` };
688
- * }
689
- */
690
- resolveRowIndex?: (row: Locator) => Promise<RowIndexResult | undefined>;
691
-
692
- /**
693
- * Waits until a row's content has stabilized before cloning in
694
- * \`toJSON({ atomic: true })\`. Needed for recycling virtualizers where the
695
- * framework updates element positions synchronously but renders cell content
696
- * asynchronously (e.g. react-window, react-virtuoso with React concurrent mode).
697
- *
698
- * Without this, the clone captures stale content from the previous occupant of the
699
- * DOM slot — the element is at the correct position but React hasn't re-rendered yet.
700
- *
701
- * Use \`Strategies.ContentReady.textStable()\` for the built-in text-polling strategy.
702
- *
703
- * @example
704
- * strategies: {
705
- * contentReady: Strategies.ContentReady.textStable({ timeout: 500 }),
706
- * }
707
- */
708
- contentReady?: ContentReadyStrategy;
709
-
710
- /**
711
- * Viewport oracle strategies for 2D virtualized tables (e.g. MUI DataGrid, AG Grid,
712
- * Braintrust-style grids where both rows and columns are virtualized simultaneously).
713
- *
714
- * When present, the cell-reading engine uses these to jump directly to the target
715
- * row/column and to detect the 2D scroll hazard (scrolling to reveal a column can
716
- * knock rows out of the vertical viewport, and vice versa).
717
- *
718
- * Completely optional and additive — existing \`navigation\` primitives remain the fallback.
719
- */
720
- viewport?: ViewportStrategy;
721
- }
722
-
723
-
724
- export interface TableConfig<T = any> {
725
- /**
726
- * Selector for the header cells, relative to the table root. Default \`'thead th'\`.
727
- * Use a function to reach headers outside the root, e.g.
728
- * \`(root) => root.page().locator('#header-table th')\`.
729
- */
730
- headerSelector?: TableSelector;
731
- /** Selector for the rows, relative to the table root. Default \`'tbody tr'\`. */
732
- rowSelector?: TableSelector;
733
- /** Selector for the cells, relative to a row. Default \`'td'\`. */
734
- cellSelector?: TableSelector;
735
- /**
736
- * Number of pages to scan for verification / iteration.
737
- * Defaults to \`1\` — set explicitly (e.g. \`maxPages: 5\`) when using a pagination
738
- * strategy, or you will never leave page 1. Init logs a warning when pagination
739
- * is configured and this is still \`1\`.
740
- */
741
- maxPages?: number;
742
- /**
743
- * Default concurrency strategy for iteration methods.
744
- * Can be overridden by the options passed to forEach, map, or filter.
745
- * Defaults to sequential when unset (safer for UI interactions).
746
- */
747
- concurrency?: RowIterationMode;
748
- /** Hook to rename columns dynamically */
749
- headerTransformer?: (args: { text: string, index: number, locator: Locator, seenHeaders: Set<string> }) => string | Promise<string>;
750
- /** Automatically scroll to table on init */
751
- autoScroll?: boolean;
752
- /** Debug options for development and troubleshooting */
753
- debug?: DebugConfig;
754
- /** Hook called after reset completes (after goToFirst, cache clear, and autoInit). */
755
- onReset?: (context: TableContext) => Promise<void>;
756
- /** All interaction strategies */
757
- strategies?: TableStrategies;
758
-
759
- /**
760
- * Unified interface for reading and writing data to specific columns.
761
- * Overrides both default extraction (toJSON) and filling (smartFill) logic.
762
- */
763
- columnOverrides?: Partial<Record<keyof T, ColumnOverride<T[keyof T]>>>;
764
-
765
- /**
766
- * Computed columns with no DOM presence. Each key becomes a virtual column name
767
- * available in \`toJSON()\`, \`getValue()\`, and \`findRow()\`/\`findRows()\` filters.
768
- * The \`compute\` function receives the full SmartRow and must only read real or
769
- * override columns (no chaining between synthetics).
770
- */
771
- syntheticColumns?: Record<string, SyntheticColumnDef<T>>;
772
-
773
- /**
774
- * Locator for an empty-state element that replaces the table when there are no results.
775
- * If header resolution fails during init() and this locator is visible, init() succeeds
776
- * and isEmpty() returns true. All row operations still throw normally.
777
- */
778
- emptyState?: Locator;
779
- }
780
-
781
- /**
782
- * @internal Resolved config after defaults are applied. Prefer {@link TableConfig} in public code.
783
- */
784
- export interface FinalTableConfig<T = any> extends TableConfig<T> {
785
- headerSelector: TableSelector;
786
- rowSelector: TableSelector;
787
- cellSelector: TableSelector;
788
- maxPages: number;
789
- autoScroll: boolean;
790
- concurrency?: RowIterationMode;
791
- debug?: TableConfig['debug'];
792
- headerTransformer: (args: { text: string, index: number, locator: Locator, seenHeaders: Set<string> }) => string | Promise<string>;
793
- onReset: (context: TableContext) => Promise<void>;
794
- strategies: TableStrategies;
795
- }
796
-
797
-
798
- export interface FillOptions {
799
- /**
800
- * Custom input mappers for specific columns.
801
- * Maps column names to functions that return the input locator for that cell.
802
- */
803
- inputMappers?: Record<string, (cell: Locator) => Locator>;
804
- }
805
-
806
-
807
-
808
- /** Callback context passed to forEach, map, and filter. */
809
- export type RowIterationContext<T = any> = {
810
- row: SmartRow<T>;
811
- /**
812
- * The row's logical/data-model index. When a \`resolveRowIndex\` strategy is configured
813
- * (e.g. MUI DataGrid's \`data-rowindex\`) this is the grid's true row index; otherwise it
814
- * equals \`index\`. Use this for \`row.bringIntoView()\` and position math on virtualized
815
- * tables — it is stable across scrolling/dedupe, unlike the visit-order \`index\`.
816
- */
817
- rowIndex: number;
818
- /**
819
- * 0-based enumeration counter — the order this row was visited (contiguous within the run).
820
- * Not a DOM position or grid identity. Use \`rowIndex\` for the row's data-model index.
821
- */
822
- index: number;
823
- /** 0-based page index — which page this row was collected from. */
824
- pageIndex: number;
825
- stop: () => void;
826
- };
827
-
828
- /** Concurrency modes for row iteration. */
829
- export type RowIterationMode = 'parallel' | 'sequential' | 'synchronized';
830
-
831
- /** Shared options for forEach, map, and filter. */
832
- export type RowIterationOptions = {
833
- /** Maximum number of pages to iterate. Defaults to config.maxPages. */
834
- maxPages?: number;
835
- /**
836
- * Concurrency strategy for iteration.
837
- * - 'parallel': Full parallel execution of both navigation and actions.
838
- * - 'synchronized': Parallel navigation (lock-step) with serial actions.
839
- * - 'sequential': Strictly serial one-at-a-time execution. No parallel navigation.
840
- * @default config.concurrency, then 'sequential'
841
- */
842
- concurrency?: RowIterationMode;
843
- /**
844
- * Deduplication strategy. Use when rows may repeat across iterations
845
- * (e.g. infinite scroll tables). Returns a unique key per row.
846
- */
847
- dedupe?: DedupeStrategy;
848
- /**
849
- * When true, use goNextBulk (if present) to advance pages during iteration.
850
- * @default false — uses goNext for one-page-at-a-time advancement
851
- */
852
- useBulkPagination?: boolean;
853
- };
854
-
855
- /**
856
- * Result of {@link useTable}. Implements \`AsyncIterable\` — \`for await (const { row } of table)\`
857
- * uses the same page-walk as \`map\` / \`forEach\` (\`scanPages\` + runMap): overscan, loading,
858
- * dedupe, and EOF final scan (#427).
859
- */
860
- export interface TableResult<T = any> extends AsyncIterable<{ row: SmartRow<T>; rowIndex: number; index: number; pageIndex: number }> {
861
- /**
862
- * Current DOM page index (0-based). Automatically maintained during pagination
863
- * and \`bringIntoView\`. Treat as **read-only** — assigning manually can desync
864
- * the path planner. Manual writes log a warning; prefer \`reset()\` / library
865
- * navigation. Writable access may become read-only in v7.
866
- */
867
- currentPageIndex: number;
868
-
869
- /**
870
- * Initializes the table by resolving headers. Must be called before using sync methods.
871
- * @param options Optional timeout for header resolution (default: 3000ms)
872
- */
873
- init(options?: { timeout?: number }): Promise<TableResult<T>>;
874
-
875
- /**
876
- * SYNC: Checks if the table has been initialized.
877
- * @returns true if init() has been called and completed, false otherwise
878
- */
879
- isInitialized(): boolean;
880
-
881
- /**
882
- * SYNC: Returns true if init() resolved via the emptyState path — the table's
883
- * empty-state locator was visible when header resolution failed.
884
- * Row operations still throw normally; use this to branch before calling them.
885
- */
886
- isEmpty(): boolean;
887
-
888
- getHeaders: () => Promise<string[]>;
889
- getHeaderCell: (columnName: string) => Promise<Locator>;
890
-
891
- /**
892
- * Finds a row by filters on the current page only. Returns immediately (sync).
893
- * Throws error if table is not initialized.
894
- * @note The sync path cannot compute a real \`rowIndex\`, so the returned SmartRow's
895
- * \`rowIndex\` is \`undefined\` (virtual-scroll positioning via \`bringIntoView()\` is limited).
896
- * Use \`findRow()\` (async) when you need a row with an accurate \`rowIndex\`.
897
- * @note Cannot filter by \`syntheticColumns\` or \`columnOverrides.read\` keys — those need
898
- * async evaluation via \`findRow()\` / \`findRows()\`. DOM filters use \`strategies.getCellLocator\`
899
- * when configured (column-virtualized grids), otherwise \`cellSelector\` + column index.
900
- */
901
- getRow: (
902
- filters: Record<string, FilterValue>,
903
- options?: { exact?: boolean }
904
- ) => SmartRow<T>;
905
-
906
- /**
907
- * Gets a row by its 0-based position in the currently-rendered DOM (sync, no scroll).
908
- * Throws if the table is not initialized.
909
- *
910
- * For button-paginated tables this is the i-th row on the current page. For virtualized
911
- * tables the render window shifts as you scroll, so \`getRowByIndex(i)\` returns whatever
912
- * row currently sits at DOM position \`i\` — NOT the logical/absolute row \`i\` in the dataset
913
- * once the list has scrolled. For the row with a specific logical/data-model index on a
914
- * virtualized table, use the async \`findRowByIndex(i)\` instead (it scrolls to the row);
915
- * to iterate by logical identity, use \`map\` / \`findRows\` (with a \`dedupe\` strategy).
916
- *
917
- * Resolution is lazy: an out-of-range index yields a SmartRow whose operations fail when
918
- * it is used, rather than throwing here.
919
- *
920
- * @param index 0-based position within the current render window
921
- */
922
- getRowByIndex: (
923
- index: number
924
- ) => SmartRow<T>;
925
-
926
- /**
927
- * ASYNC: Returns the row with a specific logical/data-model index, scrolling/paginating to
928
- * reach it. Unlike the sync \`getRowByIndex\` (render-window position), this resolves the true
929
- * data-model row \`index\` on virtualized tables.
930
- *
931
- * Reaches the row via, in order: a currently-mounted match, the viewport's random-access
932
- * \`scrollToRow\` fast path, then advancing pages (on infinite-scroll tables a "page" is a
933
- * scroll step) up to \`maxPages\`.
934
- *
935
- * Requires a \`strategies.resolveRowIndex\` to identify rows by logical index — throws if one
936
- * is not configured. Also throws if the row cannot be reached (no silent wrong-row fallback).
937
- *
938
- * @param index 0-based logical/data-model row index
939
- * @param options - \`maxPages\` bounds how far to scroll/paginate (defaults to config.maxPages)
940
- */
941
- findRowByIndex: (
942
- index: number,
943
- options?: { maxPages?: number }
944
- ) => Promise<SmartRow<T>>;
945
-
946
- /**
947
- * ASYNC: Searches for a single row across pages using pagination.
948
- * Auto-initializes the table if not already initialized.
949
- * @param filters - The filter criteria to match
950
- * @param options - Search options including exact match and max pages
951
- */
952
- findRow: (
953
- filters: Record<string, FilterValue>,
954
- options?: { exact?: boolean, maxPages?: number }
955
- ) => Promise<SmartRow<T>>;
956
-
957
- /**
958
- * ASYNC: Searches for all matching rows across pages using pagination.
959
- * Auto-initializes the table if not already initialized.
960
- * @param filters - The filter criteria to match (omit or pass {} for all rows)
961
- * @param options - Search options (exact, maxPages). \`useBulkPagination\` defaults to \`false\`: pages advance one at a time via \`goNext\` so no intermediate page is skipped. Set it to \`true\` to opt into \`goNextBulk\` (faster, but skips the rows on jumped-over pages).
962
- */
963
- findRows: (
964
- filters?: Record<string, FilterValue>,
965
- options?: { exact?: boolean, maxPages?: number, useBulkPagination?: boolean }
966
- ) => Promise<SmartRowArray<T>>;
967
-
968
- /**
969
- * Resolves the named column and scrolls it into view.
970
- * Prefers \`strategies.viewport.scrollToColumn\` when configured; otherwise scrolls the
971
- * header cell via Playwright \`scrollIntoViewIfNeeded()\`.
972
- */
973
- scrollToColumn: (columnName: string) => Promise<void>;
974
-
975
- /**
976
- * Counts the number of rows, optionally filtered.
977
- * Without arguments, counts all rows. With filters, counts only matching rows.
978
- * Paginates when pagination is configured.
979
- */
980
- countRows: (filters?: Record<string, FilterValue>, options?: { exact?: boolean; maxPages?: number }) => Promise<number>;
981
-
982
- /**
983
- * Iterates over rows and extracts the value of a single column.
984
- * More efficient than map + toJSON for single-column extraction.
985
- * @param columnName - The name of the column to extract
986
- * @param options - Iteration options
987
- */
988
- mapColumn<R = string>(columnName: string, options?: RowIterationOptions): Promise<R[]>;
989
-
990
- /**
991
- * @deprecated Use \`mapColumn\` (or \`map\`) instead. Will be removed in v7.0.0.
992
- * Iterates over rows and extracts the value of a single column as strings.
993
- * @param columnName - The name of the column to extract
994
- * @param options - Iteration options
995
- */
996
- getColumnValues(columnName: string, options?: RowIterationOptions): Promise<string[]>;
997
-
998
-
999
- /**
1000
- * Resets the table: calls goToFirst (if configured), clears cache, re-inits headers, then calls onReset.
1001
- */
1002
- reset: () => Promise<void>;
1003
-
1004
- /**
1005
- * Revalidates the table's structure (headers, columns) without resetting pagination or state.
1006
- * Useful when columns change visibility or order dynamically.
1007
- */
1008
- revalidate: () => Promise<void>;
1009
-
1010
- /**
1011
- * Iterates every row across all pages, calling the callback for side effects.
1012
- * Execution is sequential by default (safe for interactions like clicking/filling).
1013
- * Call \`stop()\` in the callback to end iteration early.
1014
- *
1015
- * @param callback - Function receiving { row, rowIndex, stop }
1016
- * @param options - maxPages, concurrency, dedupe, useBulkPagination
1017
- *
1018
- * @example
1019
- * await table.forEach(async ({ row, stop }) => {
1020
- * if (await row.getCell('Status').innerText() === 'Done') stop();
1021
- * await row.getCell('Checkbox').click();
1022
- * });
1023
- */
1024
- forEach(
1025
- callback: (ctx: RowIterationContext<T>) => void | Promise<void>,
1026
- options?: RowIterationOptions
1027
- ): Promise<void>;
1028
-
1029
- /**
1030
- * Transforms every row across all pages into a value. Returns a flat array.
1031
- * Defaults to \`concurrency: 'sequential'\` (safe for clicks/fills). Pass
1032
- * \`concurrency: 'parallel'\` for read-only extraction, or \`'synchronized'\` when
1033
- * navigation must stay lock-step on virtualized grids.
1034
- * Call \`stop()\` to halt after the current page finishes.
1035
- *
1036
- * @param callback - Function receiving { row, rowIndex, stop }
1037
- * @param options - maxPages, concurrency, dedupe, useBulkPagination
1038
- *
1039
- * @example
1040
- * // Default sequential — safe for UI interactions
1041
- * const assignees = await table.map(async ({ row }) => {
1042
- * await row.getCell('Assignee').locator('button').click();
1043
- * const name = await page.locator('.popover .name').innerText();
1044
- * await page.keyboard.press('Escape');
1045
- * return name;
1046
- * });
1047
- *
1048
- * @example
1049
- * // Read-only extraction — opt into parallel
1050
- * const emails = await table.map(
1051
- * ({ row }) => row.getCell('Email').innerText(),
1052
- * { concurrency: 'parallel' }
1053
- * );
1054
- */
1055
- map<R>(
1056
- callback: (ctx: RowIterationContext<T>) => R | Promise<R>,
1057
- options?: RowIterationOptions
1058
- ): Promise<R[]>;
1059
-
1060
- /**
1061
- * Shorthand for \`map()\` + \`reset()\`. Iterates every row across all pages, applies the
1062
- * callback (defaults to \`row.toJSON()\`), then resets the table back to page 1 — even if
1063
- * the callback throws.
1064
- *
1065
- * @param callback - Optional map function. Defaults to \`({ row }) => row.toJSON()\`.
1066
- * @param options - Same options as \`map()\`.
1067
- *
1068
- * @example
1069
- * // Zero-arg: returns toJSON() for every row
1070
- * const rows = await table.toArray();
1071
- *
1072
- * @example
1073
- * // Custom callback
1074
- * const names = await table.toArray(({ row }) => row.getCell('Name').innerText());
1075
- *
1076
- * @example
1077
- * // With options
1078
- * const rows = await table.toArray(({ row }) => row.toJSON(), { concurrency: 'parallel' });
1079
- */
1080
- toArray<R = Record<string, unknown>>(
1081
- callback?: (ctx: RowIterationContext<T>) => R | Promise<R>,
1082
- options?: RowIterationOptions
1083
- ): Promise<R[]>;
1084
-
1085
- /**
1086
- * Filters rows across all pages by an async predicate. Returns a SmartRowArray.
1087
- * Rows are returned as-is — call \`bringIntoView()\` on each if needed.
1088
- * Execution is sequential by default.
1089
- *
1090
- * @param predicate - Function receiving { row, rowIndex, stop }
1091
- * @param options - maxPages, concurrency, dedupe, useBulkPagination
1092
- *
1093
- * @example
1094
- * const active = await table.filter(async ({ row }) =>
1095
- * await row.getCell('Status').innerText() === 'Active'
1096
- * );
1097
- */
1098
- filter(
1099
- predicate: (ctx: RowIterationContext<T>) => boolean | Promise<boolean>,
1100
- options?: RowIterationOptions
1101
- ): Promise<SmartRowArray<T>>;
1102
-
1103
- /**
1104
- * Provides access to sorting actions and assertions.
1105
- */
1106
- sorting: {
1107
- /**
1108
- * Applies the configured sorting strategy to the specified column.
1109
- * @param columnName The name of the column to sort.
1110
- * @param direction The direction to sort ('asc' or 'desc').
1111
- */
1112
- apply(columnName: string, direction: 'asc' | 'desc'): Promise<void>;
1113
- /**
1114
- * Gets the current sort state of a column using the configured sorting strategy.
1115
- * @param columnName The name of the column to check.
1116
- * @returns A promise that resolves to 'asc', 'desc', or 'none'.
1117
- */
1118
- getState(columnName: string): Promise<'asc' | 'desc' | 'none'>;
1119
- };
1120
-
1121
- /**
1122
- * Generate an AI-friendly configuration prompt for debugging.
1123
- * Outputs table HTML and TypeScript definitions to help AI assistants generate config.
1124
- * Automatically throws an Error containing the prompt.
1125
- */
1126
- generateConfig: () => Promise<void>;
1127
-
1128
- /**
1129
- * @deprecated Use \`generateConfig()\` instead. Will be removed in v7.0.0.
1130
- */
1131
- generateConfigPrompt: () => Promise<void>;
1132
- }
1133
- `;