@everygrid/grid 0.4.7

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.

Potentially problematic release.


This version of @everygrid/grid might be problematic. Click here for more details.

Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +680 -0
  3. package/dist/Everygrid.css +3 -0
  4. package/dist/everygrid-config.json +7 -0
  5. package/dist/everygrid.standalone.js +401 -0
  6. package/dist/i18n/en.json.d.ts +86 -0
  7. package/dist/i18n/ko.json.d.ts +86 -0
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.js +24227 -0
  10. package/dist/src/components/ColumnSelectorComponent.d.ts +8 -0
  11. package/dist/src/components/DiffPopupComponent.d.ts +14 -0
  12. package/dist/src/components/EmptyGridPlaceholderComponent.d.ts +15 -0
  13. package/dist/src/components/EverygridComponent.d.ts +5 -0
  14. package/dist/src/components/ExcelViewComponent.d.ts +20 -0
  15. package/dist/src/components/GridTableComponent.d.ts +28 -0
  16. package/dist/src/components/GridToolbarComponent.d.ts +49 -0
  17. package/dist/src/components/HiddenColumnSelectorComponent.d.ts +7 -0
  18. package/dist/src/components/InsertedRowsComponent.d.ts +21 -0
  19. package/dist/src/components/MobileColumnSelectorComponent.d.ts +8 -0
  20. package/dist/src/components/NestedTableComponent.d.ts +10 -0
  21. package/dist/src/components/PaginationComponent.d.ts +21 -0
  22. package/dist/src/components/PinnedTableComponent.d.ts +26 -0
  23. package/dist/src/components/PopupComponent.d.ts +29 -0
  24. package/dist/src/components/RowCountComponent.d.ts +18 -0
  25. package/dist/src/components/RowDetailComponent.d.ts +8 -0
  26. package/dist/src/components/TableCellComponent.d.ts +18 -0
  27. package/dist/src/components/TextEditorPopupComponent.d.ts +6 -0
  28. package/dist/src/core/Everygrid.d.ts +568 -0
  29. package/dist/src/core/ExcelView.d.ts +28 -0
  30. package/dist/src/core/GridHandle.d.ts +214 -0
  31. package/dist/src/core/GridHandle.test.d.ts +1 -0
  32. package/dist/src/core/ResizeUtils.d.ts +3 -0
  33. package/dist/src/core/highlightUtils.d.ts +4 -0
  34. package/dist/src/core/normalizeOptions.d.ts +13 -0
  35. package/dist/src/core/normalizeOptions.test.d.ts +1 -0
  36. package/dist/src/core/types.d.ts +361 -0
  37. package/dist/src/core/useVirtualWindow.d.ts +89 -0
  38. package/dist/src/core/useVirtualWindow.test.d.ts +1 -0
  39. package/dist/src/core/utils.d.ts +19 -0
  40. package/dist/src/i18n/I18n.d.ts +16 -0
  41. package/dist/src/icons/ChevronDownIcon.d.ts +2 -0
  42. package/dist/src/icons/ColumnWidthIcon.d.ts +3 -0
  43. package/dist/src/icons/ColumnsIcon.d.ts +3 -0
  44. package/dist/src/icons/CommaIcon.d.ts +1 -0
  45. package/dist/src/icons/ConfigIcon.d.ts +4 -0
  46. package/dist/src/icons/DiffIcon.d.ts +4 -0
  47. package/dist/src/icons/DownloadIcon.d.ts +3 -0
  48. package/dist/src/icons/EditIcon.d.ts +1 -0
  49. package/dist/src/icons/ExcelIcon.d.ts +3 -0
  50. package/dist/src/icons/GlobeIcon.d.ts +2 -0
  51. package/dist/src/icons/HideIcon.d.ts +1 -0
  52. package/dist/src/icons/InfoIcon.d.ts +2 -0
  53. package/dist/src/icons/InsertRowIcon.d.ts +4 -0
  54. package/dist/src/icons/MobileColumnsIcon.d.ts +3 -0
  55. package/dist/src/icons/PinEmptyIcon.d.ts +1 -0
  56. package/dist/src/icons/PinFilledIcon.d.ts +1 -0
  57. package/dist/src/icons/ReloadIcon.d.ts +3 -0
  58. package/dist/src/icons/RowDetailIcon.d.ts +3 -0
  59. package/dist/src/icons/SearchIcon.d.ts +3 -0
  60. package/dist/src/icons/SortDownIcon.d.ts +1 -0
  61. package/dist/src/icons/SortResetIcon.d.ts +3 -0
  62. package/dist/src/icons/SortUpIcon.d.ts +1 -0
  63. package/dist/src/icons/TrashIcon.d.ts +3 -0
  64. package/dist/src/icons/UndoIcon.d.ts +3 -0
  65. package/dist/src/index.d.ts +14 -0
  66. package/dist/src/react/index.d.ts +20 -0
  67. package/dist/src/standalone-entry.d.ts +2 -0
  68. package/dist/src/wasm/ExcelExportClient.d.ts +14 -0
  69. package/dist/src/wasm/ExportWorker.d.ts +1 -0
  70. package/dist/src/wasm/GridEngineWasm.d.ts +70 -0
  71. package/dist/src/wasm/GridEngineWorker.d.ts +102 -0
  72. package/dist/wasm/everygrid_wasm.js +422 -0
  73. package/dist/wasm/everygrid_wasm_bg.wasm +0 -0
  74. package/package.json +61 -0
