@livestore/wa-sqlite 0.4.0-dev.9 → 0.5.0-dev.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 (63) hide show
  1. package/README.md +46 -36
  2. package/dist/README.md +14 -14
  3. package/dist/fts5/wa-sqlite.mjs +1 -1
  4. package/dist/fts5/wa-sqlite.node.mjs +1 -1
  5. package/dist/fts5/wa-sqlite.node.wasm +0 -0
  6. package/dist/fts5/wa-sqlite.wasm +0 -0
  7. package/dist/wa-sqlite-async.mjs +1 -1
  8. package/dist/wa-sqlite-async.wasm +0 -0
  9. package/dist/wa-sqlite-jspi.mjs +1 -1
  10. package/dist/wa-sqlite-jspi.wasm +0 -0
  11. package/dist/wa-sqlite.mjs +1 -1
  12. package/dist/wa-sqlite.node.mjs +1 -1
  13. package/dist/wa-sqlite.node.wasm +0 -0
  14. package/dist/wa-sqlite.wasm +0 -0
  15. package/package.json +40 -29
  16. package/src/FacadeVFS.js +252 -261
  17. package/src/VFS.js +84 -85
  18. package/src/WebLocksMixin.js +354 -351
  19. package/src/examples/AccessHandlePoolVFS.js +185 -194
  20. package/src/examples/IDBBatchAtomicVFS.js +429 -409
  21. package/src/examples/IDBMirrorVFS.js +402 -409
  22. package/src/examples/MemoryAsyncVFS.js +32 -37
  23. package/src/examples/MemoryVFS.js +71 -75
  24. package/src/examples/OPFSAdaptiveVFS.js +206 -206
  25. package/src/examples/OPFSAnyContextVFS.js +141 -140
  26. package/src/examples/OPFSCoopSyncVFS.js +297 -299
  27. package/src/examples/OPFSPermutedVFS.js +529 -540
  28. package/src/examples/README.md +27 -15
  29. package/src/examples/tag.js +27 -27
  30. package/src/sqlite-api.js +910 -941
  31. package/src/sqlite-constants.js +246 -232
  32. package/src/types/globals.d.ts +52 -52
  33. package/src/types/index.d.ts +591 -576
  34. package/src/types/tsconfig.json +1 -1
  35. package/test/AccessHandlePoolVFS.test.js +21 -21
  36. package/test/IDBBatchAtomicVFS.test.js +69 -69
  37. package/test/IDBMirrorVFS.test.js +21 -21
  38. package/test/MemoryAsyncVFS.test.js +21 -21
  39. package/test/MemoryVFS.test.js +21 -21
  40. package/test/OPFSAdaptiveVFS.test.js +21 -21
  41. package/test/OPFSAnyContextVFS.test.js +21 -21
  42. package/test/OPFSCoopSyncVFS.test.js +21 -21
  43. package/test/OPFSPermutedVFS.test.js +21 -21
  44. package/test/TestContext.js +44 -41
  45. package/test/WebLocksMixin.test.js +369 -360
  46. package/test/api.test.js +23 -23
  47. package/test/api_exec.js +72 -61
  48. package/test/api_misc.js +53 -54
  49. package/test/api_statements.js +271 -279
  50. package/test/callbacks.test.js +492 -478
  51. package/test/data/idbv5.json +1135 -1
  52. package/test/sql.test.js +30 -30
  53. package/test/sql_0001.js +49 -33
  54. package/test/sql_0002.js +55 -34
  55. package/test/sql_0003.js +85 -49
  56. package/test/sql_0004.js +76 -47
  57. package/test/sql_0005.js +60 -44
  58. package/test/test-worker.js +171 -163
  59. package/test/vfs_xAccess.js +1 -2
  60. package/test/vfs_xClose.js +50 -49
  61. package/test/vfs_xOpen.js +73 -72
  62. package/test/vfs_xRead.js +31 -31
  63. package/test/vfs_xWrite.js +30 -29
@@ -9,113 +9,94 @@
9
9
 
10
10
  /**
11
11
  * Javascript types that SQLite can use
12
- *
12
+ *
13
13
  * C integer and floating-point types both map to/from Javascript `number`.
14
14
  * Blob data can be provided to SQLite as `Uint8Array<ArrayBuffer>` or `number[]` (with
15
15
  * each element converted to a byte); SQLite always returns blob data as
16
16
  * `Uint8Array<ArrayBuffer>`
17
17
  */
18
- type SQLiteCompatibleType = number|string|Uint8Array<ArrayBuffer>|Array<number>|bigint|null;
18
+ type SQLiteCompatibleType = number | string | Uint8Array<ArrayBuffer> | Array<number> | bigint | null
19
+
20
+ /** https://sqlite.org/session/c_changeset_conflict.html */
21
+ type SQLiteChangesetConflictType =
22
+ | typeof import('@livestore/wa-sqlite/src/sqlite-constants.js').SQLITE_CHANGESET_DATA
23
+ | typeof import('@livestore/wa-sqlite/src/sqlite-constants.js').SQLITE_CHANGESET_NOTFOUND
24
+ | typeof import('@livestore/wa-sqlite/src/sqlite-constants.js').SQLITE_CHANGESET_CONFLICT
25
+ | typeof import('@livestore/wa-sqlite/src/sqlite-constants.js').SQLITE_CHANGESET_CONSTRAINT
26
+ | typeof import('@livestore/wa-sqlite/src/sqlite-constants.js').SQLITE_CHANGESET_FOREIGN_KEY
27
+
28
+ /** https://sqlite.org/session/c_changeset_abort.html */
29
+ type SQLiteChangesetAction =
30
+ | typeof import('@livestore/wa-sqlite/src/sqlite-constants.js').SQLITE_CHANGESET_OMIT
31
+ | typeof import('@livestore/wa-sqlite/src/sqlite-constants.js').SQLITE_CHANGESET_REPLACE
32
+ | typeof import('@livestore/wa-sqlite/src/sqlite-constants.js').SQLITE_CHANGESET_ABORT
19
33
 
20
34
  /**
21
35
  * SQLite Virtual File System object
22
- *
36
+ *
23
37
  * Objects with this interface can be passed to {@link SQLiteAPI.vfs_register}
24
38
  * to define a new filesystem.
25
- *
39
+ *
26
40
  * There are examples of a synchronous
27
41
  * [MemoryVFS.js](https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/MemoryVFS.js),
28
42
  * and asynchronous
29
43
  * [MemoryAsyncVFS.js](https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/MemoryAsyncVFS.js)
30
44
  * and
31
45
  * [IndexedDbVFS.js](https://github.com/rhashimoto/wa-sqlite/blob/master/src/examples/IndexedDbVFS.js).
32
- *
46
+ *
33
47
  * @see https://sqlite.org/vfs.html
34
48
  * @see https://sqlite.org/c3ref/io_methods.html
35
49
  */
36
50
  interface SQLiteVFS {
37
51
  /** Maximum length of a file path in UTF-8 bytes (default 64) */
38
- mxPathName?: number;
52
+ mxPathName?: number
39
53
 
40
- name: string;
54
+ name: string
41
55
 
42
- close(): void|Promise<void>;
43
- isReady(): boolean|Promise<boolean>;
56
+ close(): void | Promise<void>
57
+ isReady(): boolean | Promise<boolean>
44
58
 
45
59
  /** @see https://sqlite.org/c3ref/io_methods.html */
46
- xClose(fileId: number): number|Promise<number>;
60
+ xClose(fileId: number): number | Promise<number>
47
61
 
48
62
  /** @see https://sqlite.org/c3ref/io_methods.html */
49
- xRead(
50
- fileId: number,
51
- pData: number,
52
- iAmt: number,
53
- iOffsetLo: number,
54
- iOffsetHi: number
55
- ): number|Promise<number>;
63
+ xRead(fileId: number, pData: number, iAmt: number, iOffsetLo: number, iOffsetHi: number): number | Promise<number>
56
64
 
57
65
  /** @see https://sqlite.org/c3ref/io_methods.html */
58
- xWrite(
59
- fileId: number,
60
- pData: number,
61
- iAmt: number,
62
- iOffsetLo: number,
63
- iOffsetHi: number
64
- ): number|Promise<number>;
66
+ xWrite(fileId: number, pData: number, iAmt: number, iOffsetLo: number, iOffsetHi: number): number | Promise<number>
65
67
 
66
68
  /** @see https://sqlite.org/c3ref/io_methods.html */
67
- xTruncate(fileId: number, iSizeLo: number, iSizeHi): number|Promise<number>;
69
+ xTruncate(fileId: number, iSizeLo: number, iSizeHi: number): number | Promise<number>
68
70
 
69
71
  /** @see https://sqlite.org/c3ref/io_methods.html */
70
- xSync(fileId: number, flags: number): number|Promise<number>;
72
+ xSync(fileId: number, flags: number): number | Promise<number>
71
73
 
72
74
  /** @see https://sqlite.org/c3ref/io_methods.html */
73
- xFileSize(
74
- fileId: number,
75
- pSize64: number
76
- ): number|Promise<number>;
75
+ xFileSize(fileId: number, pSize64: number): number | Promise<number>
77
76
 
78
77
  /** @see https://sqlite.org/c3ref/io_methods.html */
79
- xLock(fileId: number, flags: number): number|Promise<number>;
78
+ xLock(fileId: number, flags: number): number | Promise<number>
80
79
 
81
80
  /** @see https://sqlite.org/c3ref/io_methods.html */
82
- xUnlock(fileId: number, flags: number): number|Promise<number>;
81
+ xUnlock(fileId: number, flags: number): number | Promise<number>
83
82
 
84
83
  /** @see https://sqlite.org/c3ref/io_methods.html */
85
- xCheckReservedLock(
86
- fileId: number,
87
- pResOut: number
88
- ): number|Promise<number>;
84
+ xCheckReservedLock(fileId: number, pResOut: number): number | Promise<number>
89
85
 
90
86
  /** @see https://sqlite.org/c3ref/io_methods.html */
91
- xFileControl(
92
- fileId: number,
93
- flags: number,
94
- pOut: number
95
- ): number|Promise<number>;
87
+ xFileControl(fileId: number, flags: number, pOut: number): number | Promise<number>
96
88
 
97
89
  /** @see https://sqlite.org/c3ref/io_methods.html */
98
- xDeviceCharacteristics(fileId: number): number|Promise<number>;
90
+ xDeviceCharacteristics(fileId: number): number | Promise<number>
99
91
 
100
92
  /** @see https://sqlite.org/c3ref/vfs.html */
101
- xOpen(
102
- pVfs: number,
103
- zName: number,
104
- pFile: number,
105
- flags: number,
106
- pOutFlags: number
107
- ): number|Promise<number>;
93
+ xOpen(pVfs: number, zName: number, pFile: number, flags: number, pOutFlags: number): number | Promise<number>
108
94
 
109
95
  /** @see https://sqlite.org/c3ref/vfs.html */
110
- xDelete(pVfs: number, zName: number, syncDir: number): number|Promise<number>;
96
+ xDelete(pVfs: number, zName: number, syncDir: number): number | Promise<number>
111
97
 
112
98
  /** @see https://sqlite.org/c3ref/vfs.html */
113
- xAccess(
114
- pVfs: number,
115
- zName: number,
116
- flags: number,
117
- pResOut: number
118
- ): number|Promise<number>;
99
+ xAccess(pVfs: number, zName: number, flags: number, pResOut: number): number | Promise<number>
119
100
  }
120
101
 
121
102
  /**
@@ -128,29 +109,29 @@ declare interface SQLitePrepareOptions {
128
109
  * Set `unscoped` to `true` to give iterated statements an arbitrary
129
110
  * lifetime.
130
111
  */
131
- unscoped?: boolean;
112
+ unscoped?: boolean
132
113
 
133
114
  /**
134
115
  * SQLITE_PREPARE_* flags
135
116
  * @see https://www.sqlite.org/c3ref/c_prepare_normalize.html#sqlitepreparepersistent
136
117
  */
137
- flags?: number;
118
+ flags?: number
138
119
  }
139
120
 
