@effect/sql-sqlite-wasm 0.20.6 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ export * as OpfsWorker from "./OpfsWorker.js"
5
+
1
6
  /**
2
7
  * @since 1.0.0
3
8
  */
@@ -0,0 +1,9 @@
1
+ import type { Primitive } from "@effect/sql/Statement"
2
+
3
+ /** @internal */
4
+ export type OpfsWorkerMessage =
5
+ | [id: number, sql: string, params: ReadonlyArray<Primitive>]
6
+ | ["import", id: number, data: Uint8Array]
7
+ | ["export", id: number]
8
+ | ["update_hook"]
9
+ | ["close"]
@@ -1,45 +1,17 @@
1
1
  /**
2
2
  * @since 1.0.0
3
3
  */
4
-
5
- declare module "@sqlite.org/sqlite-wasm" {
6
- export type OpenMode = "c" | "ct" | "w" | "wt" | "r" | "rt"
7
- export type RowMode = "object" | "array" | "stmt"
8
-
9
- export interface SqliteHandle {
10
- readonly _: unique symbol
11
- }
12
-
13
- export class DB {
14
- constructor(dbName?: string, mode?: OpenMode)
15
-
16
- readonly pointer: SqliteHandle
17
-
18
- exec(options: {
19
- sql: string
20
- bind?: ReadonlyArray<unknown> | undefined
21
- rowMode?: RowMode | undefined
22
- resultRows?: Array<unknown> | undefined
23
- })
24
-
25
- close(): void
26
- }
27
- class OpfsDb extends DB {}
28
-
29
- interface OO1 {
30
- readonly DB: typeof DB
31
- readonly OpfsDb?: typeof OpfsDb
32
- }
33
-
34
- interface CApi {
35
- readonly sqlite3_js_db_export: (db: SqliteHandle) => Uint8Array
4
+ declare module "@effect/wa-sqlite/src/examples/IDBBatchAtomicVFS.js" {
5
+ export class IDBBatchAtomicVFS {
6
+ static async create(name: string, module: any, options?: any): Promise<any>
36
7
  }
8
+ }
37
9
 
38
- interface SqliteWasm {
39
- readonly oo1: OO1
40
- readonly capi: CApi
10
+ /**
11
+ * @since 1.0.0
12
+ */
13
+ declare module "@effect/wa-sqlite/src/examples/AccessHandlePoolVFS.js" {
14
+ export class AccessHandlePoolVFS {
15
+ static async create(name: string, module: any, options?: any): Promise<any>
41
16
  }
42
-
43
- const init: () => Promise<SqliteWasm>
44
- export default init
45
17
  }