@@ -0,0 +1,89 @@
1
+ /** The slice of rows to render, plus the spacer heights that stand in for the rest. */
2
+ export interface VirtualWindow {
3
+ /** First rendered row index. */
4
+ start: number;
5
+ /** One past the last rendered row index. */
6
+ end: number;
7
+ /** Spacer height above the rendered rows, in px. */
8
+ topPad: number;
9
+ /** Spacer height below the rendered rows, in px. */
10
+ bottomPad: number;
11
+ }
12
+ /**
13
+ * Largest spacer height a virtual scroller may ask for.
14
+ *
15
+ * Browsers clamp how tall an element can be, and a spacer past that limit silently stops growing —
16
+ * the scrollbar then covers only part of the data and the rows beyond it cannot be reached at all.
17
+ * Chrome cuts off at 16,777,214px (2^24 - 2), measured; Firefox and Safari sit near the same mark.
18
+ */
19
+ export declare const MAX_SEGMENT_PX = 16777000;
20
+ /** Row height a virtualised target falls back to when its config does not set one. */
21
+ export declare const DEFAULT_ROW_HEIGHT = 36;
22
+ /**
23
+ * Rows per segment, before the height limit is taken into account.
24
+ *
25
+ * Comfortably under what the limit alone would allow. A shorter segment keeps the scroller itself
26
+ * short — 6.8M px rather than 16.7M at a 34px row — and the scrollbar thumb correspondingly less
27
+ * twitchy: a pixel of thumb travel covers about a third as many rows, which is what makes dragging
28
+ * through a very large result feel controllable rather than like a slot machine.
29
+ */
30
+ export declare const SEGMENT_ROWS = 200000;
31
+ /**
32
+ * How many rows one scrollable segment holds, for a given row height.
33
+ *
34
+ * A result larger than this is scrolled a segment at a time (the pager moves between them) rather
35
+ * than being squeezed into one over-long scroller. Keeping every segment laid out 1:1 is what makes
36
+ * scrolling smooth: a row is exactly `rowHeight` tall and travelling `rowHeight` advances exactly
37
+ * one row. Compressing the whole result into one scroller instead would break that correspondence —
38
+ * the rows would step rather than slide.
39
+ *
40
+ * The height limit is the backstop, not the target: an unusually tall row yields a shorter segment
41
+ * rather than one that overflows what the browser will lay out.
42
+ */
43
+ export declare function segmentRows(rowHeight: number): number;
44
+ /**
45
+ * Ceiling on how far ahead of the viewport the window may reach while scrolling.
46
+ *
47
+ * Deliberately short. Its original job — covering the frame the window used to lag behind by — is
48
+ * gone now that the window is committed before the frame paints, so what is left is a head start
49
+ * on the engine's block fetches. Every row it adds is a row rendered on each scroll event, and
50
+ * during a fast fling that render is what the scroll outruns, so a big lead makes the thing it was
51
+ * meant to help worse.
52
+ */
53
+ export declare const MAX_LEAD_ROWS = 16;
54
+ /**
55
+ * Rows to render past the window, in the direction of travel.
56
+ *
57
+ * A scroll event's state update paints one frame later, so by the time the rows appear the
58
+ * scroller has already moved on — at speed, further than the overscan covers, and the viewport
59
+ * ends up over bare spacer. Extending the window along the direction of travel by the distance
60
+ * just covered closes that gap.
61
+ *
62
+ * It is measured as a row delta, not pixels: under the compressed mapping a pixel spans many rows,
63
+ * so `Δpx / rowHeight` would badly under-reach. Deriving it from two window computations makes it
64
+ * correct in both modes without either knowing about the other.
65
+ */
66
+ export declare function leadRows(scrollTop: number, prevScrollTop: number, viewportHeight: number, rowHeight: number, overscan: number, totalRows: number): number;
67
+ /**
68
+ * Pure window maths — no DOM, no React. Everything the virtual body needs is derived here so it
69
+ * can be reasoned about (and tested) on its own.
70
+ */
71
+ export declare function computeWindow(scrollTop: number, viewportHeight: number, rowHeight: number, overscan: number, totalRows: number, lead?: number): VirtualWindow;
72
+ /**
73
+ * Tracks a scroll container and reports the row window to render.
74
+ *
75
+ * Scroll events are coalesced to one measurement per frame: a fast wheel or drag fires dozens of
76
+ * events between paints, and re-rendering the body on each one is what makes naive virtual lists
77
+ * stutter.
78
+ */
79
+ export declare function useVirtualWindow(totalRows: number, rowHeight: number, overscan: number): {
80
+ scrollerRef: (el: HTMLDivElement | null) => void;
81
+ onScroll: () => void;
82
+ scrollToTop: () => void;
83
+ window: {
84
+ start: number;
85
+ end: number;
86
+ topPad: number;
87
+ bottomPad: number;
88
+ };
89
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Checks if a value is a valid JSON string that represents an object or array.
3
+ * Supports non-standard JSON values like Infinity and NaN for better developer experience.
4
+ */
5
+ export declare const isJsonString: (val: unknown) => boolean;
6
+ export declare const formatIsoTimestamp: (val: string) => string;
7
+ export declare const parseIfJson: (val: unknown) => unknown;
8
+ /**
9
+ * Determines if an object/array is too complex to be rendered in-place.
10
+ */
11
+ export declare const isTooComplex: (val: unknown) => boolean;
12
+ /**
13
+ * Generates a summary label for objects and arrays.
14
+ */
15
+ export declare const getSummaryLabel: (val: unknown) => string;
16
+ /**
17
+ * Checks if a value is a valid XML string.
18
+ */
19
+ export declare const isXmlString: (val: unknown) => boolean;
@@ -0,0 +1,16 @@
1
+ export declare class I18n {
2
+ private static locale;
3
+ private static explicit;
4
+ private static translations;
5
+ static setLocale(locale: 'ko' | 'en'): void;
6
+ static getLocale(): 'ko' | 'en';
7
+ /**
8
+ * Retrieves translated text using dot notation.
9
+ * Example: I18n.t('toolbar.showExcelPreview')
10
+ */
11
+ static t(key: string, params?: Record<string, string | number>): string;
12
+ /**
13
+ * Initializes the locale based on the browser language settings.
14
+ */
15
+ static initFromBrowser(): void;
16
+ }
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const ChevronDownIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const ColumnWidthIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const ColumnsIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const CommaIcon: () => import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** Toolbar "config": curly braces, in the toolbar's stroke weight and box. */
2
+ export declare const ConfigIcon: ({ className }: {
3
+ className?: string;
4
+ }) => import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** Toolbar "diff": the code brackets, in the toolbar's stroke weight and box. */
2
+ export declare const DiffIcon: ({ className }: {
3
+ className?: string;
4
+ }) => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const DownloadIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const EditIcon: () => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const ExcelIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const GlobeIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const HideIcon: () => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const InfoIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** Toolbar "insert row": a plus, drawn with the same stroke weight and box as the other toolbar icons. */
2
+ export declare const InsertRowIcon: ({ className }: {
3
+ className?: string;
4
+ }) => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const MobileColumnsIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const PinEmptyIcon: () => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const PinFilledIcon: () => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const ReloadIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const RowDetailIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const SearchIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const SortDownIcon: () => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const SortResetIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const SortUpIcon: () => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const TrashIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const UndoIcon: ({ className }: {
2
+ className?: string;
3
+ }) => import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { Everygrid } from './core/Everygrid';
2
+ export { Everygrid } from './core/Everygrid';
3
+ export { Everygrid as default } from './core/Everygrid';
4
+ export { GridHandle, RowHandle, CellHandle, ColumnHandle } from './core/GridHandle';
5
+ export type { RowKey, RowStatus, CellChange, RowChange, ColumnChange, RowPatch, RowDeletion, Patch, CellChangeEvent, CheckEvent, GridEvents } from './core/GridHandle';
6
+ export declare const loadEverygridConfig: typeof Everygrid.loadEverygridConfig;
7
+ export declare const createGrid: typeof Everygrid.createGrid;
8
+ export { useGrid, EverygridGrid } from './react';
9
+ export type { EverygridGridProps } from './react';
10
+ export { GridEngineWasm } from './wasm/GridEngineWasm';
11
+ export { I18n } from './i18n/I18n';
12
+ export { GlobeIcon } from './icons/GlobeIcon';
13
+ export { ChevronDownIcon } from './icons/ChevronDownIcon';
14
+ export type { ReloadOptions, GridOptions, GridColumn, ColumnI18n, GridMobileColumnsConfig, GridTargetConfig, GridPaginationConfig, GridColorConfig, EditableColConfig, GridRowKeyConfig, GridRowActionsConfig, GridToolbarConfig, GridLinkConfig, IEverygrid, GridLoadProgress, ServerFetchParams, ServerFetchResult, } from './core/types';
@@ -0,0 +1,20 @@
1
+ import { CSSProperties } from 'react';
2
+ type Fetcher = string | (() => Promise<Record<string, unknown>[]>);
3
+ /**
4
+ * Mount an Everygrid grid for the life of the component that renders its `<div id={id}/>`.
5
+ *
6
+ * One line per grid: it creates the grid (config is auto-loaded from the app-root
7
+ * `everygrid.config.json`) and tears it down on unmount. `mount` coalesces concurrent creates of the
8
+ * same id, and the teardown is deferred + cancelled on remount, so React StrictMode's double-invoke
9
+ * neither double-creates nor unmounts a root mid-render.
10
+ */
11
+ export declare function useGrid(id: string, fetcher?: Fetcher): void;
12
+ export interface EverygridGridProps {
13
+ id: string;
14
+ fetcher?: Fetcher;
15
+ className?: string;
16
+ style?: CSSProperties;
17
+ }
18
+ /** Renders the grid's container `<div>` and manages its lifecycle via {@link useGrid}. */
19
+ export declare function EverygridGrid({ id, fetcher, className, style }: EverygridGridProps): import("react").JSX.Element;
20
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Everygrid } from './core/Everygrid';
2
+ export default Everygrid;
@@ -0,0 +1,14 @@
1
+ export interface ExportResult {
2
+ bytes: Uint8Array;
3
+ isZip: boolean;
4
+ }
5
+ export declare function runExcelExport(opts: {
6
+ baseName: string;
7
+ total: number;
8
+ chunkSize: number;
9
+ fetchChunk: (page: number, size: number) => Promise<unknown[]>;
10
+ onProgress?: (done: number, total: number) => void;
11
+ signal?: AbortSignal;
12
+ relational?: boolean;
13
+ keyField?: string;
14
+ }): Promise<ExportResult>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,70 @@
1
+ /**
2
+ * GridEngineWasm.ts
3
+ * Main-thread proxy for the WASM GridEngine running inside a Web Worker.
4
+ * All heavy operations (setData, filter, sort, getPage) execute off the main thread,
5
+ * so the UI never freezes even with millions of rows.
6
+ */
7
+ export declare class GridEngineWasm {
8
+ private static healthLogged;
9
+ private readonly engineId;
10
+ private readonly worker;
11
+ private seq;
12
+ private readonly pending;
13
+ private progressCallback?;
14
+ private constructor();
15
+ private send;
16
+ /** Creates a new engine instance with its own dedicated Worker. */
17
+ static create(engineId: string, onProgress?: (stage: 'indexing' | 'ready', progress: number) => void): Promise<GridEngineWasm>;
18
+ /** Loads the full dataset. Runs in the worker — non-blocking. */
19
+ setData(data: unknown[], reportProgress?: boolean): Promise<void>;
20
+ /**
21
+ * Streaming load — begin. Clears the engine and resets the worker-side byte scanner.
22
+ * Pair with streamChunk() (many) and streamEnd() (once).
23
+ */
24
+ streamStart(reportProgress?: boolean): Promise<void>;
25
+ /**
26
+ * Streaming load — feed one raw byte chunk straight from fetch's ReadableStream.
27
+ * The buffer is transferred (zero-copy); the caller must not reuse `bytes` afterward.
28
+ * All JSON parsing happens in the worker, so the main thread never blocks.
29
+ * @returns running total of complete rows parsed so far.
30
+ */
31
+ streamChunk(bytes: Uint8Array): Promise<number>;
32
+ /** Streaming load — finish. Flushes remaining rows and builds the index in the worker. */
33
+ streamEnd(reportProgress?: boolean): Promise<void>;
34
+ /**
35
+ * Patches rows in place at their raw (unfiltered, unsorted) positions — the cheap path for
36
+ * an edit. `setData` would re-upload and re-index the whole dataset, and report progress
37
+ * while doing it, to change one cell.
38
+ */
39
+ updateRows(rows: {
40
+ index: number;
41
+ row: unknown;
42
+ }[]): Promise<void>;
43
+ /** Inserts rows at a raw position — the row-add path. */
44
+ insertRows(index: number, rows: unknown[]): Promise<void>;
45
+ /** Removes rows at raw positions. */
46
+ removeRows(indices: number[]): Promise<void>;
47
+ /** Applies filter+sort and fetches the page in a single atomic Worker call — prevents interleaving. */
48
+ filterSortAndGetPage(text: string, col: string, asc: boolean, page: number, pageSize: number): Promise<{
49
+ rows: unknown[];
50
+ filtered: number;
51
+ raw: number;
52
+ }>;
53
+ /** Returns a page of rows plus the filtered total. */
54
+ getPage(page: number, pageSize: number): Promise<{
55
+ rows: unknown[];
56
+ total: number;
57
+ }>;
58
+ /** Returns a page of the raw (unfiltered) rows plus the raw total — used by "export all". */
59
+ getRawPage(page: number, pageSize: number): Promise<{
60
+ rows: unknown[];
61
+ total: number;
62
+ }>;
63
+ /** Returns the filtered row count. */
64
+ getTotalCount(): Promise<number>;
65
+ /** Returns the raw (unfiltered) row count. */
66
+ getRawCount(): Promise<number>;
67
+ /** Terminates the worker thread, releasing its WASM memory and the thread itself immediately.
68
+ * Each grid has its own worker, so this only affects this engine. */
69
+ terminate(): void;
70
+ }
@@ -0,0 +1,102 @@
1
+ /**
2
+ * GridEngineWorker.ts
3
+ * Web Worker script — runs inside a dedicated worker thread.
4
+ * Loads the Rust WASM module and handles postMessage commands from the main thread.
5
+ * Each GridEngine instance is keyed by an `id` so one worker can serve multiple grids.
6
+ * Each grid has its own independent command queue to prevent interleaving.
7
+ */
8
+ export type WorkerRequest = {
9
+ id: string;
10
+ seq: number;
11
+ cmd: 'init';
12
+ } | {
13
+ id: string;
14
+ seq: number;
15
+ cmd: 'setData';
16
+ bytes: Uint8Array;
17
+ } | {
18
+ id: string;
19
+ seq: number;
20
+ cmd: 'appendChunk';
21
+ bytes: Uint8Array;
22
+ } | {
23
+ id: string;
24
+ seq: number;
25
+ cmd: 'streamStart';
26
+ } | {
27
+ id: string;
28
+ seq: number;
29
+ cmd: 'streamChunk';
30
+ bytes: Uint8Array;
31
+ } | {
32
+ id: string;
33
+ seq: number;
34
+ cmd: 'streamEnd';
35
+ } | {
36
+ id: string;
37
+ seq: number;
38
+ cmd: 'filterSortAndGetPage';
39
+ text: string;
40
+ col: string;
41
+ asc: boolean;
42
+ page: number;
43
+ pageSize: number;
44
+ } | {
45
+ id: string;
46
+ seq: number;
47
+ cmd: 'getPage';
48
+ page: number;
49
+ pageSize: number;
50
+ } | {
51
+ id: string;
52
+ seq: number;
53
+ cmd: 'getRawPage';
54
+ page: number;
55
+ pageSize: number;
56
+ } | {
57
+ id: string;
58
+ seq: number;
59
+ cmd: 'getTotalCount';
60
+ } | {
61
+ id: string;
62
+ seq: number;
63
+ cmd: 'getRawCount';
64
+ } | {
65
+ id: string;
66
+ seq: number;
67
+ cmd: 'updateRows';
68
+ indices: Uint32Array;
69
+ rowsJson: string;
70
+ } | {
71
+ id: string;
72
+ seq: number;
73
+ cmd: 'insertRows';
74
+ index: number;
75
+ rowsJson: string;
76
+ } | {
77
+ id: string;
78
+ seq: number;
79
+ cmd: 'removeRows';
80
+ indices: Uint32Array;
81
+ } | {
82
+ id: string;
83
+ seq: number;
84
+ cmd: 'finalize';
85
+ };
86
+ export type WorkerResponse = {
87
+ id: string;
88
+ seq: number;
89
+ ok: true;
90
+ result?: unknown;
91
+ } | {
92
+ id: string;
93
+ seq: number;
94
+ ok: false;
95
+ error: string;
96
+ } | {
97
+ id: string;
98
+ seq: -1;
99
+ type: 'progress';
100
+ stage: 'indexing' | 'ready';
101
+ progress: number;
102
+ };