140
121
  /**
141
122
  * Javascript wrappers for the SQLite C API (plus a few convenience functions)
142
- *
123
+ *
143
124
  * Function signatures have been slightly modified to be more
144
125
  * Javascript-friendly. For the C functions that return an error code,
145
126
  * the corresponding Javascript wrapper will throw an exception with a
146
127
  * `code` property on an error.
147
- *
128
+ *
148
129
  * Note that a few functions return a Promise in order to accomodate
149
130
  * either a synchronous or asynchronous SQLite build, generally those
150
131
  * involved with opening/closing a database or executing a statement.
151
- *
132
+ *
152
133
  * To create an instance of the API, follow these steps:
153
- *
134
+ *
154
135
  * ```javascript
155
136
  * // Import an ES6 module factory function from one of the
156
137
  * // package builds, either '@livestore/wa-sqlite.mjs' (synchronous) or
@@ -158,35 +139,35 @@ declare interface SQLitePrepareOptions {
158
139
  * // use the asynchronous build if you plan to use an
159
140
  * // asynchronous VFS or module.
160
141
  * import SQLiteESMFactory from '@livestore/wa-sqlite/dist/wa-sqlite.mjs';
161
- *
142
+ *
162
143
  * // Import the Javascript API wrappers.
163
144
  * import * as SQLite from '@livestore/wa-sqlite';
164
- *
145
+ *
165
146
  * // Use an async function to simplify Promise handling.
166
147
  * (async function() {
167
148
  * // Invoke the ES6 module factory to create the SQLite
168
149
  * // Emscripten module. This will fetch and compile the
169
150
  * // .wasm file.
170
151
  * const module = await SQLiteESMFactory();
171
- *
152
+ *
172
153
  * // Use the module to build the API instance.
173
154
  * const sqlite3 = SQLite.Factory(module);
174
- *
155
+ *
175
156
  * // Use the API to open and access a database.
176
157
  * const db = await sqlite3.open_v2('myDB');
177
158
  * ...
178
159
  * })();
179
160
  * ```
180
- *
161
+ *
181
162
  * @see https://sqlite.org/c3ref/funclist.html
182
163
  */
183
164
  interface SQLiteAPI {
184
165
  /**
185
166
  * Bind a collection of values to a statement
186
- *
167
+ *
187
168
  * This convenience function binds values from either an array or object
188
169
  * to a prepared statement with placeholder parameters.
189
- *
170
+ *
190
171
  * Array example using numbered parameters (numbering is implicit in
191
172
  * this example):
192
173
  * ```
@@ -196,7 +177,7 @@ interface SQLiteAPI {
196
177
  * ...
197
178
  * }
198
179
  * ```
199
- *
180
+ *
200
181
  * Object example using named parameters (':', '@', or '$' prefixes
201
182
  * are allowed):
202
183
  * ```
@@ -210,88 +191,88 @@ interface SQLiteAPI {
210
191
  * ...
211
192
  * }
212
193
  * ```
213
- *
194
+ *
214
195
  * Note that SQLite bindings are indexed beginning with 1, but when
215
196
  * binding values from an array `a` the values begin with `a[0]`.
216
197
  * @param stmt prepared statement pointer
217
- * @param bindings
198
+ * @param bindings
218
199
  * @returns `SQLITE_OK` (throws exception on error)
219
200
  */
220
201
  bind_collection(
221
202
  stmt: number,
222
- bindings: {[index: string]: SQLiteCompatibleType|null}|Array<SQLiteCompatibleType|null>
223
- ): number;
203
+ bindings: { [index: string]: SQLiteCompatibleType | null } | Array<SQLiteCompatibleType | null>,
204
+ ): number
224
205
 
225
206
  /**
226
207
  * Bind value to prepared statement
227
- *
208
+ *
228
209
  * This convenience function calls the appropriate `bind_*` function
229
210
  * based on the type of `value`. Note that binding indices begin with 1.
230
211
  * @param stmt prepared statement pointer
231
212
  * @param i binding index
232
- * @param value
213
+ * @param value
233
214
  * @returns `SQLITE_OK` (throws exception on error)
234
215
  */
235
- bind(stmt: number, i: number, value: SQLiteCompatibleType|null): number;
216
+ bind(stmt: number, i: number, value: SQLiteCompatibleType | null): number
236
217
 
237
218
  /**
238
219
  * Bind blob to prepared statement parameter
239
- *
220
+ *
240
221
  * Note that binding indices begin with 1.
241
222
  * @see https://www.sqlite.org/c3ref/bind_blob.html
242
223
  * @param stmt prepared statement pointer
243
224
  * @param i binding index
244
- * @param value
225
+ * @param value
245
226
  * @returns `SQLITE_OK` (throws exception on error)
246
227
  */
247
- bind_blob(stmt: number, i: number, value: Uint8Array<ArrayBuffer>|Array<number>): number;
228
+ bind_blob(stmt: number, i: number, value: Uint8Array<ArrayBuffer> | Array<number>): number
248
229
 
249
230
  /**
250
231
  * Bind number to prepared statement parameter
251
- *
232
+ *
252
233
  * Note that binding indices begin with 1.
253
234
  * @see https://www.sqlite.org/c3ref/bind_blob.html
254
235
  * @param stmt prepared statement pointer
255
236
  * @param i binding index
256
- * @param value
237
+ * @param value
257
238
  * @returns `SQLITE_OK` (throws exception on error)
258
239
  */
259
- bind_double(stmt: number, i: number, value: number): number;
240
+ bind_double(stmt: number, i: number, value: number): number
260
241
 
261
- /**
242
+ /**
262
243
  * Bind number to prepared statement parameter
263
- *
244
+ *
264
245
  * Note that binding indices begin with 1.
265
246
  * @see https://www.sqlite.org/c3ref/bind_blob.html
266
247
  * @param stmt prepared statement pointer
267
248
  * @param i binding index
268
- * @param value
249
+ * @param value
269
250
  * @returns `SQLITE_OK` (throws exception on error)
270
251
  */
271
- bind_int(stmt: number, i: number, value: number): number;
252
+ bind_int(stmt: number, i: number, value: number): number
272
253
 
273
- /**
254
+ /**
274
255
  * Bind number to prepared statement parameter
275
- *
256
+ *
276
257
  * Note that binding indices begin with 1.
277
258
  * @see https://www.sqlite.org/c3ref/bind_blob.html
278
259
  * @param stmt prepared statement pointer
279
260
  * @param i binding index
280
- * @param value
261
+ * @param value
281
262
  * @returns `SQLITE_OK` (throws exception on error)
282
263
  */
283
- bind_int64(stmt: number, i: number, value: bigint): number;
264
+ bind_int64(stmt: number, i: number, value: bigint): number
284
265
 
285
- /**
266
+ /**
286
267
  * Bind null to prepared statement
287
- *
268
+ *
288
269
  * Note that binding indices begin with 1.
289
270
  * @see https://www.sqlite.org/c3ref/bind_blob.html
290
271
  * @param stmt prepared statement pointer
291
272
  * @param i binding index
292
273
  * @returns `SQLITE_OK` (throws exception on error)
293
274
  */
294
- bind_null(stmt: number, i: number): number;
275
+ bind_null(stmt: number, i: number): number
295
276
 
296
277
  /**
297
278
  * Get number of bound parameters
@@ -299,30 +280,30 @@ interface SQLiteAPI {
299
280
  * @param stmt prepared statement pointer
300
281
  * @returns number of statement binding locations
301
282
  */
302
- bind_parameter_count(stmt: number): number;
283
+ bind_parameter_count(stmt: number): number
303
284
 
304
285
  /**
305
286
  * Get name of bound parameter
306
- *
287
+ *
307
288
  * Note that binding indices begin with 1.
308
289
  * @see https://www.sqlite.org/c3ref/bind_parameter_name.html
309
290
  * @param stmt prepared statement pointer
310
291
  * @param i binding index
311
292
  * @returns binding name
312
293
  */
313
- bind_parameter_name(stmt: number, i: number): string;
294
+ bind_parameter_name(stmt: number, i: number): string
314
295
 
315
- /**
296
+ /**
316
297
  * Bind string to prepared statement
317
- *
298
+ *
318
299
  * Note that binding indices begin with 1.
319
300
  * @see https://www.sqlite.org/c3ref/bind_blob.html
320
301
  * @param stmt prepared statement pointer
321
302
  * @param i binding index
322
- * @param value
303
+ * @param value
323
304
  * @returns `SQLITE_OK` (throws exception on error)
324
305
  */
325
- bind_text(stmt: number, i: number, value: string): number;
306
+ bind_text(stmt: number, i: number, value: string): number
326
307
 
327
308
  /**
328
309
  * Get count of rows modified by last insert/update
@@ -330,7 +311,7 @@ interface SQLiteAPI {
330
311
  * @param db database pointer
331
312
  * @returns number of rows modified
332
313
  */
333
- changes(db): number;
314
+ changes(db: number): number
334
315
 
335
316
  /**
336
317
  * https://www.sqlite.org/c3ref/deserialize.html
@@ -349,8 +330,8 @@ interface SQLiteAPI {
349
330
  pData: Uint8Array<ArrayBuffer>,
350
331
  szDb: number,
351
332
  szBuf: number,
352
- mFlags: number
353
- ): number;
333
+ mFlags: number,
334
+ ): number
354
335
 
355
336
  /**
356
337
  * unsigned char *sqlite3_serialize(
@@ -364,7 +345,7 @@ interface SQLiteAPI {
364
345
  db: number,
365
346
  zSchema: string,
366
347
  // mFlags: number
367
- ): Uint8Array<ArrayBuffer>;
348
+ ): Uint8Array<ArrayBuffer>
368
349
 
369
350
  // sqlite3_backup *sqlite3_backup_init(
370
351
  // sqlite3 *pDest, /* Destination database handle */
