@toclocoinc/lattice-grid 1.68.1 → 1.69.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.
Files changed (165) hide show
  1. package/README.md +26 -1
  2. package/angular/fesm2022/toclocoinc-lattice-grid-angular.mjs +1 -0
  3. package/angular/package.json +1 -1
  4. package/docs/API.html +3834 -1278
  5. package/docs/api-detail.html +102 -4
  6. package/lattice-grid.d.ts +2635 -143
  7. package/lattice-grid.esm.min.js +257 -50
  8. package/lattice-grid.min.cjs +257 -50
  9. package/lattice-grid.min.css +1 -1
  10. package/lattice-grid.min.js +257 -50
  11. package/modules/ai.d.ts +111 -13
  12. package/modules/ai.esm.min.js +19 -3
  13. package/modules/ai.min.cjs +19 -3
  14. package/modules/ai.min.js +19 -3
  15. package/modules/angular.d.ts +1 -1
  16. package/modules/angular.esm.min.js +3 -3
  17. package/modules/angular.min.cjs +3 -3
  18. package/modules/angular.min.js +3 -3
  19. package/modules/chart-alluvial.d.ts +1 -1
  20. package/modules/chart-alluvial.esm.min.js +1 -1
  21. package/modules/chart-alluvial.min.cjs +1 -1
  22. package/modules/chart-alluvial.min.js +1 -1
  23. package/modules/chart-arc.d.ts +1 -1
  24. package/modules/chart-arc.esm.min.js +1 -1
  25. package/modules/chart-arc.min.cjs +1 -1
  26. package/modules/chart-arc.min.js +1 -1
  27. package/modules/chart-bubblemap.d.ts +1 -1
  28. package/modules/chart-bubblemap.esm.min.js +1 -1
  29. package/modules/chart-bubblemap.min.cjs +1 -1
  30. package/modules/chart-bubblemap.min.js +1 -1
  31. package/modules/chart-bump.d.ts +1 -1
  32. package/modules/chart-bump.esm.min.js +1 -1
  33. package/modules/chart-bump.min.cjs +1 -1
  34. package/modules/chart-bump.min.js +1 -1
  35. package/modules/chart-calendar.d.ts +1 -1
  36. package/modules/chart-calendar.esm.min.js +1 -1
  37. package/modules/chart-calendar.min.cjs +1 -1
  38. package/modules/chart-calendar.min.js +1 -1
  39. package/modules/chart-decomposition.d.ts +1 -1
  40. package/modules/chart-decomposition.esm.min.js +1 -1
  41. package/modules/chart-decomposition.min.cjs +1 -1
  42. package/modules/chart-decomposition.min.js +1 -1
  43. package/modules/chart-diverging.d.ts +1 -1
  44. package/modules/chart-diverging.esm.min.js +1 -1
  45. package/modules/chart-diverging.min.cjs +1 -1
  46. package/modules/chart-diverging.min.js +1 -1
  47. package/modules/chart-dumbbell.d.ts +1 -1
  48. package/modules/chart-dumbbell.esm.min.js +1 -1
  49. package/modules/chart-dumbbell.min.cjs +1 -1
  50. package/modules/chart-dumbbell.min.js +1 -1
  51. package/modules/chart-fan.d.ts +1 -1
  52. package/modules/chart-fan.esm.min.js +1 -1
  53. package/modules/chart-fan.min.cjs +1 -1
  54. package/modules/chart-fan.min.js +1 -1
  55. package/modules/chart-hexbin.d.ts +1 -1
  56. package/modules/chart-hexbin.esm.min.js +1 -1
  57. package/modules/chart-hexbin.min.cjs +1 -1
  58. package/modules/chart-hexbin.min.js +1 -1
  59. package/modules/chart-hexmap.d.ts +1 -1
  60. package/modules/chart-hexmap.esm.min.js +1 -1
  61. package/modules/chart-hexmap.min.cjs +1 -1
  62. package/modules/chart-hexmap.min.js +1 -1
  63. package/modules/chart-icicle.d.ts +1 -1
  64. package/modules/chart-icicle.esm.min.js +1 -1
  65. package/modules/chart-icicle.min.cjs +1 -1
  66. package/modules/chart-icicle.min.js +1 -1
  67. package/modules/chart-markermap.d.ts +1 -1
  68. package/modules/chart-markermap.esm.min.js +1 -1
  69. package/modules/chart-markermap.min.cjs +1 -1
  70. package/modules/chart-markermap.min.js +1 -1
  71. package/modules/chart-parallel.d.ts +1 -1
  72. package/modules/chart-parallel.esm.min.js +1 -1
  73. package/modules/chart-parallel.min.cjs +1 -1
  74. package/modules/chart-parallel.min.js +1 -1
  75. package/modules/chart-ridgeline.d.ts +1 -1
  76. package/modules/chart-ridgeline.esm.min.js +1 -1
  77. package/modules/chart-ridgeline.min.cjs +1 -1
  78. package/modules/chart-ridgeline.min.js +1 -1
  79. package/modules/chart-roc.d.ts +1 -1
  80. package/modules/chart-roc.esm.min.js +1 -1
  81. package/modules/chart-roc.min.cjs +1 -1
  82. package/modules/chart-roc.min.js +1 -1
  83. package/modules/chart-slope.d.ts +1 -1
  84. package/modules/chart-slope.esm.min.js +1 -1
  85. package/modules/chart-slope.min.cjs +1 -1
  86. package/modules/chart-slope.min.js +1 -1
  87. package/modules/chart-splom.d.ts +1 -1
  88. package/modules/chart-splom.esm.min.js +1 -1
  89. package/modules/chart-splom.min.cjs +1 -1
  90. package/modules/chart-splom.min.js +1 -1
  91. package/modules/chart-waffle.d.ts +1 -1
  92. package/modules/chart-waffle.esm.min.js +1 -1
  93. package/modules/chart-waffle.min.cjs +1 -1
  94. package/modules/chart-waffle.min.js +1 -1
  95. package/modules/charts.d.ts +1 -1
  96. package/modules/charts.esm.min.js +9 -9
  97. package/modules/charts.min.cjs +9 -9
  98. package/modules/charts.min.js +9 -9
  99. package/modules/data-router.d.ts +35 -5
  100. package/modules/data-router.esm.min.js +9 -4
  101. package/modules/data-router.min.cjs +9 -4
  102. package/modules/data-router.min.js +9 -4
  103. package/modules/devtools.d.ts +1 -1
  104. package/modules/devtools.esm.min.js +1 -1
  105. package/modules/devtools.min.cjs +1 -1
  106. package/modules/devtools.min.js +1 -1
  107. package/modules/dhtmlx-compat.d.ts +1 -1
  108. package/modules/dhtmlx-compat.esm.min.js +3 -3
  109. package/modules/dhtmlx-compat.min.cjs +3 -3
  110. package/modules/dhtmlx-compat.min.js +3 -3
  111. package/modules/gantt.d.ts +283 -33
  112. package/modules/gantt.esm.min.js +15 -8
  113. package/modules/gantt.min.cjs +15 -8
  114. package/modules/gantt.min.js +15 -8
  115. package/modules/geo-europe-nuts.d.ts +1 -1
  116. package/modules/geo-europe-nuts.esm.min.js +1 -1
  117. package/modules/geo-uk.d.ts +1 -1
  118. package/modules/geo-uk.esm.min.js +1 -1
  119. package/modules/geo-us-states.d.ts +1 -1
  120. package/modules/geo-us-states.esm.min.js +1 -1
  121. package/modules/geo-world-110m.d.ts +1 -1
  122. package/modules/geo-world-110m.esm.min.js +1 -1
  123. package/modules/geo-world-50m.d.ts +1 -1
  124. package/modules/geo-world-50m.esm.min.js +1 -1
  125. package/modules/htmx.d.ts +1 -1
  126. package/modules/htmx.esm.min.js +257 -50
  127. package/modules/htmx.min.cjs +257 -50
  128. package/modules/htmx.min.js +257 -50
  129. package/modules/kanban.d.ts +456 -5
  130. package/modules/kanban.esm.min.js +3 -3
  131. package/modules/kanban.min.cjs +3 -3
  132. package/modules/kanban.min.js +3 -3
  133. package/modules/kpi.d.ts +68 -4
  134. package/modules/kpi.esm.min.js +3 -3
  135. package/modules/kpi.min.cjs +3 -3
  136. package/modules/kpi.min.js +3 -3
  137. package/modules/layout.d.ts +134 -8
  138. package/modules/layout.esm.min.js +3 -3
  139. package/modules/layout.min.cjs +3 -3
  140. package/modules/layout.min.js +3 -3
  141. package/modules/mock-socket.d.ts +1 -1
  142. package/modules/mock-socket.esm.min.js +1 -1
  143. package/modules/mock-socket.min.cjs +1 -1
  144. package/modules/mock-socket.min.js +1 -1
  145. package/modules/react.d.ts +5 -1
  146. package/modules/react.esm.min.js +3 -3
  147. package/modules/react.min.cjs +3 -3
  148. package/modules/react.min.js +3 -3
  149. package/modules/svelte.d.ts +1 -1
  150. package/modules/svelte.esm.min.js +3 -3
  151. package/modules/svelte.min.cjs +3 -3
  152. package/modules/svelte.min.js +3 -3
  153. package/modules/tabs.d.ts +96 -20
  154. package/modules/tabs.esm.min.js +3 -3
  155. package/modules/tabs.min.cjs +3 -3
  156. package/modules/tabs.min.js +3 -3
  157. package/modules/vue.d.ts +5 -1
  158. package/modules/vue.esm.min.js +3 -3
  159. package/modules/vue.min.cjs +3 -3
  160. package/modules/vue.min.js +3 -3
  161. package/modules/webcomponent.d.ts +10 -39
  162. package/modules/webcomponent.esm.min.js +302 -54
  163. package/modules/webcomponent.min.cjs +302 -54
  164. package/modules/webcomponent.min.js +302 -54
  165. package/package.json +1 -1
package/lattice-grid.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, type declarations
2
+ * Lattice Grid 1.69.0, type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -329,6 +329,12 @@ export interface NumberFormat {
329
329
  * `'scientific'`.
330
330
  */
331
331
  notation?: 'standard' | 'compact' | 'scientific';
332
+ /**
333
+ * Which compact form `notation: 'compact'` uses — `'short'` (the default)
334
+ * gives `1.2M`, `'long'` gives `1.2 million`. Ignored under any other
335
+ * notation.
336
+ */
337
+ compactDisplay?: 'short' | 'long';
332
338
  /**
333
339
  * How a negative number reads: `'minus'`, the default, gives `-1,234`;
334
340
  * `'parentheses'` gives `(1,234)`, the accounting form; `'suffix'` gives
@@ -954,8 +960,11 @@ export interface Editor {
954
960
  */
955
961
  cancelBeforeStart?(): boolean;
956
962
  /**
957
- * Declared, but not consulted by the grid: an editor discards its session by
958
- * calling `params.stop(true)`, which is what the built-in editors do.
963
+ * Return `true` when the session ends to discard the edit instead of
964
+ * committing it — the counterpart of `cancelBeforeStart`, asked once, on the
965
+ * commit path every route ends at (Enter, Tab, and clicking away). The
966
+ * built-in editors answer `true` after their own `cancel()`; an editor may
967
+ * also discard at any moment by calling `params.stop(true)`.
959
968
  */
960
969
  cancelOnClose?(): boolean;
961
970
  /**
@@ -1343,17 +1352,20 @@ export interface ColumnCellSpec {
1343
1352
  */
1344
1353
  wrap?: boolean;
1345
1354
  /**
1346
- * Declared, but not read: rows that grow to fit their content are a
1347
- * grid-level setting, `autoHeight`, and this per-column flag reaches
1348
- * nothing. `cell.wrap` is the per-column half that does work.
1349
- */
1350
- autoHeight?: boolean;
1351
- /**
1352
- * Declared, but not read: flashing a cell whose value changed is a
1353
- * grid-level setting, `highlightOnChange`, and this per-column flag reaches
1354
- * nothing.
1355
+ * Flash this column's cells when their value changes — the per-column half
1356
+ * of the grid-level `highlightOnChange`, for a grid where one column is the
1357
+ * one worth watching. `true` takes the default colour and duration; an
1358
+ * object takes the same `{ colour, duration }` the grid-level key accepts.
1359
+ * Grid-level `highlightOnChange` covers every column and wins where both are
1360
+ * set.
1355
1361
  */
1356
- flash?: boolean;
1362
+ flash?: boolean | string | {
1363
+ colour?: string;
1364
+ color?: string;
1365
+ /** Milliseconds. `0` leaves the highlight until it is cleared. */
1366
+ duration?: number;
1367
+ enabled?: boolean;
1368
+ };
1357
1369
  /**
1358
1370
  * Make this column's cell span several columns, as a function of the cell.
1359
1371
  * Return 1 or less for no span; the span is floored and clamped to the
@@ -1553,12 +1565,16 @@ export interface ColumnLayoutSpec {
1553
1565
  */
1554
1566
  lockVisible?: boolean;
1555
1567
  /**
1556
- * Hold this column where it is: it cannot be dragged, and it cannot be
1557
- * pulled into a header band. Off by default. Only truthiness is read, so
1558
- * `'start'` and `'end'` lock the column where it already sits rather than
1559
- * moving it to that edge.
1568
+ * Hold this column where it is: it cannot be dragged, it cannot be moved by
1569
+ * the keyboard, and it cannot be pulled into a header band. Off by default.
1570
+ *
1571
+ * This locks a column; it does not place one. `'start'` and `'end'` were
1572
+ * declared and never implemented — every reader tested truthiness, so either
1573
+ * one pinned the column wherever it already sat — and the union was narrowed
1574
+ * to the boolean the grid actually honours. Put a column
1575
+ * at an edge by ordering `columns`, or pin it with `layout.pinned`.
1560
1576
  */
1561
- lockPosition?: boolean | 'start' | 'end';
1577
+ lockPosition?: boolean;
1562
1578
  }
1563
1579
 
