jsql-neo 5.5.0 → 6.0.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 (81) hide show
  1. package/LICENSE +202 -202
  2. package/README.md +8155 -8097
  3. package/bin/jsql +320 -320
  4. package/bin/jsql-server +90 -90
  5. package/bin/jsql-server-control.js +177 -177
  6. package/index.d.ts +412 -385
  7. package/index.js +128 -124
  8. package/lib/ast.js +214 -214
  9. package/lib/btree.js +478 -413
  10. package/lib/cache.js +328 -328
  11. package/lib/client.js +125 -125
  12. package/lib/database.js +1741 -1744
  13. package/lib/date-types.js +182 -182
  14. package/lib/errors.js +89 -89
  15. package/lib/jsql_format.js +497 -497
  16. package/lib/migrate.js +254 -254
  17. package/lib/mod.js +292 -292
  18. package/lib/mongo_server.js +607 -607
  19. package/lib/multiserver.js +140 -140
  20. package/lib/mysql_compat.js +413 -413
  21. package/lib/mysql_server.js +1237 -1237
  22. package/lib/native_client.js +722 -732
  23. package/lib/nedb_compat.js +506 -506
  24. package/lib/pg_server.js +864 -864
  25. package/lib/plugin.js +259 -35
  26. package/lib/plugins/audit.js +37 -0
  27. package/lib/plugins/index.js +72 -0
  28. package/lib/plugins/logger.js +35 -0
  29. package/lib/plugins/metrics.js +38 -0
  30. package/lib/plugins/timestamps.js +57 -0
  31. package/lib/plugins/validation.js +128 -0
  32. package/lib/prepared.js +37 -0
  33. package/lib/query.js +834 -815
  34. package/lib/redis_server.js +571 -571
  35. package/lib/sql.js +4053 -3460
  36. package/lib/sqlite_compat.js +323 -323
  37. package/lib/sqlite_worker.js +264 -264
  38. package/lib/table.js +1351 -1304
  39. package/lib/tui.js +502 -502
  40. package/lib/wasm.js +1 -1
  41. package/lib/wasm_client.js +715 -718
  42. package/lib/web_ui.js +257 -257
  43. package/native/jsql-neo-native.node +0 -0
  44. package/nativesrc/jsql-neo-core/Cargo.lock +462 -455
  45. package/nativesrc/jsql-neo-core/Cargo.toml +26 -24
  46. package/nativesrc/jsql-neo-core/src/engine/hybrid.rs +492 -455
  47. package/nativesrc/jsql-neo-core/src/engine/memory.rs +191 -168
  48. package/nativesrc/jsql-neo-core/src/engine/mod.rs +74 -62
  49. package/nativesrc/jsql-neo-core/src/engine/table.rs +996 -700
  50. package/nativesrc/jsql-neo-core/src/lib.rs +2 -2
  51. package/nativesrc/jsql-neo-core/src/storage/mod.rs +2 -2
  52. package/nativesrc/jsql-neo-core/src/storage/persistent.rs +1 -1
  53. package/nativesrc/jsql-neo-core/src/storage/wal.rs +298 -85
  54. package/nativesrc/jsql-neo-core/src/types.rs +93 -93
  55. package/nativesrc/jsql-neo-native/Cargo.lock +613 -606
  56. package/nativesrc/jsql-neo-native/Cargo.toml +24 -16
  57. package/nativesrc/jsql-neo-native/build.rs +3 -3
  58. package/nativesrc/jsql-neo-native/package.json +7 -7
  59. package/nativesrc/jsql-neo-native/src/lib.rs +281 -269
  60. package/nativesrc/jsql-neo-wasm/Cargo.lock +472 -465
  61. package/nativesrc/jsql-neo-wasm/Cargo.toml +22 -15
  62. package/nativesrc/jsql-neo-wasm/src/lib.rs +463 -447
  63. package/package.json +87 -87
  64. package/postinstall.js +158 -158
  65. package/test/btree.test.js +144 -128
  66. package/test/coverage.js +187 -187
  67. package/test/join.test.js +110 -110
  68. package/test/native.test.js +158 -158
  69. package/test/query-opt.test.js +109 -0
  70. package/test/regress-5.1.0.js +271 -271
  71. package/test/smoke.js +58 -58
  72. package/test/sql-parser.test.js +450 -273
  73. package/test/wasm.test.js +110 -110
  74. package/wasm/browser.d.ts +89 -89
  75. package/wasm/browser.mjs +591 -569
  76. package/wasm/browser_bg.mjs +618 -597
  77. package/wasm/jsql_neo_wasm.d.ts +44 -38
  78. package/wasm/jsql_neo_wasm.js +641 -520
  79. package/wasm/jsql_neo_wasm_bg.wasm +0 -0
  80. package/wasm/jsql_neo_wasm_bg.wasm.d.ts +26 -26
  81. package/wasm/package.json +11 -11