@@ -377,25 +358,20 @@ interface SQLiteAPI {
377
358
  // int sqlite3_backup_remaining(sqlite3_backup *p);
378
359
  // int sqlite3_backup_pagecount(sqlite3_backup *p);
379
360
 
380
- backup_init(
381
- pDest: number,
382
- zDestName: string,
383
- pSource: number,
384
- zSourceName: string
385
- ): number;
361
+ backup_init(pDest: number, zDestName: string, pSource: number, zSourceName: string): number
386
362
 
387
- backup_step(p: number, nPage: number): number;
388
- backup_finish(p: number): number;
389
- backup_remaining(p: number): number;
390
- backup_pagecount(p: number): number;
363
+ backup_step(p: number, nPage: number): number
364
+ backup_finish(p: number): number
365
+ backup_remaining(p: number): number
366
+ backup_pagecount(p: number): number
391
367
 
392
368
  /**
393
369
  * Combines the `backup_init`, `backup_step`, and `backup_finish` functions.
394
370
  * destName/sourceName is usually "main" or "temp".
395
- *
371
+ *
396
372
  * @returns `SQLITE_OK` (throws exception on error)
397
373
  */
398
- backup(pDest: number, zDestName: string, pSource: number, zSourceName: string): number;
374
+ backup(pDest: number, zDestName: string, pSource: number, zSourceName: string): number
399
375
 
400
376
  /**
401
377
  * Reset all bindings on a prepared statement.
@@ -403,7 +379,7 @@ interface SQLiteAPI {
403
379
  * @param stmt prepared statement pointer
404
380
  * @returns `SQLITE_OK` (throws exception on error)
405
381
  */
406
- clear_bindings(stmt: number): number;
382
+ clear_bindings(stmt: number): number
407
383
 
408
384
  /**
409
385
  * Close database connection
@@ -411,27 +387,27 @@ interface SQLiteAPI {
411
387
  * @param db database pointer
412
388
  * @returns `SQLITE_OK` (throws exception on error)
413
389
  */
414
- close(db): Promise<number>;
390
+ close(db: number): Promise<number>
415
391
 
416
392
  /**
417
393
  * Call the appropriate `column_*` function based on the column type
418
- *
394
+ *
419
395
  * The type is determined by calling {@link column_type}, which may
420
396
  * not match the type declared in `CREATE TABLE`. Note that if the column
421
397
  * value is a blob then as with `column_blob` the result may be invalid
422
398
  * after the next SQLite call; copy if it needs to be retained.
423
- *
399
+ *
424
400
  * Integer values are returned as Number if within the min/max safe
425
401
  * integer bounds, otherwise they are returned as BigInt.
426
402
  * @param stmt prepared statement pointer
427
403
  * @param i column index
428
404
  * @returns column value
429
405
  */
430
- column(stmt: number, i: number): SQLiteCompatibleType;
406
+ column(stmt: number, i: number): SQLiteCompatibleType
431
407
 
432
408
  /**
433
409
  * Extract a column value from a row after a prepared statment {@link step}
434
- *
410
+ *
435
411
  * The contents of the returned buffer may be invalid after the
436
412
  * next SQLite call. Make a copy of the data (e.g. with `.slice()`)
437
413
  * if longer retention is required.
@@ -440,7 +416,7 @@ interface SQLiteAPI {
440
416
  * @param i column index
441
417
  * @returns column value
442
418
  */
443
- column_blob(stmt: number, i: number): Uint8Array<ArrayBuffer>;
419
+ column_blob(stmt: number, i: number): Uint8Array<ArrayBuffer>
444
420
 
445
421
  /**
446
422
  * Get storage size for column text or blob
@@ -449,7 +425,7 @@ interface SQLiteAPI {
449
425
  * @param i column index
450
426
  * @returns number of bytes in column text or blob
451
427
  */
452
- column_bytes(stmt: number, i: number): number;
428
+ column_bytes(stmt: number, i: number): number
453
429
 
454
430
  /**
455
431
  * Get number of columns for a prepared statement
@@ -457,7 +433,7 @@ interface SQLiteAPI {
457
433
  * @param stmt prepared statement pointer
458
434
  * @returns number of columns
459
435
  */
460
- column_count(stmt: number): number;
436
+ column_count(stmt: number): number
461
437
 
462
438
  /**
463
439
  * Extract a column value from a row after a prepared statment {@link step}
@@ -466,7 +442,7 @@ interface SQLiteAPI {
466
442
  * @param i column index
467
443
  * @returns column value
468
444
  */
469
- column_double(stmt: number, i: number): number;
445
+ column_double(stmt: number, i: number): number
470
446
 
471
447
  /**
472
448
  * Extract a column value from a row after a prepared statment {@link step}
@@ -475,7 +451,7 @@ interface SQLiteAPI {
475
451
  * @param i column index
476
452
  * @returns column value
477
453
  */
478
- column_int(stmt: number, i: number): number;
454
+ column_int(stmt: number, i: number): number
479
455
 
480
456
  /**
481
457
  * Extract a column value from a row after a prepared statment {@link step}
@@ -484,26 +460,26 @@ interface SQLiteAPI {
484
460
  * @param i column index
485
461
  * @returns column value
486
462
  */
487
- column_int64(stmt: number, i: number): bigint;
463
+ column_int64(stmt: number, i: number): bigint
488
464
 
489
- /**
465
+ /**
490
466
  * Get a column name for a prepared statement
491
467
  * @see https://www.sqlite.org/c3ref/column_blob.html
492
468
  * @param stmt prepared statement pointer
493
469
  * @param i column index
494
470
  * @returns column name
495
471
  */
496
- column_name(stmt: number, i: number): string;
472
+ column_name(stmt: number, i: number): string
497
473
 
498
474
  /**
499
475
  * Get names for all columns of a prepared statement
500
- *
476
+ *
501
477
  * This is a convenience function that calls {@link column_count} and
502
478
  * {@link column_name}.
503
- * @param stmt
479
+ * @param stmt
504
480
  * @returns array of column names
505
481
  */
506
- column_names(stmt: number): Array<string>;
482
+ column_names(stmt: number): Array<string>
507
483
 
508
484
  /**
509
485
  * Extract a column value from a row after a prepared statment {@link step}
@@ -512,48 +488,46 @@ interface SQLiteAPI {
512
488
  * @param i column index
513
489
  * @returns column value
514
490
  */
515
- column_text(stmt: number, i: number): string;
491
+ column_text(stmt: number, i: number): string
516
492
 
517
493
  /**
518
494
  * Get column type for a prepared statement
519
- *
495
+ *
520
496
  * Note that this type may not match the type declared in `CREATE TABLE`.
521
497
  * @see https://www.sqlite.org/c3ref/column_blob.html
522
498
  * @param stmt prepared statement pointer
523
499
  * @param i column index
524
500
  * @returns enumeration value for type
525
501
  */
526
- column_type(stmt: number, i: number): number;
502
+ column_type(stmt: number, i: number): number
527
503
 
528
504
  /**
529
505
  * Register a commit hook
530
- *
506
+ *
531
507
  * @see https://www.sqlite.org/c3ref/commit_hook.html
532
508
  *
533
509
  * @param db database pointer
534
510
  * @param callback If a non-zero value is returned, commit is converted into
535
511
  * a rollback; disables callback when null
536
512
  */
537
- commit_hook(
538
- db: number,
539
- callback: (() => number) | null): void;
513
+ commit_hook(db: number, callback: (() => number) | null): void
540
514
 
541
515
  /**
542
516
  * Create or redefine SQL functions
543
- *
517
+ *
544
518
  * The application data passed is ignored. Use closures instead.
545
- *
519
+ *
546
520
  * If any callback function returns a Promise, that function must
547
521
  * be declared `async`, i.e. it must allow use of `await`.
548
522
  * @see https://sqlite.org/c3ref/create_function.html
549
523
  * @param db database pointer
550
- * @param zFunctionName
524
+ * @param zFunctionName
551
525
  * @param nArg number of function arguments
552
526
  * @param eTextRep text encoding (and other flags)
553
527
  * @param pApp application data (ignored)
554
- * @param xFunc
555
- * @param xStep
556
- * @param xFinal
528
+ * @param xFunc
529
+ * @param xStep
530
+ * @param xFinal
557
531
  * @returns `SQLITE_OK` (throws exception on error)
558
532
  */
559
533
  create_function(
@@ -562,9 +536,10 @@ interface SQLiteAPI {
562
536
  nArg: number,
563
537
  eTextRep: number,
564
538
  pApp: number,
565
- xFunc?: (context: number, values: Uint32Array) => void|Promise<void>,
566
- xStep?: (context: number, values: Uint32Array) => void|Promise<void>,
567
- xFinal?: (context: number) => void|Promise<void>): number;
539
+ xFunc?: (context: number, values: Uint32Array) => void | Promise<void>,
540
+ xStep?: (context: number, values: Uint32Array) => void | Promise<void>,
541
+ xFinal?: (context: number) => void | Promise<void>,
542
+ ): number
568
543
 
569
544
  /**
570
545
  * Get number of columns in current row of a prepared statement
@@ -572,11 +547,11 @@ interface SQLiteAPI {
572
547
  * @param stmt prepared statement pointer
573
548
  * @returns number of columns
574
549
  */
575
- data_count(stmt: number): number;
550
+ data_count(stmt: number): number
576
551
 
577
552
  /**
578
553
  * One-step query execution interface
579
- *
554
+ *
580
555
  * The implementation of this function uses {@link row}, which makes a
581
556
  * copy of blobs and returns BigInt for integers outside the safe integer
582
557
  * bounds for Number.
@@ -589,21 +564,21 @@ interface SQLiteAPI {
589
564
  exec(
590
565
  db: number,
591
566
  zSQL: string,
592
- callback?: (row: Array<SQLiteCompatibleType|null>, columns: string[]) => void
593
- // ): Promise<number>;
594
- ): number;
567
+ callback?: (row: Array<SQLiteCompatibleType | null>, columns: string[]) => void,
568
+ // ): Promise<number>;
569
+ ): number
595
570
 
596
571
  /**
597
572
  * Destroy a prepared statement object compiled by {@link statements}
598
573
  * with the `unscoped` option set to `true`
599
- *
574
+ *
600
575
  * This function does *not* throw on error.
601
576
  * @see https://www.sqlite.org/c3ref/finalize.html
602
577
  * @param stmt prepared statement pointer
603
578
  * @returns Promise resolving to `SQLITE_OK` or error status
604
579
  */
605
580
  // finalize(stmt: number): Promise<number>;
606
- finalize(stmt: number): number;
581
+ finalize(stmt: number): number
607
582
 
608
583
  /**
609
584
  * Test for autocommit mode
@@ -611,14 +586,14 @@ interface SQLiteAPI {
611
586
  * @param db database pointer
612
587
  * @returns Non-zero if autocommit mode is on, zero otherwise
613
588
  */
614
- get_autocommit(db: number): number;
589
+ get_autocommit(db: number): number
615
590
 
616
591
  /**
617
592
  * Get SQLite library version
618
593
  * @see https://www.sqlite.org/c3ref/libversion.html
619
594
  * @returns version string, e.g. '3.35.5'
620
595
  */
621
- libversion(): string;
596
+ libversion(): string
622
597
 
623
598
  /**
624
599
  * Get SQLite library version
@@ -632,51 +607,45 @@ interface SQLiteAPI {
632
607
  * @see https://www.sqlite.org/c3ref/limit.html
633
608
  * @param db database pointer
634
609
  * @param id limit category
635
- * @param newVal
610
+ * @param newVal
636
611
  * @returns previous setting
637
612
  */
638
- limit(
639
- db: number,
640
- id: number,
641
- newVal: number): number;
613
+ limit(db: number, id: number, newVal: number): number
642
614
 
643
615
  /**
644
616
  * Opening a new database connection.
645
- *
617
+ *
646
618
  * Note that this function differs from the C API in that it
647
619
  * returns the Promise-wrapped database pointer (instead of a
648
620
  * result code).
649
621
  * @see https://sqlite.org/c3ref/open.html
650
- * @param zFilename
622
+ * @param zFilename
651
623
  * @param iFlags `SQLite.SQLITE_OPEN_CREATE | SQLite.SQLITE_OPEN_READWRITE` (0x6) if omitted
652
624
  * @param zVfs VFS name
653
625
  * @returns Promise-wrapped database pointer.
654
626
  */
655
- open_v2(
656
- zFilename: string,
657
- iFlags?: number,
658
- zVfs?: string
659
- ): Promise<number>;
627
+ open_v2(zFilename: string, iFlags?: number, zVfs?: string): Promise<number>
660
628
 
661
- open_v2Sync(
662
- zFilename: string,
663
- iFlags?: number,
664
- zVfs?: string
665
- ): number;
629
+ open_v2Sync(zFilename: string, iFlags?: number, zVfs?: string): number
666
630
 
667
631
  /**
668
632
  * Specify callback to be invoked between long-running queries
669
- *
633
+ *
670
634
  * The application data passed is ignored. Use closures instead.
671
- *
635
+ *
672
636
  * If any callback function returns a Promise, that function must
673
637
  * be declared `async`, i.e. it must allow use of `await`.
674
638
  * @param db database pointer
675
639
  * @param nProgressOps target number of database operations between handler invocations
676
- * @param handler
677
- * @param userData
640
+ * @param handler
641
+ * @param userData
678
642
  */
679
- progress_handler(db: number, nProgressOps: number, handler: (userData: any) => number|Promise<number>, userData);
643
+ progress_handler(
644
+ db: number,
645
+ nProgressOps: number,
646
+ handler: (userData: unknown) => number | Promise<number>,
647
+ userData: unknown,
648
+ ): void
680
649
 
681
650
  /**
682
651
  * Reset a prepared statement object
@@ -684,97 +653,105 @@ interface SQLiteAPI {
684
653
  * @param stmt prepared statement pointer
685
654
  * @returns `SQLITE_OK` (rejects on error)
686
655
  */
687
- reset(stmt: number): number;
656
+ reset(stmt: number): number
688
657
 
689
658
  /**
690
659
  * Convenience function to call `result_*` based of the type of `value`
691
660
  * @param context context pointer
692
- * @param value
661
+ * @param value
693
662
  */
694
- result(context: number, value: (SQLiteCompatibleType|number[])|null): void;
663
+ result(context: number, value: number[] | null): void
695
664
 
696
665
  /**
697
666
  * Set the result of a function or vtable column
698
667
  * @see https://sqlite.org/c3ref/result_blob.html
699
668
  * @param context context pointer
700
- * @param value
669
+ * @param value
701
670
  */
702
- result_blob(context: number, value: Uint8Array<ArrayBuffer>|number[]): void;
671
+ result_blob(context: number, value: Uint8Array<ArrayBuffer> | number[]): void
703
672
 
704
673
  /**
705
674
  * Set the result of a function or vtable column
706
675
  * @see https://sqlite.org/c3ref/result_blob.html
707
676
  * @param context context pointer
708
- * @param value
677
+ * @param value
709
678
  */
710
- result_double(context: number, value: number): void;
679
+ result_double(context: number, value: number): void
711
680
 
712
681
  /**
713
682
  * Set the result of a function or vtable column
714
683
  * @see https://sqlite.org/c3ref/result_blob.html
715
684
  * @param context context pointer
716
- * @param value
685
+ * @param value
717
686
  */
718
- result_int(context: number, value: number): void;
687
+ result_int(context: number, value: number): void
719
688
 
720
689
  /**
721
690
  * Set the result of a function or vtable column
722
691
  * @see https://sqlite.org/c3ref/result_blob.html
723
692
  * @param context context pointer
724
- * @param value
693
+ * @param value
725
694
  */
726
- result_int64(context: number, value: bigint): void;
695
+ result_int64(context: number, value: bigint): void
727
696
 
728
697
  /**
729
698
  * Set the result of a function or vtable column
730
699
  * @see https://sqlite.org/c3ref/result_blob.html
731
700
  * @param context context pointer
732
701
  */
733
- result_null(context: number): void;
702
+ result_null(context: number): void
734
703
 
735
704
  /**
736
705
  * Set the result of a function or vtable column
737
706
  * @see https://sqlite.org/c3ref/result_blob.html
738
707
  * @param context context pointer
739
- * @param value
708
+ * @param value
740
709
  */
741
- result_text(context: number, value: string): void;
710
+ result_text(context: number, value: string): void
742
711
 
743
- /**
744
- * Get all column data for a row from a prepared statement step
745
- *
746
- * This convenience function will return a copy of any blob, unlike
747
- * {@link column_blob} which returns a value referencing volatile WASM
748
- * memory with short validity. Like {@link column}, it will return a
749
- * BigInt for integers outside the safe integer bounds for Number.
750
- * @param stmt prepared statement pointer
751
- * @returns row data
752
- */
753
- row(stmt: number): Array<SQLiteCompatibleType|null>;
712
+ /**
713
+ * Get all column data for a row from a prepared statement step
714
+ *
715
+ * This convenience function will return a copy of any blob, unlike
716
+ * {@link column_blob} which returns a value referencing volatile WASM
717
+ * memory with short validity. Like {@link column}, it will return a
718
+ * BigInt for integers outside the safe integer bounds for Number.
719
+ * @param stmt prepared statement pointer
720
+ * @returns row data
721
+ */
722
+ row(stmt: number): Array<SQLiteCompatibleType | null>
754
723
 
755
724
  /**
756
725
  * Register a callback function that is invoked to authorize certain SQL statement actions.
757
726
  * @see https://www.sqlite.org/c3ref/set_authorizer.html
758
727
  * @param db database pointer
759
- * @param authFunction
760
- * @param userData
728
+ * @param authFunction
729
+ * @param userData
761
730
  */
762
731
  set_authorizer(
763
732
  db: number,
764
- authFunction: (userData: any, iActionCode: number, param3: string|null, param4: string|null, param5: string|null, param6: string|null) => number|Promise<number>,
765
- userData: any): number;
766
-
733
+ authFunction: (
734
+ userData: any,
735
+ iActionCode: number,
736
+ param3: string | null,
737
+ param4: string | null,
738
+ param5: string | null,
739
+ param6: string | null,
740
+ ) => number | Promise<number>,
741
+ userData: any,
742
+ ): number
743
+
767
744
  /**
768
745
  * Get statement SQL
769
746
  * @see https://www.sqlite.org/c3ref/expanded_sql.html
770
747
  * @param stmt prepared statement pointer
771
748
  * @returns SQL
772
749
  */
