@delightloop/spreadsheet-wasm 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.
package/README.md ADDED
@@ -0,0 +1,143 @@
1
+ # @delightloop/spreadsheet-wasm
2
+
3
+ High-performance spreadsheet engine compiled to WebAssembly using Rust.
4
+
5
+ ## Features
6
+
7
+ - **High-Performance CSV Parsing**: Parse large CSV files efficiently
8
+ - **Multi-Column Sorting**: Stable sort with multiple columns support
9
+ - **Advanced Filtering**: Text, number, date, and enum filters
10
+ - **Global Search**: Fuzzy matching across all cells
11
+ - **Data Validation**: Email, phone, URL, LinkedIn validation
12
+ - **Aggregations**: Count, sum, avg, min, max, unique operations
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @delightloop/spreadsheet-wasm
18
+ # or
19
+ pnpm add @delightloop/spreadsheet-wasm
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ```typescript
25
+ import init, { SpreadsheetEngine } from '@delightloop/spreadsheet-wasm';
26
+
27
+ // Initialize WASM
28
+ await init();
29
+
30
+ // Create engine instance
31
+ const engine = new SpreadsheetEngine();
32
+
33
+ // Load CSV data
34
+ const response = await fetch('/data.csv');
35
+ const bytes = new Uint8Array(await response.arrayBuffer());
36
+ const result = engine.load_csv(bytes);
37
+
38
+ if (result.success) {
39
+ console.log(`Loaded ${result.rowCount} rows with ${result.columnCount} columns`);
40
+ }
41
+
42
+ // Get rows (paginated)
43
+ const rows = engine.get_rows(0, 100);
44
+
45
+ // Sort by column
46
+ engine.sort([
47
+ { columnId: 'col1', direction: 'asc' },
48
+ { columnId: 'col2', direction: 'desc' },
49
+ ]);
50
+
51
+ // Filter rows
52
+ engine.filter([
53
+ { columnId: 'col1', operator: 'contains', value: 'search term' },
54
+ ]);
55
+
56
+ // Search across all columns
57
+ engine.search('query');
58
+
59
+ // Update cell
60
+ const validation = engine.update_cell('row-id', 'email', 'test@example.com');
61
+ if (validation.valid) {
62
+ console.log('Cell updated successfully');
63
+ }
64
+
65
+ // Export to CSV
66
+ const csvBytes = engine.export_csv();
67
+ ```
68
+
69
+ ## API Reference
70
+
71
+ ### SpreadsheetEngine
72
+
73
+ #### Constructor
74
+
75
+ ```typescript
76
+ const engine = new SpreadsheetEngine();
77
+ ```
78
+
79
+ #### CSV Operations
80
+
81
+ - `load_csv(bytes: Uint8Array): CsvParseResult` - Parse CSV data
82
+ - `export_csv(): Uint8Array` - Export data as CSV
83
+
84
+ #### Data Operations
85
+
86
+ - `set_data(rows: Row[])` - Set all rows
87
+ - `set_columns(columns: ColumnConfig[])` - Set column configuration
88
+ - `get_rows(start: number, count: number): Row[]` - Get paginated rows
89
+ - `get_row(rowId: string): Row | null` - Get single row
90
+ - `get_columns(): ColumnConfig[]` - Get all columns
91
+ - `update_cell(rowId: string, colKey: string, value: any): ValidationResult`
92
+ - `add_row(row: Row): string` - Add row and return ID
93
+ - `delete_rows(rowIds: string[])` - Delete multiple rows
94
+ - `duplicate_rows(rowIds: string[]): string[]` - Duplicate rows
95
+
96
+ #### Column Operations
97
+
98
+ - `add_column(config: ColumnConfig): string` - Add column
99
+ - `update_column(colId: string, config: ColumnConfig)` - Update column
100
+ - `delete_column(colId: string)` - Delete column
101
+ - `reorder_columns(colIds: string[])` - Reorder columns
102
+
103
+ #### Sort/Filter/Search
104
+
105
+ - `sort(configs: SortConfig[])` - Apply sort
106
+ - `filter(configs: FilterConfig[])` - Apply filters
107
+ - `search(query: string)` - Global search
108
+ - `clear_filters()` - Clear all filters, sorts, and search
109
+
110
+ #### Validation
111
+
112
+ - `validate_cell(value: any, dataType: string): ValidationResult`
113
+
114
+ #### Aggregations
115
+
116
+ - `aggregate(colKey: string, op: string): AggregationResult`
117
+ - `get_unique_values(colKey: string): any[]`
118
+
119
+ #### State
120
+
121
+ - `get_total_rows(): number` - Total row count
122
+ - `get_visible_rows(): number` - Visible row count (after filter)
123
+
124
+ ## Building from Source
125
+
126
+ ### Prerequisites
127
+
128
+ - Rust (latest stable)
129
+ - wasm-pack (`cargo install wasm-pack`)
130
+
131
+ ### Build
132
+
133
+ ```bash
134
+ # Build WASM
135
+ wasm-pack build --target web --release
136
+
137
+ # Run tests
138
+ cargo test
139
+ ```
140
+
141
+ ## License
142
+
143
+ MIT
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@delightloop/spreadsheet-wasm",
3
+ "type": "module",
4
+ "collaborators": [
5
+ "DelightLoop <dev@delightloop.com>"
6
+ ],
7
+ "description": "High-performance spreadsheet engine with 99.999999% accurate CSV type detection compiled to WebAssembly",
8
+ "version": "0.2.0",
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/labs-delightloop/spreadsheet-wasm"
13
+ },
14
+ "files": [
15
+ "spreadsheet_wasm_bg.wasm",
16
+ "spreadsheet_wasm.js",
17
+ "spreadsheet_wasm.d.ts"
18
+ ],
19
+ "main": "spreadsheet_wasm.js",
20
+ "types": "spreadsheet_wasm.d.ts",
21
+ "sideEffects": [
22
+ "./snippets/*"
23
+ ],
24
+ "keywords": [
25
+ "spreadsheet",
26
+ "csv",
27
+ "wasm",
28
+ "webassembly",
29
+ "parser",
30
+ "data-grid",
31
+ "type-detection"
32
+ ]
33
+ }
@@ -0,0 +1,204 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * Main spreadsheet engine exposed to JavaScript
6
+ */
7
+ export class SpreadsheetEngine {
8
+ free(): void;
9
+ [Symbol.dispose](): void;
10
+ /**
11
+ * Add a new column
12
+ */
13
+ add_column(config: any): string;
14
+ /**
15
+ * Add a new row
16
+ */
17
+ add_row(row: any): string;
18
+ /**
19
+ * Perform aggregation on a column
20
+ */
21
+ aggregate(col_key: string, op: string): any;
22
+ /**
23
+ * Clear all filters, sorts, and search
24
+ */
25
+ clear_filters(): void;
26
+ /**
27
+ * Delete a column
28
+ */
29
+ delete_column(col_id: string): void;
30
+ /**
31
+ * Delete rows by IDs
32
+ */
33
+ delete_rows(row_ids: any): void;
34
+ /**
35
+ * Duplicate rows and return new IDs
36
+ */
37
+ duplicate_rows(row_ids: any): any;
38
+ /**
39
+ * Export current data to CSV bytes
40
+ */
41
+ export_csv(): Uint8Array;
42
+ /**
43
+ * Apply filter configuration
44
+ */
45
+ filter(configs: any): void;
46
+ /**
47
+ * Get all columns
48
+ */
49
+ get_columns(): any;
50
+ /**
51
+ * Get current filter configuration
52
+ */
53
+ get_filter_configs(): any;
54
+ /**
55
+ * Get a single row by ID
56
+ */
57
+ get_row(row_id: string): any;
58
+ /**
59
+ * Get rows (paginated)
60
+ */
61
+ get_rows(start: number, count: number): any;
62
+ /**
63
+ * Get current sort configuration
64
+ */
65
+ get_sort_configs(): any;
66
+ /**
67
+ * Get total row count
68
+ */
69
+ get_total_rows(): number;
70
+ /**
71
+ * Get unique values for a column (for filter dropdowns)
72
+ */
73
+ get_unique_values(col_key: string): any;
74
+ /**
75
+ * Get visible row count (after filters)
76
+ */
77
+ get_visible_rows(): number;
78
+ /**
79
+ * Initialize with default 20 empty rows
80
+ */
81
+ init_default_rows(): void;
82
+ /**
83
+ * Initialize with a specified number of empty rows
84
+ * Useful for creating a new blank spreadsheet
85
+ */
86
+ init_empty_rows(count: number): void;
87
+ /**
88
+ * Load data from CSV bytes
89
+ * Returns a CsvParseResult as JsValue
90
+ */
91
+ load_csv(bytes: Uint8Array): any;
92
+ /**
93
+ * Create a new SpreadsheetEngine instance
94
+ */
95
+ constructor();
96
+ /**
97
+ * Reorder columns
98
+ */
99
+ reorder_columns(col_ids: any): void;
100
+ /**
101
+ * Search across all columns
102
+ */
103
+ search(query: string): void;
104
+ /**
105
+ * Set columns configuration
106
+ */
107
+ set_columns(columns: any): void;
108
+ /**
109
+ * Set data from JavaScript array
110
+ */
111
+ set_data(rows: any): void;
112
+ /**
113
+ * Apply sort configuration
114
+ */
115
+ sort(configs: any): void;
116
+ /**
117
+ * Update a cell value
118
+ */
119
+ update_cell(row_id: string, col_key: string, value: any): any;
120
+ /**
121
+ * Update column configuration
122
+ */
123
+ update_column(col_id: string, config: any): void;
124
+ /**
125
+ * Validate a single cell value
126
+ */
127
+ validate_cell(value: any, data_type: string): any;
128
+ /**
129
+ * Validate an entire row
130
+ */
131
+ validate_row(row: any, columns: any): any;
132
+ }
133
+
134
+ /**
135
+ * Initialize panic hook for better error messages
136
+ */
137
+ export function init(): void;
138
+
139
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
140
+
141
+ export interface InitOutput {
142
+ readonly memory: WebAssembly.Memory;
143
+ readonly __wbg_spreadsheetengine_free: (a: number, b: number) => void;
144
+ readonly init: () => void;
145
+ readonly spreadsheetengine_add_column: (a: number, b: any) => [number, number];
146
+ readonly spreadsheetengine_add_row: (a: number, b: any) => [number, number];
147
+ readonly spreadsheetengine_aggregate: (a: number, b: number, c: number, d: number, e: number) => any;
148
+ readonly spreadsheetengine_clear_filters: (a: number) => void;
149
+ readonly spreadsheetengine_delete_column: (a: number, b: number, c: number) => void;
150
+ readonly spreadsheetengine_delete_rows: (a: number, b: any) => void;
151
+ readonly spreadsheetengine_duplicate_rows: (a: number, b: any) => any;
152
+ readonly spreadsheetengine_export_csv: (a: number) => [number, number];
153
+ readonly spreadsheetengine_filter: (a: number, b: any) => void;
154
+ readonly spreadsheetengine_get_columns: (a: number) => any;
155
+ readonly spreadsheetengine_get_filter_configs: (a: number) => any;
156
+ readonly spreadsheetengine_get_row: (a: number, b: number, c: number) => any;
157
+ readonly spreadsheetengine_get_rows: (a: number, b: number, c: number) => any;
158
+ readonly spreadsheetengine_get_sort_configs: (a: number) => any;
159
+ readonly spreadsheetengine_get_total_rows: (a: number) => number;
160
+ readonly spreadsheetengine_get_unique_values: (a: number, b: number, c: number) => any;
161
+ readonly spreadsheetengine_get_visible_rows: (a: number) => number;
162
+ readonly spreadsheetengine_init_default_rows: (a: number) => void;
163
+ readonly spreadsheetengine_init_empty_rows: (a: number, b: number) => void;
164
+ readonly spreadsheetengine_load_csv: (a: number, b: number, c: number) => any;
165
+ readonly spreadsheetengine_new: () => number;
166
+ readonly spreadsheetengine_reorder_columns: (a: number, b: any) => void;
167
+ readonly spreadsheetengine_search: (a: number, b: number, c: number) => void;
168
+ readonly spreadsheetengine_set_columns: (a: number, b: any) => void;
169
+ readonly spreadsheetengine_set_data: (a: number, b: any) => void;
170
+ readonly spreadsheetengine_sort: (a: number, b: any) => void;
171
+ readonly spreadsheetengine_update_cell: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
172
+ readonly spreadsheetengine_update_column: (a: number, b: number, c: number, d: any) => void;
173
+ readonly spreadsheetengine_validate_cell: (a: number, b: any, c: number, d: number) => any;
174
+ readonly spreadsheetengine_validate_row: (a: number, b: any, c: any) => any;
175
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
176
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
177
+ readonly __wbindgen_exn_store: (a: number) => void;
178
+ readonly __externref_table_alloc: () => number;
179
+ readonly __wbindgen_externrefs: WebAssembly.Table;
180
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
181
+ readonly __wbindgen_start: () => void;
182
+ }
183
+
184
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
185
+
186
+ /**
187
+ * Instantiates the given `module`, which can either be bytes or
188
+ * a precompiled `WebAssembly.Module`.
189
+ *
190
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
191
+ *
192
+ * @returns {InitOutput}
193
+ */
194
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
195
+
196
+ /**
197
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
198
+ * for everything else, calls `WebAssembly.instantiate` directly.
199
+ *
200
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
201
+ *
202
+ * @returns {Promise<InitOutput>}
203
+ */
204
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,855 @@
1
+ /* @ts-self-types="./spreadsheet_wasm.d.ts" */
2
+
3
+ /**
4
+ * Main spreadsheet engine exposed to JavaScript
5
+ */
6
+ export class SpreadsheetEngine {
7
+ __destroy_into_raw() {
8
+ const ptr = this.__wbg_ptr;
9
+ this.__wbg_ptr = 0;
10
+ SpreadsheetEngineFinalization.unregister(this);
11
+ return ptr;
12
+ }
13
+ free() {
14
+ const ptr = this.__destroy_into_raw();
15
+ wasm.__wbg_spreadsheetengine_free(ptr, 0);
16
+ }
17
+ /**
18
+ * Add a new column
19
+ * @param {any} config
20
+ * @returns {string}
21
+ */
22
+ add_column(config) {
23
+ let deferred1_0;
24
+ let deferred1_1;
25
+ try {
26
+ const ret = wasm.spreadsheetengine_add_column(this.__wbg_ptr, config);
27
+ deferred1_0 = ret[0];
28
+ deferred1_1 = ret[1];
29
+ return getStringFromWasm0(ret[0], ret[1]);
30
+ } finally {
31
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
32
+ }
33
+ }
34
+ /**
35
+ * Add a new row
36
+ * @param {any} row
37
+ * @returns {string}
38
+ */
39
+ add_row(row) {
40
+ let deferred1_0;
41
+ let deferred1_1;
42
+ try {
43
+ const ret = wasm.spreadsheetengine_add_row(this.__wbg_ptr, row);
44
+ deferred1_0 = ret[0];
45
+ deferred1_1 = ret[1];
46
+ return getStringFromWasm0(ret[0], ret[1]);
47
+ } finally {
48
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
49
+ }
50
+ }
51
+ /**
52
+ * Perform aggregation on a column
53
+ * @param {string} col_key
54
+ * @param {string} op
55
+ * @returns {any}
56
+ */
57
+ aggregate(col_key, op) {
58
+ const ptr0 = passStringToWasm0(col_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
59
+ const len0 = WASM_VECTOR_LEN;
60
+ const ptr1 = passStringToWasm0(op, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
61
+ const len1 = WASM_VECTOR_LEN;
62
+ const ret = wasm.spreadsheetengine_aggregate(this.__wbg_ptr, ptr0, len0, ptr1, len1);
63
+ return ret;
64
+ }
65
+ /**
66
+ * Clear all filters, sorts, and search
67
+ */
68
+ clear_filters() {
69
+ wasm.spreadsheetengine_clear_filters(this.__wbg_ptr);
70
+ }
71
+ /**
72
+ * Delete a column
73
+ * @param {string} col_id
74
+ */
75
+ delete_column(col_id) {
76
+ const ptr0 = passStringToWasm0(col_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
77
+ const len0 = WASM_VECTOR_LEN;
78
+ wasm.spreadsheetengine_delete_column(this.__wbg_ptr, ptr0, len0);
79
+ }
80
+ /**
81
+ * Delete rows by IDs
82
+ * @param {any} row_ids
83
+ */
84
+ delete_rows(row_ids) {
85
+ wasm.spreadsheetengine_delete_rows(this.__wbg_ptr, row_ids);
86
+ }
87
+ /**
88
+ * Duplicate rows and return new IDs
89
+ * @param {any} row_ids
90
+ * @returns {any}
91
+ */
92
+ duplicate_rows(row_ids) {
93
+ const ret = wasm.spreadsheetengine_duplicate_rows(this.__wbg_ptr, row_ids);
94
+ return ret;
95
+ }
96
+ /**
97
+ * Export current data to CSV bytes
98
+ * @returns {Uint8Array}
99
+ */
100
+ export_csv() {
101
+ const ret = wasm.spreadsheetengine_export_csv(this.__wbg_ptr);
102
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
103
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
104
+ return v1;
105
+ }
106
+ /**
107
+ * Apply filter configuration
108
+ * @param {any} configs
109
+ */
110
+ filter(configs) {
111
+ wasm.spreadsheetengine_filter(this.__wbg_ptr, configs);
112
+ }
113
+ /**
114
+ * Get all columns
115
+ * @returns {any}
116
+ */
117
+ get_columns() {
118
+ const ret = wasm.spreadsheetengine_get_columns(this.__wbg_ptr);
119
+ return ret;
120
+ }
121
+ /**
122
+ * Get current filter configuration
123
+ * @returns {any}
124
+ */
125
+ get_filter_configs() {
126
+ const ret = wasm.spreadsheetengine_get_filter_configs(this.__wbg_ptr);
127
+ return ret;
128
+ }
129
+ /**
130
+ * Get a single row by ID
131
+ * @param {string} row_id
132
+ * @returns {any}
133
+ */
134
+ get_row(row_id) {
135
+ const ptr0 = passStringToWasm0(row_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
136
+ const len0 = WASM_VECTOR_LEN;
137
+ const ret = wasm.spreadsheetengine_get_row(this.__wbg_ptr, ptr0, len0);
138
+ return ret;
139
+ }
140
+ /**
141
+ * Get rows (paginated)
142
+ * @param {number} start
143
+ * @param {number} count
144
+ * @returns {any}
145
+ */
146
+ get_rows(start, count) {
147
+ const ret = wasm.spreadsheetengine_get_rows(this.__wbg_ptr, start, count);
148
+ return ret;
149
+ }
150
+ /**
151
+ * Get current sort configuration
152
+ * @returns {any}
153
+ */
154
+ get_sort_configs() {
155
+ const ret = wasm.spreadsheetengine_get_sort_configs(this.__wbg_ptr);
156
+ return ret;
157
+ }
158
+ /**
159
+ * Get total row count
160
+ * @returns {number}
161
+ */
162
+ get_total_rows() {
163
+ const ret = wasm.spreadsheetengine_get_total_rows(this.__wbg_ptr);
164
+ return ret >>> 0;
165
+ }
166
+ /**
167
+ * Get unique values for a column (for filter dropdowns)
168
+ * @param {string} col_key
169
+ * @returns {any}
170
+ */
171
+ get_unique_values(col_key) {
172
+ const ptr0 = passStringToWasm0(col_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
173
+ const len0 = WASM_VECTOR_LEN;
174
+ const ret = wasm.spreadsheetengine_get_unique_values(this.__wbg_ptr, ptr0, len0);
175
+ return ret;
176
+ }
177
+ /**
178
+ * Get visible row count (after filters)
179
+ * @returns {number}
180
+ */
181
+ get_visible_rows() {
182
+ const ret = wasm.spreadsheetengine_get_visible_rows(this.__wbg_ptr);
183
+ return ret >>> 0;
184
+ }
185
+ /**
186
+ * Initialize with default 20 empty rows
187
+ */
188
+ init_default_rows() {
189
+ wasm.spreadsheetengine_init_default_rows(this.__wbg_ptr);
190
+ }
191
+ /**
192
+ * Initialize with a specified number of empty rows
193
+ * Useful for creating a new blank spreadsheet
194
+ * @param {number} count
195
+ */
196
+ init_empty_rows(count) {
197
+ wasm.spreadsheetengine_init_empty_rows(this.__wbg_ptr, count);
198
+ }
199
+ /**
200
+ * Load data from CSV bytes
201
+ * Returns a CsvParseResult as JsValue
202
+ * @param {Uint8Array} bytes
203
+ * @returns {any}
204
+ */
205
+ load_csv(bytes) {
206
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
207
+ const len0 = WASM_VECTOR_LEN;
208
+ const ret = wasm.spreadsheetengine_load_csv(this.__wbg_ptr, ptr0, len0);
209
+ return ret;
210
+ }
211
+ /**
212
+ * Create a new SpreadsheetEngine instance
213
+ */
214
+ constructor() {
215
+ const ret = wasm.spreadsheetengine_new();
216
+ this.__wbg_ptr = ret >>> 0;
217
+ SpreadsheetEngineFinalization.register(this, this.__wbg_ptr, this);
218
+ return this;
219
+ }
220
+ /**
221
+ * Reorder columns
222
+ * @param {any} col_ids
223
+ */
224
+ reorder_columns(col_ids) {
225
+ wasm.spreadsheetengine_reorder_columns(this.__wbg_ptr, col_ids);
226
+ }
227
+ /**
228
+ * Search across all columns
229
+ * @param {string} query
230
+ */
231
+ search(query) {
232
+ const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
233
+ const len0 = WASM_VECTOR_LEN;
234
+ wasm.spreadsheetengine_search(this.__wbg_ptr, ptr0, len0);
235
+ }
236
+ /**
237
+ * Set columns configuration
238
+ * @param {any} columns
239
+ */
240
+ set_columns(columns) {
241
+ wasm.spreadsheetengine_set_columns(this.__wbg_ptr, columns);
242
+ }
243
+ /**
244
+ * Set data from JavaScript array
245
+ * @param {any} rows
246
+ */
247
+ set_data(rows) {
248
+ wasm.spreadsheetengine_set_data(this.__wbg_ptr, rows);
249
+ }
250
+ /**
251
+ * Apply sort configuration
252
+ * @param {any} configs
253
+ */
254
+ sort(configs) {
255
+ wasm.spreadsheetengine_sort(this.__wbg_ptr, configs);
256
+ }
257
+ /**
258
+ * Update a cell value
259
+ * @param {string} row_id
260
+ * @param {string} col_key
261
+ * @param {any} value
262
+ * @returns {any}
263
+ */
264
+ update_cell(row_id, col_key, value) {
265
+ const ptr0 = passStringToWasm0(row_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
266
+ const len0 = WASM_VECTOR_LEN;
267
+ const ptr1 = passStringToWasm0(col_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
268
+ const len1 = WASM_VECTOR_LEN;
269
+ const ret = wasm.spreadsheetengine_update_cell(this.__wbg_ptr, ptr0, len0, ptr1, len1, value);
270
+ return ret;
271
+ }
272
+ /**
273
+ * Update column configuration
274
+ * @param {string} col_id
275
+ * @param {any} config
276
+ */
277
+ update_column(col_id, config) {
278
+ const ptr0 = passStringToWasm0(col_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
279
+ const len0 = WASM_VECTOR_LEN;
280
+ wasm.spreadsheetengine_update_column(this.__wbg_ptr, ptr0, len0, config);
281
+ }
282
+ /**
283
+ * Validate a single cell value
284
+ * @param {any} value
285
+ * @param {string} data_type
286
+ * @returns {any}
287
+ */
288
+ validate_cell(value, data_type) {
289
+ const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
290
+ const len0 = WASM_VECTOR_LEN;
291
+ const ret = wasm.spreadsheetengine_validate_cell(this.__wbg_ptr, value, ptr0, len0);
292
+ return ret;
293
+ }
294
+ /**
295
+ * Validate an entire row
296
+ * @param {any} row
297
+ * @param {any} columns
298
+ * @returns {any}
299
+ */
300
+ validate_row(row, columns) {
301
+ const ret = wasm.spreadsheetengine_validate_row(this.__wbg_ptr, row, columns);
302
+ return ret;
303
+ }
304
+ }
305
+ if (Symbol.dispose) SpreadsheetEngine.prototype[Symbol.dispose] = SpreadsheetEngine.prototype.free;
306
+
307
+ /**
308
+ * Initialize panic hook for better error messages
309
+ */
310
+ export function init() {
311
+ wasm.init();
312
+ }
313
+
314
+ function __wbg_get_imports() {
315
+ const import0 = {
316
+ __proto__: null,
317
+ __wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
318
+ const ret = Error(getStringFromWasm0(arg0, arg1));
319
+ return ret;
320
+ },
321
+ __wbg_Number_04624de7d0e8332d: function(arg0) {
322
+ const ret = Number(arg0);
323
+ return ret;
324
+ },
325
+ __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(arg0, arg1) {
326
+ const v = arg1;
327
+ const ret = typeof(v) === 'bigint' ? v : undefined;
328
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
329
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
330
+ },
331
+ __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
332
+ const v = arg0;
333
+ const ret = typeof(v) === 'boolean' ? v : undefined;
334
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
335
+ },
336
+ __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
337
+ const ret = debugString(arg1);
338
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
339
+ const len1 = WASM_VECTOR_LEN;
340
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
341
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
342
+ },
343
+ __wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
344
+ const ret = arg0 in arg1;
345
+ return ret;
346
+ },
347
+ __wbg___wbindgen_is_bigint_31b12575b56f32fc: function(arg0) {
348
+ const ret = typeof(arg0) === 'bigint';
349
+ return ret;
350
+ },
351
+ __wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
352
+ const ret = typeof(arg0) === 'function';
353
+ return ret;
354
+ },
355
+ __wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
356
+ const val = arg0;
357
+ const ret = typeof(val) === 'object' && val !== null;
358
+ return ret;
359
+ },
360
+ __wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
361
+ const ret = typeof(arg0) === 'string';
362
+ return ret;
363
+ },
364
+ __wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
365
+ const ret = arg0 === undefined;
366
+ return ret;
367
+ },
368
+ __wbg___wbindgen_jsval_eq_11888390b0186270: function(arg0, arg1) {
369
+ const ret = arg0 === arg1;
370
+ return ret;
371
+ },
372
+ __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
373
+ const ret = arg0 == arg1;
374
+ return ret;
375
+ },
376
+ __wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
377
+ const obj = arg1;
378
+ const ret = typeof(obj) === 'number' ? obj : undefined;
379
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
380
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
381
+ },
382
+ __wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
383
+ const obj = arg1;
384
+ const ret = typeof(obj) === 'string' ? obj : undefined;
385
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
386
+ var len1 = WASM_VECTOR_LEN;
387
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
388
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
389
+ },
390
+ __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
391
+ throw new Error(getStringFromWasm0(arg0, arg1));
392
+ },
393
+ __wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
394
+ const ret = arg0.call(arg1);
395
+ return ret;
396
+ }, arguments); },
397
+ __wbg_done_57b39ecd9addfe81: function(arg0) {
398
+ const ret = arg0.done;
399
+ return ret;
400
+ },
401
+ __wbg_entries_58c7934c745daac7: function(arg0) {
402
+ const ret = Object.entries(arg0);
403
+ return ret;
404
+ },
405
+ __wbg_error_7534b8e9a36f1ab4: function(arg0, arg1) {
406
+ let deferred0_0;
407
+ let deferred0_1;
408
+ try {
409
+ deferred0_0 = arg0;
410
+ deferred0_1 = arg1;
411
+ console.error(getStringFromWasm0(arg0, arg1));
412
+ } finally {
413
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
414
+ }
415
+ },
416
+ __wbg_getRandomValues_71d446877d8b0ad4: function() { return handleError(function (arg0, arg1) {
417
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
418
+ }, arguments); },
419
+ __wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
420
+ const ret = arg0[arg1 >>> 0];
421
+ return ret;
422
+ },
423
+ __wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
424
+ const ret = Reflect.get(arg0, arg1);
425
+ return ret;
426
+ }, arguments); },
427
+ __wbg_get_with_ref_key_1dc361bd10053bfe: function(arg0, arg1) {
428
+ const ret = arg0[arg1];
429
+ return ret;
430
+ },
431
+ __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
432
+ let result;
433
+ try {
434
+ result = arg0 instanceof ArrayBuffer;
435
+ } catch (_) {
436
+ result = false;
437
+ }
438
+ const ret = result;
439
+ return ret;
440
+ },
441
+ __wbg_instanceof_Map_53af74335dec57f4: function(arg0) {
442
+ let result;
443
+ try {
444
+ result = arg0 instanceof Map;
445
+ } catch (_) {
446
+ result = false;
447
+ }
448
+ const ret = result;
449
+ return ret;
450
+ },
451
+ __wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
452
+ let result;
453
+ try {
454
+ result = arg0 instanceof Uint8Array;
455
+ } catch (_) {
456
+ result = false;
457
+ }
458
+ const ret = result;
459
+ return ret;
460
+ },
461
+ __wbg_isArray_d314bb98fcf08331: function(arg0) {
462
+ const ret = Array.isArray(arg0);
463
+ return ret;
464
+ },
465
+ __wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
466
+ const ret = Number.isSafeInteger(arg0);
467
+ return ret;
468
+ },
469
+ __wbg_iterator_6ff6560ca1568e55: function() {
470
+ const ret = Symbol.iterator;
471
+ return ret;
472
+ },
473
+ __wbg_length_32ed9a279acd054c: function(arg0) {
474
+ const ret = arg0.length;
475
+ return ret;
476
+ },
477
+ __wbg_length_35a7bace40f36eac: function(arg0) {
478
+ const ret = arg0.length;
479
+ return ret;
480
+ },
481
+ __wbg_new_361308b2356cecd0: function() {
482
+ const ret = new Object();
483
+ return ret;
484
+ },
485
+ __wbg_new_3eb36ae241fe6f44: function() {
486
+ const ret = new Array();
487
+ return ret;
488
+ },
489
+ __wbg_new_8a6f238a6ece86ea: function() {
490
+ const ret = new Error();
491
+ return ret;
492
+ },
493
+ __wbg_new_dca287b076112a51: function() {
494
+ const ret = new Map();
495
+ return ret;
496
+ },
497
+ __wbg_new_dd2b680c8bf6ae29: function(arg0) {
498
+ const ret = new Uint8Array(arg0);
499
+ return ret;
500
+ },
501
+ __wbg_next_3482f54c49e8af19: function() { return handleError(function (arg0) {
502
+ const ret = arg0.next();
503
+ return ret;
504
+ }, arguments); },
505
+ __wbg_next_418f80d8f5303233: function(arg0) {
506
+ const ret = arg0.next;
507
+ return ret;
508
+ },
509
+ __wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
510
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
511
+ },
512
+ __wbg_push_8ffdcb2063340ba5: function(arg0, arg1) {
513
+ const ret = arg0.push(arg1);
514
+ return ret;
515
+ },
516
+ __wbg_set_1eb0999cf5d27fc8: function(arg0, arg1, arg2) {
517
+ const ret = arg0.set(arg1, arg2);
518
+ return ret;
519
+ },
520
+ __wbg_set_3f1d0b984ed272ed: function(arg0, arg1, arg2) {
521
+ arg0[arg1] = arg2;
522
+ },
523
+ __wbg_set_6cb8631f80447a67: function() { return handleError(function (arg0, arg1, arg2) {
524
+ const ret = Reflect.set(arg0, arg1, arg2);
525
+ return ret;
526
+ }, arguments); },
527
+ __wbg_set_f43e577aea94465b: function(arg0, arg1, arg2) {
528
+ arg0[arg1 >>> 0] = arg2;
529
+ },
530
+ __wbg_stack_0ed75d68575b0f3c: function(arg0, arg1) {
531
+ const ret = arg1.stack;
532
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
533
+ const len1 = WASM_VECTOR_LEN;
534
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
535
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
536
+ },
537
+ __wbg_value_0546255b415e96c1: function(arg0) {
538
+ const ret = arg0.value;
539
+ return ret;
540
+ },
541
+ __wbindgen_cast_0000000000000001: function(arg0) {
542
+ // Cast intrinsic for `F64 -> Externref`.
543
+ const ret = arg0;
544
+ return ret;
545
+ },
546
+ __wbindgen_cast_0000000000000002: function(arg0) {
547
+ // Cast intrinsic for `I64 -> Externref`.
548
+ const ret = arg0;
549
+ return ret;
550
+ },
551
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
552
+ // Cast intrinsic for `Ref(String) -> Externref`.
553
+ const ret = getStringFromWasm0(arg0, arg1);
554
+ return ret;
555
+ },
556
+ __wbindgen_cast_0000000000000004: function(arg0) {
557
+ // Cast intrinsic for `U64 -> Externref`.
558
+ const ret = BigInt.asUintN(64, arg0);
559
+ return ret;
560
+ },
561
+ __wbindgen_init_externref_table: function() {
562
+ const table = wasm.__wbindgen_externrefs;
563
+ const offset = table.grow(4);
564
+ table.set(0, undefined);
565
+ table.set(offset + 0, undefined);
566
+ table.set(offset + 1, null);
567
+ table.set(offset + 2, true);
568
+ table.set(offset + 3, false);
569
+ },
570
+ };
571
+ return {
572
+ __proto__: null,
573
+ "./spreadsheet_wasm_bg.js": import0,
574
+ };
575
+ }
576
+
577
+ const SpreadsheetEngineFinalization = (typeof FinalizationRegistry === 'undefined')
578
+ ? { register: () => {}, unregister: () => {} }
579
+ : new FinalizationRegistry(ptr => wasm.__wbg_spreadsheetengine_free(ptr >>> 0, 1));
580
+
581
+ function addToExternrefTable0(obj) {
582
+ const idx = wasm.__externref_table_alloc();
583
+ wasm.__wbindgen_externrefs.set(idx, obj);
584
+ return idx;
585
+ }
586
+
587
+ function debugString(val) {
588
+ // primitive types
589
+ const type = typeof val;
590
+ if (type == 'number' || type == 'boolean' || val == null) {
591
+ return `${val}`;
592
+ }
593
+ if (type == 'string') {
594
+ return `"${val}"`;
595
+ }
596
+ if (type == 'symbol') {
597
+ const description = val.description;
598
+ if (description == null) {
599
+ return 'Symbol';
600
+ } else {
601
+ return `Symbol(${description})`;
602
+ }
603
+ }
604
+ if (type == 'function') {
605
+ const name = val.name;
606
+ if (typeof name == 'string' && name.length > 0) {
607
+ return `Function(${name})`;
608
+ } else {
609
+ return 'Function';
610
+ }
611
+ }
612
+ // objects
613
+ if (Array.isArray(val)) {
614
+ const length = val.length;
615
+ let debug = '[';
616
+ if (length > 0) {
617
+ debug += debugString(val[0]);
618
+ }
619
+ for(let i = 1; i < length; i++) {
620
+ debug += ', ' + debugString(val[i]);
621
+ }
622
+ debug += ']';
623
+ return debug;
624
+ }
625
+ // Test for built-in
626
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
627
+ let className;
628
+ if (builtInMatches && builtInMatches.length > 1) {
629
+ className = builtInMatches[1];
630
+ } else {
631
+ // Failed to match the standard '[object ClassName]'
632
+ return toString.call(val);
633
+ }
634
+ if (className == 'Object') {
635
+ // we're a user defined class or Object
636
+ // JSON.stringify avoids problems with cycles, and is generally much
637
+ // easier than looping through ownProperties of `val`.
638
+ try {
639
+ return 'Object(' + JSON.stringify(val) + ')';
640
+ } catch (_) {
641
+ return 'Object';
642
+ }
643
+ }
644
+ // errors
645
+ if (val instanceof Error) {
646
+ return `${val.name}: ${val.message}\n${val.stack}`;
647
+ }
648
+ // TODO we could test for more things here, like `Set`s and `Map`s.
649
+ return className;
650
+ }
651
+
652
+ function getArrayU8FromWasm0(ptr, len) {
653
+ ptr = ptr >>> 0;
654
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
655
+ }
656
+
657
+ let cachedDataViewMemory0 = null;
658
+ function getDataViewMemory0() {
659
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
660
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
661
+ }
662
+ return cachedDataViewMemory0;
663
+ }
664
+
665
+ function getStringFromWasm0(ptr, len) {
666
+ ptr = ptr >>> 0;
667
+ return decodeText(ptr, len);
668
+ }
669
+
670
+ let cachedUint8ArrayMemory0 = null;
671
+ function getUint8ArrayMemory0() {
672
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
673
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
674
+ }
675
+ return cachedUint8ArrayMemory0;
676
+ }
677
+
678
+ function handleError(f, args) {
679
+ try {
680
+ return f.apply(this, args);
681
+ } catch (e) {
682
+ const idx = addToExternrefTable0(e);
683
+ wasm.__wbindgen_exn_store(idx);
684
+ }
685
+ }
686
+
687
+ function isLikeNone(x) {
688
+ return x === undefined || x === null;
689
+ }
690
+
691
+ function passArray8ToWasm0(arg, malloc) {
692
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
693
+ getUint8ArrayMemory0().set(arg, ptr / 1);
694
+ WASM_VECTOR_LEN = arg.length;
695
+ return ptr;
696
+ }
697
+
698
+ function passStringToWasm0(arg, malloc, realloc) {
699
+ if (realloc === undefined) {
700
+ const buf = cachedTextEncoder.encode(arg);
701
+ const ptr = malloc(buf.length, 1) >>> 0;
702
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
703
+ WASM_VECTOR_LEN = buf.length;
704
+ return ptr;
705
+ }
706
+
707
+ let len = arg.length;
708
+ let ptr = malloc(len, 1) >>> 0;
709
+
710
+ const mem = getUint8ArrayMemory0();
711
+
712
+ let offset = 0;
713
+
714
+ for (; offset < len; offset++) {
715
+ const code = arg.charCodeAt(offset);
716
+ if (code > 0x7F) break;
717
+ mem[ptr + offset] = code;
718
+ }
719
+ if (offset !== len) {
720
+ if (offset !== 0) {
721
+ arg = arg.slice(offset);
722
+ }
723
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
724
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
725
+ const ret = cachedTextEncoder.encodeInto(arg, view);
726
+
727
+ offset += ret.written;
728
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
729
+ }
730
+
731
+ WASM_VECTOR_LEN = offset;
732
+ return ptr;
733
+ }
734
+
735
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
736
+ cachedTextDecoder.decode();
737
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
738
+ let numBytesDecoded = 0;
739
+ function decodeText(ptr, len) {
740
+ numBytesDecoded += len;
741
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
742
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
743
+ cachedTextDecoder.decode();
744
+ numBytesDecoded = len;
745
+ }
746
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
747
+ }
748
+
749
+ const cachedTextEncoder = new TextEncoder();
750
+
751
+ if (!('encodeInto' in cachedTextEncoder)) {
752
+ cachedTextEncoder.encodeInto = function (arg, view) {
753
+ const buf = cachedTextEncoder.encode(arg);
754
+ view.set(buf);
755
+ return {
756
+ read: arg.length,
757
+ written: buf.length
758
+ };
759
+ };
760
+ }
761
+
762
+ let WASM_VECTOR_LEN = 0;
763
+
764
+ let wasmModule, wasm;
765
+ function __wbg_finalize_init(instance, module) {
766
+ wasm = instance.exports;
767
+ wasmModule = module;
768
+ cachedDataViewMemory0 = null;
769
+ cachedUint8ArrayMemory0 = null;
770
+ wasm.__wbindgen_start();
771
+ return wasm;
772
+ }
773
+
774
+ async function __wbg_load(module, imports) {
775
+ if (typeof Response === 'function' && module instanceof Response) {
776
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
777
+ try {
778
+ return await WebAssembly.instantiateStreaming(module, imports);
779
+ } catch (e) {
780
+ const validResponse = module.ok && expectedResponseType(module.type);
781
+
782
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
783
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
784
+
785
+ } else { throw e; }
786
+ }
787
+ }
788
+
789
+ const bytes = await module.arrayBuffer();
790
+ return await WebAssembly.instantiate(bytes, imports);
791
+ } else {
792
+ const instance = await WebAssembly.instantiate(module, imports);
793
+
794
+ if (instance instanceof WebAssembly.Instance) {
795
+ return { instance, module };
796
+ } else {
797
+ return instance;
798
+ }
799
+ }
800
+
801
+ function expectedResponseType(type) {
802
+ switch (type) {
803
+ case 'basic': case 'cors': case 'default': return true;
804
+ }
805
+ return false;
806
+ }
807
+ }
808
+
809
+ function initSync(module) {
810
+ if (wasm !== undefined) return wasm;
811
+
812
+
813
+ if (module !== undefined) {
814
+ if (Object.getPrototypeOf(module) === Object.prototype) {
815
+ ({module} = module)
816
+ } else {
817
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
818
+ }
819
+ }
820
+
821
+ const imports = __wbg_get_imports();
822
+ if (!(module instanceof WebAssembly.Module)) {
823
+ module = new WebAssembly.Module(module);
824
+ }
825
+ const instance = new WebAssembly.Instance(module, imports);
826
+ return __wbg_finalize_init(instance, module);
827
+ }
828
+
829
+ async function __wbg_init(module_or_path) {
830
+ if (wasm !== undefined) return wasm;
831
+
832
+
833
+ if (module_or_path !== undefined) {
834
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
835
+ ({module_or_path} = module_or_path)
836
+ } else {
837
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
838
+ }
839
+ }
840
+
841
+ if (module_or_path === undefined) {
842
+ module_or_path = new URL('spreadsheet_wasm_bg.wasm', import.meta.url);
843
+ }
844
+ const imports = __wbg_get_imports();
845
+
846
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
847
+ module_or_path = fetch(module_or_path);
848
+ }
849
+
850
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
851
+
852
+ return __wbg_finalize_init(instance, module);
853
+ }
854
+
855
+ export { initSync, __wbg_init as default };
Binary file