@ox0/data-grid 0.1.21 → 0.2.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 (138) hide show
  1. package/README.md +1 -1
  2. package/dist/774.js +586 -0
  3. package/dist/components/ColumnChooser.d.ts +9 -9
  4. package/dist/components/ColumnChooser.d.ts.map +1 -1
  5. package/dist/components/ColumnResizeHandle.d.ts +25 -0
  6. package/dist/components/ColumnResizeHandle.d.ts.map +1 -0
  7. package/dist/components/DataCell.d.ts +38 -0
  8. package/dist/components/DataCell.d.ts.map +1 -0
  9. package/dist/components/DataGrid.aggregate.test.d.ts +2 -0
  10. package/dist/components/DataGrid.aggregate.test.d.ts.map +1 -0
  11. package/dist/components/DataGrid.d.ts +6 -3
  12. package/dist/components/DataGrid.d.ts.map +1 -1
  13. package/dist/components/DataGrid.export.test.d.ts +2 -0
  14. package/dist/components/DataGrid.export.test.d.ts.map +1 -0
  15. package/dist/components/DataGrid.group.test.d.ts +2 -0
  16. package/dist/components/DataGrid.group.test.d.ts.map +1 -0
  17. package/dist/components/DataGrid.keyboard.test.d.ts +2 -0
  18. package/dist/components/DataGrid.keyboard.test.d.ts.map +1 -0
  19. package/dist/components/DataGrid.midnight.test.d.ts +2 -0
  20. package/dist/components/DataGrid.midnight.test.d.ts.map +1 -0
  21. package/dist/components/DataGrid.select.test.d.ts +2 -0
  22. package/dist/components/DataGrid.select.test.d.ts.map +1 -0
  23. package/dist/components/DataGrid.server.test.d.ts +2 -0
  24. package/dist/components/DataGrid.server.test.d.ts.map +1 -0
  25. package/dist/components/DataGrid.views.test.d.ts +2 -0
  26. package/dist/components/DataGrid.views.test.d.ts.map +1 -0
  27. package/dist/components/ExportButton.d.ts +14 -0
  28. package/dist/components/ExportButton.d.ts.map +1 -0
  29. package/dist/components/OverflowTooltip.d.ts +15 -0
  30. package/dist/components/OverflowTooltip.d.ts.map +1 -0
  31. package/dist/components/Pager.d.ts +22 -0
  32. package/dist/components/Pager.d.ts.map +1 -0
  33. package/dist/components/ViewsMenu.d.ts +19 -0
  34. package/dist/components/ViewsMenu.d.ts.map +1 -0
  35. package/dist/components/VirtualScroller.d.ts +14 -24
  36. package/dist/components/VirtualScroller.d.ts.map +1 -1
  37. package/dist/components/auto-width.d.ts +31 -0
  38. package/dist/components/auto-width.d.ts.map +1 -0
  39. package/dist/components/auto-width.test.d.ts +2 -0
  40. package/dist/components/auto-width.test.d.ts.map +1 -0
  41. package/dist/components/column-layout.d.ts +66 -3
  42. package/dist/components/column-layout.d.ts.map +1 -1
  43. package/dist/components/format.d.ts +7 -0
  44. package/dist/components/format.d.ts.map +1 -0
  45. package/dist/components/numbers.d.ts +12 -0
  46. package/dist/components/numbers.d.ts.map +1 -0
  47. package/dist/components/numbers.test.d.ts +2 -0
  48. package/dist/components/numbers.test.d.ts.map +1 -0
  49. package/dist/hooks/create-engine.d.ts +16 -0
  50. package/dist/hooks/create-engine.d.ts.map +1 -0
  51. package/dist/hooks/create-engine.test.d.ts +2 -0
  52. package/dist/hooks/create-engine.test.d.ts.map +1 -0
  53. package/dist/hooks/midnight.d.ts +21 -0
  54. package/dist/hooks/midnight.d.ts.map +1 -0
  55. package/dist/hooks/midnight.test.d.ts +2 -0
  56. package/dist/hooks/midnight.test.d.ts.map +1 -0
  57. package/dist/hooks/stabilize.d.ts +13 -0
  58. package/dist/hooks/stabilize.d.ts.map +1 -0
  59. package/dist/hooks/stabilize.test.d.ts +2 -0
  60. package/dist/hooks/stabilize.test.d.ts.map +1 -0
  61. package/dist/hooks/use-column-reorder.d.ts +33 -0
  62. package/dist/hooks/use-column-reorder.d.ts.map +1 -0
  63. package/dist/hooks/use-grid-worker.test.d.ts +2 -0
  64. package/dist/hooks/use-grid-worker.test.d.ts.map +1 -0
  65. package/dist/hooks/use-grid.d.ts +65 -10
  66. package/dist/hooks/use-grid.d.ts.map +1 -1
  67. package/dist/hooks/use-row-reorder.d.ts +38 -0
  68. package/dist/hooks/use-row-reorder.d.ts.map +1 -0
  69. package/dist/hooks/use-row-reorder.test.d.ts +2 -0
  70. package/dist/hooks/use-row-reorder.test.d.ts.map +1 -0
  71. package/dist/hooks/use-views.d.ts +40 -0
  72. package/dist/hooks/use-views.d.ts.map +1 -0
  73. package/dist/index.d.ts +1 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +6173 -1365
  76. package/dist/ingest.d.ts +11 -0
  77. package/dist/ingest.d.ts.map +1 -1
  78. package/dist/omnibar/highlight.d.ts +19 -0
  79. package/dist/omnibar/highlight.d.ts.map +1 -0
  80. package/dist/omnibar/highlight.test.d.ts +2 -0
  81. package/dist/omnibar/highlight.test.d.ts.map +1 -0
  82. package/dist/omnibar/query-schema.d.ts +16 -0
  83. package/dist/omnibar/query-schema.d.ts.map +1 -0
  84. package/dist/rslib-runtime.js +46 -0
  85. package/dist/server/server-engine.d.ts +42 -0
  86. package/dist/server/server-engine.d.ts.map +1 -0
  87. package/dist/server/server-engine.group.test.d.ts +2 -0
  88. package/dist/server/server-engine.group.test.d.ts.map +1 -0
  89. package/dist/server/server-engine.test.d.ts +2 -0
  90. package/dist/server/server-engine.test.d.ts.map +1 -0
  91. package/dist/spawn-worker.d.ts +11 -0
  92. package/dist/spawn-worker.d.ts.map +1 -0
  93. package/dist/store/column-state.d.ts +41 -0
  94. package/dist/store/column-state.d.ts.map +1 -0
  95. package/dist/store/column-state.test.d.ts +2 -0
  96. package/dist/store/column-state.test.d.ts.map +1 -0
  97. package/dist/store/grid-store.d.ts +31 -2
  98. package/dist/store/grid-store.d.ts.map +1 -1
  99. package/dist/test-worker.d.ts +15 -0
  100. package/dist/test-worker.d.ts.map +1 -0
  101. package/dist/types.d.ts +17 -63
  102. package/dist/types.d.ts.map +1 -1
  103. package/dist/worker/aggregate.d.ts +18 -0
  104. package/dist/worker/aggregate.d.ts.map +1 -0
  105. package/dist/worker/aggregate.test.d.ts +2 -0
  106. package/dist/worker/aggregate.test.d.ts.map +1 -0
  107. package/dist/worker/dataset.d.ts +28 -2
  108. package/dist/worker/dataset.d.ts.map +1 -1
  109. package/dist/worker/dataset.test.d.ts +2 -0
  110. package/dist/worker/dataset.test.d.ts.map +1 -0
  111. package/dist/worker/engine-client.d.ts +15 -0
  112. package/dist/worker/engine-client.d.ts.map +1 -0
  113. package/dist/worker/engine.d.ts +2 -0
  114. package/dist/worker/engine.d.ts.map +1 -0
  115. package/dist/worker/engine.js +4 -0
  116. package/dist/worker/filter.d.ts +8 -4
  117. package/dist/worker/filter.d.ts.map +1 -1
  118. package/dist/worker/fraction-digits.d.ts +11 -0
  119. package/dist/worker/fraction-digits.d.ts.map +1 -0
  120. package/dist/worker/group.d.ts +45 -0
  121. package/dist/worker/group.d.ts.map +1 -0
  122. package/dist/worker/group.test.d.ts +2 -0
  123. package/dist/worker/group.test.d.ts.map +1 -0
  124. package/dist/worker/handle-message.d.ts +9 -0
  125. package/dist/worker/handle-message.d.ts.map +1 -0
  126. package/dist/worker/protocol.d.ts +121 -0
  127. package/dist/worker/protocol.d.ts.map +1 -0
  128. package/dist/worker/sort.d.ts +27 -0
  129. package/dist/worker/sort.d.ts.map +1 -1
  130. package/dist/worker/sync-engine.d.ts +4 -4
  131. package/dist/worker/sync-engine.d.ts.map +1 -1
  132. package/dist/worker/types.d.ts +91 -14
  133. package/dist/worker/types.d.ts.map +1 -1
  134. package/package.json +6 -5
  135. package/dist/worker/date.d.ts +0 -10
  136. package/dist/worker/date.d.ts.map +0 -1
  137. package/dist/worker/date.test.d.ts +0 -2
  138. package/dist/worker/date.test.d.ts.map +0 -1