773
- sql(stmt: number): string;
750
+ sql(stmt: number): string
774
751
 
775
752
  /**
776
753
  * SQL statement iterator
777
- *
754
+ *
778
755
  * This function manages statement compilation by creating an async
779
756
  * iterator that yields a prepared statement handle on each iteration.
780
757
  * It is typically used with a `for await` loop (in an async function),
@@ -783,7 +760,7 @@ interface SQLiteAPI {
783
760
  * // Compile one statement on each iteration of this loop.
784
761
  * for await (const stmt of sqlite3.statements(db, sql)) {
785
762
  * // Bind parameters here if using SQLite placeholders.
786
- *
763
+ *
787
764
  * // Execute the statement with this loop.
788
765
  * while (await sqlite3.step(stmt) === SQLite.SQLITE_ROW) {
789
766
  * // Collect row data here.
@@ -792,14 +769,14 @@ interface SQLiteAPI {
792
769
  * // Change bindings, reset, and execute again if desired.
793
770
  * }
794
771
  * ```
795
- *
772
+ *
796
773
  * By default, the lifetime of a yielded prepared statement is managed
797
774
  * automatically by the iterator, ending at the end of each iteration.
798
775
  * {@link finalize} should *not* be called on a statement provided by
799
776
  * the iterator unless the `unscoped` option is set to `true` (that
800
777
  * option is provided for applications that wish to manage statement
801
778
  * lifetimes manually).
802
- *
779
+ *
803
780
  * If using the iterator manually, i.e. by calling its `next`
804
781
  * method, be sure to call the `return` method if iteration
805
782
  * is abandoned before completion (`for await` and other implicit
@@ -807,11 +784,11 @@ interface SQLiteAPI {
807
784
  * to ensure that all allocated resources are released.
808
785
  * @see https://www.sqlite.org/c3ref/prepare.html
809
786
  * @param db database pointer
810
- * @param sql
787
+ * @param sql
811
788
  * @param options
812
789
  */
813
790
  // statements(db: number, sql: string, options?: SQLitePrepareOptions): AsyncIterable<number>;
814
- statements(db: number, sql: string, options?: SQLitePrepareOptions): ReadonlyArray<number>;
791
+ statements(db: number, sql: string, options?: SQLitePrepareOptions): ReadonlyArray<number>
815
792
 
816
793
  /**
817
794
  * Evaluate an SQL statement
@@ -821,11 +798,11 @@ interface SQLiteAPI {
821
798
  * (rejects on error)
822
799
  */
823
800
  // step(stmt: number): Promise<number>;
824
- step(stmt: number): number;
801
+ step(stmt: number): number
825
802
 
826
- /**
803
+ /**
827
804
  * Register an update hook
828
- *
805
+ *
829
806
  * The callback is invoked whenever a row is updated, inserted, or deleted
830
807
  * in a rowid table on this connection.
831
808
  * @see https://www.sqlite.org/c3ref/update_hook.html
@@ -835,33 +812,32 @@ interface SQLiteAPI {
835
812
  * - SQLITE_INSERT: 18
836
813
  * - SQLITE_UPDATE: 23
837
814
  * @see https://www.sqlite.org/c3ref/c_alter_table.html
838
- *
815
+ *
839
816
  * @param db database pointer
840
817
  * @param callback
841
818
  */
842
- update_hook(
819
+ update_hook(
843
820
  db: number,
844
- callback: (updateType: number, dbName: string|null, tblName: string|null, rowid: bigint) => void): void;
845
-
846
-
821
+ callback: (updateType: number, dbName: string | null, tblName: string | null, rowid: bigint) => void,
822
+ ): void
847
823
 
848
824
  /**
849
825
  * Extract a value from `sqlite3_value`
850
- *
826
+ *
851
827
  * This is a convenience function that calls the appropriate `value_*`
852
828
  * function based on its type. Note that if the value is a blob then as
853
829
  * with `value_blob` the result may be invalid after the next SQLite call.
854
- *
830
+ *
855
831
  * Integer values are returned as Number if within the min/max safe
856
832
  * integer bounds, otherwise they are returned as BigInt.
857
833
  * @param pValue `sqlite3_value` pointer
858
834
  * @returns value
859
835
  */
860
- value(pValue: number): SQLiteCompatibleType;
836
+ value(pValue: number): SQLiteCompatibleType
861
837
 
862
838
  /**
863
839
  * Extract a value from `sqlite3_value`
864
- *
840
+ *
865
841
  * The contents of the returned buffer may be invalid after the
866
842
  * next SQLite call. Make a copy of the data (e.g. with `.slice()`)
867
843
  * if longer retention is required.
@@ -869,7 +845,7 @@ interface SQLiteAPI {
869
845
  * @param pValue `sqlite3_value` pointer
870
846
  * @returns value
871
847
  */
872
- value_blob(pValue: number): Uint8Array<ArrayBuffer>;
848
+ value_blob(pValue: number): Uint8Array<ArrayBuffer>
873
849
 
874
850
  /**
875
851
  * Get blob or text size for value
@@ -877,7 +853,7 @@ interface SQLiteAPI {
877
853
  * @param pValue `sqlite3_value` pointer
878
854
  * @returns size
879
855
  */
880
- value_bytes(pValue: number): number;
856
+ value_bytes(pValue: number): number
881
857
 
882
858
  /**
883
859
  * Extract a value from `sqlite3_value`
@@ -885,7 +861,7 @@ interface SQLiteAPI {
885
861
  * @param pValue `sqlite3_value` pointer
886
862
  * @returns value
887
863
  */
888
- value_double(pValue: number): number;
864
+ value_double(pValue: number): number
889
865
 
890
866
  /**
891
867
  * Extract a value from `sqlite3_value`
@@ -893,7 +869,7 @@ interface SQLiteAPI {
893
869
  * @param pValue `sqlite3_value` pointer
894
870
  * @returns value
895
871
  */
896
- value_int(pValue: number): number;
872
+ value_int(pValue: number): number
897
873
 
898
874
  /**
899
875
  * Extract a value from `sqlite3_value`
@@ -901,7 +877,7 @@ interface SQLiteAPI {
901
877
  * @param pValue `sqlite3_value` pointer
902
878
  * @returns value
903
879
  */
904
- value_int64(pValue: number): bigint;
880
+ value_int64(pValue: number): bigint
905
881
 
906
882
  /**
907
883
  * Extract a value from `sqlite3_value`
@@ -909,7 +885,7 @@ interface SQLiteAPI {
909
885
  * @param pValue `sqlite3_value` pointer
910
886
  * @returns value
911
887
  */
912
- value_text(pValue: number): string;
888
+ value_text(pValue: number): string
913
889
 
914
890
  /**
915
891
  * Get type of `sqlite3_value`
@@ -917,355 +893,376 @@ interface SQLiteAPI {
917
893
  * @param pValue `sqlite3_value` pointer
918
894
  * @returns enumeration value for type
919
895
  */
920
- value_type(pValue: number): number;
921
-
896
+ value_type(pValue: number): number
897
+
922
898
  /**
923
899
  * Register a new Virtual File System.
924
- *
900
+ *
925
901
  * @see https://www.sqlite.org/c3ref/vfs_find.html
926
902
  * @param vfs VFS object
927
- * @param makeDefault
903
+ * @param makeDefault
928
904
  * @returns `SQLITE_OK` (throws exception on error)
929
905
  */
930
- vfs_register(vfs: SQLiteVFS, makeDefault?: boolean): number;
906
+ vfs_register(vfs: SQLiteVFS, makeDefault?: boolean): number
931
907
 
932
- vfs_registered: Set<string>;
908
+ vfs_registered: Set<string>
933
909
 
934
910
  /**
935
911
  * Create a new session object for a database.
936
- *
912
+ *
937
913
  * @param db database pointer
938
914
  * @param zDb database name
939
915
  * @returns session pointer
940
916
  */
941
- session_create(db: number, zDb: string): number;
917
+ session_create(db: number, zDb: string): number
942
918
 
943
919
  /**
944
920
  * Attach a database to a session.
945
- *
921
+ *
946
922
  * @param pSession session pointer
947
923
  * @param zTab table name
948
924
  * @returns `SQLITE_OK` (throws exception on error)
949
925
  */
950
- session_attach(pSession: number, zTab: string | null): number;
926
+ session_attach(pSession: number, zTab: string | null): number
951
927
 
952
928
  /**
953
929
  * Enable or disable a session.
954
- *
930
+ *
955
931
  * @param pSession session pointer
956
- * @param enable
932
+ * @param enable
957
933
  */
958
- session_enable(pSession: number, enable: boolean): void;
934
+ session_enable(pSession: number, enable: boolean): void
959
935
 
960
936
  /**
961
937
  * Get the changeset for a session.
962
- *
938
+ *
963
939
  * @param pSession session pointer
964
940
  * @returns {result: number, size: number, changeset: Uint8Array<ArrayBuffer>}
965
941
  */
966
942
  session_changeset(pSession: number): {
967
- result: number;
968
- size: number;
969
- changeset: Uint8Array<ArrayBuffer> | null;
970
- };
943
+ result: number
944
+ size: number
945
+ changeset: Uint8Array<ArrayBuffer> | null
946
+ }
971
947
 
972
948
  session_changeset_inverted(pSession: number): {
973
- result: number;
974
- size: number;
975
- changeset: Uint8Array<ArrayBuffer>;
976
- };
949
+ result: number
950
+ size: number
951
+ changeset: Uint8Array<ArrayBuffer>
952
+ }
977
953
 
978
954
  /**
979
955
  * Delete a session object.
980
- *
956
+ *
981
957
  * @param pSession session pointer
982
958
  */
983
- session_delete(pSession: number): void;
959
+ session_delete(pSession: number): void
984
960
 
985
961
  /**
986
962
  * Start a changeset.
987
- *
963
+ *
988
964
  * @param changeset changeset blob to import from
989
965
  * @returns changeset iterator pointer
990
966
  */
991
- changeset_start(changesetBlob: Uint8Array<ArrayBuffer>): number;
967
+ changeset_start(changesetBlob: Uint8Array<ArrayBuffer>): number
992
968
 
993
969
  /**
994
970
  * Finalize a changeset iterator.
995
- *
971
+ *
996
972
  * @param pIter changeset iterator pointer
997
973
  * @returns `SQLITE_OK` (throws exception on error)
998
974
  */
999
- changeset_finalize(pIter: number): number;
975
+ changeset_finalize(pIter: number): number
1000
976
 
1001
977
  /**
1002
978
  * Invert a changeset.
1003
- *
979
+ *
1004
980
  * @param input changeset to invert
1005
981
  * @returns inverted changeset
1006
982
  */