package/test/wasm.test.js CHANGED
@@ -1,111 +1,111 @@
1
- /*
2
- * WASM (.wasm) regression tests
3
- * node test/wasm.test.js
4
- * Covers: JSQL CRUD + flat row shape, shorthand schemas, pk-aware by-id CRUD,
5
- * non-auto pk insert backfill, and beginTransaction / rollback / commit.
6
- */
7
- const path = require('path');
8
- const ROOT = path.join(__dirname, '..');
9
-
10
- let passed = 0, failed = 0;
11
- function ok(name, cond, extra) {
12
- if (cond) { passed++; console.log('[OK]', name); }
13
- else { failed++; console.log('[FAIL]', name, extra !== undefined ? JSON.stringify(extra) : ''); }
14
- }
15
-
16
- (async () => {
17
- const { JSQL } = require(path.join(ROOT, 'lib', 'wasm_client'));
18
-
19
- /* ---------- basic CRUD + flat row shape ---------- */
20
- {
21
- const db = new JSQL({ modules: false });
22
- await db.start();
23
- await db.createTable('users', { id: 'integer primary key auto_increment', name: 'string', age: 'integer' });
24
- const ids = await db.insert('users', [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }]);
25
- ok('wasm batch insert returns ids', Array.isArray(ids) && ids.length === 2, ids);
26
-
27
- const row = await db.findById('users', 1);
28
- ok('wasm findById flat row', row && row.id === 1 && row.name === 'Alice' && !('fields' in row), row);
29
-
30
- const rows = await db.find('users', {});
31
- ok('wasm find returns flat rows', rows.length === 2 && rows[1].name === 'Bob', rows);
32
- ok('wasm filter match', (await db.find('users', { age: 25 })).length === 1);
33
- ok('wasm count', (await db.count('users')) === 2);
34
-
35
- await db.updateById('users', 1, { age: 31 });
36
- ok('wasm updateById applied', (await db.findById('users', 1)).age === 31, await db.findById('users', 1));
37
-
38
- await db.updateByIds('users', [[2, { age: 99 }]]);
39
- ok('wasm updateByIds applied', (await db.findById('users', 2)).age === 99, await db.findById('users', 2));
40
-
41
- ok('wasm findByIds', (await db.findByIds('users', [1, 2])).length === 2);
42
-
43
- await db.removeById('users', 1);
44
- ok('wasm removeById applied', (await db.count('users')) === 1, await db.count('users'));
45
-
46
- await db.removeByIds('users', [2]);
47
- ok('wasm removeByIds applied', (await db.count('users')) === 0, await db.count('users'));
48
- await db.stop();
49
- }
50
-
51
- /* ---------- non-auto pk: id resolution by pk value ---------- */
52
- {
53
- const db = new JSQL({ modules: false });
54
- await db.start();
55
- await db.createTable('config', { key: { type: 'string', primaryKey: true }, value: 'string' });
56
- const ids = await db.insert('config', [{ key: 'a', value: '1' }, { key: 'b', value: '2' }]);
57
- ok('wasm non-auto pk insert returns pk values', JSON.stringify(ids) === JSON.stringify(['a', 'b']), ids);
58
-
59
- const a = await db.findById('config', 'a');
60
- ok('wasm findById resolves string pk', a && a.value === '1' && !('fields' in a), a);
61
- ok('wasm findById pk miss returns null', (await db.findById('config', 'nope')) === null);
62
-
63
- await db.updateById('config', 'b', { value: '22' });
64
- ok('wasm updateById resolves string pk', (await db.findById('config', 'b')).value === '22', await db.findById('config', 'b'));
65
-
66
- await db.removeById('config', 'a');
67
- ok('wasm removeById resolves string pk', (await db.count('config')) === 1, await db.count('config'));
68
-
69
- await db.removeByIds('config', ['b']);
70
- ok('wasm removeByIds resolves string pk', (await db.count('config')) === 0, await db.count('config'));
71
- await db.stop();
72
- }
73
-
74
- /* ---------- shorthand schema ---------- */
75
- {
76
- const db = new JSQL({ modules: false });
77
- await db.start();
78
- await db.createTable('t2', { name: 'string unique', n: 'number', ok: 'boolean' });
79
- await db.insert('t2', { name: 'x', n: 1.5, ok: true });
80
- const r2 = (await db.find('t2', {}))[0];
81
- ok('wasm shorthand schema fields', r2.name === 'x' && r2.n === 1.5 && r2.ok === true, r2);
82
-
83
- await db.createTable('cfg', 'key string primary key, value string');
84
- const cfgIds = await db.insert('cfg', { key: 'a', value: '1' });
85
- ok('wasm full shorthand string schema', cfgIds[0] === 'a' && (await db.findById('cfg', 'a')).value === '1', cfgIds);
86
- await db.stop();
87
- }
88
-
89
- /* ---------- transactions ---------- */
90
- {
91
- const db = new JSQL({ modules: false });
92
- await db.start();
93
- await db.createTable('tx', { id: 'integer primary key auto_increment', name: 'string' });
94
- await db.insert('tx', { name: 'n1' });
95
- await db.beginTransaction();
96
- await db.insert('tx', { name: 'n2' });
97
- await db.rollback();
98
- ok('wasm rollback reverts insert', (await db.count('tx')) === 1, await db.count('tx'));
99
- await db.beginTransaction();
100
- await db.insert('tx', { name: 'n3' });
101
- await db.commit();
102
- ok('wasm commit keeps insert', (await db.count('tx')) === 2, await db.count('tx'));
103
- await db.stop();
104
- }
105
-
106
- console.log(`\n${passed} passed, ${failed} failed`);
107
- process.exit(failed ? 1 : 0);
108
- })().catch(e => {
109
- console.error('[FATAL]', e.stack.split('\n').slice(0, 3).join('\n'));
110
- process.exit(1);
1
+ /*
2
+ * WASM (.wasm) regression tests
3
+ * node test/wasm.test.js
4
+ * Covers: JSQL CRUD + flat row shape, shorthand schemas, pk-aware by-id CRUD,
5
+ * non-auto pk insert backfill, and beginTransaction / rollback / commit.
6
+ */
7
+ const path = require('path');
8
+ const ROOT = path.join(__dirname, '..');
9
+
10
+ let passed = 0, failed = 0;
11
+ function ok(name, cond, extra) {
12
+ if (cond) { passed++; console.log('[OK]', name); }
13
+ else { failed++; console.log('[FAIL]', name, extra !== undefined ? JSON.stringify(extra) : ''); }
14
+ }
15
+
16
+ (async () => {
17
+ const { JSQL } = require(path.join(ROOT, 'lib', 'wasm_client'));
18
+
19
+ /* ---------- basic CRUD + flat row shape ---------- */
20
+ {
21
+ const db = new JSQL({ modules: false });
22
+ await db.start();
23
+ await db.createTable('users', { id: 'integer primary key auto_increment', name: 'string', age: 'integer' });
24
+ const ids = await db.insert('users', [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }]);
25
+ ok('wasm batch insert returns ids', Array.isArray(ids) && ids.length === 2, ids);
26
+
27
+ const row = await db.findById('users', 1);
28
+ ok('wasm findById flat row', row && row.id === 1 && row.name === 'Alice' && !('fields' in row), row);
29
+
30
+ const rows = await db.find('users', {});
31
+ ok('wasm find returns flat rows', rows.length === 2 && rows[1].name === 'Bob', rows);
32
+ ok('wasm filter match', (await db.find('users', { age: 25 })).length === 1);
33
+ ok('wasm count', (await db.count('users')) === 2);
34
+
35
+ await db.updateById('users', 1, { age: 31 });
36
+ ok('wasm updateById applied', (await db.findById('users', 1)).age === 31, await db.findById('users', 1));
37
+
38
+ await db.updateByIds('users', [[2, { age: 99 }]]);
39
+ ok('wasm updateByIds applied', (await db.findById('users', 2)).age === 99, await db.findById('users', 2));
40
+
41
+ ok('wasm findByIds', (await db.findByIds('users', [1, 2])).length === 2);
42
+
43
+ await db.removeById('users', 1);
44
+ ok('wasm removeById applied', (await db.count('users')) === 1, await db.count('users'));
45
+
46
+ await db.removeByIds('users', [2]);
47
+ ok('wasm removeByIds applied', (await db.count('users')) === 0, await db.count('users'));
48
+ await db.stop();
49
+ }
50
+
51
+ /* ---------- non-auto pk: id resolution by pk value ---------- */
52
+ {
53
+ const db = new JSQL({ modules: false });
54
+ await db.start();
55
+ await db.createTable('config', { key: { type: 'string', primaryKey: true }, value: 'string' });
56
+ const ids = await db.insert('config', [{ key: 'a', value: '1' }, { key: 'b', value: '2' }]);
57
+ ok('wasm non-auto pk insert returns pk values', JSON.stringify(ids) === JSON.stringify(['a', 'b']), ids);
58
+
59
+ const a = await db.findById('config', 'a');
60
+ ok('wasm findById resolves string pk', a && a.value === '1' && !('fields' in a), a);
61
+ ok('wasm findById pk miss returns null', (await db.findById('config', 'nope')) === null);
62
+
63
+ await db.updateById('config', 'b', { value: '22' });
64
+ ok('wasm updateById resolves string pk', (await db.findById('config', 'b')).value === '22', await db.findById('config', 'b'));
65
+
66
+ await db.removeById('config', 'a');
67
+ ok('wasm removeById resolves string pk', (await db.count('config')) === 1, await db.count('config'));
68
+
69
+ await db.removeByIds('config', ['b']);
70
+ ok('wasm removeByIds resolves string pk', (await db.count('config')) === 0, await db.count('config'));
71
+ await db.stop();
72
+ }
73
+
74
+ /* ---------- shorthand schema ---------- */
75
+ {
76
+ const db = new JSQL({ modules: false });
77
+ await db.start();
78
+ await db.createTable('t2', { name: 'string unique', n: 'number', ok: 'boolean' });
79
+ await db.insert('t2', { name: 'x', n: 1.5, ok: true });
80
+ const r2 = (await db.find('t2', {}))[0];
81
+ ok('wasm shorthand schema fields', r2.name === 'x' && r2.n === 1.5 && r2.ok === true, r2);
82
+
83
+ await db.createTable('cfg', 'key string primary key, value string');
84
+ const cfgIds = await db.insert('cfg', { key: 'a', value: '1' });
85
+ ok('wasm full shorthand string schema', cfgIds[0] === 'a' && (await db.findById('cfg', 'a')).value === '1', cfgIds);
86
+ await db.stop();
87
+ }
88
+
89
+ /* ---------- transactions ---------- */
90
+ {
91
+ const db = new JSQL({ modules: false });
92
+ await db.start();
93
+ await db.createTable('tx', { id: 'integer primary key auto_increment', name: 'string' });
94
+ await db.insert('tx', { name: 'n1' });
95
+ await db.beginTransaction();
96
+ await db.insert('tx', { name: 'n2' });
97
+ await db.rollback();
98
+ ok('wasm rollback reverts insert', (await db.count('tx')) === 1, await db.count('tx'));
99
+ await db.beginTransaction();
100
+ await db.insert('tx', { name: 'n3' });
101
+ await db.commit();
102
+ ok('wasm commit keeps insert', (await db.count('tx')) === 2, await db.count('tx'));
103
+ await db.stop();
104
+ }
105
+
106
+ console.log(`\n${passed} passed, ${failed} failed`);
107
+ process.exit(failed ? 1 : 0);
108
+ })().catch(e => {
109
+ console.error('[FATAL]', e.stack.split('\n').slice(0, 3).join('\n'));
110
+ process.exit(1);
111
111
  });
package/wasm/browser.d.ts CHANGED
@@ -1,89 +1,89 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
-
4
- export function jsql_begin_tx(): string;
5
-
6
- export function jsql_commit_tx(tx_id: string): string;
7
-
8
- export function jsql_count(table: string): string;
9
-
10
- export function jsql_create_table(name: string, schema_json: string): string;
11
-
12
- export function jsql_drop_table(name: string): string;
13
-
14
- export function jsql_find(table: string, filter_json: string, limit: number, offset: number): string;
15
-
16
- export function jsql_find_by_id(table: string, id: bigint): string;
17
-
18
- export function jsql_find_by_ids(table: string, ids_json: string): string;
19
-
20
- export function jsql_insert(table: string, data_json: string): string;
21
-
22
- export function jsql_insert_buf(table: string, data: Uint8Array): string;
23
-
24
- export function jsql_insert_buf_count(table: string, data: Uint8Array): string;
25
-
26
- export function jsql_insert_json(table: string, json: string): string;
27
-
28
- export function jsql_remove_by_id(table: string, id: bigint): string;
29
-
30
- export function jsql_remove_by_ids(table: string, ids_json: string): string;
31
-
32
- export function jsql_reset(): void;
33
-
34
- export function jsql_rollback_tx(tx_id: string): string;
35
-
36
- export function jsql_update_by_id(table: string, id: bigint, data_json: string): string;
37
-
38
- export function jsql_update_by_ids(table: string, batch_json: string): string;
39
-
40
- export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
41
-
42
- export interface InitOutput {
43
- readonly memory: WebAssembly.Memory;
44
- readonly jsql_begin_tx: () => [number, number];
45
- readonly jsql_commit_tx: (a: number, b: number) => [number, number];
46
- readonly jsql_count: (a: number, b: number) => [number, number];
47
- readonly jsql_create_table: (a: number, b: number, c: number, d: number) => [number, number];
48
- readonly jsql_drop_table: (a: number, b: number) => [number, number];
49
- readonly jsql_find: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
50
- readonly jsql_find_by_id: (a: number, b: number, c: bigint) => [number, number];
51
- readonly jsql_find_by_ids: (a: number, b: number, c: number, d: number) => [number, number];
52
- readonly jsql_insert: (a: number, b: number, c: number, d: number) => [number, number];
53
- readonly jsql_insert_buf: (a: number, b: number, c: number, d: number) => [number, number];
54
- readonly jsql_insert_buf_count: (a: number, b: number, c: number, d: number) => [number, number];
55
- readonly jsql_insert_json: (a: number, b: number, c: number, d: number) => [number, number];
56
- readonly jsql_remove_by_id: (a: number, b: number, c: bigint) => [number, number];
57
- readonly jsql_remove_by_ids: (a: number, b: number, c: number, d: number) => [number, number];
58
- readonly jsql_rollback_tx: (a: number, b: number) => [number, number];
59
- readonly jsql_update_by_id: (a: number, b: number, c: bigint, d: number, e: number) => [number, number];
60
- readonly jsql_update_by_ids: (a: number, b: number, c: number, d: number) => [number, number];
61
- readonly jsql_reset: () => void;
62
- readonly __wbindgen_malloc: (a: number, b: number) => number;
63
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
64
- readonly __wbindgen_externrefs: WebAssembly.Table;
65
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
66
- readonly __wbindgen_start: () => void;
67
- }
68
-
69
- export type SyncInitInput = BufferSource | WebAssembly.Module;
70
-
71
- /**
72
- * Instantiates the given `module`, which can either be bytes or
73
- * a precompiled `WebAssembly.Module`.
74
- *
75
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
76
- *
77
- * @returns {InitOutput}
78
- */
79
- export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
80
-
81
- /**
82
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
83
- * for everything else, calls `WebAssembly.instantiate` directly.
84
- *
85
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
86
- *
87
- * @returns {Promise<InitOutput>}
88
- */
89
- export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function jsql_begin_tx(): string;
5
+
6
+ export function jsql_commit_tx(tx_id: string): string;
7
+
8
+ export function jsql_count(table: string): string;
9
+
10
+ export function jsql_create_table(name: string, schema_json: string): string;
11
+
12
+ export function jsql_drop_table(name: string): string;
13
+
14
+ export function jsql_find(table: string, filter_json: string, limit: number, offset: number): string;
15
+
16
+ export function jsql_find_by_id(table: string, id: bigint): string;
17
+
18
+ export function jsql_find_by_ids(table: string, ids_json: string): string;
19
+
20
+ export function jsql_insert(table: string, data_json: string): string;
21
+
22
+ export function jsql_insert_buf(table: string, data: Uint8Array): string;
23
+
24
+ export function jsql_insert_buf_count(table: string, data: Uint8Array): string;
25
+
26
+ export function jsql_insert_json(table: string, json: string): string;
27
+
28
+ export function jsql_remove_by_id(table: string, id: bigint): string;
29
+
30
+ export function jsql_remove_by_ids(table: string, ids_json: string): string;
31
+
32
+ export function jsql_reset(): void;
33
+
34
+ export function jsql_rollback_tx(tx_id: string): string;
35
+
36
+ export function jsql_update_by_id(table: string, id: bigint, data_json: string): string;
37
+
38
+ export function jsql_update_by_ids(table: string, batch_json: string): string;
39
+
40
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
41
+
42
+ export interface InitOutput {
43
+ readonly memory: WebAssembly.Memory;
44
+ readonly jsql_begin_tx: () => [number, number];
45
+ readonly jsql_commit_tx: (a: number, b: number) => [number, number];
46
+ readonly jsql_count: (a: number, b: number) => [number, number];
47
+ readonly jsql_create_table: (a: number, b: number, c: number, d: number) => [number, number];
48
+ readonly jsql_drop_table: (a: number, b: number) => [number, number];
49
+ readonly jsql_find: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
50
+ readonly jsql_find_by_id: (a: number, b: number, c: bigint) => [number, number];
51
+ readonly jsql_find_by_ids: (a: number, b: number, c: number, d: number) => [number, number];
52
+ readonly jsql_insert: (a: number, b: number, c: number, d: number) => [number, number];
53
+ readonly jsql_insert_buf: (a: number, b: number, c: number, d: number) => [number, number];
54
+ readonly jsql_insert_buf_count: (a: number, b: number, c: number, d: number) => [number, number];
55
+ readonly jsql_insert_json: (a: number, b: number, c: number, d: number) => [number, number];
56
+ readonly jsql_remove_by_id: (a: number, b: number, c: bigint) => [number, number];
57
+ readonly jsql_remove_by_ids: (a: number, b: number, c: number, d: number) => [number, number];
58
+ readonly jsql_rollback_tx: (a: number, b: number) => [number, number];
59
+ readonly jsql_update_by_id: (a: number, b: number, c: bigint, d: number, e: number) => [number, number];
60
+ readonly jsql_update_by_ids: (a: number, b: number, c: number, d: number) => [number, number];
61
+ readonly jsql_reset: () => void;
62
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
63
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
64
+ readonly __wbindgen_externrefs: WebAssembly.Table;
65
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
66
+ readonly __wbindgen_start: () => void;
67
+ }
68
+
69
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
70
+
71
+ /**
72
+ * Instantiates the given `module`, which can either be bytes or
73
+ * a precompiled `WebAssembly.Module`.
74
+ *
75
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
76
+ *
77
+ * @returns {InitOutput}
78
+ */
79
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
80
+
81
+ /**
82
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
83
+ * for everything else, calls `WebAssembly.instantiate` directly.
84
+ *
85
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
86
+ *
87
+ * @returns {Promise<InitOutput>}
88
+ */
89
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;