@@ -1,20 +1,46 @@
1
1
  import type { FilterToken, SortEntry } from "../types";
2
+ import { type Aggregates } from "./aggregate";
2
3
  import type { IndexEntry, IngestedRow, SerializableColumnMeta } from "./types";
3
4
  export type Dataset<Row> = {
4
5
  configure(columns: readonly SerializableColumnMeta[], timeZone: string): void;
5
- ingestRows(rows: readonly IngestedRow<Row>[], replace: boolean): void;
6
+ /**
7
+ * `more`: further batches of this ingest follow — the stats (summary and group aggregates),
8
+ * which scan every row, wait for the last batch instead of re-running for each.
9
+ */
10
+ ingestRows(rows: readonly IngestedRow<Row>[], replace: boolean, more?: boolean): void;
6
11
  sort(sort: readonly SortEntry[]): void;
7
- filter(tokens: readonly FilterToken[], evalNow: string): void;
12
+ filter(tokens: readonly FilterToken[], evalNow: number): void;
13
+ reorderRow(movedId: string, beforeId: string | null): void;
14
+ /** Groups by these columns (none: ungrouped); expansion state starts over. */
15
+ groupBy(columnIds: readonly string[], defaultExpanded: boolean): void;
16
+ setGroupExpanded(groupKey: string, isExpanded: boolean): void;
17
+ /** What renders, from `start`: rows, and group headers while grouped. */
8
18
  slice(start: number, end: number): {
9
19
  start: number;
10
20
  entries: IndexEntry<Row>[];
11
21
  };
22
+ /** Rows only, in display order (collapsed groups included), for scans. */
23
+ rowSlice(start: number, end: number): IndexEntry<Row>[];
24
+ /** The ids of `rowSlice`'s rows. */
25
+ rowIds(start: number, end: number): string[];
26
+ /** Rows matching the filter. */
12
27
  readonly totalCount: number;
28
+ /** Positions that render: `totalCount` plus group headers, less collapsed groups' rows. */
29
+ readonly renderedCount: number;
30
+ /** Stats over every matching row for the columns that ask for them; undefined when none do. */
31
+ readonly aggregates: Aggregates | undefined;
32
+ /** The most fraction digits each numeric column has across every row (columns with none left out). */
33
+ readonly fractionDigits: Readonly<Record<string, number>>;
13
34
  };