1007
- changeset_invert(input: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
983
+ changeset_invert(input: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>
1008
984
 
1009
985
  /**
1010
- * Apply a changeset to a database.
1011
- *
1012
- * @param db database pointer
1013
- * @param changeset changeset to apply
1014
- * @returns `SQLITE_OK` (throws exception on error)
986
+ * Apply a changeset to the main database of the database handle passed.
987
+ *
988
+ * @param db - database handle pointer
989
+ * @param changeset - changeset to apply
990
+ * @param xFilter - Optional filter callback invoked once per table in the
991
+ * changeset. Return zero to skip changes for that table, non-zero to
992
+ * include them. Pass null to include all tables.
993
+ * @param xConflict - Conflict handler invoked for each conflict with the
994
+ * conflict type `eConflict` ({@link SQLITE_CHANGESET_DATA},
995
+ * {@link SQLITE_CHANGESET_NOTFOUND}, {@link SQLITE_CHANGESET_CONFLICT},
996
+ * {@link SQLITE_CHANGESET_CONSTRAINT}, or {@link SQLITE_CHANGESET_FOREIGN_KEY}).
997
+ * Must return {@link SQLITE_CHANGESET_OMIT}, {@link SQLITE_CHANGESET_REPLACE},
998
+ * or {@link SQLITE_CHANGESET_ABORT}.
999
+ * @returns {@link SQLITE_OK} if successful.
1000
+ * @throws {@link SQLiteError} if an error occurs.
1001
+ *
1002
+ * @see {@link https://sqlite.org/session/sqlite3changeset_apply.html}
1015
1003
  */
1016
- changeset_apply(db: number, changeset: Uint8Array<ArrayBuffer>, options?: {
1017
- onConflict?: (conflictType: number) => 0 | 1 | 2
1018
- }): number;
1019
-
1004
+ changeset_apply(
1005
+ db: number,
1006
+ changeset: Uint8Array<ArrayBuffer>,
1007
+ xFilter: ((zTab: string) => number) | null,
1008
+ xConflict: (eConflict: SQLiteChangesetConflictType) => SQLiteChangesetAction,
1009
+ ): number
1020
1010
  }
1021
1011
 
1022
- type SQLiteAPI_ = SQLiteAPI;
1023
- type SQLiteVFS_ = SQLiteVFS
1012
+ type SQLiteAPI_ = SQLiteAPI
1013
+ type SQLiteVFS_ = SQLiteVFS
1024
1014
 
1025
1015
  declare module '@livestore/wa-sqlite' {
1026
- export type SQLiteVFS = SQLiteVFS_;
1027
- export type SQLiteAPI = SQLiteAPI_
1016
+ export type SQLiteVFS = SQLiteVFS_
1017
+ export type SQLiteAPI = SQLiteAPI_
1028
1018
  }
1029
1019
 
1030
-
1031
1020
  /** @ignore */
1032
1021
  declare module '@livestore/wa-sqlite/src/sqlite-constants.js' {
1033
- export const SQLITE_OK: 0;
1034
- export const SQLITE_ERROR: 1;
1035
- export const SQLITE_INTERNAL: 2;
1036
- export const SQLITE_PERM: 3;
1037
- export const SQLITE_ABORT: 4;
1038
- export const SQLITE_BUSY: 5;
1039
- export const SQLITE_LOCKED: 6;
1040
- export const SQLITE_NOMEM: 7;
1041
- export const SQLITE_READONLY: 8;
1042
- export const SQLITE_INTERRUPT: 9;
1043
- export const SQLITE_IOERR: 10;
1044
- export const SQLITE_CORRUPT: 11;
1045
- export const SQLITE_NOTFOUND: 12;
1046
- export const SQLITE_FULL: 13;
1047
- export const SQLITE_CANTOPEN: 14;
1048
- export const SQLITE_PROTOCOL: 15;
1049
- export const SQLITE_EMPTY: 16;
1050
- export const SQLITE_SCHEMA: 17;
1051
- export const SQLITE_TOOBIG: 18;
1052
- export const SQLITE_CONSTRAINT: 19;
1053
- export const SQLITE_MISMATCH: 20;
1054
- export const SQLITE_MISUSE: 21;
1055
- export const SQLITE_NOLFS: 22;
1056
- export const SQLITE_AUTH: 23;
1057
- export const SQLITE_FORMAT: 24;
1058
- export const SQLITE_RANGE: 25;
1059
- export const SQLITE_NOTADB: 26;
1060
- export const SQLITE_NOTICE: 27;
1061
- export const SQLITE_WARNING: 28;
1062
- export const SQLITE_ROW: 100;
1063
- export const SQLITE_DONE: 101;
1064
- export const SQLITE_IOERR_ACCESS: 3338;
1065
- export const SQLITE_IOERR_CHECKRESERVEDLOCK: 3594;
1066
- export const SQLITE_IOERR_CLOSE: 4106;
1067
- export const SQLITE_IOERR_DATA: 8202;
1068
- export const SQLITE_IOERR_DELETE: 2570;
1069
- export const SQLITE_IOERR_DELETE_NOENT: 5898;
1070
- export const SQLITE_IOERR_DIR_FSYNC: 1290;
1071
- export const SQLITE_IOERR_FSTAT: 1802;
1072
- export const SQLITE_IOERR_FSYNC: 1034;
1073
- export const SQLITE_IOERR_GETTEMPPATH: 6410;
1074
- export const SQLITE_IOERR_LOCK: 3850;
1075
- export const SQLITE_IOERR_NOMEM: 3082;
1076
- export const SQLITE_IOERR_READ: 266;
1077
- export const SQLITE_IOERR_RDLOCK: 2314;
1078
- export const SQLITE_IOERR_SEEK: 5642;
1079
- export const SQLITE_IOERR_SHORT_READ: 522;
1080
- export const SQLITE_IOERR_TRUNCATE: 1546;
1081
- export const SQLITE_IOERR_UNLOCK: 2058;
1082
- export const SQLITE_IOERR_VNODE: 6922;
1083
- export const SQLITE_IOERR_WRITE: 778;
1084
- export const SQLITE_IOERR_BEGIN_ATOMIC: 7434;
1085
- export const SQLITE_IOERR_COMMIT_ATOMIC: 7690;
1086
- export const SQLITE_IOERR_ROLLBACK_ATOMIC: 7946;
1087
- export const SQLITE_CONSTRAINT_CHECK: 275;
1088
- export const SQLITE_CONSTRAINT_COMMITHOOK: 531;
1089
- export const SQLITE_CONSTRAINT_FOREIGNKEY: 787;
1090
- export const SQLITE_CONSTRAINT_FUNCTION: 1043;
1091
- export const SQLITE_CONSTRAINT_NOTNULL: 1299;
1092
- export const SQLITE_CONSTRAINT_PINNED: 2835;
1093
- export const SQLITE_CONSTRAINT_PRIMARYKEY: 1555;
1094
- export const SQLITE_CONSTRAINT_ROWID: 2579;
1095
- export const SQLITE_CONSTRAINT_TRIGGER: 1811;
1096
- export const SQLITE_CONSTRAINT_UNIQUE: 2067;
1097
- export const SQLITE_CONSTRAINT_VTAB: 2323;
1098
- export const SQLITE_OPEN_READONLY: 1;
1099
- export const SQLITE_OPEN_READWRITE: 2;
1100
- export const SQLITE_OPEN_CREATE: 4;
1101
- export const SQLITE_OPEN_DELETEONCLOSE: 8;
1102
- export const SQLITE_OPEN_EXCLUSIVE: 16;
1103
- export const SQLITE_OPEN_AUTOPROXY: 32;
1104
- export const SQLITE_OPEN_URI: 64;
1105
- export const SQLITE_OPEN_MEMORY: 128;
1106
- export const SQLITE_OPEN_MAIN_DB: 256;
1107
- export const SQLITE_OPEN_TEMP_DB: 512;
1108
- export const SQLITE_OPEN_TRANSIENT_DB: 1024;
1109
- export const SQLITE_OPEN_MAIN_JOURNAL: 2048;
1110
- export const SQLITE_OPEN_TEMP_JOURNAL: 4096;
1111
- export const SQLITE_OPEN_SUBJOURNAL: 8192;
1112
- export const SQLITE_OPEN_SUPER_JOURNAL: 16384;
1113
- export const SQLITE_OPEN_NOMUTEX: 32768;
1114
- export const SQLITE_OPEN_FULLMUTEX: 65536;
1115
- export const SQLITE_OPEN_SHAREDCACHE: 131072;
1116
- export const SQLITE_OPEN_PRIVATECACHE: 262144;
1117
- export const SQLITE_OPEN_WAL: 524288;
1118
- export const SQLITE_OPEN_NOFOLLOW: 16777216;
1119
- export const SQLITE_LOCK_NONE: 0;
1120
- export const SQLITE_LOCK_SHARED: 1;
1121
- export const SQLITE_LOCK_RESERVED: 2;
1122
- export const SQLITE_LOCK_PENDING: 3;
1123
- export const SQLITE_LOCK_EXCLUSIVE: 4;
1124
- export const SQLITE_IOCAP_ATOMIC: 1;
1125
- export const SQLITE_IOCAP_ATOMIC512: 2;
1126
- export const SQLITE_IOCAP_ATOMIC1K: 4;
1127
- export const SQLITE_IOCAP_ATOMIC2K: 8;
1128
- export const SQLITE_IOCAP_ATOMIC4K: 16;
1129
- export const SQLITE_IOCAP_ATOMIC8K: 32;
1130
- export const SQLITE_IOCAP_ATOMIC16K: 64;
1131
- export const SQLITE_IOCAP_ATOMIC32K: 128;
1132
- export const SQLITE_IOCAP_ATOMIC64K: 256;
1133
- export const SQLITE_IOCAP_SAFE_APPEND: 512;
1134
- export const SQLITE_IOCAP_SEQUENTIAL: 1024;
1135
- export const SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN: 2048;
1136
- export const SQLITE_IOCAP_POWERSAFE_OVERWRITE: 4096;
1137
- export const SQLITE_IOCAP_IMMUTABLE: 8192;
1138
- export const SQLITE_IOCAP_BATCH_ATOMIC: 16384;
1139
- export const SQLITE_ACCESS_EXISTS: 0;
1140
- export const SQLITE_ACCESS_READWRITE: 1;
1141
- export const SQLITE_ACCESS_READ: 2;
1142
- export const SQLITE_FCNTL_LOCKSTATE: 1;
1143
- export const SQLITE_FCNTL_GET_LOCKPROXYFILE: 2;
1144
- export const SQLITE_FCNTL_SET_LOCKPROXYFILE: 3;
1145
- export const SQLITE_FCNTL_LAST_ERRNO: 4;
1146
- export const SQLITE_FCNTL_SIZE_HINT: 5;
1147
- export const SQLITE_FCNTL_CHUNK_SIZE: 6;
1148
- export const SQLITE_FCNTL_FILE_POINTER: 7;
1149
- export const SQLITE_FCNTL_SYNC_OMITTED: 8;
1150
- export const SQLITE_FCNTL_WIN32_AV_RETRY: 9;
1151
- export const SQLITE_FCNTL_PERSIST_WAL: 10;
1152
- export const SQLITE_FCNTL_OVERWRITE: 11;
1153
- export const SQLITE_FCNTL_VFSNAME: 12;
1154
- export const SQLITE_FCNTL_POWERSAFE_OVERWRITE: 13;
1155
- export const SQLITE_FCNTL_PRAGMA: 14;
1156
- export const SQLITE_FCNTL_BUSYHANDLER: 15;
1157
- export const SQLITE_FCNTL_TEMPFILENAME: 16;
1158
- export const SQLITE_FCNTL_MMAP_SIZE: 18;
1159
- export const SQLITE_FCNTL_TRACE: 19;
1160
- export const SQLITE_FCNTL_HAS_MOVED: 20;
1161
- export const SQLITE_FCNTL_SYNC: 21;
1162
- export const SQLITE_FCNTL_COMMIT_PHASETWO: 22;
1163
- export const SQLITE_FCNTL_WIN32_SET_HANDLE: 23;
1164
- export const SQLITE_FCNTL_WAL_BLOCK: 24;
1165
- export const SQLITE_FCNTL_ZIPVFS: 25;
1166
- export const SQLITE_FCNTL_RBU: 26;
1167
- export const SQLITE_FCNTL_VFS_POINTER: 27;
1168
- export const SQLITE_FCNTL_JOURNAL_POINTER: 28;
1169
- export const SQLITE_FCNTL_WIN32_GET_HANDLE: 29;
1170
- export const SQLITE_FCNTL_PDB: 30;
1171
- export const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE: 31;
1172
- export const SQLITE_FCNTL_COMMIT_ATOMIC_WRITE: 32;
1173
- export const SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE: 33;
1174
- export const SQLITE_FCNTL_LOCK_TIMEOUT: 34;
1175
- export const SQLITE_FCNTL_DATA_VERSION: 35;
1176
- export const SQLITE_FCNTL_SIZE_LIMIT: 36;
1177
- export const SQLITE_FCNTL_CKPT_DONE: 37;
1178
- export const SQLITE_FCNTL_RESERVE_BYTES: 38;
1179
- export const SQLITE_FCNTL_CKPT_START: 39;
1180
- export const SQLITE_INTEGER: 1;
1181
- export const SQLITE_FLOAT: 2;
1182
- export const SQLITE_TEXT: 3;
1183
- export const SQLITE_BLOB: 4;
1184
- export const SQLITE_NULL: 5;
1185
- export const SQLITE_STATIC: 0;
1186
- export const SQLITE_TRANSIENT: -1;
1187
- export const SQLITE_UTF8: 1;
1188
- export const SQLITE_UTF16LE: 2;
1189
- export const SQLITE_UTF16BE: 3;
1190
- export const SQLITE_UTF16: 4;
1191
- export const SQLITE_INDEX_CONSTRAINT_EQ: 2;
1192
- export const SQLITE_INDEX_CONSTRAINT_GT: 4;
1193
- export const SQLITE_INDEX_CONSTRAINT_LE: 8;
1194
- export const SQLITE_INDEX_CONSTRAINT_LT: 16;
1195
- export const SQLITE_INDEX_CONSTRAINT_GE: 32;
1196
- export const SQLITE_INDEX_CONSTRAINT_MATCH: 64;
1197
- export const SQLITE_INDEX_CONSTRAINT_LIKE: 65;
1198
- export const SQLITE_INDEX_CONSTRAINT_GLOB: 66;
1199
- export const SQLITE_INDEX_CONSTRAINT_REGEXP: 67;
1200
- export const SQLITE_INDEX_CONSTRAINT_NE: 68;
1201
- export const SQLITE_INDEX_CONSTRAINT_ISNOT: 69;
1202
- export const SQLITE_INDEX_CONSTRAINT_ISNOTNULL: 70;
1203
- export const SQLITE_INDEX_CONSTRAINT_ISNULL: 71;
1204
- export const SQLITE_INDEX_CONSTRAINT_IS: 72;
1205
- export const SQLITE_INDEX_CONSTRAINT_FUNCTION: 150;
1206
- export const SQLITE_INDEX_SCAN_UNIQUE: 1;
1207
- export const SQLITE_DETERMINISTIC: 0x000000800;
1208
- export const SQLITE_DIRECTONLY: 0x000080000;
1209
- export const SQLITE_SUBTYPE: 0x000100000;
1210
- export const SQLITE_INNOCUOUS: 0x000200000;
1211
- export const SQLITE_SYNC_NORMAL: 0x00002;
1212
- export const SQLITE_SYNC_FULL: 0x00003;
1213
- export const SQLITE_SYNC_DATAONLY: 0x00010;
1214
- export const SQLITE_CREATE_INDEX: 1;
1215
- export const SQLITE_CREATE_TABLE: 2;
1216
- export const SQLITE_CREATE_TEMP_INDEX: 3;
1217
- export const SQLITE_CREATE_TEMP_TABLE: 4;
1218
- export const SQLITE_CREATE_TEMP_TRIGGER: 5;
1219
- export const SQLITE_CREATE_TEMP_VIEW: 6;
1220
- export const SQLITE_CREATE_TRIGGER: 7;
1221
- export const SQLITE_CREATE_VIEW: 8;
1222
- export const SQLITE_DELETE: 9;
1223
- export const SQLITE_DROP_INDEX: 10;
1224
- export const SQLITE_DROP_TABLE: 11;
1225
- export const SQLITE_DROP_TEMP_INDEX: 12;
1226
- export const SQLITE_DROP_TEMP_TABLE: 13;
1227
- export const SQLITE_DROP_TEMP_TRIGGER: 14;
1228
- export const SQLITE_DROP_TEMP_VIEW: 15;
1229
- export const SQLITE_DROP_TRIGGER: 16;
1230
- export const SQLITE_DROP_VIEW: 17;
1231
- export const SQLITE_INSERT: 18;
1232
- export const SQLITE_PRAGMA: 19;
1233
- export const SQLITE_READ: 20;
1234
- export const SQLITE_SELECT: 21;
1235
- export const SQLITE_TRANSACTION: 22;
1236
- export const SQLITE_UPDATE: 23;
1237
- export const SQLITE_ATTACH: 24;
1238
- export const SQLITE_DETACH: 25;
1239
- export const SQLITE_ALTER_TABLE: 26;
1240
- export const SQLITE_REINDEX: 27;
1241
- export const SQLITE_ANALYZE: 28;
1242
- export const SQLITE_CREATE_VTABLE: 29;
1243
- export const SQLITE_DROP_VTABLE: 30;
1244
- export const SQLITE_FUNCTION: 31;
1245
- export const SQLITE_SAVEPOINT: 32;
1246
- export const SQLITE_COPY: 0;
1247
- export const SQLITE_RECURSIVE: 33;
1248
- export const SQLITE_DENY: 1;
1249
- export const SQLITE_IGNORE: 2;
1250
- export const SQLITE_LIMIT_LENGTH: 0;
1251
- export const SQLITE_LIMIT_SQL_LENGTH: 1;
1252
- export const SQLITE_LIMIT_COLUMN: 2;
1253
- export const SQLITE_LIMIT_EXPR_DEPTH: 3;
1254
- export const SQLITE_LIMIT_COMPOUND_SELECT: 4;
1255
- export const SQLITE_LIMIT_VDBE_OP: 5;
1256
- export const SQLITE_LIMIT_FUNCTION_ARG: 6;
1257
- export const SQLITE_LIMIT_ATTACHED: 7;
1258
- export const SQLITE_LIMIT_LIKE_PATTERN_LENGTH: 8;
1259
- export const SQLITE_LIMIT_VARIABLE_NUMBER: 9;
1260
- export const SQLITE_LIMIT_TRIGGER_DEPTH: 10;
1261
- export const SQLITE_LIMIT_WORKER_THREADS: 11;
1262
- export const SQLITE_PREPARE_PERSISTENT: 0x01;
1263
- export const SQLITE_PREPARE_NORMALIZED: 0x02;
1264
- export const SQLITE_PREPARE_NO_VTAB: 0x04;
1022
+ export const SQLITE_OK: 0
1023
+ export const SQLITE_ERROR: 1
1024
+ export const SQLITE_INTERNAL: 2
1025
+ export const SQLITE_PERM: 3
1026
+ export const SQLITE_ABORT: 4
1027
+ export const SQLITE_BUSY: 5
1028
+ export const SQLITE_LOCKED: 6
1029
+ export const SQLITE_NOMEM: 7
1030
+ export const SQLITE_READONLY: 8
1031
+ export const SQLITE_INTERRUPT: 9
1032
+ export const SQLITE_IOERR: 10
1033
+ export const SQLITE_CORRUPT: 11
1034
+ export const SQLITE_NOTFOUND: 12
1035
+ export const SQLITE_FULL: 13
1036
+ export const SQLITE_CANTOPEN: 14
1037
+ export const SQLITE_PROTOCOL: 15
1038
+ export const SQLITE_EMPTY: 16
1039
+ export const SQLITE_SCHEMA: 17
1040
+ export const SQLITE_TOOBIG: 18
1041
+ export const SQLITE_CONSTRAINT: 19
1042
+ export const SQLITE_MISMATCH: 20
1043
+ export const SQLITE_MISUSE: 21
1044
+ export const SQLITE_NOLFS: 22
1045
+ export const SQLITE_AUTH: 23
1046
+ export const SQLITE_FORMAT: 24
1047
+ export const SQLITE_RANGE: 25
1048
+ export const SQLITE_NOTADB: 26
1049
+ export const SQLITE_NOTICE: 27
1050
+ export const SQLITE_WARNING: 28
1051
+ export const SQLITE_ROW: 100
1052
+ export const SQLITE_DONE: 101
1053
+ export const SQLITE_IOERR_ACCESS: 3338
1054
+ export const SQLITE_IOERR_CHECKRESERVEDLOCK: 3594
1055
+ export const SQLITE_IOERR_CLOSE: 4106
1056
+ export const SQLITE_IOERR_DATA: 8202
1057
+ export const SQLITE_IOERR_DELETE: 2570
1058
+ export const SQLITE_IOERR_DELETE_NOENT: 5898
1059
+ export const SQLITE_IOERR_DIR_FSYNC: 1290
1060
+ export const SQLITE_IOERR_FSTAT: 1802
1061
+ export const SQLITE_IOERR_FSYNC: 1034
1062
+ export const SQLITE_IOERR_GETTEMPPATH: 6410
1063
+ export const SQLITE_IOERR_LOCK: 3850
1064
+ export const SQLITE_IOERR_NOMEM: 3082
1065
+ export const SQLITE_IOERR_READ: 266
1066
+ export const SQLITE_IOERR_RDLOCK: 2314
1067
+ export const SQLITE_IOERR_SEEK: 5642
1068
+ export const SQLITE_IOERR_SHORT_READ: 522
1069
+ export const SQLITE_IOERR_TRUNCATE: 1546
1070
+ export const SQLITE_IOERR_UNLOCK: 2058
1071
+ export const SQLITE_IOERR_VNODE: 6922
1072
+ export const SQLITE_IOERR_WRITE: 778
1073
+ export const SQLITE_IOERR_BEGIN_ATOMIC: 7434
1074
+ export const SQLITE_IOERR_COMMIT_ATOMIC: 7690
1075
+ export const SQLITE_IOERR_ROLLBACK_ATOMIC: 7946
1076
+ export const SQLITE_CONSTRAINT_CHECK: 275
1077
+ export const SQLITE_CONSTRAINT_COMMITHOOK: 531
1078
+ export const SQLITE_CONSTRAINT_FOREIGNKEY: 787
1079
+ export const SQLITE_CONSTRAINT_FUNCTION: 1043
1080
+ export const SQLITE_CONSTRAINT_NOTNULL: 1299
1081
+ export const SQLITE_CONSTRAINT_PINNED: 2835
1082
+ export const SQLITE_CONSTRAINT_PRIMARYKEY: 1555
1083
+ export const SQLITE_CONSTRAINT_ROWID: 2579
1084
+ export const SQLITE_CONSTRAINT_TRIGGER: 1811
1085
+ export const SQLITE_CONSTRAINT_UNIQUE: 2067
1086
+ export const SQLITE_CONSTRAINT_VTAB: 2323
1087
+ export const SQLITE_OPEN_READONLY: 1
1088
+ export const SQLITE_OPEN_READWRITE: 2
1089
+ export const SQLITE_OPEN_CREATE: 4
1090
+ export const SQLITE_OPEN_DELETEONCLOSE: 8
1091
+ export const SQLITE_OPEN_EXCLUSIVE: 16
1092
+ export const SQLITE_OPEN_AUTOPROXY: 32
1093
+ export const SQLITE_OPEN_URI: 64
1094
+ export const SQLITE_OPEN_MEMORY: 128
1095
+ export const SQLITE_OPEN_MAIN_DB: 256
1096
+ export const SQLITE_OPEN_TEMP_DB: 512
1097
+ export const SQLITE_OPEN_TRANSIENT_DB: 1024
1098
+ export const SQLITE_OPEN_MAIN_JOURNAL: 2048
1099
+ export const SQLITE_OPEN_TEMP_JOURNAL: 4096
1100
+ export const SQLITE_OPEN_SUBJOURNAL: 8192
1101
+ export const SQLITE_OPEN_SUPER_JOURNAL: 16384
1102
+ export const SQLITE_OPEN_NOMUTEX: 32768
1103
+ export const SQLITE_OPEN_FULLMUTEX: 65536
1104
+ export const SQLITE_OPEN_SHAREDCACHE: 131072
1105
+ export const SQLITE_OPEN_PRIVATECACHE: 262144
1106
+ export const SQLITE_OPEN_WAL: 524288
1107
+ export const SQLITE_OPEN_NOFOLLOW: 16777216
1108
+ export const SQLITE_LOCK_NONE: 0
1109
+ export const SQLITE_LOCK_SHARED: 1
1110
+ export const SQLITE_LOCK_RESERVED: 2
1111
+ export const SQLITE_LOCK_PENDING: 3
1112
+ export const SQLITE_LOCK_EXCLUSIVE: 4
1113
+ export const SQLITE_IOCAP_ATOMIC: 1
1114
+ export const SQLITE_IOCAP_ATOMIC512: 2
1115
+ export const SQLITE_IOCAP_ATOMIC1K: 4
1116
+ export const SQLITE_IOCAP_ATOMIC2K: 8
1117
+ export const SQLITE_IOCAP_ATOMIC4K: 16
1118
+ export const SQLITE_IOCAP_ATOMIC8K: 32
1119
+ export const SQLITE_IOCAP_ATOMIC16K: 64
1120
+ export const SQLITE_IOCAP_ATOMIC32K: 128
1121
+ export const SQLITE_IOCAP_ATOMIC64K: 256
1122
+ export const SQLITE_IOCAP_SAFE_APPEND: 512
1123
+ export const SQLITE_IOCAP_SEQUENTIAL: 1024
1124
+ export const SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN: 2048
1125
+ export const SQLITE_IOCAP_POWERSAFE_OVERWRITE: 4096
1126
+ export const SQLITE_IOCAP_IMMUTABLE: 8192
1127
+ export const SQLITE_IOCAP_BATCH_ATOMIC: 16384
1128
+ export const SQLITE_ACCESS_EXISTS: 0
1129
+ export const SQLITE_ACCESS_READWRITE: 1
1130
+ export const SQLITE_ACCESS_READ: 2
1131
+ export const SQLITE_FCNTL_LOCKSTATE: 1
1132
+ export const SQLITE_FCNTL_GET_LOCKPROXYFILE: 2
1133
+ export const SQLITE_FCNTL_SET_LOCKPROXYFILE: 3
1134
+ export const SQLITE_FCNTL_LAST_ERRNO: 4
1135
+ export const SQLITE_FCNTL_SIZE_HINT: 5
1136
+ export const SQLITE_FCNTL_CHUNK_SIZE: 6
1137
+ export const SQLITE_FCNTL_FILE_POINTER: 7
1138
+ export const SQLITE_FCNTL_SYNC_OMITTED: 8
1139
+ export const SQLITE_FCNTL_WIN32_AV_RETRY: 9
1140
+ export const SQLITE_FCNTL_PERSIST_WAL: 10
1141
+ export const SQLITE_FCNTL_OVERWRITE: 11
1142
+ export const SQLITE_FCNTL_VFSNAME: 12
1143
+ export const SQLITE_FCNTL_POWERSAFE_OVERWRITE: 13
1144
+ export const SQLITE_FCNTL_PRAGMA: 14
1145
+ export const SQLITE_FCNTL_BUSYHANDLER: 15
1146
+ export const SQLITE_FCNTL_TEMPFILENAME: 16
1147
+ export const SQLITE_FCNTL_MMAP_SIZE: 18
1148
+ export const SQLITE_FCNTL_TRACE: 19
1149
+ export const SQLITE_FCNTL_HAS_MOVED: 20
1150
+ export const SQLITE_FCNTL_SYNC: 21
1151
+ export const SQLITE_FCNTL_COMMIT_PHASETWO: 22
1152
+ export const SQLITE_FCNTL_WIN32_SET_HANDLE: 23
1153
+ export const SQLITE_FCNTL_WAL_BLOCK: 24
1154
+ export const SQLITE_FCNTL_ZIPVFS: 25
1155
+ export const SQLITE_FCNTL_RBU: 26
1156
+ export const SQLITE_FCNTL_VFS_POINTER: 27
1157
+ export const SQLITE_FCNTL_JOURNAL_POINTER: 28
1158
+ export const SQLITE_FCNTL_WIN32_GET_HANDLE: 29
1159
+ export const SQLITE_FCNTL_PDB: 30
1160
+ export const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE: 31
1161
+ export const SQLITE_FCNTL_COMMIT_ATOMIC_WRITE: 32
1162
+ export const SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE: 33
1163
+ export const SQLITE_FCNTL_LOCK_TIMEOUT: 34
1164
+ export const SQLITE_FCNTL_DATA_VERSION: 35
1165
+ export const SQLITE_FCNTL_SIZE_LIMIT: 36
1166
+ export const SQLITE_FCNTL_CKPT_DONE: 37
1167
+ export const SQLITE_FCNTL_RESERVE_BYTES: 38
1168
+ export const SQLITE_FCNTL_CKPT_START: 39
1169
+ export const SQLITE_INTEGER: 1
1170
+ export const SQLITE_FLOAT: 2
1171
+ export const SQLITE_TEXT: 3
1172
+ export const SQLITE_BLOB: 4
1173
+ export const SQLITE_NULL: 5
1174
+ export const SQLITE_STATIC: 0
1175
+ export const SQLITE_TRANSIENT: -1
1176
+ export const SQLITE_UTF8: 1
1177
+ export const SQLITE_UTF16LE: 2
1178
+ export const SQLITE_UTF16BE: 3
1179
+ export const SQLITE_UTF16: 4
1180
+ export const SQLITE_INDEX_CONSTRAINT_EQ: 2
1181
+ export const SQLITE_INDEX_CONSTRAINT_GT: 4
1182
+ export const SQLITE_INDEX_CONSTRAINT_LE: 8
1183
+ export const SQLITE_INDEX_CONSTRAINT_LT: 16
1184
+ export const SQLITE_INDEX_CONSTRAINT_GE: 32
1185
+ export const SQLITE_INDEX_CONSTRAINT_MATCH: 64
1186
+ export const SQLITE_INDEX_CONSTRAINT_LIKE: 65
1187
+ export const SQLITE_INDEX_CONSTRAINT_GLOB: 66
1188
+ export const SQLITE_INDEX_CONSTRAINT_REGEXP: 67
1189
+ export const SQLITE_INDEX_CONSTRAINT_NE: 68
1190
+ export const SQLITE_INDEX_CONSTRAINT_ISNOT: 69
1191
+ export const SQLITE_INDEX_CONSTRAINT_ISNOTNULL: 70
1192
+ export const SQLITE_INDEX_CONSTRAINT_ISNULL: 71
1193
+ export const SQLITE_INDEX_CONSTRAINT_IS: 72
1194
+ export const SQLITE_INDEX_CONSTRAINT_FUNCTION: 150
1195
+ export const SQLITE_INDEX_SCAN_UNIQUE: 1
1196
+ export const SQLITE_DETERMINISTIC: 0x000000800
1197
+ export const SQLITE_DIRECTONLY: 0x000080000
1198
+ export const SQLITE_SUBTYPE: 0x000100000
1199
+ export const SQLITE_INNOCUOUS: 0x000200000
1200
+ export const SQLITE_SYNC_NORMAL: 0x00002
1201
+ export const SQLITE_SYNC_FULL: 0x00003
1202
+ export const SQLITE_SYNC_DATAONLY: 0x00010
1203
+ export const SQLITE_CREATE_INDEX: 1
1204
+ export const SQLITE_CREATE_TABLE: 2
1205
+ export const SQLITE_CREATE_TEMP_INDEX: 3
1206
+ export const SQLITE_CREATE_TEMP_TABLE: 4
1207
+ export const SQLITE_CREATE_TEMP_TRIGGER: 5
1208
+ export const SQLITE_CREATE_TEMP_VIEW: 6
1209
+ export const SQLITE_CREATE_TRIGGER: 7
1210
+ export const SQLITE_CREATE_VIEW: 8
1211
+ export const SQLITE_DELETE: 9
1212
+ export const SQLITE_DROP_INDEX: 10
1213
+ export const SQLITE_DROP_TABLE: 11
1214
+ export const SQLITE_DROP_TEMP_INDEX: 12
1215
+ export const SQLITE_DROP_TEMP_TABLE: 13
1216
+ export const SQLITE_DROP_TEMP_TRIGGER: 14
1217
+ export const SQLITE_DROP_TEMP_VIEW: 15
1218
+ export const SQLITE_DROP_TRIGGER: 16
1219
+ export const SQLITE_DROP_VIEW: 17
1220
+ export const SQLITE_INSERT: 18
1221
+ export const SQLITE_PRAGMA: 19
1222
+ export const SQLITE_READ: 20
1223
+ export const SQLITE_SELECT: 21
1224
+ export const SQLITE_TRANSACTION: 22
1225
+ export const SQLITE_UPDATE: 23
1226
+ export const SQLITE_ATTACH: 24
1227
+ export const SQLITE_DETACH: 25
1228
+ export const SQLITE_ALTER_TABLE: 26
1229
+ export const SQLITE_REINDEX: 27
1230
+ export const SQLITE_ANALYZE: 28
1231
+ export const SQLITE_CREATE_VTABLE: 29
1232
+ export const SQLITE_DROP_VTABLE: 30
1233
+ export const SQLITE_FUNCTION: 31
1234
+ export const SQLITE_SAVEPOINT: 32
1235
+ export const SQLITE_COPY: 0
1236
+ export const SQLITE_RECURSIVE: 33
1237
+ export const SQLITE_DENY: 1
1238
+ export const SQLITE_IGNORE: 2
1239
+ export const SQLITE_LIMIT_LENGTH: 0
1240
+ export const SQLITE_LIMIT_SQL_LENGTH: 1
1241
+ export const SQLITE_LIMIT_COLUMN: 2
1242
+ export const SQLITE_LIMIT_EXPR_DEPTH: 3
1243
+ export const SQLITE_LIMIT_COMPOUND_SELECT: 4
1244
+ export const SQLITE_LIMIT_VDBE_OP: 5
1245
+ export const SQLITE_LIMIT_FUNCTION_ARG: 6
1246
+ export const SQLITE_LIMIT_ATTACHED: 7
1247
+ export const SQLITE_LIMIT_LIKE_PATTERN_LENGTH: 8
1248
+ export const SQLITE_LIMIT_VARIABLE_NUMBER: 9
1249
+ export const SQLITE_LIMIT_TRIGGER_DEPTH: 10
1250
+ export const SQLITE_LIMIT_WORKER_THREADS: 11
1251
+ export const SQLITE_CHANGESET_DATA: 1
1252
+ export const SQLITE_CHANGESET_NOTFOUND: 2
1253
+ export const SQLITE_CHANGESET_CONFLICT: 3
1254
+ export const SQLITE_CHANGESET_CONSTRAINT: 4
1255
+ export const SQLITE_CHANGESET_FOREIGN_KEY: 5
1256
+ export const SQLITE_CHANGESET_OMIT: 0
1257
+ export const SQLITE_CHANGESET_REPLACE: 1
1258
+ export const SQLITE_CHANGESET_ABORT: 2
1259
+ export const SQLITE_PREPARE_PERSISTENT: 0x01
1260
+ export const SQLITE_PREPARE_NORMALIZED: 0x02
1261
+ export const SQLITE_PREPARE_NO_VTAB: 0x04
1265
1262
  }
1266
1263
 
1267
1264
  declare module '@livestore/wa-sqlite' {
1268
- export * from '@livestore/wa-sqlite/src/sqlite-constants.js';
1265
+ export * from '@livestore/wa-sqlite/src/sqlite-constants.js'
1269
1266
 
1270
1267
  /**
1271
1268
  * @ignore
@@ -1275,111 +1272,131 @@ declare module '@livestore/wa-sqlite' {
1275
1272
  * @param {*} Module SQLite module
1276
1273
  * @returns {SQLiteAPI}
1277
1274
  */
1278
- export function Factory(Module: any): SQLiteAPI;
1275
+ export function Factory(Module: any): SQLiteAPI
1279
1276
 
1280
1277
  export class SQLiteError extends Error {
1281
- constructor(message: any, code: any);
1282
- code: any;
1278
+ constructor(message: any, code: any)
1279
+ code: any
1283
1280
  }
1284
1281
  }
1285
1282
 
1286
1283
  /** @ignore */
1287
1284
  declare module '@livestore/wa-sqlite/dist/wa-sqlite.mjs' {
1288
- function ModuleFactory(config?: object): Promise<any>;
1289
- export = ModuleFactory;
1285
+ function ModuleFactory(config?: object): Promise<any>
1286
+ export = ModuleFactory
1290
1287
  }
1291
1288
 
1292
1289
  /** @ignore */
1293
1290
  declare module '@livestore/wa-sqlite/dist/wa-sqlite-async.mjs' {
1294
- function ModuleFactory(config?: object): Promise<any>;
1295
- export = ModuleFactory;
1291
+ function ModuleFactory(config?: object): Promise<any>
1292
+ export = ModuleFactory
1293
+ }
1294
+
1295
+ /** @ignore */
1296
+ declare module '@livestore/wa-sqlite/dist/wa-sqlite.node.mjs' {
1297
+ function ModuleFactory(config?: object): Promise<any>
1298
+ export = ModuleFactory
1299
+ }
1300
+
1301
+ /** @ignore */
1302
+ declare module '@livestore/wa-sqlite/src/sqlite-api.js' {
1303
+ export * from '@livestore/wa-sqlite'
1296
1304
  }
1297
1305
 
1298
1306
  /** @ignore */
1299
1307
  declare module '@livestore/wa-sqlite/src/VFS.js' {
1300
- export * from '@livestore/wa-sqlite/src/sqlite-constants.js';
1308
+ export * from '@livestore/wa-sqlite/src/sqlite-constants.js'
1301
1309
 
1302
1310
  export class Base {
1303
- name: string;
1304
- mxPathName: number;
1311
+ constructor(name: string, module: any)
1312
+ name: string
1313
+ mxPathName: number
1305
1314
  /**
1306
1315
  * @param {number} fileId
1307
1316
  * @returns {number|Promise<number>}
1308
1317
  */
1309
- xClose(fileId: number): number;
1318
+ xClose(fileId: number): number
1310
1319
  /**
1311
1320
  * @param {number} fileId
1312
1321
  * @param {Uint8Array<ArrayBuffer>} pData
1313
1322
  * @param {number} iOffset
1314
1323
  * @returns {number}
1315
1324
  */
1316
- xRead(fileId: number, pData: {
1317
- size: number;
1318
- value: Uint8Array<ArrayBuffer>;
1319
- }, iOffset: number): number;
1325
+ xRead(
1326
+ fileId: number,
1327
+ pData: {
1328
+ size: number
1329
+ value: Uint8Array<ArrayBuffer>
1330
+ },
1331
+ iOffset: number,
1332
+ ): number
1320
1333
  /**
1321
1334
  * @param {number} fileId
1322
1335
  * @param {Uint8Array<ArrayBuffer>} pData
1323
1336
  * @param {number} iOffset
1324
1337
  * @returns {number}
1325
1338
  */
1326
- xWrite(fileId: number, pData: {
1327
- size: number;
1328
- value: Uint8Array<ArrayBuffer>;
1329
- }, iOffset: number): number;
1339
+ xWrite(
1340
+ fileId: number,
1341
+ pData: {
1342
+ size: number
1343
+ value: Uint8Array<ArrayBuffer>
1344
+ },
1345
+ iOffset: number,
1346
+ ): number
1330
1347
  /**
1331
1348
  * @param {number} fileId
1332
1349
  * @param {number} iSize
1333
1350
  * @returns {number}
1334
1351
  */
1335
- xTruncate(fileId: number, iSize: number): number;
1352
+ xTruncate(fileId: number, iSize: number): number
1336
1353
  /**
1337
1354
  * @param {number} fileId
1338
1355
  * @param {*} flags
1339
1356
  * @returns {number}
1340
1357
  */
1341
- xSync(fileId: number, flags: any): number;
1358
+ xSync(fileId: number, flags: any): number
1342
1359
  /**
1343
1360
  * @param {number} fileId
1344
1361
  * @param {DataView} pSize64
1345
1362
  * @returns {number|Promise<number>}
1346
1363
  */
1347
- xFileSize(fileId: number, pSize64: DataView): number;
1364
+ xFileSize(fileId: number, pSize64: DataView): number
1348
1365
  /**
1349
1366
  * @param {number} fileId
1350
1367
  * @param {number} flags
1351
1368
  * @returns {number}
1352
1369
  */
1353
- xLock(fileId: number, flags: number): number;
1370
+ xLock(fileId: number, flags: number): number
1354
1371
  /**
1355
1372
  * @param {number} fileId
1356
1373
  * @param {number} flags
1357
1374
  * @returns {number}
1358
1375
  */
1359
- xUnlock(fileId: number, flags: number): number;
1376
+ xUnlock(fileId: number, flags: number): number
1360
1377
  /**
1361
1378
  * @param {number} fileId
1362
1379
  * @param {DataView} pResOut
1363
1380
  * @returns {number}
1364
1381
  */
1365
- xCheckReservedLock(fileId: number, pResOut: DataView): number;
1382
+ xCheckReservedLock(fileId: number, pResOut: DataView): number
1366
1383
  /**
1367
1384
  * @param {number} fileId
1368
1385
  * @param {number} flags
1369
1386
  * @param {DataView} pArg
1370
1387
  * @returns {number}
1371
1388
  */
1372
- xFileControl(fileId: number, flags: number, pArg: DataView): number;
1389
+ xFileControl(fileId: number, flags: number, pArg: DataView): number
1373
1390
  /**
1374
1391
  * @param {number} fileId
1375
1392
  * @returns {number}
1376
1393
  */
1377
- xSectorSize(fileId: number): number;
1394
+ xSectorSize(fileId: number): number
1378
1395
  /**
1379
1396
  * @param {number} fileId
1380
1397
  * @returns {number}
1381
1398
  */
1382
- xDeviceCharacteristics(fileId: number): number;
1399
+ xDeviceCharacteristics(fileId: number): number
1383
1400
  /**
1384
1401
  * @param {string?} name
1385
1402
  * @param {number} fileId
@@ -1387,28 +1404,28 @@ declare module '@livestore/wa-sqlite/src/VFS.js' {
1387
1404
  * @param {DataView} pOutFlags
1388
1405
  * @returns {number}
1389
1406
  */
1390
- xOpen(name: string | null, fileId: number, flags: number, pOutFlags: DataView): number;
1407
+ xOpen(name: string | null, fileId: number, flags: number, pOutFlags: DataView): number
1391
1408
  /**
1392
1409
  *
1393
1410
  * @param {string} name
1394
1411
  * @param {number} syncDir
1395
1412
  * @returns {number}
1396
1413
  */
1397
- xDelete(name: string, syncDir: number): number;
1414
+ xDelete(name: string, syncDir: number): number
1398
1415
  /**
1399
1416
  * @param {string} name
1400
1417
  * @param {number} flags
1401
1418
  * @param {DataView} pResOut
1402
1419
  * @returns {number}
1403
1420
  */
1404
- xAccess(name: string, flags: number, pResOut: DataView): number;
1421
+ xAccess(name: string, flags: number, pResOut: DataView): number
1405
1422
  /**
1406
1423
  * Handle asynchronous operation. This implementation will be overriden on
1407
1424
  * registration by an Asyncify build.
1408
1425
  * @param {function(): Promise<number>} f
1409
1426
  * @returns {number}
1410
1427
  */
1411
- handleAsync(f: () => Promise<number>): number;
1428
+ handleAsync(f: () => Promise<number>): number
1412
1429
  }
1413
1430
  }
1414
1431
 
@@ -1416,67 +1433,66 @@ declare module '@livestore/wa-sqlite/src/VFS.js' {
1416
1433
  declare module '@livestore/wa-sqlite/src/FacadeVFS.js' {
1417
1434
  export type FacadeVFS = any
1418
1435
  }
1419
-
1420
1436
 
1421
1437
  declare module '@livestore/wa-sqlite/src/examples/AccessHandlePoolVFS.js' {
1422
- import * as VFS from "@livestore/wa-sqlite/src/VFS.js";
1438
+ import * as VFS from '@livestore/wa-sqlite/src/VFS.js'
1423
1439
  export class AccessHandlePoolVFS extends VFS.Base {
1424
1440
  constructor(name: string, module: any)
1425
- static create(name: string, module: any): Promise<AccessHandlePoolVFS>;
1441
+ static create(name: string, module: any): Promise<AccessHandlePoolVFS>
1426
1442
  }
1427
1443
  }
1428
1444
 
1429
1445
  declare module '@livestore/wa-sqlite/src/examples/OPFSCoopSyncVFS.js' {
1430
- import * as VFS from "@livestore/wa-sqlite/src/VFS.js";
1446
+ import * as VFS from '@livestore/wa-sqlite/src/VFS.js'
1431
1447
  export class OPFSCoopSyncVFS extends VFS.Base {
1432
1448
  constructor(name: string, module: any)
1433
- static create(name: string, module: any): Promise<OPFSCoopSyncVFS>;
1449
+ static create(name: string, module: any): Promise<OPFSCoopSyncVFS>
1434
1450
  }
1435
1451
  }
1436
1452
 
1437
1453
  /** @ignore */
1438
1454
  declare module '@livestore/wa-sqlite/src/examples/IndexedDbVFS.js' {
1439
- import * as VFS from "@livestore/wa-sqlite/src/VFS.js";
1455
+ import * as VFS from '@livestore/wa-sqlite/src/VFS.js'
1440
1456
  export class IndexedDbVFS extends VFS.Base {
1441
1457
  /**
1442
1458
  * @param {string} idbName Name of IndexedDB database.
1443
1459
  */
1444
- constructor(idbName?: string);
1445
- name: string;
1446
- mapIdToFile: Map<any, any>;
1447
- cacheSize: number;
1448
- db: any;
1460
+ constructor(idbName?: string)
1461
+ name: string
1462
+ mapIdToFile: Map<any, any>
1463
+ cacheSize: number
1464
+ db: any
1449
1465
  // close(): Promise<void>;
1450
- close(): void;
1466
+ close(): void
1451
1467
  /**
1452
1468
  * Delete a file from IndexedDB.
1453
1469
  * @param {string} name
1454
1470
  */
1455
- deleteFile(name: string): Promise<void>;
1471
+ deleteFile(name: string): Promise<void>
1456
1472
  /**
1457
1473
  * Forcibly clear an orphaned file lock.
1458
1474
  * @param {string} name
1459
1475
  */
1460
- forceClearLock(name: string): Promise<void>;
1461
- _getStore(mode?: string): any;
1476
+ forceClearLock(name: string): Promise<void>
1477
+ _getStore(mode?: string): any
1462
1478
  /**
1463
1479
  * Returns the key for file metadata.
1464
1480
  * @param {string} name
1465
1481
  * @returns
1466
1482
  */
1467
- _metaKey(name: string): string;
1483
+ _metaKey(name: string): string
1468
1484
  /**
1469
1485
  * Returns the key for file block data.
1470
1486
  * @param {string} name
1471
1487
  * @param {number} index
1472
1488
  * @returns
1473
1489
  */
1474
- _blockKey(name: string, index: number): string;
1475
- _getBlock(store: any, file: any, index: any): Promise<any>;
1476
- _putBlock(store: any, file: any, index: any, blockData: any): void;
1477
- _purgeCache(store: any, file: any, size?: number): void;
1478
- _flushCache(store: any, file: any): Promise<void>;
1479
- _sync(file: any): Promise<void>;
1490
+ _blockKey(name: string, index: number): string
1491
+ _getBlock(store: any, file: any, index: any): Promise<any>
1492
+ _putBlock(store: any, file: any, index: any, blockData: any): void
1493
+ _purgeCache(store: any, file: any, size?: number): void
1494
+ _flushCache(store: any, file: any): Promise<void>
1495
+ _sync(file: any): Promise<void>
1480
1496
  /**
1481
1497
  * Helper function that deletes all keys greater or equal to `key`
1482
1498
  * provided they start with `prefix`.
@@ -1484,26 +1500,25 @@ declare module '@livestore/wa-sqlite/src/examples/IndexedDbVFS.js' {
1484
1500
  * @param {string} [prefix]
1485
1501
  * @returns
1486
1502
  */
1487
- _delete(key: string, prefix?: string): Promise<any>;
1503
+ _delete(key: string, prefix?: string): Promise<any>
1488
1504
  }
1489
1505
  }
1490
1506
 
1491
1507
  /** @ignore */
1492
1508
  declare module '@livestore/wa-sqlite/src/examples/MemoryVFS.js' {
1493
- import * as VFS from "@livestore/wa-sqlite/src/VFS.js";
1509
+ import * as VFS from '@livestore/wa-sqlite/src/VFS.js'
1494
1510
  /** @ignore */
1495
1511
  export class MemoryVFS extends VFS.Base {
1496
- name: string;
1497
- mapNameToFile: Map<any, any>;
1498
- mapIdToFile: Map<any, any>;
1512
+ name: string
1513
+ mapNameToFile: Map<any, any>
1514
+ mapIdToFile: Map<any, any>
1499
1515
  }
1500
1516
  }
1501
1517
 
1502
1518
  /** @ignore */
1503
1519
  declare module '@livestore/wa-sqlite/src/examples/MemoryAsyncVFS.js' {
1504
- import { MemoryVFS } from "@livestore/wa-sqlite/src/examples/MemoryVFS.js";
1505
- export class MemoryAsyncVFS extends MemoryVFS {
1506
- }
1520
+ import { MemoryVFS } from '@livestore/wa-sqlite/src/examples/MemoryVFS.js'
1521
+ export class MemoryAsyncVFS extends MemoryVFS {}
1507
1522
  }
1508
1523
 
1509
1524
  /** @ignore */
@@ -1527,5 +1542,5 @@ declare module '@livestore/wa-sqlite/src/examples/tag.js' {
1527
1542
  * @param {number} db
1528
1543
  * @returns {function(TemplateStringsArray, ...any): Promise<object[]>}
1529
1544
  */
1530
- export function tag(sqlite3: any, db: number): (arg0: TemplateStringsArray, ...args: any[]) => Promise<object[]>;
1545
+ export function tag(sqlite3: any, db: number): (arg0: TemplateStringsArray, ...args: any[]) => Promise<object[]>
1531
1546
  }