1564
1580
  export interface ColumnHeaderSpec {
@@ -1929,8 +1945,10 @@ export interface ColumnGroup {
1929
1945
  */
1930
1946
  showWhen?: 'open' | 'closed' | 'always';
1931
1947
  /**
1932
- * Declared, and carried onto the resolved band, but not read: nothing in the
1933
- * grid consults it when a column is moved.
1948
+ * Keep this band's columns together: a move that would take one of them out
1949
+ * of the band's run, or drop a column from outside into it, is refused with
1950
+ * a warning. Off by default, in which case a drag, a keyboard move or the
1951
+ * column menu may separate them.
1934
1952
  */
1935
1953
  marryChildren?: boolean;
1936
1954
  /**
@@ -3119,8 +3137,9 @@ export interface EditConfig {
3119
3137
  mode?: 'cell' | 'row';
3120
3138
  /**
3121
3139
  * Which mouse gesture opens an editor: `'double'` click, the default, or
3122
- * `'single'`. The keyboard path is always live regardless. `'key'` is
3123
- * accepted but behaves as `'double'` — it does not suppress the mouse.
3140
+ * `'single'`. `'key'` binds no mouse gesture at all, for a grid that is read
3141
+ * with the mouse and written with the keyboard. The keyboard path (Enter,
3142
+ * F2, typing over a cell) is live under all three.
3124
3143
  */
3125
3144
  start?: 'single' | 'double' | 'key';
3126
3145
  /**
@@ -3391,6 +3410,15 @@ export interface GridConfig {
3391
3410
  * own `<html lang>` and then to `en-GB`.
3392
3411
  */
3393
3412
  locale?: string;
3413
+ /**
3414
+ * A partial message catalogue laid over the one `locale` resolves — every
3415
+ * string the grid renders or announces. Supply a bundled catalogue (`FR_FR`,
3416
+ * `AR`, …) or your own object; overrides merge over the default rather than
3417
+ * replacing it, so translating part of the interface leaves the remainder in
3418
+ * English rather than showing raw keys. Every valid key is listed in
3419
+ * `MESSAGE_KEYS`; a key that is not is ignored with a warning.
3420
+ */
3421
+ messages?: Record<string, string | Record<string, string>>;
3394
3422
  /**
3395
3423
  * Writing direction. An explicit `'ltr'` or `'rtl'` always wins. Omit it, or
3396
3424
  * say `'auto'`, to settle it from the mount or the nearest ancestor
@@ -4491,6 +4519,12 @@ export interface GridState {
4491
4519
  where?: string[];
4492
4520
  /** The quick-filter text. Absent when there was none. */
4493
4521
  quick?: string;
4522
+ /**
4523
+ * How the quick filter matched. Saved with the text and only when it is not
4524
+ * the default, because a view restored as `contains` when it was saved as
4525
+ * `words` or `regex` shows a different set of rows than the one it captured.
4526
+ */
4527
+ quickMode?: 'contains' | 'words' | 'fuzzy' | 'regex';
4494
4528
  /** The sort entries that were in force, outermost first. */
4495
4529
  sort?: SortEntry[];
4496
4530
  /** The ids of the columns the rows were grouped by, outermost first. */
@@ -4515,6 +4549,17 @@ export interface GridState {
4515
4549
  * content coordinates, so they track scroll and resize.
4516
4550
  */
4517
4551
  annotations?: AnnotationMark[];
4552
+ /**
4553
+ * The ids of the redacted columns. Always present when the grid has a
4554
+ * redaction model — even empty — so that "stop redacting" is an action redo
4555
+ * can reproduce.
4556
+ */
4557
+ redaction?: string[];
4558
+ /**
4559
+ * The ids of the columns whose histogram is open. Always present when the
4560
+ * grid has a facet model, for the same reason `redaction` is.
4561
+ */
4562
+ facets?: string[];
4518
4563
  /** The keys of the group and tree rows that were open. */
4519
4564
  expanded?: string[];
4520
4565
  /** The keys of the selected rows. */
@@ -4595,8 +4640,10 @@ export interface FormattingScale {
4595
4640
  /** The value that takes the last colour. Required unless `from` derives it. */
4596
4641
  max?: number;
4597
4642
  /**
4598
- * Declared, but not read: a three-colour scale is made by giving three
4599
- * `colours`, whose middle stop is reached at the midpoint of the range.
4643
+ * The value the middle colour is reached at. Needs an odd number of
4644
+ * `colours` (a middle stop to pin) and a value inside `min`..`max`; each
4645
+ * half of the scale is then spaced evenly within itself, so only the pivot
4646
+ * moves. Without it the middle stop sits at the midpoint of the range.
4600
4647
  */
4601
4648
  mid?: number;
4602
4649
  /**
@@ -5972,6 +6019,18 @@ export interface ColumnProfile {
5972
6019
  * profile is opened to answer.
5973
6020
  */
5974
6021
  missing: number;
6022
+ /**
6023
+ * How many of those rows carry a value the statistics could use — a number.
6024
+ * `present` counts values of any kind, so the two differ on a text column
6025
+ * and on one with unparseable entries.
6026
+ */
6027
+ numeric: number;
6028
+ /**
6029
+ * What the figures were computed over, when that is a window rather than
6030
+ * every matching row (a source that holds everything omits it, so
6031
+ * `if (profile.coverage)` is the "is this windowed" test).
6032
+ */
6033
+ coverage?: { covered: number; total: number };
5975
6034
  /** How many different values the column holds over those rows. */
5976
6035
  distinct: number;
5977
6036
  /** The smallest numeric value, or null on a column with no numbers in it. */
@@ -6446,96 +6505,368 @@ export interface ColumnDistribution {
6446
6505
  */
6447
6506
  export type EventName =
6448
6507
  /* Lifecycle */
6449
- | 'ready' | 'destroy' | 'render:first' | 'render:done' | 'config:changed'
6508
+ /** The grid has finished building and every API on it is ready to call; fires once, on the frame after `createGrid` returns. */
6509
+ | 'ready'
6510
+ /** `grid.destroy()` was called and is about to release everything, so a handler can still read the grid one last time. */
6511
+ | 'destroy'
6512
+ /** The renderer has written its first frame into the host element. */
6513
+ | 'render:first'
6514
+ /** A render pass has finished writing cells: the row window it drew, what caused the pass, and how long each phase took. */
6515
+ | 'render:done'
6516
+ /** A configuration key was written at run time through `grid.set(key, value)` or `grid.setAll(values)`, after the grid rebuilt. */
6517
+ | 'config:changed'
6518
+ /** A licence key was installed through `grid.licence.set(key)`, and again when its asynchronous verification settles. */
6450
6519
  | 'licence:changed'
6451
6520
  /* Data */
6452
- | 'model:changed' | 'rows:changed' | 'rows:queued' | 'rows:deferred'
6453
- | 'rows:paused' | 'rows:resumed' | 'row:received' | 'row:sent' | 'row:copied'
6454
- | 'row:moved' | 'source:error' | 'stream:chunk' | 'stream:end' | 'stream:evicted'
6521
+ /** The display model was rebuilt — rows reloaded, the tree re-flattened, a page fetched, a query re-run — with `reason` naming which. */
6522
+ | 'model:changed'
6523
+ /** Rows were added, updated, removed or moved. `identified: true` means the payload names exactly which rows moved. */
6524
+ | 'rows:changed'
6525
+ /** A change arrived while the feed was being batched and was put on the queue instead of applied. */
6526
+ | 'rows:queued'
6527
+ /** A flush ran out of its frame budget and carried the rest of the change into the next one. */
6528
+ | 'rows:deferred'
6529
+ /** `grid.changes.pause()` held the feed: changes keep arriving and stop being applied. */
6530
+ | 'rows:paused'
6531
+ /** `grid.changes.resume()` released the feed and applied what had been held. */
6532
+ | 'rows:resumed'
6533
+ /** A row dragged from another grid was accepted into this one, on the receiving grid. */
6534
+ | 'row:received'
6535
+ /** A row was dragged out of this grid into another one and removed from here (a move, not a copy). */
6536
+ | 'row:sent'
6537
+ /** A row was dragged out of this grid into another one and kept here as well (a copy). */
6538
+ | 'row:copied'
6539
+ /** A row was reordered within this grid, from one display index to another. */
6540
+ | 'row:moved'
6541
+ /** A source could not fetch what was asked of it: a page, a group's children, a tree branch, or the stream itself. */
6542
+ | 'source:error'
6543
+ /** A streaming source applied a chunk of arriving rows. */
6544
+ | 'stream:chunk'
6545
+ /** A streaming source reached the end of its feed; `promoted` says whether it handed over to an in-memory source. */
6546
+ | 'stream:end'
6547
+ /** A rolling-window stream dropped rows off the back of its window to stay inside its limit. */
6548
+ | 'stream:evicted'
6455
6549
  /* The row-drag gesture as it happens. Notifications only:
6456
6550
  * the drop is already vetoable by `beforeRowMove` and `beforeRowReceive`, and
6457
6551
  * a third veto on the same gesture would be a fourth place to look. All four
6458
6552
  * fire on the grid the drag started in and carry a {@link RowDragEvent}. */
6459
- | 'rowDrag:started' | 'rowDrag:moved' | 'rowDrag:left' | 'rowDrag:ended'
6553
+ /** A row drag passed the drag threshold and began, on the grid the row was picked up in. */
6554
+ | 'rowDrag:started'
6555
+ /** The pointer moved during a row drag, coalesced to one event per animation frame. */
6556
+ | 'rowDrag:moved'
6557
+ /** The pointer left a grid it had been dragging over; `over` names the grid just left. */
6558
+ | 'rowDrag:left'
6559
+ /** The row drag ended — released anywhere, inside a grid or outside every one; `dropped` says whether it is being acted on. */
6560
+ | 'rowDrag:ended'
6460
6561
  /* Cells and editing */
6461
- | 'cell:changed' | 'cell:pending' | 'cell:confirmed' | 'cell:reverted' | 'cell:conflict'
6462
- | 'cell:clicked' | 'cell:dblclicked' | 'cell:contextmenu'
6562
+ /** A cell's value was written: by an edit commit, by a revert, or by an undo/redo step. */
6563
+ | 'cell:changed'
6564
+ /** An optimistic cell edit was sent to the transport and is awaiting the server's answer. */
6565
+ | 'cell:pending'
6566
+ /** The server accepted a pending cell edit; `value` is what it confirmed, which may not be what was sent. */
6567
+ | 'cell:confirmed'
6568
+ /** A pending cell edit was refused and the previous value put back. */
6569
+ | 'cell:reverted'
6570
+ /** The server accepted a pending cell edit but returned a row that disagrees with what the grid holds. */
6571
+ | 'cell:conflict'
6572
+ /** A cell was clicked (primary button, single click). */
6573
+ | 'cell:clicked'
6574
+ /** A cell was double-clicked. */
6575
+ | 'cell:dblclicked'
6576
+ /** A context menu was requested on a cell, by the pointer or by the keyboard's menu key. */
6577
+ | 'cell:contextmenu'
6463
6578
  /* The pointer entering and leaving a cell. Announcements
6464
6579
  * only, carrying what `cell:clicked` carries plus the cell element as
6465
6580
  * `target`. A host cannot wire these itself: rows and cells are pooled and
6466
6581
  * re-used as the grid scrolls, so a listener bound to a cell node fires for
6467
6582
  * whichever row occupies it next. Nothing in the grid is gated on hover, so
6468
6583
  * a keyboard user reaches everything a pointer does. */
6469
- | 'cell:mouseover' | 'cell:mouseout'
6584
+ /** The pointer entered a cell; crossing between two children of one cell is not a re-entry. */
6585
+ | 'cell:mouseover'
6586
+ /** The pointer left a cell; crossing between two children of one cell is not a departure. */
6587
+ | 'cell:mouseout'
6470
6588
  /* A pointer press and release on a cell, the same
6471
6589
  * convention as the hover pair above: announcements only, carrying what
6472
6590
  * `cell:clicked` carries plus the cell element as `target`. A host cannot
6473
6591
  * wire these itself for the same reason it cannot wire the hover pair —
6474
6592
  * rows and cells are pooled and re-used as the grid scrolls, so a listener
6475
6593
  * bound to a cell node fires for whichever row occupies it next. */
6476
- | 'cell:mousedown' | 'cell:mouseup'
6477
- | 'cell:edit:start' | 'cell:edit:end' | 'row:edit:start' | 'row:edit:end'
6478
- | 'row:clicked' | 'row:dblclicked'
6479
- | 'row:pending' | 'row:confirmed' | 'row:reverted' | 'row:conflict'
6480
- | 'form:opened' | 'form:closed' | 'form:saved' | 'form:error'
6594
+ /** A pointer button was pressed on a cell, before any click is resolved. */
6595
+ | 'cell:mousedown'
6596
+ /** A pointer button was released on a cell. */
6597
+ | 'cell:mouseup'
6598
+ /** A cell editor opened, by double-click, by Enter, or by typing into the cell. */
6599
+ | 'cell:edit:start'
6600
+ /** A cell editor closed: committed, cancelled, or refused by validation — `valid` and `cancelled` say which. */
6601
+ | 'cell:edit:end'
6602
+ /** A whole-row editor opened, the row-edit counterpart of `cell:edit:start`. */
6603
+ | 'row:edit:start'
6604
+ /** A whole-row editor closed, the row-edit counterpart of `cell:edit:end`. */
6605
+ | 'row:edit:end'
6606
+ /** A row was clicked, alongside the `cell:clicked` for the cell under the pointer. */
6607
+ | 'row:clicked'
6608
+ /** A row was double-clicked, alongside the `cell:dblclicked` for the cell under the pointer. */
6609
+ | 'row:dblclicked'
6610
+ /** An optimistic row append or delete was sent to the transport and is awaiting the server's answer. */
6611
+ | 'row:pending'
6612
+ /** The server accepted a pending row append or delete; an append is rekeyed from its temporary key first. */
6613
+ | 'row:confirmed'
6614
+ /** A pending row append or delete was refused: the optimistic append is discarded, the tombstoned row restored. */
6615
+ | 'row:reverted'
6616
+ /** The server accepted a pending row append or delete but returned a row that disagrees with what the grid holds. */
6617
+ | 'row:conflict'
6618
+ /** The row form opened over a row. */
6619
+ | 'form:opened'
6620
+ /** The row form was closed without saving. */
6621
+ | 'form:closed'
6622
+ /** The row form's values were saved back to the row. */
6623
+ | 'form:saved'
6624
+ /** The row form could not load or save a row; `timedOut` distinguishes a slow backend from a refusal. */
6625
+ | 'form:error'
6481
6626
  /* Query */
6482
- | 'sort:changed' | 'filter:changed' | 'group:toggled'
6483
- | 'facet:computed' | 'facet:filtered' | 'facet:expanded' | 'facet:failed'
6627
+ /** The sort order changed, through `grid.sort.set()` or a header click. */
6628
+ | 'sort:changed'
6629
+ /** The filters changed: a structured condition, the quick filter's text, or a named host predicate. */
6630
+ | 'filter:changed'
6631
+ /** A group row was expanded or collapsed — one group, one branch, or all of them at once. */
6632
+ | 'group:toggled'
6633
+ /** A column's facet buckets finished computing, with how long it took and whether a worker did it. */
6634
+ | 'facet:computed'
6635
+ /** A facet histogram was used to filter its column, or that filter was cleared. */
6636
+ | 'facet:filtered'
6637
+ /** A facet panel section was opened or closed. */
6638
+ | 'facet:expanded'
6639
+ /** A column's facet buckets could not be computed. */
6640
+ | 'facet:failed'
6484
6641
  /* Columns */
6485
- | 'column:moved' | 'column:resized' | 'column:visible' | 'column:pinned'
6486
- | 'column:grouped' | 'column:pivoted' | 'column:filter:open' | 'column:profile:open'
6642
+ /** A column was moved to a different display position. */
6643
+ | 'column:moved'
6644
+ /** A column's width changed, by a header drag or by `grid.columns.resize()`. */
6645
+ | 'column:resized'
6646
+ /** Columns were shown or hidden. */
6647
+ | 'column:visible'
6648
+ /** A column was pinned to a side, or unpinned. */
6649
+ | 'column:pinned'
6650
+ /** The row grouping changed: which columns the rows are grouped by. */
6651
+ | 'column:grouped'
6652
+ /** The pivot changed: which columns the rows are pivoted by, locally or pushed down to the backend. */
6653
+ | 'column:pivoted'
6654
+ /** The header's filter affordance was activated and the column's filter popup should open. */
6655
+ | 'column:filter:open'
6656
+ /** The column menu's profile item was activated and the column's profile should open. */
6657
+ | 'column:profile:open'
6658
+ /** The header's menu affordance was activated and the column menu should open. */
6487
6659
  | 'column:menu:open'
6660
+ /** A pivot measure cell was drilled into; the payload names the row and column paths behind it. */
6488
6661
  | 'pivot:drill'
6489
- | 'columns:changed' | 'columns:tagged' | 'columngroup:changed' | 'header:contextmenu'
6662
+ /** The column set changed other than by moving, resizing, hiding or pinning — a type inference pass rewrote it. */
6663
+ | 'columns:changed'
6664
+ /** `grid.columns.showTagged()` chose which columns to show from their tags. */
6665
+ | 'columns:tagged'
6666
+ /** A banded header group was formed, renamed, moved, dissolved, removed or restored from state. */
6667
+ | 'columngroup:changed'
6668
+ /** A context menu was requested on a column header. */
6669
+ | 'header:contextmenu'
6490
6670
  /* Selection and view */
6491
- | 'selection:changed' | 'range:changed' | 'clipboard:copy'
6492
- | 'page:changed' | 'scroll' | 'scroll:end' | 'size:changed'
6493
- | 'detail:toggled' | 'toolpanel:focus' | 'highlight:changed' | 'find:changed'
6671
+ /** The row selection changed and was accepted (a `beforeSelect` veto raises `selection:cancelled` instead). */
6672
+ | 'selection:changed'
6673
+ /** The selected cell ranges changed. */
6674
+ | 'range:changed'
6675
+ /** A copy to the clipboard was attempted; `ok` says whether it reached the clipboard. */
6676
+ | 'clipboard:copy'
6677
+ /** The page or the page size changed. */
6678
+ | 'page:changed'
6679
+ /** The viewport scrolled to a new offset; fires only when the offset actually moved, not on a refresh. */
6680
+ | 'scroll'
6681
+ /** Scrolling settled: the last of a scroll gesture's frames has been drawn. */
6682
+ | 'scroll:end'
6683
+ /** The host element's box changed size, as reported by the `ResizeObserver` the grid watches it with. */
6684
+ | 'size:changed'
6685
+ /** A master-detail region was opened or closed. */
6686
+ | 'detail:toggled'
6687
+ /** The keyboard asked for focus to move to the tool panel (Ctrl+Alt+P). */
6688
+ | 'toolpanel:focus'
6689
+ /** The set of host-declared highlights changed. */
6690
+ | 'highlight:changed'
6691
+ /** The find bar's query, open state or match count changed. */
6692
+ | 'find:changed'
6494
6693
  /* Tree data */
6495
- | 'tree:loading' | 'tree:loaded' | 'tree:loadFailed' | 'tree:loadAborted'
6694
+ /** A tree branch was expanded and `tree.loadChildren` was called for it. */
6695
+ | 'tree:loading'
6696
+ /** A tree branch's children arrived and were added. */
6697
+ | 'tree:loaded'
6698
+ /** A tree branch's `loadChildren` rejected; the branch is left unloaded so it can be retried. */
6699
+ | 'tree:loadFailed'
6700
+ /** A tree branch was collapsed before its children arrived, so the fetch was abandoned. */
6701
+ | 'tree:loadAborted'
6496
6702
  /* State, history and views */
6497
- | 'state:changed' | 'state:reset' | 'history:changed' | 'history:applied'
6498
- | 'views:changed' | 'view:applied' | 'view:saved' | 'view:removed'
6499
- | 'view:renamed' | 'view:default'
6703
+ /** One logical state change — a gesture, an apply, an undo or a reset — announced once, whatever routed it. */
6704
+ | 'state:changed'
6705
+ /** `grid.state.reset()` restored the arrangement the grid was built with. */
6706
+ | 'state:reset'
6707
+ /** The undo/redo stacks moved: what can now be undone or redone. */
6708
+ | 'history:changed'
6709
+ /** An undo or redo step was applied. */
6710
+ | 'history:applied'
6711
+ /** The saved-view list changed, for any reason; the named `view:*` events say which view moved. */
6712
+ | 'views:changed'
6713
+ /** A saved view was applied to the grid. */
6714
+ | 'view:applied'
6715
+ /** A saved view was created, updated or imported. */
6716
+ | 'view:saved'
6717
+ /** A saved view was deleted. */
6718
+ | 'view:removed'
6719
+ /** A saved view was renamed. */
6720
+ | 'view:renamed'
6721
+ /** A saved view was made the default one. */
6722
+ | 'view:default'
6500
6723
  /* Validation: a declared column rule vetoed an edit, or a
6501
6724
  * recorded error was cleared. The veto itself rides the cancellable `beforeEdit`. */
6502
- | 'validation:failed' | 'validation:cleared'
6725
+ /** A declared column rule refused an edit; the failures name the column and the message for each. */
6726
+ | 'validation:failed'
6727
+ /** Recorded validation errors were cleared — for one cell, one row, or the whole grid. */
6728
+ | 'validation:cleared'
6503
6729
  /* Formatting and presentation */
6504
- | 'formatting:changed' | 'redaction:changed' | 'permissions:changed'
6505
- | 'presentation:changed' | 'presentation:started' | 'presentation:ended'
6730
+ /** A conditional-formatting rule was added, changed, removed or replaced. */
6731
+ | 'formatting:changed'
6732
+ /** The set of redacted columns changed. */
6733
+ | 'redaction:changed'
6734
+ /** The per-column permission levels changed. */
6735
+ | 'permissions:changed'
6736
+ /** Either the responsive presentation switched between the table and the card layout, or `presentation.start()` was called again while already running. */
6737
+ | 'presentation:changed'
6738
+ /** `grid.presentation.start()` began presenting. */
6739
+ | 'presentation:started'
6740
+ /** `grid.presentation.stop()` stopped presenting. */
6741
+ | 'presentation:ended'
6742
+ /** The presentation stepped to a view in its deck, including the first one. */
6506
6743
  | 'presentation:view'
6507
- | 'presentation:scale' | 'presentation:spotlight' | 'presentation:captured'
6744
+ /** The presentation's enlargement changed. */
6745
+ | 'presentation:scale'
6746
+ /** The presentation's spotlight was armed over some rows and columns, or cleared. */
6747
+ | 'presentation:spotlight'
6748
+ /** A screenshot of the grid was captured (`grid.capture()`), with the image's size and type. */
6749
+ | 'presentation:captured'
6508
6750
  /* Collaboration */
6509
- | 'comment:added' | 'comment:edited' | 'comment:deleted' | 'comment:failed'
6510
- | 'comment:resolved' | 'comment:unresolved'
6511
- | 'comment:threadOpened' | 'comment:threadClosed' | 'comment:indexLoaded'
6512
- | 'presence:published' | 'presence:joined' | 'presence:updated' | 'presence:left'
6513
- | 'presence:failed' | 'presence:lockRefused'
6751
+ /** A comment was added to a cell, or a reply added to a thread. */
6752
+ | 'comment:added'
6753
+ /** A comment's text was edited. */
6754
+ | 'comment:edited'
6755
+ /** A comment was deleted. */
6756
+ | 'comment:deleted'
6757
+ /** A comment operation could not reach the backend; `operation` names which one. */
6758
+ | 'comment:failed'
6759
+ /** A comment thread was marked resolved. */
6760
+ | 'comment:resolved'
6761
+ /** A resolved comment thread was reopened. */
6762
+ | 'comment:unresolved'
6763
+ /** A cell's comment thread was opened. */
6764
+ | 'comment:threadOpened'
6765
+ /** A cell's comment thread was closed or dismissed. */
6766
+ | 'comment:threadClosed'
6767
+ /** The comment index for the visible rows finished loading, with how many entries it carried. */
6768
+ | 'comment:indexLoaded'
6769
+ /** This grid published its own presence — the cell it is on, its selection — to the presence transport. */
6770
+ | 'presence:published'
6771
+ /** A peer appeared in the presence channel for the first time. */
6772
+ | 'presence:joined'
6773
+ /** A peer already present moved or changed what it is doing. */
6774
+ | 'presence:updated'
6775
+ /** A peer left the presence channel or timed out. */
6776
+ | 'presence:left'
6777
+ /** A presence subscribe or publish could not reach the transport. */
6778
+ | 'presence:failed'
6779
+ /** An edit was refused because a peer holds the cell's lock. */
6780
+ | 'presence:lockRefused'
6514
6781
  /* Comparison and time */
6515
- | 'diff:changed' | 'diff:swapped'
6516
- | 'timeline:attached' | 'timeline:detached' | 'timeline:seek' | 'timeline:seeking'
6782
+ /** Diff mode was turned on against a snapshot, or turned off. */
6783
+ | 'diff:changed'
6784
+ /** The two sides of a diff were swapped. */
6785
+ | 'diff:swapped'
6786
+ /** The timeline scrubber began recording what each change replaces. */
6787
+ | 'timeline:attached'
6788
+ /** The timeline scrubber stopped recording and the grid returned to the present. */
6789
+ | 'timeline:detached'
6790
+ /** The timeline finished moving and the grid now stands at that position. */
6791
+ | 'timeline:seek'
6792
+ /** The timeline is about to move, with where it is coming from and going to. */
6793
+ | 'timeline:seeking'
6517
6794
  /* Annotations */
6795
+ /** The annotation overlay's marks changed: one was drawn, moved or erased, or the tool changed. */
6518
6796
  | 'annotation:changed'
6519
6797
  /* Export */
6520
- | 'export:progress' | 'export:request' | 'export:done'
6798
+ /** A streaming export wrote another chunk, with rows written, rows expected and bytes so far. */
6799
+ | 'export:progress'
6800
+ /** A remote export request is about to be handed to the host's `export.remote.fetch` hook. */
6801
+ | 'export:request'
6802
+ /** A remote export came back and the file was handed over (or downloaded). */
6803
+ | 'export:done'
6521
6804
  /* Keyboard help overlay (past-tense notifications) */
6522
- | 'shortcuts:opened' | 'shortcuts:closed'
6805
+ /** The keyboard-shortcuts overlay was opened. */
6806
+ | 'shortcuts:opened'
6807
+ /** The keyboard-shortcuts overlay was closed. */
6808
+ | 'shortcuts:closed'
6523
6809
  /* Print (past-tense notifications) */
6524
- | 'print:before' | 'print:after'
6810
+ /** Print mode has been applied and the grid laid out un-virtualised, just before the print dialog. */
6811
+ | 'print:before'
6812
+ /** The print dialog has returned and print mode has been undone. */
6813
+ | 'print:after'
6525
6814
  /* Cancellable before-events. Delivered through the async
6526
6815
  * before-dispatch path with a {@link BeforeEvent} carrying preventDefault. */
6527
- | 'beforeEdit' | 'beforeSort' | 'beforeFilter'
6528
- | 'beforeColumnMove' | 'beforeColumnResize' | 'beforeColumnHide'
6529
- | 'beforeSelect' | 'beforeRowAdd' | 'beforeDelete' | 'beforeRowMove' | 'beforeGroup'
6816
+ /** A user or AI edit is about to be committed; call `preventDefault(reason?)` to stop it. */
6817
+ | 'beforeEdit'
6818
+ /** A user sort is about to be applied; call `preventDefault(reason?)` to stop it. */
6819
+ | 'beforeSort'
6820
+ /** A user filter — structured or quick — is about to be applied; call `preventDefault(reason?)` to stop it. */
6821
+ | 'beforeFilter'
6822
+ /** A user column move is about to be applied; call `preventDefault(reason?)` to stop it. */
6823
+ | 'beforeColumnMove'
6824
+ /** A user column resize is about to be applied; call `preventDefault(reason?)` to stop it. */
6825
+ | 'beforeColumnResize'
6826
+ /** A user column hide is about to be applied; call `preventDefault(reason?)` to stop it. */
6827
+ | 'beforeColumnHide'
6828
+ /** A user selection change is about to be announced; call `preventDefault(reason?)` to snap it back. */
6829
+ | 'beforeSelect'
6830
+ /** A user row append is about to be sent; call `preventDefault(reason?)` to stop it. */
6831
+ | 'beforeRowAdd'
6832
+ /** A user row delete is about to be applied; call `preventDefault(reason?)` to stop it. */
6833
+ | 'beforeDelete'
6834
+ /** A user row reorder is about to be applied; call `preventDefault(reason?)` to stop it. */
6835
+ | 'beforeRowMove'
6836
+ /** A user group expand or collapse is about to be applied; call `preventDefault(reason?)` to stop it. */
6837
+ | 'beforeGroup'
6838
+ /* Row transfer between grids */
6530
6839
  /* A row dropped in from another grid, on the receiving grid:
6531
6840
  * a {@link BeforeRowReceiveEvent}. */
6841
+ /** A row dragged from another grid is about to be inserted here; call `preventDefault(reason?)` to refuse it. */
6532
6842
  | 'beforeRowReceive'
6533
6843
  /* Their cancellation notifications (past-tense, non-cancellable). */
6534
- | 'edit:cancelled' | 'sort:cancelled' | 'filter:cancelled'
6535
- | 'columnMove:cancelled' | 'columnResize:cancelled' | 'columnHide:cancelled'
6536
- | 'selection:cancelled' | 'rowAdd:cancelled' | 'delete:cancelled'
6537
- | 'rowMove:cancelled' | 'group:cancelled' | 'rowReceive:cancelled'
6844
+ /** A `beforeEdit` handler vetoed the commit, or it went stale while an async handler was thinking. */
6845
+ | 'edit:cancelled'
6846
+ /** A `beforeSort` handler vetoed the sort. */
6847
+ | 'sort:cancelled'
6848
+ /** A `beforeFilter` handler vetoed the filter. */
6849
+ | 'filter:cancelled'
6850
+ /** A `beforeColumnMove` handler vetoed the move. */
6851
+ | 'columnMove:cancelled'
6852
+ /** A `beforeColumnResize` handler vetoed the resize. */
6853
+ | 'columnResize:cancelled'
6854
+ /** A `beforeColumnHide` handler vetoed the hide. */
6855
+ | 'columnHide:cancelled'
6856
+ /** A `beforeSelect` handler vetoed the selection change, which has been snapped back. */
6857
+ | 'selection:cancelled'
6858
+ /** A `beforeRowAdd` handler vetoed the append. */
6859
+ | 'rowAdd:cancelled'
6860
+ /** A `beforeDelete` handler vetoed the delete, or the rows were gone by the time an async handler settled. */
6861
+ | 'delete:cancelled'
6862
+ /** A `beforeRowMove` handler vetoed the reorder. */
6863
+ | 'rowMove:cancelled'
6864
+ /** A `beforeGroup` handler vetoed the expand or collapse. */
6865
+ | 'group:cancelled'
6866
+ /** A `beforeRowReceive` handler refused the drop, or the drop went stale while an async handler was thinking. */
6867
+ | 'rowReceive:cancelled'
6538
6868
  /* Every event at once, for logging and debugging. */
6869
+ /** Every event above, delivered to one handler; the payload is whichever event fired. */
6539
6870
  | '*';
6540
6871
 
6541
6872
  export interface GridEvent {
@@ -6553,6 +6884,11 @@ export interface GridEvent {
6553
6884
  origin: 'api' | 'user' | 'init' | 'ai';
6554
6885
  /** The grid that emitted it, so one handler can serve several grids. */
6555
6886
  grid: Grid;
6887
+ /**
6888
+ * The event's own fields, spread alongside the three above: which cell, which
6889
+ * column, which rows. What arrives depends on the event — {@link EventPayloads}
6890
+ * names the specialisation each one carries.
6891
+ */
6556
6892
  [key: string]: unknown;
6557
6893
  }
6558
6894
 
@@ -6908,11 +7244,36 @@ export interface CsvExportOptions {
6908
7244
  * or that opted out with `export.csv: false`, are still excluded.
6909
7245
  */
6910
7246
  columns?: string[];
7247
+ /**
7248
+ * Include the columns the grid hides, rather than only the visible ones.
7249
+ * Off by default. Columns that opted out with `export.csv: false` are still
7250
+ * excluded.
7251
+ */
7252
+ hidden?: boolean;
6911
7253
  /**
6912
7254
  * Which rows to export: `'visible'` (the default — what the filters and sort
6913
7255
  * leave), `'all'`, or `'selected'`.
6914
7256
  */
6915
7257
  rows?: 'visible' | 'all' | 'selected';
7258
+ /**
7259
+ * The formula-injection guard, **on by default**: a field beginning with
7260
+ * `=`, `+`, `-`, `@`, a tab or a CR is prefixed with an apostrophe, because
7261
+ * a spreadsheet would otherwise execute it when the file is opened. `false`
7262
+ * turns it off; an object tunes it — `characters` to widen or narrow the
7263
+ * set, `prefix` to change the escape, `keepNumbers: true` to leave a field
7264
+ * that is entirely a number alone (so a negative currency stays numeric).
7265
+ */
7266
+ sanitise?: boolean | {
7267
+ enabled?: boolean;
7268
+ prefix?: string;
7269
+ characters?: string;
7270
+ keepNumbers?: boolean;
7271
+ };
7272
+ /**
7273
+ * Emit a UTF-8 byte-order mark, so Excel detects the encoding instead of
7274
+ * guessing at it. Off by default.
7275
+ */
7276
+ bom?: boolean;
6916
7277
  /**
6917
7278
  * The name for the downloaded file. A `.csv` extension is added when it has
6918
7279
  * none, and a name is generated when you give none.
@@ -6986,6 +7347,11 @@ export interface ExcelExportOptions extends Omit<CsvExportOptions, 'delimiter' |
6986
7347
  * `'hidden'` keeps them as Excel-hidden columns for round-trip fidelity.
6987
7348
  */
6988
7349
  hiddenColumns?: 'omit' | 'hidden';
7350
+ /**
7351
+ * Put Excel's filter dropdowns on the header row, so the sheet opens ready
7352
+ * to filter. On by default; `false` writes a plain header.
7353
+ */
7354
+ autoFilter?: boolean;
6989
7355
  /** Explicit merged body ranges in A1 form, e.g. ['A3:A4']. */
6990
7356
  merges?: string[];
6991
7357
  /**
@@ -7390,6 +7756,20 @@ export interface DetailApi {
7390
7756
  export interface SelectionApi {
7391
7757
  /** Drop every range, leaving the row and cell selection alone. */
7392
7758
  clearRange(): void;
7759
+ /**
7760
+ * The selected cells as a status bar states them: how many carry a value,
7761
+ * how many of those are numbers, and the sum, extremes and mean of the
7762
+ * numbers. Every figure but the two counts is null when nothing selected is
7763
+ * numeric. {@link SelectionApi.statistics} is the fuller answer.
7764
+ */
7765
+ summary(): {
7766
+ count: number;
7767
+ numeric: number;
7768
+ sum: number | null;
7769
+ min: number | null;
7770
+ max: number | null;
7771
+ avg: number | null;
7772
+ };
7393
7773
  /**
7394
7774
  * Everything worth knowing about the selected cells: what `summary()`
7395
7775
  * reports plus median, quartiles, deviation, distinct and outliers. Over the
@@ -7769,11 +8149,20 @@ export interface ExportApi {
7769
8149
  /**
7770
8150
  * Switch the grid into print layout — every row in the document, no
7771
8151
  * virtualisation, no paging, pinned columns released — let the layout settle,
7772
- * call the browser's print dialog, and put the grid back as it was. Refused
7773
- * above 5,000 rows, with a message pointing at the CSV and Excel exports,
7774
- * because that is roughly a hundred printed pages.
7775
- */
7776
- print(): void;
8152
+ * call the browser's print dialog, and put the grid back as it was.
8153
+ *
8154
+ * Refused above `maxRows` (5,000 by default, roughly a hundred printed
8155
+ * pages), with a message pointing at the CSV and Excel exports. `unpin`
8156
+ * keeps the pinned columns in place; `print: false` lays the grid out and
8157
+ * restores it without calling the dialog, which is how a host paginates or
8158
+ * photographs it. Resolves with what happened, so a caller can show the
8159
+ * reason instead of guessing.
8160
+ */
8161
+ print(opts?: {
8162
+ maxRows?: number;
8163
+ unpin?: boolean;
8164
+ print?: boolean;
8165
+ }): Promise<{ printed: boolean; rows: number; reason?: string }>;
7777
8166
  }
7778
8167
 
7779
8168
  /** How `config.import` tunes the DOM import affordances (§14). */
@@ -9127,6 +9516,11 @@ export interface HistoryEntry {
9127
9516
  delegated: boolean;
9128
9517
  /** Set once the entry has been undone. */
9129
9518
  undone?: boolean;
9519
+ /**
9520
+ * Whatever else the action that was recorded needed to replay itself — the
9521
+ * writes behind an edit, the widths behind a resize. Private to the history
9522
+ * model's own apply path, and not a shape to depend on.
9523
+ */
9130
9524
  [key: string]: unknown;
9131
9525
  }
9132
9526
 
@@ -9171,10 +9565,18 @@ export interface ViewsApi {
9171
9565
  readonly activeId: string | null;
9172
9566
  /**
9173
9567
  * Save the grid's current state as a named view and make it the active one.
9174
- * The options carry `id` to overwrite a specific view, plus `shared`,
9175
- * `description` and `isDefault`.
9176
- */
9177
- save(name: string, opts?: { id?: string; overwrite?: boolean }): SavedView;
9568
+ *
9569
+ * `id` naming an existing view overwrites it; `id` naming none creates a
9570
+ * view with that id, which is how a host with server-issued ids seeds the
9571
+ * store; with no `id`, a name already taken is overwritten rather than
9572
+ * duplicated.
9573
+ */
9574
+ save(name: string, opts?: {
9575
+ id?: string;
9576
+ shared?: boolean;
9577
+ description?: string;
9578
+ isDefault?: boolean;
9579
+ }): SavedView;
9178
9580
  /**
9179
9581
  * Apply a view and make it active. It is a destination, not a patch: the
9180
9582
  * grid returns to its baseline first, so the same view gives the same grid
@@ -9203,18 +9605,51 @@ export interface ViewsApi {
9203
9605
  defaultView(): SavedView | null;
9204
9606
  /** What applying the view would change, without applying it. */
9205
9607
  diff(id: string): Record<string, unknown> | null;
9206
- /** A shareable payload for one view, or for every view when no id is given. */
9207
- export(id: string): string;
9208
9608
  /**
9209
- * Take a shared payload — the object, or its JSON — and report what was
9210
- * imported, skipped and repaired. It reports rather than throwing: an import
9211
- * that fails silently is worse than one that says so.
9609
+ * A shareable payload for one view, or for every view when no id is given —
9610
+ * an object, not JSON text, so a host can add to it before sending it.
9611
+ * `null` when the id names no view. The default marker never travels: it
9612
+ * belongs to this user's store, not to the view.
9212
9613
  */
9213
- import(json: string): SavedView;
9614
+ export(id?: string): ViewPayload | null;
9615
+ /**
9616
+ * Take a shared payload — the object, its JSON text, a bare view or a bare
9617
+ * array — and report what was imported, skipped and repaired. It reports
9618
+ * rather than throwing: an import that fails silently is worse than one that
9619
+ * says so, and one bad entry never rejects the rest of the file.
9620
+ */
9621
+ import(json: ViewPayload | SavedView | SavedView[] | string, opts?: {
9622
+ /** What a name already in the store does. `'rename'` (the default) keeps both. */
9623
+ onConflict?: 'rename' | 'overwrite' | 'skip';
9624
+ /** Overrides the shared flag on every incoming view. */
9625
+ shared?: boolean;
9626
+ }): ViewImportReport;
9214
9627
  /** Re-read from storage, after another tab or the server changed it. */
9215
9628
  reload(): void;
9216
9629
  }
9217
9630
 
9631
+ /** What {@link ViewsApi.export} produces and {@link ViewsApi.import} accepts. */
9632
+ export interface ViewPayload {
9633
+ /** Marks the object as a Lattice view payload. */
9634
+ kind: string;
9635
+ /** The payload format version, so an older file can be read or refused. */
9636
+ version: number;
9637
+ /** When it was exported, in epoch milliseconds. */
9638
+ exportedAt: number;
9639
+ /** The views themselves, each with `isDefault` cleared. */
9640
+ views: SavedView[];
9641
+ }
9642
+
9643
+ /** What {@link ViewsApi.import} reports. */
9644
+ export interface ViewImportReport {
9645
+ /** The views that were stored, as metadata — the state is not repeated. */
9646
+ imported: Omit<SavedView, 'state'>[];
9647
+ /** Each view that was not stored, with a reason in words a host can show. */
9648
+ skipped: { name: string; reason: string }[];
9649
+ /** Each state section that was dropped from an otherwise valid view. */
9650
+ repaired: { name: string; key: string; reason: string }[];
9651
+ }
9652
+
9218
9653
  export interface DiffApi {
9219
9654
  /** Exchange the baseline and the current rows. Returns false with nothing to swap. */
9220
9655
  swap(): boolean;
@@ -9674,7 +10109,18 @@ export interface Grid {
9674
10109
 
9675
10110
  /** The resolved configuration, as one object. */
9676
10111
  config(): GridConfig;
10112
+ /**
10113
+ * One configuration value, as it stands after defaults and validation — not
10114
+ * what was passed in. Typed by the key, so `get('rowHeight')` is a number
10115
+ * without a cast.
10116
+ */
9677
10117
  get<K extends keyof GridConfig>(key: K): GridConfig[K];
10118
+ /**
10119
+ * Write one configuration value, doing only the work that key implies. Every
10120
+ * key is settable at runtime — there is no "initial options" versus "live
10121
+ * options" distinction to learn — and `config:changed` follows, after the
10122
+ * grid has rebuilt.
10123
+ */
9678
10124
  set<K extends keyof GridConfig>(key: K, value: GridConfig[K]): void;
9679
10125
  /** Apply several configuration changes as one update rather than several. */
9680
10126
  setAll(values: Partial<GridConfig>): void;
@@ -9817,6 +10263,18 @@ export interface UnitConfig {
9817
10263
  * value stays a single base-unit number, so sort, filter and total are
9818
10264
  * unchanged. Parsing sums the parts. */
9819
10265
  compound?: string[];
10266
+ /**
10267
+ * Round to this many significant figures before the rung is chosen, so
10268
+ * 999,999 B at three figures reads `1 MB` rather than `1,000 kB`. Off when
10269
+ * unset or not a positive number; ignored by a `compound` column, which
10270
+ * renders across units instead.
10271
+ */
10272
+ significantFigures?: number;
10273
+ /**
10274
+ * What to show for a value that is not a finite number — null, undefined,
10275
+ * empty, or unparseable text. Empty by default.
10276
+ */
10277
+ nullDisplay?: string;
9820
10278
  }
9821
10279
 
9822
10280
  export function defineUnit(
@@ -11314,39 +11772,248 @@ export interface ChartNode {
11314
11772
  y?: number;
11315
11773
  }
11316
11774
 
11775
+ /**
11776
+ * What every chart event carries, whatever it is about.
11777
+ *
11778
+ * The three members the chart's own dispatcher adds to each payload before it
11779
+ * reaches a handler, so one handler bound to several charts can tell which chart
11780
+ * and which grid it is being told about.
11781
+ */
11782
+ export interface ChartEvent {
11783
+ /** Which event this is: `click`, `hover`, `leave`, `focus`, `draw`, `drill`, `brush` or `legend`. */
11784
+ type: ChartEventName;
11785
+ /** The chart that raised it. */
11786
+ chart: Chart;
11787
+ /** The grid the chart draws, as given in the spec. */
11788
+ grid: Grid;
11789
+ }
11790
+
11791
+ /**
11792
+ * One series' reading under a mark, on a chart with several series.
11793
+ *
11794
+ * `value` is that series' own number at the mark, and `rows` how many source
11795
+ * rows were aggregated into it — a count, not the rows themselves.
11796
+ */
11797
+ export interface ChartDatumSeries {
11798
+ /** The series key, as bound. */
11799
+ key: string;
11800
+ /** The series' display label. */
11801
+ label: string;
11802
+ /** This series' value at the mark. */
11803
+ value: number | null;
11804
+ /** How many source rows were aggregated into that value. */
11805
+ rows: number;
11806
+ }
11807
+
11808
+ /**
11809
+ * A mark, in the terms a host thinks in: `hover`'s payload, and the shape
11810
+ * `click` adds its `preventDefault` to.
11811
+ *
11812
+ * One shape for every chart type, so a host need not know whether it attached to
11813
+ * a pie, a bar chart, a treemap, a map, a matrix or a network to read what the
11814
+ * pointer is on: a type with no third channel leaves the field null. There is no
11815
+ * `point` wrapper — the fields are flat.
11816
+ */
11817
+ export interface ChartDatumEvent extends ChartEvent {
11818
+ /** The mark's label: the category, the slice, the tile, the region or the node. */
11819
+ label: string;
11820
+ /**
11821
+ * The measure under the mark when a single series sits there, otherwise null —
11822
+ * in which case the per-series numbers are in `series`.
11823
+ */
11824
+ value: number | null;
11825
+ /** The value to filter `column` to: the stored category behind the label, or null where the geometry has none. */
11826
+ category: unknown;
11827
+ /** The grid column the mark filters on, or null (a network node is a source in some rows and a target in others). */
11828
+ column: string | null;
11829
+ /** The per-series readings under the mark, or null on a geometry that has one value per mark. */
11830
+ series: ChartDatumSeries[] | null;
11831
+ /** The keys of the source rows behind the mark; empty where the geometry keeps none. */
11832
+ rowKeys: unknown[];
11833
+ /** The mark's path from the drawn root, on a hierarchy — a treemap tile, a sunburst arc, a flow end. */
11834
+ path?: unknown[];
11835
+ /** How deep the mark sits below the drawn root, on a hierarchy. */
11836
+ depth?: number;
11837
+ /** A histogram bin's lower bound, present only on a bin. */
11838
+ from?: number;
11839
+ /** A histogram bin's upper bound, present only on a bin. */
11840
+ to?: number;
11841
+ /** The DOM pointer event behind it. */
11842
+ native: object;
11843
+ }
11844
+
11845
+ /**
11846
+ * `click`: a mark was clicked, **before** the chart does anything about it.
11847
+ *
11848
+ * The one event most callers want: it is how a click on a mark becomes a filter
11849
+ * on the grid. It fires whether or not the spec sets `filterOnClick`, and it
11850
+ * fires before the filter, the drill or the selection the chart would otherwise
11851
+ * apply — so a host that wants to do something else entirely (open a drawer,
11852
+ * cross-filter a second grid) calls `preventDefault()` and takes the click over.
11853
+ */
11854
+ export interface ChartClickEvent extends ChartDatumEvent {
11855
+ /**
11856
+ * Stop the chart acting on this click — no filter, no drill, no selection
11857
+ * change. It takes no reason, and there is no `<action>:cancelled` event: this
11858
+ * is a default a host takes over, not a mutation a host vetoes.
11859
+ */
11860
+ preventDefault(): void;
11861
+ /**
11862
+ * True once a handler has called `preventDefault`. Absent until then — a
11863
+ * handler may also set it directly, which the chart honours the same way.
11864
+ */
11865
+ defaultPrevented?: boolean;
11866
+ }
11867
+
11868
+ /**
11869
+ * `focus`: the keyboard moved onto a mark, which has just been given the
11870
+ * `aria-label` a screen reader announces.
11871
+ */
11872
+ export interface ChartFocusEvent extends ChartEvent {
11873
+ /** The focused mark's label. */
11874
+ label: string;
11875
+ /** The focused mark's value. */
11876
+ value: number | null;
11877
+ /** The mark's position in the drawn order. */
11878
+ index: number;
11879
+ }
11880
+
11881
+ /**
11882
+ * `draw`: the chart finished a draw, at its settled size.
11883
+ *
11884
+ * Raised once per `draw()`, after the second pass a legend or heading that
11885
+ * changed the plot box forces — so a handler never sees the in-between,
11886
+ * wrongly-sized pass. A draw that showed the empty state instead raises nothing.
11887
+ */
11888
+ export interface ChartDrawEvent extends ChartEvent {
11889
+ /** The type drawn, which for an extension type is its registered name. */
11890
+ chartType: string;
11891
+ /** The categories drawn, in plot order. */
11892
+ categories: unknown[];
11893
+ /** Whether the binding had nothing to draw. */
11894
+ empty: boolean;
11895
+ }
11896
+
11897
+ /**
11898
+ * `drill`: the chart descended into a hierarchy, or `ascend()` came back up.
11899
+ * Raised after the new level is set and before it is drawn.
11900
+ */
11901
+ export interface ChartDrillEvent extends ChartEvent {
11902
+ /** The drill path from the top, a label per level. */
11903
+ path: unknown[];
11904
+ /** The label just descended into, or the level now shown after an `ascend()`. */
11905
+ label: string | null;
11906
+ }
11907
+
11908
+ /**
11909
+ * `brush`: a range was dragged out on an axis, **before** the chart zooms or
11910
+ * filters on it.
11911
+ *
11912
+ * A handler that wants to take the brush over calls `preventDefault()` on the
11913
+ * payload, which stops the chart zooming its own domain or filtering the grid
11914
+ * for this drag; writing `defaultPrevented` directly still works, the same way.
11915
+ */
11916
+ export interface ChartBrushEvent extends ChartEvent {
11917
+ /** What the spec asked a brush to do: `zoom` the chart's own domain, or `filter` the grid. */
11918
+ mode: string;
11919
+ /** What the dragged range resolved to: a continuous `range`, or the discrete `values` of a category axis. */
11920
+ kind: string;
11921
+ /** The category values the drag covered, on a category axis. */
11922
+ values: unknown[];
11923
+ /** The numeric or time bounds the drag covered, on a continuous axis, or null. */
11924
+ range: { from: unknown; to: unknown } | null;
11925
+ /** Which axis was dragged: `x`, `y` or `y2`. */
11926
+ axis: string;
11927
+ /** The grid column the range names — the measure's on a value axis, the dimension's on `x`. */
11928
+ column: string | null;
11929
+ /**
11930
+ * Stop the chart acting on this brush — no zoom, no filter. It takes no
11931
+ * reason, and there is no `<action>:cancelled` event: this is a default a
11932
+ * host takes over, not a mutation a host vetoes.
11933
+ */
11934
+ preventDefault(): void;
11935
+ /**
11936
+ * True once a handler has called `preventDefault`. Absent until then — a
11937
+ * handler may also set it directly, which the chart honours the same way.
11938
+ */
11939
+ defaultPrevented?: boolean;
11940
+ }
11941
+
11942
+ /** `legend`: a legend entry was clicked and the hidden set already changed; the redraw follows. */
11943
+ export interface ChartLegendEvent extends ChartEvent {
11944
+ /** The clicked entry's label. */
11945
+ label: string;
11946
+ /** The clicked entry's series key. */
11947
+ key: string;
11948
+ /** Whether that series is now hidden. */
11949
+ hidden: boolean;
11950
+ /** Every hidden series key after the click. */
11951
+ hiddenKeys: string[];
11952
+ }
11953
+
11317
11954
  /**
11318
11955
  * The events a chart raises.
11319
11956
  *
11320
11957
  * A chart's own, not the grid's: `grid.on` takes {@link EventName} and knows
11321
11958
  * nothing about these. There is no `point:click`, `point:hover` or
11322
- * `series:toggle`; the events are the flat names below and `click` is the one
11323
- * most callers want, it is how a click on a mark becomes a filter on the grid.
11959
+ * `series:toggle`; the events are the flat names below, and `click` is the one
11960
+ * most callers want — it is how a click on a mark becomes a filter on the grid.
11324
11961
  *
11325
- * `click` and `hover` carry a **flat** payload — there is no `point` wrapper:
11326
- * `{ label, category, column, value, series, rowKeys, native, preventDefault }`.
11327
- * `column` is the grid column the mark filters on and `category` the value to
11328
- * filter it to; `value` is the measure when a single series sits under the mark,
11329
- * otherwise null with the per-series numbers in `series`; `rowKeys` are the
11330
- * source rows behind the mark; `native` is the DOM event.
11962
+ * Every payload carries `type`, `chart` and `grid` ({@link ChartEvent}); what
11963
+ * else arrives is {@link ChartEventPayloads}. A handler that throws is reported
11964
+ * to the console and the rest still run. Each event also fires the matching
11965
+ * `on<Event>` in the spec (`onClick`, `onDraw`, …) before the subscribers.
11331
11966
  *
11332
- * `click` fires whether or not the spec sets `filterOnClick`, and it fires
11333
- * *before* any filter is applied: call `preventDefault()` on the payload to stop
11334
- * the chart filtering the grid and take the click over yourself. With
11335
- * `filterOnClick: true` in the spec the chart filters the grid itself on the
11336
- * clicked mark's `column`/`category` unless a handler prevented it.
11967
+ * `click` and `brush` are the two events the chart acts on, and both carry a
11968
+ * `preventDefault` a handler can call to take the action over; the rest are
11969
+ * notifications.
11337
11970
  */
11338
11971
  export type ChartEventName =
11339
- | 'click' | 'hover' | 'leave' | 'focus'
11340
- | 'draw' | 'drill' | 'brush' | 'legend';
11972
+ /** A mark was clicked, before the chart filters, drills or selects on it; cancellable. */
11973
+ | 'click'
11974
+ /** The pointer moved onto a mark and its tooltip was shown. */
11975
+ | 'hover'
11976
+ /** The pointer left every mark and the tooltip was hidden. */
11977
+ | 'leave'
11978
+ /** The keyboard moved onto a mark, which has just been described for a screen reader. */
11979
+ | 'focus'
11980
+ /** A draw finished, at the settled plot size; a draw that showed the empty state raises nothing. */
11981
+ | 'draw'
11982
+ /** The chart descended into a hierarchy, or `ascend()` came back up. */
11983
+ | 'drill'
11984
+ /** A range was dragged out on an axis, before the chart zooms or filters on it; cancellable. */
11985
+ | 'brush'
11986
+ /** A legend entry was clicked and the hidden set changed. */
11987
+ | 'legend';
11988
+
11989
+ /** What a handler receives, per chart event. */
11990
+ export interface ChartEventPayloads {
11991
+ /** The mark clicked, with `preventDefault` to take the click over. */
11992
+ click: ChartClickEvent;
11993
+ /** The mark under the pointer, the same shape a click reports. */
11994
+ hover: ChartDatumEvent;
11995
+ /** Nothing but the chart and its grid: the pointer is over no mark. */
11996
+ leave: ChartEvent;
11997
+ /** The mark the keyboard is on. */
11998
+ focus: ChartFocusEvent;
11999
+ /** What was drawn, and whether there was anything to draw. */
12000
+ draw: ChartDrawEvent;
12001
+ /** The new drill path. */
12002
+ drill: ChartDrillEvent;
12003
+ /** The range dragged out, and the column it names, with `preventDefault` to take the brush over. */
12004
+ brush: ChartBrushEvent;
12005
+ /** The legend entry clicked, and every hidden series after it. */
12006
+ legend: ChartLegendEvent;
12007
+ }
11341
12008
 
11342
12009
  /** A live chart. */
11343
12010
  export interface Chart {
11344
12011
  /**
11345
12012
  * The chart's root element — the wrapper the chart built inside the container, which
11346
- * holds the heading, the SVG, the legend and the accessible table. (Declared as an
11347
- * `SVGElement`; it is the wrapping element, and the `<svg>` is inside it.)
12013
+ * holds the heading, the SVG, the legend and the accessible table. The `<svg>` is a
12014
+ * descendant of it, not this element.
11348
12015
  */
11349
- readonly element: SVGElement;
12016
+ readonly element: HTMLElement;
11350
12017
  /** Redraw now. */
11351
12018
  draw(): void;
11352
12019
  /** Change the spec and redraw; unnamed keys keep their values. */
@@ -11356,16 +12023,18 @@ export interface Chart {
11356
12023
  /** Go up one level, on a drillable hierarchy. */
11357
12024
  ascend(levels?: number): void;
11358
12025
  /**
11359
- * Subscribe to `click`, `hover`, `leave`, `draw` or `legend`; returns a function that
11360
- * unsubscribes. A handler that throws is reported to the console and the rest still run.
12026
+ * Register an event handler; returns a function that unsubscribes. A handler that throws
12027
+ * is reported to the console and the rest still run. What each event carries is
12028
+ * {@link ChartEventPayloads}; the handler is declared with the widest of them, so narrow
12029
+ * on the name inside it.
11361
12030
  */
11362
- on(event: ChartEventName, handler: (payload: unknown) => void): () => void;
12031
+ on(event: ChartEventName, handler: (payload: ChartEventPayloads[ChartEventName]) => void): () => void;
11363
12032
  /**
11364
12033
  * Fire an event at the subscribers and at the matching `on<Event>` in the spec, and
11365
12034
  * return the payload the handlers saw — which is how a caller reads back what a handler
11366
12035
  * changed.
11367
12036
  */
11368
- emit(event: ChartEventName, payload?: unknown): void;
12037
+ emit(event: ChartEventName, payload?: object): object;
11369
12038
  /**
11370
12039
  * The chart as standalone SVG markup, empty string before the first draw. Pass `{
11371
12040
  * inlineStyles: true }` to copy the computed styles onto a clone, which is what an SVG
@@ -11378,7 +12047,7 @@ export interface Chart {
11378
12047
  * `scale` defaults to the device pixel ratio. Resolves to null where there is no canvas
11379
12048
  * or `Image`.
11380
12049
  */
11381
- toPNG(opts?: { scale?: number; background?: string }): Promise<Blob>;
12050
+ toPNG(opts?: { scale?: number; background?: string }): Promise<Blob | null>;
11382
12051
  /**
11383
12052
  * The numbers the chart is drawing, as CSV: one column per series, one row per category
11384
12053
  * (or label and total, for a hierarchy). Empty string before the first draw.
@@ -11395,43 +12064,1866 @@ export interface Chart {
11395
12064
  // Event payloads
11396
12065
  // ---------------------------------------------------------------------------
11397
12066
 
12067
+ // ---------------------------------------------------------------------------
12068
+ // Event payloads, per event
12069
+ // ---------------------------------------------------------------------------
12070
+
11398
12071
  /**
11399
- * What a handler receives, per event.
12072
+ * `render:done`: one render pass has finished writing cells.
11400
12073
  *
11401
- * `on()` is declared as `on(event: EventName, handler: EventHandler)`, so the
11402
- * declarations named every event and typed none of their payloads. The
11403
- * published reference could list the names and nothing else, which is half an
11404
- * event reference: a reader still has to run the grid to find out what arrives.
12074
+ * The pass is over and the cells are stable, which is why anything that
12075
+ * decorates them from outside — a highlight painter, a diff painter — hangs
12076
+ * off this rather than guessing at a frame delay.
12077
+ */
12078
+ export interface RenderDoneEvent extends GridEvent {
12079
+ /** The first display index the pass drew, including the overscan either side. */
12080
+ first: number;
12081
+ /** The last display index the pass drew, inclusive; `-1` when there were no rows. */
12082
+ last: number;
12083
+ /** What asked for the pass — `'scroll'` unless something else invalidated first. */
12084
+ cause: string;
12085
+ /**
12086
+ * Milliseconds per phase. `layoutMs` is deciding what to draw, `hintMs` is
12087
+ * telling the source about it, `writeMs` is the DOM itself. The wait for
12088
+ * paint is the browser's and is not measurable here.
12089
+ */
12090
+ phases: { layoutMs: number; hintMs: number; writeMs: number; totalMs: number };
12091
+ }
12092
+
12093
+ /**
12094
+ * `config:changed`: a configuration key was written at run time.
11405
12095
  *
11406
- * This map is the other half. It is populated from the payload interfaces that
11407
- * already exist and from the comments in {@link EventName} that name them — an
11408
- * event with no entry here publishes `unknown` in the reference and is counted
11409
- * by the undescribed-member ratchet in `tools/check.js`, so the gaps are
11410
- * visible and shrink rather than being papered over with a generic type. Every
11411
- * payload extends {@link GridEvent}; an entry says which specialisation.
12096
+ * `grid.set(key, value)` fills the single form; `grid.setAll(values)` fills the
12097
+ * batch form and fires once for the whole batch rather than once per key, so a
12098
+ * host restoring a saved arrangement hears one event describing a settled
12099
+ * grid instead of a dozen describing half-applied ones.
11412
12100
  */
11413
- export interface EventPayloads {
11414
- /** The row-drag gesture; all four carry the same payload. */
11415
- 'rowDrag:started': RowDragEvent;
11416
- 'rowDrag:moved': RowDragEvent;
11417
- 'rowDrag:left': RowDragEvent;
11418
- 'rowDrag:ended': RowDragEvent;
11419
- /** The cancellable before-events: a {@link BeforeEvent} carrying `preventDefault`. */
11420
- beforeEdit: BeforeEvent;
11421
- beforeSort: BeforeEvent;
11422
- beforeFilter: BeforeEvent;
11423
- beforeColumnMove: BeforeEvent;
11424
- beforeColumnResize: BeforeEvent;
11425
- beforeColumnHide: BeforeEvent;
11426
- beforeSelect: BeforeEvent;
11427
- beforeRowAdd: BeforeEvent;
11428
- beforeDelete: BeforeEvent;
11429
- beforeRowMove: BeforeEvent;
11430
- beforeGroup: BeforeEvent;
11431
- /** A row dropped in from another grid, on the receiving grid. */
11432
- beforeRowReceive: BeforeRowReceiveEvent;
11433
- /** That veto's notification, with the reason. */
11434
- 'rowReceive:cancelled': RowReceiveCancelledEvent;
11435
- /** One event per logical state change. */
11436
- 'state:changed': StateChangedEvent;
12101
+ export interface ConfigChangedEvent extends GridEvent {
12102
+ /** The key that was written, on a `grid.set` change. */
12103
+ key?: string;
12104
+ /** Its new value, on a `grid.set` change. */
12105
+ value?: unknown;
12106
+ /** What it held before, on a `grid.set` change. */
12107
+ oldValue?: unknown;
12108
+ /** The keys that were written, on a `grid.setAll` change. */
12109
+ keys?: string[];
12110
+ /** Their new values, by key, on a `grid.setAll` change. */
12111
+ values?: Record<string, unknown>;
12112
+ /** What each of them held before, by key, on a `grid.setAll` change. */
12113
+ oldValues?: Record<string, unknown>;
12114
+ }
12115
+
12116
+ /** `licence:changed`: a key was installed, and again when its check settles. */
12117
+ export interface LicenceChangedEvent extends GridEvent {
12118
+ /** The verdict as it stands — provisional on the first firing, settled on the second. */
12119
+ info: LicenceInfo;
12120
+ /** What this deployment is now treated as. */
12121
+ state: 'licensed' | 'localhost' | 'trial';
12122
+ }
12123
+
12124
+ /**
12125
+ * `model:changed`: the display model was rebuilt.
12126
+ *
12127
+ * The one event every viewer of the grid follows. `reason` is what actually
12128
+ * happened, and the rest of the payload is whatever that reason has to say —
12129
+ * a page's block and range, a tree branch's row, a stream's anchor.
12130
+ */
12131
+ export interface ModelChangedEvent extends GridEvent {
12132
+ /**
12133
+ * Why it was rebuilt: `'rows'`, `'tree'`, `'expanded'`, `'children'`,
12134
+ * `'children:loading'`, `'reload'`, `'page'`, `'expand'`, `'collapse'`,
12135
+ * `'query'`, `'stream'`, or one of the pipeline's settle reasons.
12136
+ */
12137
+ reason: string;
12138
+ /** How many display rows there now are, or how many children arrived. */
12139
+ count?: number;
12140
+ /** The branch row a `'children'` or `'children:loading'` rebuild is about. */
12141
+ row?: Row;
12142
+ /** The row key an `'expand'` or `'collapse'` is about. */
12143
+ key?: string;
12144
+ /** The block id a `'page'` rebuild filled. */
12145
+ block?: string | number;
12146
+ /** The first display index a `'page'` rebuild filled. */
12147
+ from?: number;
12148
+ /** One past the last display index a `'page'` rebuild filled. */
12149
+ to?: number;
12150
+ /** The group path a remote source's `'page'` rebuild filled under. */
12151
+ groupPath?: unknown[];
12152
+ /** How far a stream's arrivals pushed the rows above the viewport down. */
12153
+ shiftAboveViewport?: number;
12154
+ /** The row the stream is holding the viewport against. */
12155
+ anchor?: unknown;
12156
+ }
12157
+
12158
+ /**
12159
+ * `rows:changed`: rows were added, updated, removed or moved.
12160
+ *
12161
+ * **Read `identified` first.** When it is `true` the three arrays name exactly
12162
+ * the rows that moved and a derived viewer can patch rather than rescan. Every
12163
+ * other firing omits it, and a consumer that does not see it re-reads in full
12164
+ * (§5.8.1) — the default is deliberately the safe one.
12165
+ *
12166
+ * The `companion: true` firings carry **counts** in `added`/`updated`/
12167
+ * `removed`, not rows: they come from the source's own companion channel,
12168
+ * which has the numbers and not the records. Anything reading `.length` has to
12169
+ * check `identified` rather than assume an array (F-1688-B).
12170
+ */
12171
+ export interface RowsChangedEvent extends GridEvent {
12172
+ /** True when `added`, `updated` and `removed` name exactly the rows that moved. */
12173
+ identified?: boolean;
12174
+ /** The rows added — records when `identified`, a count on a companion firing. */
12175
+ added?: Row[] | number;
12176
+ /** The rows updated — records when `identified`, a count on a companion firing. */
12177
+ updated?: Row[] | number;
12178
+ /** The keys removed — keys when `identified`, a count on a companion firing. */
12179
+ removed?: string[] | number;
12180
+ /** Rows the host could not apply; the rest of the batch still applied. */
12181
+ rejected?: RejectedRow[];
12182
+ /** How the change was planned and applied, for diagnostics. */
12183
+ plan?: unknown;
12184
+ /** True on the firings that echo a change the source has already applied. */
12185
+ companion?: boolean;
12186
+ /** The change as it was handed in, on a companion firing that carries one. */
12187
+ change?: RowChange;
12188
+ /** `'import'` on a CSV/Excel import; `'edit'`-side reasons name the write. */
12189
+ reason?: string;
12190
+ /** True when the change came from an edit commit rather than a data feed. */
12191
+ edit?: boolean;
12192
+ /** The column ids an edit wrote to. */
12193
+ columns?: string[];
12194
+ /** `1` when the change was a single row reorder. */
12195
+ moved?: number;
12196
+ /** The key of the row that moved. */
12197
+ key?: string;
12198
+ /** The display index it moved from. */
12199
+ from?: number;
12200
+ /** The display index it moved to. */
12201
+ to?: number;
12202
+ }
12203
+
12204
+ /** `rows:queued`: a change arrived while the feed was batching and was queued. */
12205
+ export interface RowsQueuedEvent extends GridEvent {
12206
+ /** How many changes are waiting to be applied. */
12207
+ pending: number;
12208
+ /** How many rows those changes carry. */
12209
+ queued: number;
12210
+ /** How many rows coalescing has saved on this queue. */
12211
+ coalesced: number;
12212
+ /** Whether the feed is currently paused. */
12213
+ paused: boolean;
12214
+ }
12215
+
12216
+ /** `rows:deferred`: a flush ran out of frame budget and carried work over. */
12217
+ export interface RowsDeferredEvent extends GridEvent {
12218
+ /** How many rows were carried into the next frame. */
12219
+ deferred: number;
12220
+ /** How many rows this flush did apply. */
12221
+ applied: number;
12222
+ /** The per-flush budget, in milliseconds, that ran out. */
12223
+ budgetMs: number;
12224
+ }
12225
+
12226
+ /**
12227
+ * `rows:paused` and `rows:resumed`: the whole counter set the feed keeps,
12228
+ * which is what a host watching a live feed wants at the moment it stops or
12229
+ * starts. Identical to what `grid.changes.stats()` returns.
12230
+ */
12231
+ export interface RowsFlowEvent extends GridEvent {
12232
+ /** Whether the feed is held. */
12233
+ paused: boolean;
12234
+ /** Changes waiting to be applied. */
12235
+ pending: number;
12236
+ /** Rows those changes carry. */
12237
+ queued: number;
12238
+ /** Rows coalescing saved on the current queue. */
12239
+ coalesced: number;
12240
+ /** Rows coalescing has saved over the grid's life. */
12241
+ coalescedTotal: number;
12242
+ /** Rows that have arrived over the grid's life. */
12243
+ rows: number;
12244
+ /** Rows dropped because the buffer was full. */
12245
+ dropped: number;
12246
+ /** Rows the change log is holding right now. */
12247
+ held: number;
12248
+ /** The most it will hold before trimming. */
12249
+ heldLimit: number;
12250
+ /** How many flushes have run. */
12251
+ flushes: number;
12252
+ /** The batching strategy in force. */
12253
+ strategy: string;
12254
+ /** Flushes that ran out of budget and carried work over; a rising number means the feed outpaces the grid. */
12255
+ deferrals: number;
12256
+ /** The largest queue seen. */
12257
+ maxQueued: number;
12258
+ /** The per-flush budget, in milliseconds. */
12259
+ budgetMs: number;
12260
+ /** The time span the held log covers, or null when it holds nothing. */
12261
+ span: { from: number; to: number } | null;
12262
+ }
12263
+
12264
+ /** `row:received`: a row dragged from another grid was inserted here. */
12265
+ export interface RowReceivedEvent extends GridEvent {
12266
+ /** The row's data, as it was inserted. */
12267
+ data: Record<string, unknown>;
12268
+ /** The display index it took. */
12269
+ at: number;
12270
+ /** The key of the row it was dropped on, or null when it landed on no row. */
12271
+ overKey: string | null;
12272
+ /** Rows the insert could not apply; empty on a clean insert. */
12273
+ rejected: RejectedRow[];
12274
+ }
12275
+
12276
+ /**
12277
+ * `row:sent` and `row:copied`: a row left this grid for another one. `row:sent`
12278
+ * means it was removed from here, `row:copied` means it was kept.
12279
+ */
12280
+ export interface RowTransferEvent extends GridEvent {
12281
+ /** The key of the row that was transferred. */
12282
+ key: string;
12283
+ /** That row's data, as the target received it. */
12284
+ data: Record<string, unknown>;
12285
+ /** Which gesture it was. */
12286
+ mode: 'move' | 'copy';
12287
+ }
12288
+
12289
+ /** `row:moved`: a row was reordered within this grid. */
12290
+ export interface RowMovedEvent extends GridEvent {
12291
+ /** The key of the row that moved. */
12292
+ key: string;
12293
+ /** The display index it came from. */
12294
+ from: number;
12295
+ /** The display index it went to. */
12296
+ to: number;
12297
+ /** That row's data. */
12298
+ data: Record<string, unknown>;
12299
+ }
12300
+
12301
+ /**
12302
+ * `source:error`: a source could not fetch what was asked of it. Which of the
12303
+ * optional fields is present says what was being fetched.
12304
+ */
12305
+ export interface SourceErrorEvent extends GridEvent {
12306
+ /** What the source threw or rejected with. */
12307
+ error: unknown;
12308
+ /** The branch row whose children could not be loaded. */
12309
+ row?: Row;
12310
+ /** `'loadChildren'` on a tree fetch; absent on a page or stream failure. */
12311
+ reason?: string;
12312
+ /** The block id that failed, on a paged or remote source. */
12313
+ block?: string | number;
12314
+ /** The display range that block covers. */
12315
+ range?: { start: number; end: number };
12316
+ /** The group path the failed block sits under, on a remote grouped source. */
12317
+ groupPath?: unknown[];
12318
+ }
12319
+
12320
+ /** `stream:chunk`: a streaming source applied a chunk of arriving rows. */
12321
+ export interface StreamChunkEvent extends GridEvent {
12322
+ /** Bytes or rows read so far, as the transport reports them. */
12323
+ loaded: number;
12324
+ /** What the transport expects in total, or 0 when it does not say. */
12325
+ estimated: number;
12326
+ /** How many rows the source now holds. */
12327
+ count: number;
12328
+ /** How many times the grid has been asked to repaint for this stream. */
12329
+ renders: number;
12330
+ }
12331
+
12332
+ /** `stream:end`: a streaming source reached the end of its feed. */
12333
+ export interface StreamEndEvent extends GridEvent {
12334
+ /** How many rows arrived in all. */
12335
+ loaded: number;
12336
+ /** True when the stream handed over to an in-memory source at the end. */
12337
+ promoted: boolean;
12338
+ /** The row count above which it would have promoted. */
12339
+ threshold: number;
12340
+ }
12341
+
12342
+ /** `stream:evicted`: a rolling-window stream dropped rows off the back. */
12343
+ export interface StreamEvictedEvent extends GridEvent {
12344
+ /** How many rows this eviction dropped. */
12345
+ evicted: number;
12346
+ /** How many rows have been evicted over the stream's life. */
12347
+ total: number;
12348
+ /** How many rows are still live in the window. */
12349
+ live: number;
12350
+ }
12351
+
12352
+ /**
12353
+ * `cell:changed`: a cell's value was written.
12354
+ *
12355
+ * Fired by an edit commit, by a revert, and by each cell an undo or redo step
12356
+ * moves — `revert` and `undo` say which, and both are absent on a plain edit.
12357
+ */
12358
+ export interface CellChangedEvent extends GridEvent {
12359
+ /** The row the cell belongs to. */
12360
+ row: Row;
12361
+ /** That row's key. */
12362
+ key: string;
12363
+ /** The column id that was written. */
12364
+ colId: string;
12365
+ /** The value the cell now holds. */
12366
+ value: unknown;
12367
+ /** The value it held before. */
12368
+ oldValue: unknown;
12369
+ /** True when the write put back a value the server refused. */
12370
+ revert?: boolean;
12371
+ /** Why it was reverted, or null. */
12372
+ reason?: string | null;
12373
+ /** True when the write came from an undo step rather than a redo. */
12374
+ undo?: boolean;
12375
+ }
12376
+
12377
+ /** `cell:pending`: an optimistic cell edit was sent and is awaiting an answer. */
12378
+ export interface CellPendingEvent extends GridEvent {
12379
+ /** The row the cell belongs to. */
12380
+ row: Row;
12381
+ /** That row's key. */
12382
+ key: string;
12383
+ /** The column id that was written. */
12384
+ colId: string;
12385
+ /** The value that was sent. */
12386
+ value: unknown;
12387
+ /** The value it is holding in reserve to put back if the write is refused. */
12388
+ before: unknown;
12389
+ /** The id the op is tracked under; `grid.edit.settle(id, …)` answers it. */
12390
+ id: string;
12391
+ }
12392
+
12393
+ /** `cell:confirmed`: the server accepted a pending cell edit. */
12394
+ export interface CellConfirmedEvent extends GridEvent {
12395
+ /** The row the cell belongs to. */
12396
+ row: Row;
12397
+ /** That row's key. */
12398
+ key: string;
12399
+ /** The column id that was written. */
12400
+ colId: string;
12401
+ /** What the server confirmed, which need not be what was sent. */
12402
+ value: unknown;
12403
+ /** The id the op was tracked under. */
12404
+ id: string;
12405
+ /** True when a newer write on the same cell had already replaced this one. */
12406
+ superseded: boolean;
12407
+ }
12408
+
12409
+ /** `cell:reverted`: a pending cell edit was refused and rolled back. */
12410
+ export interface CellRevertedEvent extends GridEvent {
12411
+ /** The row the cell belongs to. */
12412
+ row: Row;
12413
+ /** That row's key. */
12414
+ key: string;
12415
+ /** The column id that was written. */
12416
+ colId: string;
12417
+ /** The value the server refused. */
12418
+ rejected: unknown;
12419
+ /** The value put back, or `undefined` when a newer write owns the cell. */
12420
+ restored: unknown;
12421
+ /** Why it was refused, or null when the transport gave no reason. */
12422
+ reason: string | null;
12423
+ /** The id the op was tracked under. */
12424
+ id: string;
12425
+ /** True when a newer write on the same cell had already replaced this one. */
12426
+ superseded: boolean;
12427
+ /** True when the rollback was actually applied; false when it was superseded. */
12428
+ applied: boolean;
12429
+ }
12430
+
12431
+ /** `cell:conflict`: the server confirmed, but returned a row that disagrees. */
12432
+ export interface CellConflictEvent extends GridEvent {
12433
+ /** The row the cell belongs to. */
12434
+ row: Row;
12435
+ /** That row's key. */
12436
+ key: string;
12437
+ /** The column id that was written. */
12438
+ colId: string;
12439
+ /** What the server confirmed for the cell. */
12440
+ value: unknown;
12441
+ /** The row the server sent back, which the grid applied over its own. */
12442
+ serverRow: Record<string, unknown>;
12443
+ /** The id the op was tracked under. */
12444
+ id: string;
12445
+ }
12446
+
12447
+ /**
12448
+ * The pointer events a cell raises: `cell:clicked`, `cell:dblclicked`,
12449
+ * `cell:mouseover`, `cell:mouseout`, `cell:mousedown` and `cell:mouseup`.
12450
+ *
12451
+ * All six carry the cell, its value and the DOM event behind them.
12452
+ * `target` — the cell element — is carried by the hover and press pairs,
12453
+ * which exist precisely so a host does not have to find that node itself:
12454
+ * rows and cells are pooled and re-used as the grid scrolls, so a listener a
12455
+ * host bound to a cell node would fire for whichever row occupies it next.
12456
+ */
12457
+ export interface CellPointerEvent extends GridEvent {
12458
+ /** The row under the pointer. */
12459
+ row: Row;
12460
+ /** That row's key. */
12461
+ key: string;
12462
+ /** Its display index. */
12463
+ index: number;
12464
+ /** The column id under the pointer. */
12465
+ colId: string;
12466
+ /** The resolved column. */
12467
+ column: Column;
12468
+ /** The cell's value, before formatting. */
12469
+ value: unknown;
12470
+ /** The cell's text, as it is drawn. */
12471
+ text: string;
12472
+ /** The DOM event behind this one, for modifier keys and `preventDefault`. */
12473
+ event: unknown;
12474
+ /** The cell element, on the hover and press pairs; absent on click and double-click. */
12475
+ target?: unknown;
12476
+ }
12477
+
12478
+ /**
12479
+ * `cell:contextmenu`: a context menu was requested on a cell.
12480
+ *
12481
+ * Raised twice over, by two routes with different payloads: the keyboard's
12482
+ * menu key goes through the grid's action table and carries `rowIndex` and
12483
+ * `colId`; the pointer goes through the renderer and carries the full cell
12484
+ * with the pointer position. A handler that wants the position must read it
12485
+ * defensively (F-1688-E).
12486
+ */
12487
+ export interface CellContextMenuEvent extends GridEvent {
12488
+ /** The row the menu was requested on. */
12489
+ row: Row;
12490
+ /** That row's key; absent on the keyboard route. */
12491
+ key?: string;
12492
+ /** Its display index; absent on the keyboard route. */
12493
+ index?: number;
12494
+ /** Its display index, on the keyboard route. */
12495
+ rowIndex?: number;
12496
+ /** The column id the menu was requested on. */
12497
+ colId: string;
12498
+ /** The resolved column; absent on the keyboard route. */
12499
+ column?: Column;
12500
+ /** The cell's value; absent on the keyboard route. */
12501
+ value?: unknown;
12502
+ /** The pointer's viewport x, on the pointer route. */
12503
+ x?: number;
12504
+ /** The pointer's viewport y, on the pointer route. */
12505
+ y?: number;
12506
+ /** The DOM event behind this one, on the pointer route. */
12507
+ event?: unknown;
12508
+ }
12509
+
12510
+ /** `cell:edit:start` and `row:edit:start`: an editor opened. */
12511
+ export interface EditStartEvent extends GridEvent {
12512
+ /** The row being edited. */
12513
+ row: Row;
12514
+ /** That row's key. */
12515
+ key: string;
12516
+ /** The column the caret is in; null on a row editor with no focused column. */
12517
+ colId: string | null;
12518
+ /** The resolved column the caret is in. */
12519
+ column: Column;
12520
+ /** The key that opened the editor, when a keypress did. */
12521
+ keyName?: string;
12522
+ /** The character typed into the cell to open it, when typing did. */
12523
+ charPress?: string;
12524
+ }
12525
+
12526
+ /**
12527
+ * `cell:edit:end` and `row:edit:end`: an editor closed.
12528
+ *
12529
+ * `valid: false` means a column rule refused the commit and the editor stayed
12530
+ * the user's problem; `cancelled: true` means nothing was written, either
12531
+ * because the user pressed Escape or because a `beforeEdit` handler vetoed.
12532
+ */
12533
+ export interface EditEndEvent extends GridEvent {
12534
+ /** The row that was being edited. */
12535
+ row: Row;
12536
+ /** That row's key. */
12537
+ key: string;
12538
+ /** The column the caret was in; null on a row editor with none. */
12539
+ colId: string | null;
12540
+ /** True when the commit passed validation, false when a rule refused it. */
12541
+ valid: boolean;
12542
+ /** True when nothing was written — Escape, or a vetoed commit. */
12543
+ cancelled?: boolean;
12544
+ /** The validation failures, when `valid` is false. */
12545
+ errors?: ValidationError[];
12546
+ /** The cells that were written; empty on a cancel. */
12547
+ writes?: { key: string; colId: string; before: unknown; after: unknown }[];
12548
+ }
12549
+
12550
+ /** `row:clicked` and `row:dblclicked`: a row was clicked or double-clicked. */
12551
+ export interface RowPointerEvent extends GridEvent {
12552
+ /** The row under the pointer. */
12553
+ row: Row;
12554
+ /** That row's key. */
12555
+ key: string;
12556
+ /** Its display index. */
12557
+ index: number;
12558
+ /** The DOM event behind this one. */
12559
+ event: unknown;
12560
+ }
12561
+
12562
+ /** `row:pending`: an optimistic row append or delete was sent to the transport. */
12563
+ export interface RowPendingEvent extends GridEvent {
12564
+ /** The id the op is tracked under; `grid.edit.settleRow(id, …)` answers it. */
12565
+ id: string;
12566
+ /** Which structural write it is. */
12567
+ kind: 'append' | 'delete';
12568
+ /** The row key — a temporary one for an append until the server rekeys it. */
12569
+ key: string;
12570
+ /** True while the key is the grid's own temporary one. */
12571
+ temp: boolean;
12572
+ /** The row as it stands in the grid, or undefined when there is none. */
12573
+ row?: Row;
12574
+ }
12575
+
12576
+ /** `row:confirmed`: the server accepted a pending row append or delete. */
12577
+ export interface RowConfirmedEvent extends GridEvent {
12578
+ /** The id the op was tracked under. */
12579
+ id: string;
12580
+ /** Which structural write it was. */
12581
+ kind: 'append' | 'delete';
12582
+ /** The row key, already rekeyed from the temporary one on an append. */
12583
+ key: string;
12584
+ /** The temporary key an append was rekeyed from. */
12585
+ tempKey?: string;
12586
+ /** The row as it now stands; undefined for a confirmed delete. */
12587
+ row?: Row;
12588
+ /** True when a newer op on the same key had already replaced this one. */
12589
+ superseded: boolean;
12590
+ }
12591
+
12592
+ /** `row:reverted`: a pending row append or delete was refused and rolled back. */
12593
+ export interface RowRevertedEvent extends GridEvent {
12594
+ /** The id the op was tracked under. */
12595
+ id: string;
12596
+ /** Which structural write it was. */
12597
+ kind: 'append' | 'delete';
12598
+ /** The row key. */
12599
+ key: string;
12600
+ /** The temporary key the append had been given. */
12601
+ tempKey?: string;
12602
+ /** Why it was refused, or null when the transport gave no reason. */
12603
+ reason: string | null;
12604
+ /** True when a newer op on the same key had already replaced this one. */
12605
+ superseded: boolean;
12606
+ /** True when the rollback was applied; false when it was superseded. */
12607
+ applied: boolean;
12608
+ /** The row as it stands after the rollback, where there is one. */
12609
+ row?: Row;
12610
+ }
12611
+
12612
+ /** `row:conflict`: the server confirmed a structural write but sent back a row that disagrees. */
12613
+ export interface RowConflictEvent extends GridEvent {
12614
+ /** The id the op was tracked under. */
12615
+ id: string;
12616
+ /** Which structural write it was. */
12617
+ kind: 'append' | 'delete';
12618
+ /** The row key. */
12619
+ key: string;
12620
+ /** The row the server sent back. */
12621
+ serverRow: Record<string, unknown>;
12622
+ /** The row as the grid holds it; undefined for a delete. */
12623
+ row?: Row;
12624
+ }
12625
+
12626
+ /** `form:opened`: the row form opened over a row. */
12627
+ export interface FormOpenedEvent extends GridEvent {
12628
+ /** The key of the row the form is editing. */
12629
+ key: string;
12630
+ /** That row. */
12631
+ row: Row;
12632
+ }
12633
+
12634
+ /** `form:closed`: the row form was closed without saving. */
12635
+ export interface FormClosedEvent extends GridEvent {
12636
+ /** The key of the row the form was editing. */
12637
+ key: string;
12638
+ }
12639
+
12640
+ /** `form:saved`: the row form's values were written back to the row. */
12641
+ export interface FormSavedEvent extends GridEvent {
12642
+ /** The key of the row that was saved. */
12643
+ key: string;
12644
+ /** Every value the form held, by field name. */
12645
+ values: Record<string, unknown>;
12646
+ /** Only the values that differ from what the row held. */
12647
+ changed: Record<string, unknown>;
12648
+ /** Fields the form held that no column maps, so nothing was written for them. */
12649
+ unmapped: string[];
12650
+ }
12651
+
12652
+ /** `form:error`: the row form could not load or save a row. */
12653
+ export interface FormErrorEvent extends GridEvent {
12654
+ /** The key of the row the form was working on. */
12655
+ key: string;
12656
+ /** What went wrong. */
12657
+ error: unknown;
12658
+ /** True when the load timed out rather than being refused. */
12659
+ timedOut: boolean;
12660
+ }
12661
+
12662
+ /** `sort:changed`: the sort order changed. */
12663
+ export interface SortChangedEvent extends GridEvent {
12664
+ /** The sort now in force, in precedence order; empty when nothing is sorted. */
12665
+ sort: SortEntry[];
12666
+ }
12667
+
12668
+ /**
12669
+ * `filter:changed`: the filters changed.
12670
+ *
12671
+ * Four routes reach it — a structured condition, the quick filter, a named
12672
+ * host predicate, and the comments filter — and each fills its own fields,
12673
+ * so every one of them is optional.
12674
+ */
12675
+ export interface FilterChangedEvent extends GridEvent {
12676
+ /** The structured filter now in force, or null when it was cleared. */
12677
+ filters?: FilterSet;
12678
+ /** The quick-filter text now in force. */
12679
+ quick?: string;
12680
+ /** How the quick filter matches. */
12681
+ quickMode?: string;
12682
+ /** The named host predicates now in force. */
12683
+ where?: string[];
12684
+ /** `'where'` when a host predicate was registered, replaced, removed or re-run. */
12685
+ cause?: string;
12686
+ /** `'unresolved'` or `'any'` when the change was the comments filter. */
12687
+ comments?: string;
12688
+ }
12689
+
12690
+ /**
12691
+ * `group:toggled`: a group row was expanded or collapsed.
12692
+ *
12693
+ * One group carries `key` or `row`; "expand all" / "collapse all" carries
12694
+ * `all: true` and no target; a deep expand carries `deep: true`.
12695
+ */
12696
+ export interface GroupToggledEvent extends GridEvent {
12697
+ /** The key of the group row that was toggled. */
12698
+ key?: string;
12699
+ /** That group row, where the caller had it. */
12700
+ row?: Row;
12701
+ /** True when it is now open. */
12702
+ expanded: boolean;
12703
+ /** True when the whole branch beneath it was opened. */
12704
+ deep?: boolean;
12705
+ /** True when every group was toggled at once. */
12706
+ all?: boolean;
12707
+ }
12708
+
12709
+ /** `facet:computed`: a column's facet buckets finished computing. */
12710
+ export interface FacetComputedEvent extends GridEvent {
12711
+ /** The column the facets are for. */
12712
+ colId: string;
12713
+ /** How many buckets the distribution was cut into. */
12714
+ buckets: number;
12715
+ /** How long it took, in milliseconds. */
12716
+ ms: number;
12717
+ /** True when a worker computed it rather than the main thread. */
12718
+ worker: boolean;
12719
+ }
12720
+
12721
+ /** `facet:filtered`: a facet histogram was used to filter its column, or cleared. */
12722
+ export interface FacetFilteredEvent extends GridEvent {
12723
+ /** The column that was filtered. */
12724
+ colId: string;
12725
+ /** The condition that was installed, or null when the filter was cleared. */
12726
+ filter: FilterSet;
12727
+ /** The gesture behind it: `'click'`, `'drag'`, `'clear'`, or whatever the caller named. */
12728
+ gesture: string;
12729
+ /** The inclusive bucket range that was selected. */
12730
+ buckets?: [number, number];
12731
+ }
12732
+
12733
+ /** `facet:expanded`: a facet panel section was opened or closed. */
12734
+ export interface FacetExpandedEvent extends GridEvent {
12735
+ /** The column whose section moved. */
12736
+ colId: string;
12737
+ /** True when it is now open. */
12738
+ expanded: boolean;
12739
+ }
12740
+
12741
+ /** `facet:failed`: a column's facet buckets could not be computed. */
12742
+ export interface FacetFailedEvent extends GridEvent {
12743
+ /** The column the facets were for. */
12744
+ colId: string;
12745
+ /** What went wrong. */
12746
+ error: unknown;
12747
+ }
12748
+
12749
+ /**
12750
+ * `column:moved`: a column was moved to a different display position.
12751
+ *
12752
+ * Two routes, two spellings of the same thing: the column model names it
12753
+ * `id`, and the header drag names it `colId` (F-1688-C). Read whichever is
12754
+ * present.
12755
+ */
12756
+ export interface ColumnMovedEvent extends GridEvent {
12757
+ /** The column that moved, on the model route. */
12758
+ id?: string;
12759
+ /** The column that moved, on the header-drag route. */
12760
+ colId?: string;
12761
+ /** The display index it moved to. */
12762
+ to: number;
12763
+ }
12764
+
12765
+ /** `column:resized`: a column's width changed. Named `id` by the model and `colId` by the header drag (F-1688-C). */
12766
+ export interface ColumnResizedEvent extends GridEvent {
12767
+ /** The column that was resized, on the model route. */
12768
+ id?: string;
12769
+ /** The column that was resized, on the header-drag route. */
12770
+ colId?: string;
12771
+ /** Its new width, in pixels. */
12772
+ width: number;
12773
+ }
12774
+
12775
+ /** `column:visible`: columns were shown or hidden. */
12776
+ export interface ColumnVisibleEvent extends GridEvent {
12777
+ /** The columns whose visibility actually changed. */
12778
+ ids: string[];
12779
+ /** True when they were hidden, false when they were shown. */
12780
+ hidden: boolean;
12781
+ }
12782
+
12783
+ /** `column:pinned`: a column was pinned to a side, or unpinned. */
12784
+ export interface ColumnPinnedEvent extends GridEvent {
12785
+ /** The column that was pinned. */
12786
+ id: string;
12787
+ /**
12788
+ * Which side it is pinned to now, or null when it was unpinned. The sides are
12789
+ * the writing-direction ones {@link ColumnApi#pin} takes — `'start'` and
12790
+ * `'end'` — not left and right, so a right-to-left grid reports the same value
12791
+ * for the same gesture.
12792
+ */
12793
+ side: 'start' | 'end' | null;
12794
+ }
12795
+
12796
+ /** `column:grouped`: the row grouping changed. */
12797
+ export interface ColumnGroupedEvent extends GridEvent {
12798
+ /** The column ids the rows are grouped by, outermost first; empty when grouping was cleared. */
12799
+ columns: string[];
12800
+ }
12801
+
12802
+ /** `column:pivoted`: the pivot changed, locally or pushed down to the backend. */
12803
+ export interface ColumnPivotedEvent extends GridEvent {
12804
+ /** The column ids the rows are pivoted by, on a local pivot. */
12805
+ columns?: string[];
12806
+ /** The fields the backend was asked to pivot by, on a pushed-down pivot. */
12807
+ pivotFields?: string[];
12808
+ /** True when the backend did the pivot. */
12809
+ remote?: boolean;
12810
+ }
12811
+
12812
+ /**
12813
+ * `column:filter:open`, `column:profile:open` and `column:menu:open`: the
12814
+ * header asked for a popup to be opened over a column. The grid raises these
12815
+ * rather than opening anything itself, so a host can put its own control
12816
+ * where the built-in one would go.
12817
+ */
12818
+ export interface ColumnMenuEvent extends GridEvent {
12819
+ /** The column the popup belongs to. */
12820
+ colId: string;
12821
+ /** The header element to anchor it to, where the caller had one. */
12822
+ element?: unknown;
12823
+ }
12824
+
12825
+ /** `pivot:drill`: a pivot measure cell was drilled into. */
12826
+ export interface PivotDrillEvent extends GridEvent {
12827
+ /** The keys of the source rows behind the measure. */
12828
+ keys: string[];
12829
+ /** The row path of the cell, as the header wrote it. */
12830
+ rowPath: string | null;
12831
+ /** The column path of the cell. */
12832
+ colPath: string | null;
12833
+ /** Which measure the cell shows. */
12834
+ measure: string | null;
12835
+ /** The DOM event behind the drill. */
12836
+ event: unknown;
12837
+ }
12838
+
12839
+ /** `columns:changed`: the column set was rewritten other than by moving, resizing, hiding or pinning. */
12840
+ export interface ColumnsChangedEvent extends GridEvent {
12841
+ /** Why it was rewritten; `'inferred'` when a type-inference pass did it. */
12842
+ reason: string;
12843
+ /** The type inferred for each column, by column id. */
12844
+ types: Record<string, string>;
12845
+ }
12846
+
12847
+ /** `columns:tagged`: `grid.columns.showTagged()` chose the visible set from the columns' tags. */
12848
+ export interface ColumnsTaggedEvent extends GridEvent {
12849
+ /** The tags that were asked for. */
12850
+ tags: string[];
12851
+ /** The columns hidden because they carry none of them. */
12852
+ hidden: string[];
12853
+ }
12854
+
12855
+ /** `columngroup:changed`: a banded header group was formed, renamed, moved, dissolved, removed or restored. */
12856
+ export interface ColumnGroupChangedEvent extends GridEvent {
12857
+ /** What happened to it. */
12858
+ action: 'formed' | 'removed' | 'renamed' | 'dissolved' | 'moved' | 'applied';
12859
+ /** The band the action was on, where it has an id. */
12860
+ groupId?: string;
12861
+ /** The leaf column removed from a band, on `'removed'`. */
12862
+ id?: string;
12863
+ /** The leaves a band was formed over, on `'formed'`. */
12864
+ ids?: string[];
12865
+ /** The display position a band moved to, on `'moved'`. */
12866
+ to?: number;
12867
+ /** The band's new title, on `'renamed'`. */
12868
+ title?: string;
12869
+ /** True when removing the last leaf dissolved the band with it. */
12870
+ dissolved?: boolean;
12871
+ }
12872
+
12873
+ /** `header:contextmenu`: a context menu was requested on a column header. */
12874
+ export interface HeaderContextMenuEvent extends GridEvent {
12875
+ /** The column the menu was requested on. */
12876
+ colId: string;
12877
+ /** The resolved column. */
12878
+ column: Column;
12879
+ /** The header element, to anchor a menu to. */
12880
+ element: unknown;
12881
+ /** The pointer's viewport x. */
12882
+ x: number;
12883
+ /** The pointer's viewport y. */
12884
+ y: number;
12885
+ /** The DOM event behind this one. */
12886
+ event: unknown;
12887
+ }
12888
+
12889
+ /** `selection:changed`: the row selection changed and was accepted. */
12890
+ export interface SelectionChangedEvent extends GridEvent {
12891
+ /** The keys of every selected row. */
12892
+ keys: string[];
12893
+ /** Those rows. */
12894
+ rows: Row[];
12895
+ }
12896
+
12897
+ /** `range:changed`: the selected cell ranges changed. */
12898
+ export interface RangeChangedEvent extends GridEvent {
12899
+ /** Every range now selected. */
12900
+ ranges: CellRange[];
12901
+ }
12902
+
12903
+ /** `clipboard:copy`: a copy to the clipboard was attempted. */
12904
+ export interface ClipboardCopyEvent extends GridEvent {
12905
+ /** The text that was put on the clipboard; empty when the copy was refused. */
12906
+ text: string;
12907
+ /** Whether it reached the clipboard. */
12908
+ ok: boolean;
12909
+ /** What was copied: `'range'`, or whichever row scope the options asked for. */
12910
+ rows: string;
12911
+ /** Why a refused copy was refused — `'discontiguous'` for a non-rectangular range. */
12912
+ reason?: string;
12913
+ }
12914
+
12915
+ /** `page:changed`: the page or the page size changed. */
12916
+ export interface PageChangedEvent extends GridEvent {
12917
+ /** The page now showing, zero-based. */
12918
+ page: number;
12919
+ /** Rows per page; 0 means paging is off. */
12920
+ pageSize: number;
12921
+ /** How many rows the current query produces. */
12922
+ total: number;
12923
+ /** How many pages that makes. */
12924
+ pageCount: number;
12925
+ }
12926
+
12927
+ /**
12928
+ * `scroll` and `scroll:end`: the viewport's offset. `scroll` fires only when
12929
+ * the offset actually moved, so a refresh is never mistaken for a scroll;
12930
+ * `scroll:end` fires once the gesture has settled.
12931
+ */
12932
+ export interface ScrollEvent extends GridEvent {
12933
+ /** The vertical offset, in content space rather than spacer space, so it survives a row-count change. */
12934
+ top: number;
12935
+ /** The logical horizontal offset: zero at the content's start in either writing direction. */
12936
+ left: number;
12937
+ }
12938
+
12939
+ /** `detail:toggled`: a master-detail region was opened or closed. */
12940
+ export interface DetailToggledEvent extends GridEvent {
12941
+ /** The keys of every row with an open detail region. */
12942
+ keys: string[];
12943
+ /** The key of the region that is mounted, or null when none is. */
12944
+ active: string | null;
12945
+ }
12946
+
12947
+ /** `highlight:changed`: the set of host-declared highlights changed. */
12948
+ export interface HighlightChangedEvent extends GridEvent {
12949
+ /** Every highlight in force, with its scope, target, colour and duration. */
12950
+ highlights: { scope: string; key: string | null; colId: string | null; colour: string; duration: number }[];
12951
+ }
12952
+
12953
+ /**
12954
+ * `find:changed`: the find bar's query, open state or match count changed.
12955
+ *
12956
+ * The count here is the model's narrower one — `current`, `total` and
12957
+ * `complete`. `grid.find.count()` adds the windowed-scope fields on top; this
12958
+ * event does not carry them (F-1688-D).
12959
+ */
12960
+ export interface FindChangedEvent extends GridEvent {
12961
+ /** What is being searched for. */
12962
+ text: string;
12963
+ /** Whether the search distinguishes case. */
12964
+ caseSensitive: boolean;
12965
+ /** Whether the whole cell must match rather than contain. */
12966
+ wholeCell: boolean;
12967
+ /** The columns being searched, or null for every visible column. */
12968
+ columns: string[] | null;
12969
+ /** Whether the find bar is showing. */
12970
+ open: boolean;
12971
+ /** Which match is current, how many there are, and whether the scan finished. */
12972
+ count: { current: number; total: number; complete: boolean };
12973
+ }
12974
+
12975
+ /** `tree:loading`: a branch was expanded and `tree.loadChildren` was called for it. */
12976
+ export interface TreeLoadingEvent extends GridEvent {
12977
+ /** The branch's row key. */
12978
+ key: string;
12979
+ /** That branch row. */
12980
+ row: Row;
12981
+ }
12982
+
12983
+ /** `tree:loaded`: a branch's children arrived and were added. */
12984
+ export interface TreeLoadedEvent extends GridEvent {
12985
+ /** The branch's row key. */
12986
+ key: string;
12987
+ /** How many children arrived. */
12988
+ count: number;
12989
+ }
12990
+
12991
+ /** `tree:loadFailed`: a branch's `loadChildren` rejected; the branch stays unloaded so it can be retried. */
12992
+ export interface TreeLoadFailedEvent extends GridEvent {
12993
+ /** The branch's row key. */
12994
+ key: string;
12995
+ /** What the loader rejected with. */
12996
+ error: unknown;
12997
+ }
12998
+
12999
+ /** `tree:loadAborted`: a branch was collapsed before its children arrived, so the fetch was abandoned. */
13000
+ export interface TreeLoadAbortedEvent extends GridEvent {
13001
+ /** The branch's row key. */
13002
+ key: string;
13003
+ }
13004
+
13005
+ /** `state:reset`: `grid.state.reset()` restored the arrangement the grid was built with. */
13006
+ export interface StateResetEvent extends GridEvent {
13007
+ /** The baseline that was restored. */
13008
+ state: GridState;
13009
+ }
13010
+
13011
+ /** `history:changed`: the undo and redo stacks moved. */
13012
+ export interface HistoryChangedEvent extends GridEvent {
13013
+ /** Whether there is anything to undo. */
13014
+ canUndo: boolean;
13015
+ /** Whether there is anything to redo. */
13016
+ canRedo: boolean;
13017
+ /** The entry an undo would apply, or null. */
13018
+ undo: HistoryEntry | null;
13019
+ /** The entry a redo would apply, or null. */
13020
+ redo: HistoryEntry | null;
13021
+ }
13022
+
13023
+ /** `history:applied`: an undo or redo step was applied. */
13024
+ export interface HistoryAppliedEvent extends GridEvent {
13025
+ /** Which way the stack moved. */
13026
+ direction: 'undo' | 'redo';
13027
+ /** The entry that was applied, or null when there was nothing to apply. */
13028
+ step: HistoryEntry | null;
13029
+ }
13030
+
13031
+ /**
13032
+ * `views:changed`: the saved-view list changed, for any reason.
13033
+ *
13034
+ * Paired with a named `view:*` event that carries the one view that moved:
13035
+ * this one is what a picker or a `localStorage` mirror wants, the named one is
13036
+ * what a host persisting to a server wants.
13037
+ */
13038
+ export interface ViewsChangedEvent extends GridEvent {
13039
+ /** Every view after the change. */
13040
+ views: SavedView[];
13041
+ /** What happened: `'save'`, `'update'`, `'import'`, `'remove'`, `'rename'`, `'default'`, `'seed'`, `'replace'` or `'apply'`. */
13042
+ reason: string;
13043
+ /** The view that moved, or null when the change was not about one view. */
13044
+ view: SavedView | null;
13045
+ /** The view now applied, on the `'apply'` firing. */
13046
+ activeId?: string;
13047
+ }
13048
+
13049
+ /** `view:applied`: a saved view was applied to the grid. */
13050
+ export interface ViewAppliedEvent extends GridEvent {
13051
+ /** The view that was applied. */
13052
+ view: SavedView;
13053
+ /** Every view, unchanged by the apply. */
13054
+ views: SavedView[];
13055
+ /** The id of the view now active. */
13056
+ activeId: string;
13057
+ }
13058
+
13059
+ /**
13060
+ * `view:saved`, `view:removed`, `view:renamed` and `view:default`: the one
13061
+ * view that moved, so a host can POST that record instead of diffing two
13062
+ * full lists to work out what the user just did.
13063
+ */
13064
+ export interface ViewChangedEvent extends GridEvent {
13065
+ /** The view that moved. */
13066
+ view: SavedView | null;
13067
+ /** Every view after the change. */
13068
+ views: SavedView[];
13069
+ /** The underlying reason: `'save'`, `'update'`, `'import'`, `'remove'`, `'rename'` or `'default'`. */
13070
+ reason: string;
13071
+ }
13072
+
13073
+ /** `validation:failed`: a declared column rule refused an edit. */
13074
+ export interface ValidationFailedEvent extends GridEvent {
13075
+ /** The key of the row whose commit was refused. */
13076
+ key: string;
13077
+ /** One entry per failing cell, with its column, code and message. */
13078
+ failures: ValidationError[];
13079
+ /** How many cells failed. */
13080
+ count: number;
13081
+ }
13082
+
13083
+ /** `validation:cleared`: recorded validation errors were cleared. */
13084
+ export interface ValidationClearedEvent extends GridEvent {
13085
+ /** The row that was cleared, or null when every row was. */
13086
+ key: string | null;
13087
+ /** The column that was cleared, or null when every column was. */
13088
+ colId: string | null;
13089
+ }
13090
+
13091
+ /** `formatting:changed`: a conditional-formatting rule was added, changed, removed or replaced. */
13092
+ export interface FormattingChangedEvent extends GridEvent {
13093
+ /** What happened to it. */
13094
+ reason: string;
13095
+ /** The scope that changed: a column id, or the grid scope. */
13096
+ scope: FormattingScope;
13097
+ /** Every rule now in force, by scope. */
13098
+ rules: Record<FormattingScope, FormattingRule[]>;
13099
+ }
13100
+
13101
+ /** `redaction:changed`: the set of redacted columns changed. */
13102
+ export interface RedactionChangedEvent extends GridEvent {
13103
+ /** Every column id now redacted. */
13104
+ columns: string[];
13105
+ }
13106
+
13107
+ /** `permissions:changed`: the per-column permission levels changed. */
13108
+ export interface PermissionsChangedEvent extends GridEvent {
13109
+ /** The level now in force for each column that has one. */
13110
+ levels: Record<string, PermissionLevel>;
13111
+ }
13112
+
13113
+ /**
13114
+ * `presentation:changed`: raised by two unrelated things under one name
13115
+ * (F-1688-A). The renderer raises it with `presentation` when the responsive
13116
+ * layout switches between the table and the card view; the presentation model
13117
+ * raises it with the deck's settings when `start()` is called again on an
13118
+ * already-running presentation. A handler has to check which fields arrived.
13119
+ */
13120
+ export interface PresentationChangedEvent extends GridEvent {
13121
+ /** `'cards'` or `'table'`, on the responsive-layout firing. */
13122
+ presentation?: 'cards' | 'table';
13123
+ /** The enlargement now in force, on the presentation-model firing. */
13124
+ scale?: number;
13125
+ /** The options the presentation is running with. */
13126
+ options?: Record<string, unknown>;
13127
+ /** The view ids in the deck. */
13128
+ views?: string[];
13129
+ /** Which of them is showing, or -1 when the deck is empty. */
13130
+ index?: number;
13131
+ }
13132
+
13133
+ /** `presentation:started`: `grid.presentation.start()` began presenting. */
13134
+ export interface PresentationStartedEvent extends GridEvent {
13135
+ /** The enlargement it started at. */
13136
+ scale: number;
13137
+ /** The options it was started with. */
13138
+ options: Record<string, unknown>;
13139
+ /** The view ids in the deck; empty when it is presenting the grid as it stands. */
13140
+ views: string[];
13141
+ /** Which view is showing, or -1 when there is no deck. */
13142
+ index: number;
13143
+ }
13144
+
13145
+ /** `presentation:view`: the presentation stepped to a view, including the first. */
13146
+ export interface PresentationViewEvent extends GridEvent {
13147
+ /** The view now showing, or null when the deck is empty. */
13148
+ viewId: string | null;
13149
+ /** Its position in the deck. */
13150
+ index: number;
13151
+ /** How many views the deck holds. */
13152
+ count: number;
13153
+ }
13154
+
13155
+ /** `presentation:scale`: the presentation's enlargement changed. */
13156
+ export interface PresentationScaleEvent extends GridEvent {
13157
+ /** The enlargement now in force, already clamped to the allowed range. */
13158
+ scale: number;
13159
+ }
13160
+
13161
+ /** `presentation:spotlight`: the spotlight was armed over some rows and columns, or cleared. */
13162
+ export interface PresentationSpotlightEvent extends GridEvent {
13163
+ /** What is lit, or null when the spotlight was cleared. */
13164
+ spotlight: { keys: string[]; colIds: string[] } | null;
13165
+ }
13166
+
13167
+ /** `presentation:captured`: a screenshot of the grid was taken. */
13168
+ export interface PresentationCapturedEvent extends GridEvent {
13169
+ /** The image's width in pixels. */
13170
+ width: number;
13171
+ /** Its height in pixels. */
13172
+ height: number;
13173
+ /** Its size in bytes. */
13174
+ bytes: number;
13175
+ /** Its MIME type. */
13176
+ mimeType: string;
13177
+ /** The file name it was downloaded under, or null when it was not downloaded. */
13178
+ fileName: string | null;
13179
+ }
13180
+
13181
+ /** `comment:added`: a comment was added to a cell, or a reply added to a thread. */
13182
+ export interface CommentAddedEvent extends GridEvent {
13183
+ /** The cell the comment is on, as the provider keys it. */
13184
+ cellKey: string;
13185
+ /** The stored comment's id, where the provider returned one. */
13186
+ commentId?: string;
13187
+ /** The comment this one replies to, or null when it starts a thread. */
13188
+ parentId: string | null;
13189
+ }
13190
+
13191
+ /** `comment:edited` and `comment:deleted`: one comment changed. */
13192
+ export interface CommentEvent extends GridEvent {
13193
+ /** The cell the comment is on. */
13194
+ cellKey: string;
13195
+ /** The comment that changed. */
13196
+ commentId: string;
13197
+ }
13198
+
13199
+ /** `comment:resolved` and `comment:unresolved`: a thread was marked resolved or reopened. */
13200
+ export interface CommentResolvedEvent extends GridEvent {
13201
+ /** The cell whose thread changed. */
13202
+ cellKey: string;
13203
+ }
13204
+
13205
+ /** `comment:threadOpened`: a cell's comment thread was opened. */
13206
+ export interface CommentThreadOpenedEvent extends GridEvent {
13207
+ /** The cell whose thread was opened. */
13208
+ cellKey: string;
13209
+ /** The row it sits on. */
13210
+ rowId: string;
13211
+ /** The column it sits on. */
13212
+ field: string;
13213
+ /** The cell's value, so a thread header can quote what is being discussed. */
13214
+ value: unknown;
13215
+ }
13216
+
13217
+ /** `comment:threadClosed`: a cell's comment thread was closed. */
13218
+ export interface CommentThreadClosedEvent extends GridEvent {
13219
+ /** The cell whose thread was closed. */
13220
+ cellKey: string;
13221
+ /** Why it closed; `'dismissed'` when the caller gave no reason. */
13222
+ reason: string;
13223
+ }
13224
+
13225
+ /** `comment:indexLoaded`: the comment index for the visible rows finished loading. */
13226
+ export interface CommentIndexLoadedEvent extends GridEvent {
13227
+ /** How many rows the index was asked for. */
13228
+ rows: number;
13229
+ /** How many entries came back. */
13230
+ entries: number;
13231
+ /** How long it took, in milliseconds. */
13232
+ ms: number;
13233
+ }
13234
+
13235
+ /** `comment:failed`: a comment operation could not reach the backend. */
13236
+ export interface CommentFailedEvent extends GridEvent {
13237
+ /** Which provider call failed. */
13238
+ operation: 'loadIndex' | 'loadThread' | 'addComment' | 'editComment' | 'deleteComment' | 'resolveThread' | 'unresolveThread';
13239
+ /** The cell it was for, where the call named one. */
13240
+ cellKey?: string;
13241
+ /** The comment it was for, where the call named one. */
13242
+ commentId?: string;
13243
+ /** What the provider threw or rejected with. */
13244
+ error: unknown;
13245
+ }
13246
+
13247
+ /** `presence:published`: this grid published its own presence to the transport. */
13248
+ export interface PresencePublishedEvent extends GridEvent {
13249
+ /** What was published: this peer's cursor, selection and identity. */
13250
+ state: Record<string, unknown>;
13251
+ }
13252
+
13253
+ /** `presence:joined` and `presence:updated`: a peer appeared, or one already present moved. */
13254
+ export interface PresencePeerEvent extends GridEvent {
13255
+ /** The peer, as the grid now holds it. */
13256
+ peer: Peer;
13257
+ }
13258
+
13259
+ /** `presence:left`: a peer left the presence channel or timed out. */
13260
+ export interface PresenceLeftEvent extends GridEvent {
13261
+ /** The peer that left. */
13262
+ peer: Peer;
13263
+ /** Why it left — the transport's reason, or the grid's own timeout. */
13264
+ reason: string;
13265
+ }
13266
+
13267
+ /** `presence:failed`: a presence subscribe or publish could not reach the transport. */
13268
+ export interface PresenceFailedEvent extends GridEvent {
13269
+ /** Which call failed. */
13270
+ operation: 'subscribe' | 'publish';
13271
+ /** What the transport threw or rejected with. */
13272
+ error: unknown;
13273
+ }
13274
+
13275
+ /** `presence:lockRefused`: an edit was refused because a peer holds the cell's lock. */
13276
+ export interface PresenceLockRefusedEvent extends GridEvent {
13277
+ /** The row key of the locked cell. */
13278
+ key: string;
13279
+ /** Its column. */
13280
+ colId: string;
13281
+ /** The peer holding the lock. */
13282
+ peer: Peer;
13283
+ }
13284
+
13285
+ /** `diff:changed`: diff mode was turned on against a snapshot, or turned off. */
13286
+ export interface DiffChangedEvent extends GridEvent {
13287
+ /** Whether the grid is now diffing. */
13288
+ enabled: boolean;
13289
+ }
13290
+
13291
+ /** `diff:swapped`: the two sides of a diff were swapped. */
13292
+ export interface DiffSwappedEvent extends GridEvent {
13293
+ /** True when the grid is now showing the snapshot as the "after" side. */
13294
+ swapped: boolean;
13295
+ /** How many rows are on the side now being shown. */
13296
+ rows: number;
13297
+ /** How many rows are on the side it came from. */
13298
+ snapshot: number;
13299
+ }
13300
+
13301
+ /** `timeline:attached`: the scrubber began recording what each change replaces. */
13302
+ export interface TimelineAttachedEvent extends GridEvent {
13303
+ /** How many steps back it is currently possible to go. */
13304
+ depth: number;
13305
+ }
13306
+
13307
+ /** `timeline:seek`: the timeline finished moving. */
13308
+ export interface TimelineSeekEvent extends GridEvent {
13309
+ /** How many steps back from the present the grid now stands; 0 is live. */
13310
+ position: number;
13311
+ /** How many steps back it is possible to go. */
13312
+ depth: number;
13313
+ /** Whether it is standing in the present. */
13314
+ live: boolean;
13315
+ /** The timestamp of the recorded state it is standing at, or null when live. */
13316
+ at: number | null;
13317
+ }
13318
+
13319
+ /** `timeline:seeking`: the timeline is about to move. */
13320
+ export interface TimelineSeekingEvent extends GridEvent {
13321
+ /** How many steps back it is coming from. */
13322
+ from: number;
13323
+ /** How many steps back it is going to. */
13324
+ to: number;
13325
+ }
13326
+
13327
+ /** `annotation:changed`: the annotation overlay's marks or tool changed. */
13328
+ export interface AnnotationChangedEvent extends GridEvent {
13329
+ /** The tool now in use, or null when none is. */
13330
+ tool: 'pen' | 'arrow' | 'rect' | 'highlight' | null;
13331
+ /** How many marks the layer now holds. */
13332
+ count: number;
13333
+ }
13334
+
13335
+ /** `export:progress`: a streaming export wrote another chunk. */
13336
+ export interface ExportProgressEvent extends GridEvent {
13337
+ /** Rows written so far. */
13338
+ written: number;
13339
+ /** Rows expected in all. */
13340
+ total: number;
13341
+ /** Bytes written so far. */
13342
+ bytes: number;
13343
+ }
13344
+
13345
+ /** `export:request`: a remote export request is about to go to the host's `export.remote.fetch` hook. */
13346
+ export interface ExportRequestEvent extends GridEvent {
13347
+ /** The request, as the hook will receive it: the query, the columns and the format. */
13348
+ request: Record<string, unknown>;
13349
+ }
13350
+
13351
+ /** `export:done`: a remote export came back and the file was handed over. */
13352
+ export interface ExportDoneEvent extends GridEvent {
13353
+ /** The request that produced it. */
13354
+ request: Record<string, unknown>;
13355
+ /** True — this firing is the remote path's; a local export does not raise it. */
13356
+ remote: boolean;
13357
+ }
13358
+
13359
+ /** `print:before` and `print:after`: print mode was applied, and undone. */
13360
+ export interface PrintEvent extends GridEvent {
13361
+ /** How many rows the print covers. */
13362
+ rows: number;
13363
+ }
13364
+
13365
+ /**
13366
+ * `beforeEdit`: a cell or row edit is about to be committed.
13367
+ *
13368
+ * Raised only for a person's or the AI's write — origin `'user'` or `'ai'`. An
13369
+ * `'api'` write (`grid.edit.setCells` with no origin, and the paste, fill and
13370
+ * clear that funnel through it) is not gated and raises nothing, so nothing
13371
+ * that worked before the gate existed changed shape.
13372
+ */
13373
+ export interface BeforeEditEvent extends BeforeEvent {
13374
+ /** The row about to be committed. */
13375
+ row: Row;
13376
+ /** That row's key. */
13377
+ key: string;
13378
+ /** Whether it is a cell edit or a row edit. */
13379
+ mode: 'cell' | 'row';
13380
+ /** The writes that are about to be made. */
13381
+ changes: { colId: string; oldValue: unknown; newValue: unknown }[];
13382
+ }
13383
+
13384
+ /** `beforeSort`: the user asked for a sort, which has not been applied yet. */
13385
+ export interface BeforeSortEvent extends BeforeEvent {
13386
+ /** The sort that is about to be applied. */
13387
+ sort: SortEntry[];
13388
+ }
13389
+
13390
+ /**
13391
+ * `beforeFilter`: the user asked for a filter, which has not been applied yet.
13392
+ *
13393
+ * The quick filter rides the same gate as the condition tree, marked `kind:
13394
+ * 'quick'` so a handler can tell them apart; each firing carries one of
13395
+ * `filters` and `quick`, never both.
13396
+ */
13397
+ export interface BeforeFilterEvent extends BeforeEvent {
13398
+ /** The structured filter about to be applied, on a `kind: 'structured'` firing. */
13399
+ filters?: FilterSet;
13400
+ /** The quick-filter text about to be applied, on a `kind: 'quick'` firing. */
13401
+ quick?: string;
13402
+ /** Which filter this is. */
13403
+ kind: 'structured' | 'quick';
13404
+ }
13405
+
13406
+ /** `beforeSelect`: the user changed the selection, which has not been announced yet. */
13407
+ export interface BeforeSelectEvent extends BeforeEvent {
13408
+ /** The keys the user has just selected. */
13409
+ keys: string[];
13410
+ /** The keys the selection would snap back to on a veto. */
13411
+ previous: string[];
13412
+ }
13413
+
13414
+ /** `beforeColumnMove`: a column is about to be moved. */
13415
+ export interface BeforeColumnMoveEvent extends BeforeEvent {
13416
+ /** The column being moved. */
13417
+ column: string;
13418
+ /** The display index it would take. */
13419
+ to: number;
13420
+ }
13421
+
13422
+ /** `beforeColumnResize`: a column is about to be resized. */
13423
+ export interface BeforeColumnResizeEvent extends BeforeEvent {
13424
+ /** The column being resized. */
13425
+ column: string;
13426
+ /** The width it would take, in pixels. */
13427
+ width: number;
13428
+ }
13429
+
13430
+ /** `beforeColumnHide`: one or more columns are about to be hidden. */
13431
+ export interface BeforeColumnHideEvent extends BeforeEvent {
13432
+ /** The columns about to be hidden. */
13433
+ columns: string[];
13434
+ }
13435
+
13436
+ /** `beforeRowAdd`: a record is about to be appended through the pending-row path. */
13437
+ export interface BeforeRowAddEvent extends BeforeEvent {
13438
+ /** The record about to be appended. */
13439
+ row: Record<string, unknown>;
13440
+ }
13441
+
13442
+ /** `beforeDelete`: one or more rows are about to be deleted. */
13443
+ export interface BeforeDeleteEvent extends BeforeEvent {
13444
+ /** The first key about to be deleted. */
13445
+ key: string;
13446
+ /** Every key about to be deleted, on the multi-row gesture. */
13447
+ keys?: string[];
13448
+ /** Every key about to be deleted. */
13449
+ rows: string[];
13450
+ }
13451
+
13452
+ /** `beforeRowMove`: a row is about to be reordered within this grid. */
13453
+ export interface BeforeRowMoveEvent extends BeforeEvent {
13454
+ /** The key of the row being moved. */
13455
+ key: string;
13456
+ /** The display index it is at. */
13457
+ from: number;
13458
+ /** The display index it would take. */
13459
+ to: number;
13460
+ }
13461
+
13462
+ /** `beforeGroup`: a group row is about to be expanded or collapsed. */
13463
+ export interface BeforeGroupEvent extends BeforeEvent {
13464
+ /** The key of the group row. */
13465
+ key: string;
13466
+ /** True when it is being opened, false when it is being closed. */
13467
+ expanded: boolean;
13468
+ }
13469
+
13470
+ /** `edit:cancelled`: a `beforeEdit` handler vetoed the commit, or it went stale. */
13471
+ export interface EditCancelledEvent extends GridEvent {
13472
+ /** The row whose commit was abandoned. */
13473
+ row: Row;
13474
+ /** That row's key. */
13475
+ key: string;
13476
+ /** Whether it was a cell edit or a row edit. */
13477
+ mode: 'cell' | 'row';
13478
+ /** The writes that would have been made. */
13479
+ changes: { colId: string; oldValue: unknown; newValue: unknown }[];
13480
+ /** The reason given to `preventDefault`, `'prevented'` when none was, or `'stale'`. */
13481
+ reason: string;
13482
+ }
13483
+
13484
+ /** `sort:cancelled`: a `beforeSort` handler vetoed the sort. */
13485
+ export interface SortCancelledEvent extends GridEvent {
13486
+ /** The sort that was not applied. */
13487
+ sort: SortEntry[];
13488
+ /** The reason given to `preventDefault`, or `'prevented'`. */
13489
+ reason: string;
13490
+ }
13491
+
13492
+ /** `filter:cancelled`: a `beforeFilter` handler vetoed the filter. */
13493
+ export interface FilterCancelledEvent extends GridEvent {
13494
+ /** The structured filter that was not applied, on a `kind: 'structured'` veto. */
13495
+ filters?: FilterSet;
13496
+ /** The quick-filter text that was not applied, on a `kind: 'quick'` veto. */
13497
+ quick?: string;
13498
+ /** Which filter was refused. */
13499
+ kind: 'structured' | 'quick';
13500
+ /** The reason given to `preventDefault`, or `'prevented'`. */
13501
+ reason: string;
13502
+ }
13503
+
13504
+ /** `columnMove:cancelled`: a `beforeColumnMove` handler vetoed the move. */
13505
+ export interface ColumnMoveCancelledEvent extends GridEvent {
13506
+ /** The column that was not moved. */
13507
+ column: string;
13508
+ /** The display index it would have taken. */
13509
+ to: number;
13510
+ /** The reason given to `preventDefault`, or `'prevented'`. */
13511
+ reason: string;
13512
+ }
13513
+
13514
+ /** `columnResize:cancelled`: a `beforeColumnResize` handler vetoed the resize. */
13515
+ export interface ColumnResizeCancelledEvent extends GridEvent {
13516
+ /** The column that was not resized. */
13517
+ column: string;
13518
+ /** The width it would have taken, in pixels. */
13519
+ width: number;
13520
+ /** The reason given to `preventDefault`, or `'prevented'`. */
13521
+ reason: string;
13522
+ }
13523
+
13524
+ /** `columnHide:cancelled`: a `beforeColumnHide` handler vetoed the hide. */
13525
+ export interface ColumnHideCancelledEvent extends GridEvent {
13526
+ /** The columns that were not hidden. */
13527
+ columns: string[];
13528
+ /** The reason given to `preventDefault`, or `'prevented'`. */
13529
+ reason: string;
13530
+ }
13531
+
13532
+ /** `selection:cancelled`: a `beforeSelect` handler vetoed the change, which has been snapped back. */
13533
+ export interface SelectionCancelledEvent extends GridEvent {
13534
+ /** The keys the user had selected, which are no longer selected. */
13535
+ keys: string[];
13536
+ /** The keys the selection was snapped back to. */
13537
+ previous: string[];
13538
+ /** The reason given to `preventDefault`, or `'prevented'`. */
13539
+ reason: string;
13540
+ }
13541
+
13542
+ /** `rowAdd:cancelled`: a `beforeRowAdd` handler vetoed the append. */
13543
+ export interface RowAddCancelledEvent extends GridEvent {
13544
+ /** The record that was not appended. */
13545
+ row: Record<string, unknown>;
13546
+ /** The reason given to `preventDefault`, or `'prevented'`. */
13547
+ reason: string;
13548
+ }
13549
+
13550
+ /** `delete:cancelled`: a `beforeDelete` handler vetoed the delete, or the rows were gone by the time it settled. */
13551
+ export interface DeleteCancelledEvent extends GridEvent {
13552
+ /** The first key that was not deleted. */
13553
+ key: string;
13554
+ /** Every key that was not deleted, on the multi-row gesture. */
13555
+ keys?: string[];
13556
+ /** Every key that was not deleted. */
13557
+ rows: string[];
13558
+ /** The reason given to `preventDefault`, `'prevented'` when none was, or `'stale'`. */
13559
+ reason: string;
13560
+ }
13561
+
13562
+ /** `rowMove:cancelled`: a `beforeRowMove` handler vetoed the reorder. */
13563
+ export interface RowMoveCancelledEvent extends GridEvent {
13564
+ /** The key of the row that did not move. */
13565
+ key: string;
13566
+ /** The display index it is still at. */
13567
+ from: number;
13568
+ /** The display index it would have taken. */
13569
+ to: number;
13570
+ /** The reason given to `preventDefault`, `'prevented'`, or `'unchanged'` when the move was a no-op. */
13571
+ reason: string;
13572
+ }
13573
+
13574
+ /** `group:cancelled`: a `beforeGroup` handler vetoed the expand or collapse. */
13575
+ export interface GroupCancelledEvent extends GridEvent {
13576
+ /** The key of the group row that did not move. */
13577
+ key: string;
13578
+ /** Whether it was being opened (true) or closed (false). */
13579
+ expanded: boolean;
13580
+ /** The reason given to `preventDefault`, or `'prevented'`. */
13581
+ reason: string;
13582
+ }
13583
+
13584
+
13585
+ /**
13586
+ * What a handler receives, per event.
13587
+ *
13588
+ * `on()` is declared as `on(event: EventName, handler: EventHandler)`, so the
13589
+ * declarations named every event and typed none of their payloads. The
13590
+ * published reference could list the names and nothing else, which is half an
13591
+ * event reference: a reader still has to run the grid to find out what arrives.
13592
+ *
13593
+ * This map is the other half. It is populated from the payload interfaces that
13594
+ * already exist and from the comments in {@link EventName} that name them — an
13595
+ * event with no entry here publishes `unknown` in the reference and is counted
13596
+ * by the undescribed-member ratchet in `tools/check.js`, so the gaps are
13597
+ * visible and shrink rather than being papered over with a generic type. Every
13598
+ * payload extends {@link GridEvent}; an entry says which specialisation.
13599
+ *
13600
+ * An entry of `void` means the event carries nothing of its own: the bus
13601
+ * still hands the handler the {@link GridEvent} envelope — `type`, `origin`
13602
+ * and `grid` — and the reference prints "no payload" rather than a type.
13603
+ */
13604
+ export interface EventPayloads {
13605
+ /** Nothing: the grid being ready is the whole message. */
13606
+ ready: void;
13607
+ /** Nothing: the grid is still readable from the handler, and that is the point. */
13608
+ destroy: void;
13609
+ /** Nothing: the first frame's window is reported by `render:done`, which follows it. */
13610
+ 'render:first': void;
13611
+ /** The window that was drawn and the milliseconds each phase took. */
13612
+ 'render:done': RenderDoneEvent;
13613
+ /** The key (or keys) that were written, with their old values. */
13614
+ 'config:changed': ConfigChangedEvent;
13615
+ /** The verdict and what this deployment is now treated as. */
13616
+ 'licence:changed': LicenceChangedEvent;
13617
+ /** Why the model was rebuilt, and whatever that reason has to say. */
13618
+ 'model:changed': ModelChangedEvent;
13619
+ /** Which rows moved — records when `identified`, counts on a companion firing. */
13620
+ 'rows:changed': RowsChangedEvent;
13621
+ /** How much is waiting on the batch queue. */
13622
+ 'rows:queued': RowsQueuedEvent;
13623
+ /** How much a flush carried into the next frame, and the budget it ran out of. */
13624
+ 'rows:deferred': RowsDeferredEvent;
13625
+ /** The whole feed counter set, as `grid.changes.stats()` returns it. */
13626
+ 'rows:paused': RowsFlowEvent;
13627
+ /** The whole feed counter set, as `grid.changes.stats()` returns it. */
13628
+ 'rows:resumed': RowsFlowEvent;
13629
+ /** The row that arrived, where it landed, and anything the insert refused. */
13630
+ 'row:received': RowReceivedEvent;
13631
+ /** The row that left and whether it was moved or copied. */
13632
+ 'row:sent': RowTransferEvent;
13633
+ /** The row that was copied out and left here as well. */
13634
+ 'row:copied': RowTransferEvent;
13635
+ /** The row that was reordered, and the indices it moved between. */
13636
+ 'row:moved': RowMovedEvent;
13637
+ /** What the source threw, and what it was fetching. */
13638
+ 'source:error': SourceErrorEvent;
13639
+ /** How much of the stream has arrived and how much is expected. */
13640
+ 'stream:chunk': StreamChunkEvent;
13641
+ /** The final row count and whether the stream promoted to memory. */
13642
+ 'stream:end': StreamEndEvent;
13643
+ /** How many rows the window dropped, and how many are still live. */
13644
+ 'stream:evicted': StreamEvictedEvent;
13645
+ /** The row-drag gesture; all four carry the same payload. */
13646
+ 'rowDrag:started': RowDragEvent;
13647
+ /** The row being dragged, the grid under the pointer, and where it would land. */
13648
+ 'rowDrag:moved': RowDragEvent;
13649
+ /** The grid the pointer has just left, with no candidate index to report. */
13650
+ 'rowDrag:left': RowDragEvent;
13651
+ /** Where the drag ended and whether the release is being acted on. */
13652
+ 'rowDrag:ended': RowDragEvent;
13653
+ /** The cell that was written, with its old and new values. */
13654
+ 'cell:changed': CellChangedEvent;
13655
+ /** The cell that was sent, the value held in reserve, and the op id. */
13656
+ 'cell:pending': CellPendingEvent;
13657
+ /** What the server confirmed, which need not be what was sent. */
13658
+ 'cell:confirmed': CellConfirmedEvent;
13659
+ /** The value that was refused, the value put back, and why. */
13660
+ 'cell:reverted': CellRevertedEvent;
13661
+ /** The row the server sent back, which disagrees with what the grid holds. */
13662
+ 'cell:conflict': CellConflictEvent;
13663
+ /** The cell that was clicked, with its value and the DOM event. */
13664
+ 'cell:clicked': CellPointerEvent;
13665
+ /** The cell that was double-clicked, with its value and the DOM event. */
13666
+ 'cell:dblclicked': CellPointerEvent;
13667
+ /** The cell the menu was requested on; the two routes fill different fields (F-1688-E). */
13668
+ 'cell:contextmenu': CellContextMenuEvent;
13669
+ /** The cell entered, plus its element as `target`. */
13670
+ 'cell:mouseover': CellPointerEvent;
13671
+ /** The cell left, plus its element as `target`. */
13672
+ 'cell:mouseout': CellPointerEvent;
13673
+ /** The cell pressed, plus its element as `target`. */
13674
+ 'cell:mousedown': CellPointerEvent;
13675
+ /** The cell released over, plus its element as `target`. */
13676
+ 'cell:mouseup': CellPointerEvent;
13677
+ /** The cell being edited, and the keypress that opened the editor. */
13678
+ 'cell:edit:start': EditStartEvent;
13679
+ /** Whether the commit was valid, whether it was cancelled, and what was written. */
13680
+ 'cell:edit:end': EditEndEvent;
13681
+ /** The row being edited, and the keypress that opened the editor. */
13682
+ 'row:edit:start': EditStartEvent;
13683
+ /** Whether the commit was valid, whether it was cancelled, and what was written. */
13684
+ 'row:edit:end': EditEndEvent;
13685
+ /** The row that was clicked and the DOM event. */
13686
+ 'row:clicked': RowPointerEvent;
13687
+ /** The row that was double-clicked and the DOM event. */
13688
+ 'row:dblclicked': RowPointerEvent;
13689
+ /** Which structural write was sent, under which id and key. */
13690
+ 'row:pending': RowPendingEvent;
13691
+ /** The confirmed write, already rekeyed when it was an append. */
13692
+ 'row:confirmed': RowConfirmedEvent;
13693
+ /** The refused write, why, and whether the rollback was applied. */
13694
+ 'row:reverted': RowRevertedEvent;
13695
+ /** The row the server sent back, which disagrees with what the grid holds. */
13696
+ 'row:conflict': RowConflictEvent;
13697
+ /** The row the form is editing. */
13698
+ 'form:opened': FormOpenedEvent;
13699
+ /** The row the form was editing. */
13700
+ 'form:closed': FormClosedEvent;
13701
+ /** Every value the form held, which of them changed, and which mapped to no column. */
13702
+ 'form:saved': FormSavedEvent;
13703
+ /** What went wrong, and whether it was a timeout rather than a refusal. */
13704
+ 'form:error': FormErrorEvent;
13705
+ /** The sort now in force, in precedence order. */
13706
+ 'sort:changed': SortChangedEvent;
13707
+ /** Whichever of the four filter routes changed, and to what. */
13708
+ 'filter:changed': FilterChangedEvent;
13709
+ /** Which group moved, whether it is now open, and whether it was a deep or an all-groups toggle. */
13710
+ 'group:toggled': GroupToggledEvent;
13711
+ /** How many buckets, how long it took, and whether a worker did it. */
13712
+ 'facet:computed': FacetComputedEvent;
13713
+ /** The condition the facet installed, or null when it was cleared. */
13714
+ 'facet:filtered': FacetFilteredEvent;
13715
+ /** The facet section that opened or closed. */
13716
+ 'facet:expanded': FacetExpandedEvent;
13717
+ /** The column the facets were for, and what went wrong. */
13718
+ 'facet:failed': FacetFailedEvent;
13719
+ /** The column that moved and where to; spelled `id` or `colId` by route (F-1688-C). */
13720
+ 'column:moved': ColumnMovedEvent;
13721
+ /** The column that was resized and its new width. */
13722
+ 'column:resized': ColumnResizedEvent;
13723
+ /** The columns whose visibility changed, and which way. */
13724
+ 'column:visible': ColumnVisibleEvent;
13725
+ /** The column and the side it is pinned to now, or null. */
13726
+ 'column:pinned': ColumnPinnedEvent;
13727
+ /** The columns the rows are grouped by now. */
13728
+ 'column:grouped': ColumnGroupedEvent;
13729
+ /** The columns the rows are pivoted by now, locally or on the backend. */
13730
+ 'column:pivoted': ColumnPivotedEvent;
13731
+ /** The column whose filter popup should open, and the element to anchor it to. */
13732
+ 'column:filter:open': ColumnMenuEvent;
13733
+ /** The column whose profile should open. */
13734
+ 'column:profile:open': ColumnMenuEvent;
13735
+ /** The column whose menu should open, and the element to anchor it to. */
13736
+ 'column:menu:open': ColumnMenuEvent;
13737
+ /** The source rows behind the measure, and the paths that identify the cell. */
13738
+ 'pivot:drill': PivotDrillEvent;
13739
+ /** Why the column set was rewritten, and what was inferred. */
13740
+ 'columns:changed': ColumnsChangedEvent;
13741
+ /** The tags that were asked for and the columns hidden for carrying none. */
13742
+ 'columns:tagged': ColumnsTaggedEvent;
13743
+ /** What happened to the band, and to which one. */
13744
+ 'columngroup:changed': ColumnGroupChangedEvent;
13745
+ /** The header the menu was requested on, and where the pointer was. */
13746
+ 'header:contextmenu': HeaderContextMenuEvent;
13747
+ /** The keys and rows now selected. */
13748
+ 'selection:changed': SelectionChangedEvent;
13749
+ /** Every cell range now selected. */
13750
+ 'range:changed': RangeChangedEvent;
13751
+ /** The text, whether it reached the clipboard, and why not when it did not. */
13752
+ 'clipboard:copy': ClipboardCopyEvent;
13753
+ /** The page, the page size, and how many pages the data makes. */
13754
+ 'page:changed': PageChangedEvent;
13755
+ /** The viewport's new offset. */
13756
+ scroll: ScrollEvent;
13757
+ /** The viewport's offset once the gesture settled. */
13758
+ 'scroll:end': ScrollEvent;
13759
+ /** Nothing: the new size is read off the element, which the handler already has. */
13760
+ 'size:changed': void;
13761
+ /** Which detail regions are open, and which one is mounted. */
13762
+ 'detail:toggled': DetailToggledEvent;
13763
+ /** Nothing: it is a request to move focus, not a report about state. */
13764
+ 'toolpanel:focus': void;
13765
+ /** Every highlight now in force. */
13766
+ 'highlight:changed': HighlightChangedEvent;
13767
+ /** The query, whether the bar is open, and the match count. */
13768
+ 'find:changed': FindChangedEvent;
13769
+ /** The branch whose children are being fetched. */
13770
+ 'tree:loading': TreeLoadingEvent;
13771
+ /** The branch and how many children arrived. */
13772
+ 'tree:loaded': TreeLoadedEvent;
13773
+ /** The branch and what the loader rejected with. */
13774
+ 'tree:loadFailed': TreeLoadFailedEvent;
13775
+ /** The branch whose fetch was abandoned. */
13776
+ 'tree:loadAborted': TreeLoadAbortedEvent;
13777
+ /** One event per logical state change. */
13778
+ 'state:changed': StateChangedEvent;
13779
+ /** The baseline that was restored. */
13780
+ 'state:reset': StateResetEvent;
13781
+ /** What can now be undone and redone. */
13782
+ 'history:changed': HistoryChangedEvent;
13783
+ /** Which way the stack moved, and the entry that was applied. */
13784
+ 'history:applied': HistoryAppliedEvent;
13785
+ /** Every view after the change, and which one moved. */
13786
+ 'views:changed': ViewsChangedEvent;
13787
+ /** The view that was applied, and the id now active. */
13788
+ 'view:applied': ViewAppliedEvent;
13789
+ /** The one view that was created, updated or imported. */
13790
+ 'view:saved': ViewChangedEvent;
13791
+ /** The one view that was deleted. */
13792
+ 'view:removed': ViewChangedEvent;
13793
+ /** The one view that was renamed. */
13794
+ 'view:renamed': ViewChangedEvent;
13795
+ /** The one view that was made the default. */
13796
+ 'view:default': ViewChangedEvent;
13797
+ /** Every cell a column rule refused, with its code and message. */
13798
+ 'validation:failed': ValidationFailedEvent;
13799
+ /** The row and column that were cleared, or null for all of them. */
13800
+ 'validation:cleared': ValidationClearedEvent;
13801
+ /** What changed, in which scope, and every rule now in force. */
13802
+ 'formatting:changed': FormattingChangedEvent;
13803
+ /** Every column id now redacted. */
13804
+ 'redaction:changed': RedactionChangedEvent;
13805
+ /** The permission level now in force for each column that has one. */
13806
+ 'permissions:changed': PermissionsChangedEvent;
13807
+ /** Either the responsive layout's new presentation, or the deck's settings (F-1688-A). */
13808
+ 'presentation:changed': PresentationChangedEvent;
13809
+ /** The scale, options and deck the presentation started with. */
13810
+ 'presentation:started': PresentationStartedEvent;
13811
+ /** Nothing: the presentation is over and there is no state left to report. */
13812
+ 'presentation:ended': void;
13813
+ /** The view now showing and its position in the deck. */
13814
+ 'presentation:view': PresentationViewEvent;
13815
+ /** The enlargement now in force. */
13816
+ 'presentation:scale': PresentationScaleEvent;
13817
+ /** What is lit, or null when the spotlight was cleared. */
13818
+ 'presentation:spotlight': PresentationSpotlightEvent;
13819
+ /** The captured image's size, type and file name. */
13820
+ 'presentation:captured': PresentationCapturedEvent;
13821
+ /** The cell, the stored comment, and the thread it replies to. */
13822
+ 'comment:added': CommentAddedEvent;
13823
+ /** The comment whose text changed. */
13824
+ 'comment:edited': CommentEvent;
13825
+ /** The comment that was deleted. */
13826
+ 'comment:deleted': CommentEvent;
13827
+ /** Which provider call failed, on what, and with what. */
13828
+ 'comment:failed': CommentFailedEvent;
13829
+ /** The cell whose thread was marked resolved. */
13830
+ 'comment:resolved': CommentResolvedEvent;
13831
+ /** The cell whose thread was reopened. */
13832
+ 'comment:unresolved': CommentResolvedEvent;
13833
+ /** The cell whose thread was opened, and the value being discussed. */
13834
+ 'comment:threadOpened': CommentThreadOpenedEvent;
13835
+ /** The cell whose thread was closed, and why. */
13836
+ 'comment:threadClosed': CommentThreadClosedEvent;
13837
+ /** How many rows were indexed, how many entries came back, and how long it took. */
13838
+ 'comment:indexLoaded': CommentIndexLoadedEvent;
13839
+ /** This grid's own presence, as it was published. */
13840
+ 'presence:published': PresencePublishedEvent;
13841
+ /** The peer that appeared. */
13842
+ 'presence:joined': PresencePeerEvent;
13843
+ /** The peer that moved or changed what it is doing. */
13844
+ 'presence:updated': PresencePeerEvent;
13845
+ /** The peer that left, and why. */
13846
+ 'presence:left': PresenceLeftEvent;
13847
+ /** Which presence call failed, and with what. */
13848
+ 'presence:failed': PresenceFailedEvent;
13849
+ /** The locked cell and the peer holding it. */
13850
+ 'presence:lockRefused': PresenceLockRefusedEvent;
13851
+ /** Whether the grid is now diffing. */
13852
+ 'diff:changed': DiffChangedEvent;
13853
+ /** Which way round the diff now is, and how many rows are on each side. */
13854
+ 'diff:swapped': DiffSwappedEvent;
13855
+ /** How far back the recorded window now reaches. */
13856
+ 'timeline:attached': TimelineAttachedEvent;
13857
+ /** Nothing: the grid is back in the present and nothing is recorded. */
13858
+ 'timeline:detached': void;
13859
+ /** Where the grid now stands, and whether that is live. */
13860
+ 'timeline:seek': TimelineSeekEvent;
13861
+ /** Where the move is coming from and going to. */
13862
+ 'timeline:seeking': TimelineSeekingEvent;
13863
+ /** The tool in use and how many marks the layer holds. */
13864
+ 'annotation:changed': AnnotationChangedEvent;
13865
+ /** Rows written, rows expected, bytes so far. */
13866
+ 'export:progress': ExportProgressEvent;
13867
+ /** The request about to go to the host's export hook. */
13868
+ 'export:request': ExportRequestEvent;
13869
+ /** The request that produced the file that came back. */
13870
+ 'export:done': ExportDoneEvent;
13871
+ /** Nothing: the overlay is open and there is nothing else to say about it. */
13872
+ 'shortcuts:opened': void;
13873
+ /** Nothing: the overlay is closed and focus has gone back where it was. */
13874
+ 'shortcuts:closed': void;
13875
+ /** How many rows the print covers. */
13876
+ 'print:before': PrintEvent;
13877
+ /** How many rows the print covered. */
13878
+ 'print:after': PrintEvent;
13879
+ /** The row, the mode and the writes about to be committed, with `preventDefault` to stop them. */
13880
+ beforeEdit: BeforeEditEvent;
13881
+ /** The sort about to be applied, with `preventDefault` to stop it. */
13882
+ beforeSort: BeforeSortEvent;
13883
+ /** The filter about to be applied, with `preventDefault` to stop it. */
13884
+ beforeFilter: BeforeFilterEvent;
13885
+ /** The column move about to be applied, with `preventDefault` to stop it. */
13886
+ beforeColumnMove: BeforeColumnMoveEvent;
13887
+ /** The column resize about to be applied, with `preventDefault` to stop it. */
13888
+ beforeColumnResize: BeforeColumnResizeEvent;
13889
+ /** The column hide about to be applied, with `preventDefault` to stop it. */
13890
+ beforeColumnHide: BeforeColumnHideEvent;
13891
+ /** The selection about to be announced, with `preventDefault` to snap it back. */
13892
+ beforeSelect: BeforeSelectEvent;
13893
+ /** The row append about to be sent, with `preventDefault` to stop it. */
13894
+ beforeRowAdd: BeforeRowAddEvent;
13895
+ /** The row delete about to be applied, with `preventDefault` to stop it. */
13896
+ beforeDelete: BeforeDeleteEvent;
13897
+ /** The row reorder about to be applied, with `preventDefault` to stop it. */
13898
+ beforeRowMove: BeforeRowMoveEvent;
13899
+ /** The group toggle about to be applied, with `preventDefault` to stop it. */
13900
+ beforeGroup: BeforeGroupEvent;
13901
+ /** A row dropped in from another grid, on the receiving grid. */
13902
+ beforeRowReceive: BeforeRowReceiveEvent;
13903
+ /** The commit that was abandoned, and why. */
13904
+ 'edit:cancelled': EditCancelledEvent;
13905
+ /** The sort that was not applied, and why. */
13906
+ 'sort:cancelled': SortCancelledEvent;
13907
+ /** The filter that was not applied, and why. */
13908
+ 'filter:cancelled': FilterCancelledEvent;
13909
+ /** The column move that was not applied, and why. */
13910
+ 'columnMove:cancelled': ColumnMoveCancelledEvent;
13911
+ /** The column resize that was not applied, and why. */
13912
+ 'columnResize:cancelled': ColumnResizeCancelledEvent;
13913
+ /** The column hide that was not applied, and why. */
13914
+ 'columnHide:cancelled': ColumnHideCancelledEvent;
13915
+ /** The selection that was snapped back, and why. */
13916
+ 'selection:cancelled': SelectionCancelledEvent;
13917
+ /** The append that was not sent, and why. */
13918
+ 'rowAdd:cancelled': RowAddCancelledEvent;
13919
+ /** The delete that was not applied, and why. */
13920
+ 'delete:cancelled': DeleteCancelledEvent;
13921
+ /** The reorder that was not applied, and why. */
13922
+ 'rowMove:cancelled': RowMoveCancelledEvent;
13923
+ /** The group toggle that was not applied, and why. */
13924
+ 'group:cancelled': GroupCancelledEvent;
13925
+ /** That veto's notification, with the reason. */
13926
+ 'rowReceive:cancelled': RowReceiveCancelledEvent;
13927
+ /** Whichever past-tense event fired; the wildcard is never given a before-event. */
13928
+ '*': GridEvent;
11437
13929
  }