14
35
  /**
15
36
  * In-memory client-mode dataset: holds the full row set and the composed sort/filter index map.
16
37
  * Row data is never reordered in memory — the sorted/filtered index arrays point into `rows`.
17
38
  * Shared by the Web Worker transport and the synchronous in-process engine.
39
+ *
40
+ * Client-mode ingest arrives in batches (docs/llm/data-grid-architecture.md "Streaming
41
+ * first-slice"), so appending is incremental: a batch computes sort keys and filter matches for
42
+ * its own rows only, then merges into the existing order. A sort change re-sorts but reuses the
43
+ * per-row match flags; a filter change re-evaluates rows but keeps the sort.
18
44
  */
19
45
  export declare function createDataset<Row>(): Dataset<Row>;
20
46
  //# sourceMappingURL=dataset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataset.d.ts","sourceRoot":"","sources":["../../src/worker/dataset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAE9E,MAAM,MAAM,OAAO,CAAC,GAAG,IAAI;IACzB,SAAS,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7E,UAAU,CAAC,IAAI,EAAE,SAAS,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACrE,IAAI,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CAAA;IACtC,MAAM,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7D,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAA;KAAE,CAAA;IAChF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAuDjD"}
1
+ {"version":3,"file":"dataset.d.ts","sourceRoot":"","sources":["../../src/worker/dataset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAWlF,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA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MAAM,CAAA;IAC9B,+FAA+F;IAC/F,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAC3C,sGAAsG;IACtG,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC1D,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAiMjD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dataset.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataset.test.d.ts","sourceRoot":"","sources":["../../src/worker/dataset.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { WorkerRequest, WorkerResponse } from "./protocol";
2
+ import type { DataEngineInterface } from "./types";
3
+ /** A request/response channel to a message handler — in process, or across a worker. */
4
+ export type EngineTransport<Row> = {
5
+ send(request: WorkerRequest<Row>): void;
6
+ dispose(): void;
7
+ };
8
+ /**
9
+ * The main-thread side of {@link DataEngineInterface}, shared by both engines: numbers requests,
10
+ * translates responses into {@link EngineEvent}s, and fans them out to subscribers. `connect`
11
+ * receives the response callback and returns the transport; the sync engine connects a message
12
+ * handler directly, the worker engine connects `postMessage`.
13
+ */
14
+ export declare function createEngineClient<Row>(kind: DataEngineInterface<Row>["kind"], connect: (onResponse: (response: WorkerResponse<Row>) => void) => EngineTransport<Row>): DataEngineInterface<Row>;
15
+ //# sourceMappingURL=engine-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-client.d.ts","sourceRoot":"","sources":["../../src/worker/engine-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAsC,MAAM,SAAS,CAAA;AAItF,wFAAwF;AACxF,MAAM,MAAM,eAAe,CAAC,GAAG,IAAI;IACjC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;IACvC,OAAO,IAAI,IAAI,CAAA;CAChB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EACpC,IAAI,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EACtC,OAAO,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,eAAe,CAAC,GAAG,CAAC,GACrF,mBAAmB,CAAC,GAAG,CAAC,CAmK1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/worker/engine.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { createMessageHandler } from "../774.js";
2
+ const scope = globalThis;
3
+ const handle = createMessageHandler((response)=>scope.postMessage(response));
4
+ scope.addEventListener("message", (event)=>handle(event.data));
@@ -1,6 +1,10 @@
1
- import type { FilterToken } from "../types";
1
+ import type { Query } from "@ox0/query";
2
2
  import type { IngestedRow, SerializableColumnMeta } from "./types";
3
- /** Evaluates one committed `FilterToken` against a row. Every token in a `FilterToken[]` ANDs together. */
4
- export declare function evaluateToken<Row extends object>(row: IngestedRow<Row>, token: FilterToken, columnsById: ReadonlyMap<string, SerializableColumnMeta>, searchableColumns: readonly SerializableColumnMeta[], timeZone: string, evalNow: string): boolean;
5
- export declare function evaluateTokens<Row extends object>(row: IngestedRow<Row>, tokens: readonly FilterToken[], columnsById: ReadonlyMap<string, SerializableColumnMeta>, timeZone: string, evalNow: string): boolean;
3
+ /**
4
+ * A predicate for committed tokens, all of which must match. The semantics are `@ox0/query`'s
5
+ * `createMatcher` — the grid has no evaluator of its own, so client mode filters exactly like any
6
+ * other `@ox0/query` consumer. `evalNow` is the instant "today" is taken from (epoch ms), resolved
7
+ * to a calendar day in `timeZone`, like every date value.
8
+ */
9
+ export declare function createRowMatcher<Row>(tokens: Query, columns: readonly SerializableColumnMeta[], timeZone: string, evalNow: number): (row: IngestedRow<Row>) => boolean;
6
10
  //# sourceMappingURL=filter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/worker/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,WAAW,EAGZ,MAAM,UAAU,CAAA;AAGjB,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAsGlE,2GAA2G;AAC3G,wBAAgB,aAAa,CAAC,GAAG,SAAS,MAAM,EAC9C,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EACrB,KAAK,EAAE,WAAW,EAClB,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,EACxD,iBAAiB,EAAE,SAAS,sBAAsB,EAAE,EACpD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED,wBAAgB,cAAc,CAAC,GAAG,SAAS,MAAM,EAC/C,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EACrB,MAAM,EAAE,SAAS,WAAW,EAAE,EAC9B,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,EACxD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAKT"}
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/worker/filter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,YAAY,CAAA;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAoBlE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAClC,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAC1C,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,OAAO,CAKpC"}
@@ -0,0 +1,11 @@
1
+ import type { IngestedRow, SerializableColumnMeta } from "./types";
2
+ /** More than this many fraction digits isn't padded to (a long float would push every value left). */
3
+ export declare const MAX_FRACTION_DIGITS = 6;
4
+ /** How many digits a number has after its decimal point, as `String` writes it (capped). */
5
+ export declare function fractionDigitsOf(value: unknown): number;
6
+ /**
7
+ * Raises `into` to the most fraction digits each numeric column has in `rows` from `from` on — the
8
+ * width the grid pads every value of the column to, so decimal points line up (spec "Numbers").
9
+ */
10
+ export declare function scanFractionDigits<Row>(rows: readonly IngestedRow<Row>[], from: number, columns: readonly SerializableColumnMeta[], into: Map<string, number>): void;
11
+ //# sourceMappingURL=fraction-digits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fraction-digits.d.ts","sourceRoot":"","sources":["../../src/worker/fraction-digits.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAElE,sGAAsG;AACtG,eAAO,MAAM,mBAAmB,IAAI,CAAA;AAEpC,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAWvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EACpC,IAAI,EAAE,SAAS,WAAW,CAAC,GAAG,CAAC,EAAE,EACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAC1C,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACxB,IAAI,CAcN"}
@@ -0,0 +1,45 @@
1
+ import type { SortEntry } from "../types";
2
+ import { type Aggregates } from "./aggregate";
3
+ import type { IndexEntry, IngestedRow, SerializableColumnMeta } from "./types";
4
+ /** One rendered position of a grouped result: a group header, or a row (by index into `rows`). */
5
+ export type GroupedItem = Extract<IndexEntry<never>, {
6
+ kind: "group-header";
7
+ }> | {
8
+ readonly kind: "row";
9
+ readonly index: number;
10
+ readonly level: number;
11
+ };
12
+ export type Grouped = {
13
+ /** What renders, top to bottom: headers, and the rows of expanded groups. */
14
+ readonly items: readonly GroupedItem[];
15
+ /** Every row in group order, collapsed groups included — what a scan walks. */
16
+ readonly ordered: readonly number[];
17
+ };
18
+ export type GroupOptions<Row> = {
19
+ readonly rows: readonly IngestedRow<Row>[];
20
+ /** The rows to group, already filtered and sorted; that order is kept inside each group. */
21
+ readonly indices: readonly number[];
22
+ readonly columns: readonly SerializableColumnMeta[];
23
+ readonly sort: readonly SortEntry[];
24
+ /** Groups toggled away from `defaultExpanded`, by key. */
25
+ readonly expansion: ReadonlyMap<string, boolean>;
26
+ readonly defaultExpanded: boolean;
27
+ /** Columns whose stats each group header carries (over all its rows, collapsed or not). */
28
+ readonly aggregateColumns: readonly SerializableColumnMeta[];
29
+ /**
30
+ * Stats already computed for these rows, by group key: used where present, filled in where
31
+ * not. The caller drops it when the set of rows changes.
32
+ */
33
+ readonly statsCache?: Map<string, Aggregates>;
34
+ };
35
+ /**
36
+ * Client-mode grouping (architecture doc "Client mode grouping"): buckets the filtered, sorted rows
37
+ * by each grouping column in turn. Groups are ordered by their value — in that column's sort
38
+ * direction when it is sorted, else ascending — with the empty group (nullish values) last, the
39
+ * same as nullish sorts. Rows keep their sorted order inside a group.
40
+ *
41
+ * A group's key is its path of values (JSON), stable for as long as the grouping columns are; the
42
+ * format is internal (spec "groupKey contract").
43
+ */
44
+ export declare function groupRows<Row>(options: GroupOptions<Row>): Grouped;
45
+ //# sourceMappingURL=group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/worker/group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAqB,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AAS,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,GAAG,OAAO,CA4ElE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=group.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.test.d.ts","sourceRoot":"","sources":["../../src/worker/group.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type { WorkerRequest, WorkerResponse } from "./protocol";
2
+ /**
3
+ * The worker's request handler, separate from `engine.ts` (which only binds it to the worker
4
+ * global) so it can be driven directly in tests. Requests are handled in arrival order and each
5
+ * posts its response before the next is read, which is what lets the main thread apply responses
6
+ * in order without reordering.
7
+ */
8
+ export declare function createMessageHandler<Row>(post: (response: WorkerResponse<Row>) => void): (request: WorkerRequest<Row>) => void;
9
+ //# sourceMappingURL=handle-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-message.d.ts","sourceRoot":"","sources":["../../src/worker/handle-message.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAU,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGvE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EACtC,IAAI,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,GAC5C,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,IAAI,CA6FvC"}
@@ -0,0 +1,121 @@
1
+ import type { FilterToken, SortEntry } from "../types";
2
+ import type { Aggregates } from "./aggregate";
3
+ import type { IndexEntry, IngestedRow, ScanRange, SerializableColumnMeta } from "./types";
4
+ /**
5
+ * Messages between the main thread and the Web Worker engine — the Phase 1 client-mode subset of
6
+ * docs/llm/data-grid-architecture.md "Message protocol". Server mode (`ingest-page`,
7
+ * `invalidate-cache`, `cache-miss`), row reorder, scans, aggregates, and grouping add their
8
+ * messages when those phases land.
9
+ *
10
+ * Every request carries a `requestId`, and every response echoes the request it answers. The
11
+ * worker handles requests in order and responds in order, so responses never need reordering;
12
+ * the ids tell the main thread which requests are still in flight.
13
+ */
14
+ export type WorkerRequest<Row> = {
15
+ readonly type: "configure";
16
+ readonly requestId: number;
17
+ readonly columns: readonly SerializableColumnMeta[];
18
+ readonly mode: "client" | "server";
19
+ readonly timeZone: string;
20
+ } | {
21
+ readonly type: "ingest-rows";
22
+ readonly requestId: number;
23
+ readonly rows: readonly IngestedRow<Row>[];
24
+ readonly replace: boolean;
25
+ readonly more?: boolean;
26
+ } | {
27
+ readonly type: "sort";
28
+ readonly requestId: number;
29
+ readonly sort: readonly SortEntry[];
30
+ } | {
31
+ readonly type: "filter";
32
+ readonly requestId: number;
33
+ readonly filter: readonly FilterToken[];
34
+ readonly evalNow: number;
35
+ } | {
36
+ readonly type: "slice";
37
+ readonly requestId: number;
38
+ readonly start: number;
39
+ readonly end: number;
40
+ } | {
41
+ readonly type: "scan";
42
+ readonly requestId: number;
43
+ readonly scanId: number;
44
+ readonly chunkSize: number;
45
+ readonly range?: ScanRange;
46
+ } | {
47
+ readonly type: "row-ids";
48
+ readonly requestId: number;
49
+ readonly start: number;
50
+ readonly end: number;
51
+ } | {
52
+ readonly type: "abort-scan";
53
+ readonly requestId: number;
54
+ readonly scanId: number;
55
+ } | {
56
+ readonly type: "reorder-row";
57
+ readonly requestId: number;
58
+ readonly movedId: string;
59
+ readonly beforeId: string | null;
60
+ } | {
61
+ readonly type: "group-by";
62
+ readonly requestId: number;
63
+ readonly columnIds: readonly string[];
64
+ readonly defaultExpanded: boolean;
65
+ } | {
66
+ readonly type: "expand-group";
67
+ readonly requestId: number;
68
+ readonly groupKey: string;
69
+ } | {
70
+ readonly type: "collapse-group";
71
+ readonly requestId: number;
72
+ readonly groupKey: string;
73
+ };
74
+ /**
75
+ * After every data change: the rows matching the filter, the positions that render (the same
76
+ * unless grouped: headers add positions, collapsed groups take their rows away), and the stats.
77
+ */
78
+ export type Counts = {
79
+ readonly totalCount: number;
80
+ readonly renderedCount: number;
81
+ readonly aggregates?: Aggregates;
82
+ readonly fractionDigits?: Readonly<Record<string, number>>;
83
+ };
84
+ export type WorkerResponse<Row> = {
85
+ readonly type: "ready";
86
+ } | ({
87
+ readonly type: "ingested";
88
+ readonly requestId: number;
89
+ } & Counts) | ({
90
+ readonly type: "sorted";
91
+ readonly requestId: number;
92
+ } & Counts) | ({
93
+ readonly type: "filtered";
94
+ readonly requestId: number;
95
+ } & Counts) | ({
96
+ readonly type: "grouped";
97
+ readonly requestId: number;
98
+ } & Counts) | {
99
+ readonly type: "scan-chunk";
100
+ readonly scanId: number;
101
+ readonly entries: readonly IndexEntry<Row>[];
102
+ readonly done: boolean;
103
+ } | {
104
+ readonly type: "row-ids";
105
+ readonly requestId: number;
106
+ readonly ids: readonly string[];
107
+ } | ({
108
+ readonly type: "reordered";
109
+ readonly requestId: number;
110
+ } & Counts) | {
111
+ readonly type: "slice";
112
+ readonly requestId: number;
113
+ readonly start: number;
114
+ readonly entries: readonly IndexEntry<Row>[];
115
+ } | {
116
+ readonly type: "error";
117
+ readonly requestId: number;
118
+ readonly message: string;
119
+ readonly fatal?: boolean;
120
+ };
121
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/worker/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEzF;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,CAAC,GAAG,IACzB;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,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AAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,CAAA;CAC7C,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA"}
@@ -1,8 +1,35 @@
1
1
  import type { SortEntry } from "../types";
2
2
  import type { IngestedRow, SerializableColumnMeta } from "./types";
3
+ export declare function toSortKey(value: unknown, dataType: SerializableColumnMeta["dataType"]): number | string | null;
4
+ /** Returns null when neither value is nullish — signals the caller to apply direction-sensitive comparison. */
5
+ export declare function compareNullish(a: number | string | null, b: number | string | null): number | null;
6
+ export declare function compareKeys(a: number | string | null, b: number | string | null): number;
7
+ type SortKey = number | string | null;
8
+ /**
9
+ * Per-sort-entry key columns, one key per row, extended as rows are appended so a batch only pays
10
+ * for its own rows' keys.
11
+ */
12
+ export type SortKeys = {
13
+ readonly entries: readonly SortEntry[];
14
+ readonly columns: readonly {
15
+ readonly direction: "asc" | "desc";
16
+ readonly values: SortKey[];
17
+ }[];
18
+ };
19
+ export declare function createSortKeys(sort: readonly SortEntry[]): SortKeys;
20
+ /** Computes keys for `rows[from..]` and appends them. */
21
+ export declare function extendSortKeys<Row>(keys: SortKeys, rows: readonly IngestedRow<Row>[], from: number, columnsById: ReadonlyMap<string, SerializableColumnMeta>): void;
22
+ /**
23
+ * Orders two row indices by the sort keys. Ties fall back to row index, which makes the order
24
+ * stable and lets a merge of separately sorted runs reproduce a full sort exactly.
25
+ */
26
+ export declare function compareRowIndices(keys: SortKeys, a: number, b: number): number;
27
+ /** Merges two index runs that are each already ordered by `keys`. */
28
+ export declare function mergeSortedIndices(keys: SortKeys, left: readonly number[], right: readonly number[]): number[];
3
29
  /**
4
30
  * Multi-column stable sort. Returns a new array of row-array indices in sorted order; row data is
5
31
  * never reordered in memory.
6
32
  */
7
33
  export declare function sortIndices<Row>(rows: readonly IngestedRow<Row>[], sort: readonly SortEntry[], columnsById: ReadonlyMap<string, SerializableColumnMeta>): number[];
34
+ export {};
8
35
  //# sourceMappingURL=sort.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/worker/sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAmClE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAC7B,IAAI,EAAE,SAAS,WAAW,CAAC,GAAG,CAAC,EAAE,EACjC,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,GACvD,MAAM,EAAE,CA2BV"}
1
+ {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/worker/sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAElE,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,sBAAsB,CAAC,UAAU,CAAC,GAC3C,MAAM,GAAG,MAAM,GAAG,IAAI,CAexB;AAED,+GAA+G;AAC/G,wBAAgB,cAAc,CAC5B,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EACzB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GACxB,MAAM,GAAG,IAAI,CAKf;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAGxF;AAED,KAAK,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;AAErC;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAA;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,CAAA;KAAE,EAAE,CAAA;CAChG,CAAA;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,QAAQ,CAKnE;AAED,yDAAyD;AACzD,wBAAgB,cAAc,CAAC,GAAG,EAChC,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,WAAW,CAAC,GAAG,CAAC,EAAE,EACjC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,GACvD,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY9E;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,EAAE,CAWV;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAC7B,IAAI,EAAE,SAAS,WAAW,CAAC,GAAG,CAAC,EAAE,EACjC,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,GACvD,MAAM,EAAE,CAMV"}
@@ -1,9 +1,9 @@
1
1
  import type { DataEngineInterface } from "./types";
2
2
  /**
3
- * Synchronous in-process implementation of {@link DataEngineInterface}, for SSR and tests where
4
- * no Worker API exists. Wraps the same `Dataset` the Web Worker transport will wrap — behavior is
5
- * identical, only the transport differs. See docs/llm/data-grid-architecture.md "Worker-less
6
- * engine for SSR and tests".
3
+ * Synchronous in-process implementation of {@link DataEngineInterface}, for SSR, tests, and
4
+ * environments with no usable Worker. It runs the same message handler the Web Worker runs, called
5
+ * directly — so behavior is identical and every event is delivered before the call that caused it
6
+ * returns. See docs/llm/data-grid-architecture.md "Worker-less engine for SSR and tests".
7
7
  */
8
8
  export declare function createSyncEngine<Row>(): DataEngineInterface<Row>;
9
9
  //# sourceMappingURL=sync-engine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync-engine.d.ts","sourceRoot":"","sources":["../../src/worker/sync-engine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,KAAK,mBAAmB,CAAC,GAAG,CAAC,CAuBhE"}
1
+ {"version":3,"file":"sync-engine.d.ts","sourceRoot":"","sources":["../../src/worker/sync-engine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,KAAK,mBAAmB,CAAC,GAAG,CAAC,CAKhE"}
@@ -26,9 +26,8 @@ export type IngestedRow<Row> = Row & {
26
26
  } & Partial<Record<`__derived_${string}`, unknown>>;
27
27
  /**
28
28
  * Internal counterpart of the public `GridRow<Row>`. Field-identical except `row` entries carry
29
- * `IngestedRow<Row>` instead of `Row`. Group-header entries are part of the v1 shape so the slice
30
- * contract does not change shape in a later phase, even though nothing produces one until
31
- * grouping (Phase 6) lands.
29
+ * `IngestedRow<Row>` instead of `Row`. Group headers come from client-mode grouping (`groupBy`), and
30
+ * a grouped row carries its group depth in `level`.
32
31
  */
33
32
  export type IndexEntry<Row> = {
34
33
  readonly kind: "row";
@@ -42,24 +41,102 @@ export type IndexEntry<Row> = {
42
41
  readonly isExpanded: boolean;
43
42
  readonly level: number;
44
43
  readonly aggregates?: Readonly<Record<string, Partial<Record<AggregateStat, unknown>>>>;
44
+ readonly rowsStart?: number;
45
+ };
46
+ /**
47
+ * What an engine reports back. Both engines deliver events in the order the work happened: a
48
+ * `count` follows every ingest/sort/filter, and a `slice` always reflects every count delivered
49
+ * before it, so a consumer can apply events as they come without reordering or discarding any.
50
+ * `settledRequestId` is the last data-changing request applied, for telling whether one sent
51
+ * later is still in flight.
52
+ */
53
+ export type EngineEvent<Row> = {
54
+ readonly type: "count";
55
+ readonly totalCount: number;
56
+ readonly rowCount?: number;
57
+ readonly aggregates?: Readonly<Record<string, Partial<Record<AggregateStat, unknown>>>>;
58
+ readonly fractionDigits?: Readonly<Record<string, number>>;
59
+ readonly settledRequestId: number;
60
+ } | {
61
+ readonly type: "slice";
62
+ readonly start: number;
63
+ readonly entries: readonly IndexEntry<Row>[];
64
+ } | {
65
+ readonly type: "error";
66
+ readonly message: string;
67
+ readonly fatal: boolean;
68
+ } | {
69
+ readonly type: "server";
70
+ readonly status: ServerStatus;
71
+ readonly generation: number;
72
+ };
73
+ /** What the grid knows about a server result set, for loading/error UI, ARIA, and the pager. */
74
+ export type ServerStatus = {
75
+ /** "initial": nothing loaded yet; "append": loading beside loaded rows; "error": the last request failed. */
76
+ readonly phase: "idle" | "initial" | "append" | "error";
77
+ readonly error?: unknown;
78
+ /** The server's total of matching rows; -1 when it doesn't know; undefined before the first response. */
79
+ readonly totalCount?: number;
80
+ /**
81
+ * Grouped: the rows that render (headers included) — the server's `renderedRowCount`, or -1
82
+ * when it sent none (or no `renderedStartOffset` with it).
83
+ */
84
+ readonly renderedCount?: number;
85
+ /** More rows can be fetched past the loaded ones (the last page had a `nextCursor`). */
86
+ readonly hasMore: boolean;
87
+ /** Pagination mode: the page shown (0-based) and how many rows it has. */
88
+ readonly page?: {
89
+ readonly index: number;
90
+ readonly rowCount: number;
91
+ };
92
+ /** Pagination mode: a previous page is reachable. */
93
+ readonly hasPrevious?: boolean;
94
+ };
95
+ /** Part of the scan order (end exclusive); a scan without one walks every row. */
96
+ export type ScanRange = {
97
+ readonly start: number;
98
+ readonly end: number;
45
99
  };
46
100
  /**
47
101
  * Shared contract between the Web Worker transport and the synchronous in-process engine used
48
102
  * for SSR and tests (docs/llm/data-grid-architecture.md "Worker-less engine for SSR and tests").
103
+ * Every call is fire-and-forget; results arrive through `subscribe`. The sync engine emits them
104
+ * before the call returns, the worker engine after a round trip — consumers handle both the same
105
+ * way.
49
106
  *
50
- * This is the Phase 1 subset: client-mode ingest, sort, filter, and slice. `ingestPage` (server
51
- * mode, Phase 3), `reorderRow` and `scan` (Phase 5) are added to this interface when those phases
52
- * land — they are not stubbed here.
107
+ * Data-changing calls return the `requestId` they were sent as, to compare against
108
+ * `settledRequestId`.
109
+ *
110
+ * The client-mode subset: ingest, sort, filter, row reorder, and slice. `ingestPage` (server mode,
111
+ * Phase 3) and `scan` (Phase 5) are added when those phases land — they are not stubbed here.
53
112
  */
54
113
  export interface DataEngineInterface<Row> {
114
+ readonly kind: "worker" | "sync" | "server";
55
115
  configure(columns: readonly SerializableColumnMeta[], mode: "client" | "server", timeZone: string): void;
56
- ingestRows(rows: readonly IngestedRow<Row>[], replace: boolean): void;
57
- sort(sort: readonly SortEntry[]): void;
58
- filter(tokens: readonly FilterToken[], evalNow: string): void;
59
- slice(start: number, end: number): {
60
- readonly start: number;
61
- readonly entries: IndexEntry<Row>[];
62
- };
63
- readonly totalCount: number;
116
+ /** `more`: further batches of this ingest follow (stats are computed after the last). */
117
+ ingestRows(rows: readonly IngestedRow<Row>[], replace: boolean, more?: boolean): number;
118
+ sort(sort: readonly SortEntry[]): number;
119
+ /** `evalNow`: the instant (epoch ms) relative dates and open ranges count from. */
120
+ filter(tokens: readonly FilterToken[], evalNow: number): number;
121
+ /** Moves a row before another (null: to the end) in the dataset's own order; client mode. */
122
+ reorderRow(movedId: string, beforeId: string | null): number;
123
+ /** Groups by these columns (none: ungrouped), starting every group expanded or collapsed. */
124
+ groupBy(columnIds: readonly string[], defaultExpanded: boolean): number;
125
+ setGroupExpanded(groupKey: string, isExpanded: boolean): number;
126
+ requestSlice(start: number, end: number): void;
127
+ /**
128
+ * Every row in the current (sorted, filtered) order, a chunk at a time — for "select all
129
+ * matching" and bulk actions' `rows()`. Ending the iteration early or aborting `signal` stops it.
130
+ * Server mode yields nothing: the backend holds the rows.
131
+ */
132
+ scan(chunkSize: number, signal: AbortSignal, range?: ScanRange): AsyncIterable<readonly IndexEntry<Row>[]>;
133
+ /**
134
+ * The ids of the rows in a range of scan order (a group's rows: `rowsStart`, `rowCount`). Server
135
+ * mode resolves to none.
136
+ */
137
+ rowIds(start: number, end: number): Promise<readonly string[]>;
138
+ subscribe(listener: (event: EngineEvent<Row>) => void): () => void;
139
+ /** Terminates the worker. The engine is unusable afterwards. */
140
+ dispose(): void;
64
141
  }
65
142
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/worker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAErE;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;IACvD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;IAC7C,QAAQ,CA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EAAE,OAAO,GAAG,MAAM,CAAA;IAC/D,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9C;;;;OAIG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,KAAK,CAAC,EAAE,SAAS,GAChB,aAAa,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC5C;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAA;IAC9D,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAA;IAClE,gEAAgE;IAChE,OAAO,IAAI,IAAI,CAAA;CAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox0/data-grid",
3
- "version": "0.1.21",
3
+ "version": "0.2.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/esturcke/ox0-platform.git",
@@ -23,15 +23,16 @@
23
23
  "dependencies": {
24
24
  "@tanstack/react-virtual": "^3.14.13",
25
25
  "zustand": "^5.0.0",
26
- "@ox0/hooks": "0.4.0",
27
- "@ox0/tokens": "0.7.0",
28
- "@ox0/ui": "3.12.0"
26
+ "@ox0/tokens": "0.8.0",
27
+ "@ox0/query": "0.5.0",
28
+ "@ox0/ui": "3.13.0",
29
+ "@ox0/hooks": "0.4.0"
29
30
  },
30
31
  "peerDependencies": {
31
32
  "react": "^19.0.0"
32
33
  },
33
34
  "scripts": {
34
- "build": "rslib build -c ../../rslib.config.ts && rm -f tsconfig.build.tsbuildinfo && tsc -p tsconfig.build.json",
35
+ "build": "rslib build && tsx scripts/check-worker-dist.ts && rm -f tsconfig.build.tsbuildinfo && tsc -p tsconfig.build.json",
35
36
  "typecheck": "tsc -p tsconfig.json",
36
37
  "lint": "oxlint .",
37
38
  "test": "vitest run"
@@ -1,10 +0,0 @@
1
- /**
2
- * Buckets a row's date value to a calendar day (`YYYY-MM-DD`) in `timeZone`. A plain `YYYY-MM-DD`
3
- * value already denotes that calendar day per spec ("Date normalization") and passes through
4
- * unchanged — no timezone conversion needed. A full timestamp or epoch-millis number is converted
5
- * via the day it falls on when observed in `timeZone`.
6
- */
7
- export declare function toCalendarDay(value: string | number, timeZone: string): string | null;
8
- /** Shifts a `YYYY-MM-DD` calendar day by a signed amount of days/weeks/months/years. */
9
- export declare function shiftDay(day: string, amount: number, unit: "d" | "w" | "m" | "y"): string;
10
- //# sourceMappingURL=date.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/worker/date.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKrF;AAED,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAQzF"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=date.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date.test.d.ts","sourceRoot":"","sources":["../../src/worker/date.test.ts"],"names":[],"mappings":""}