@lix-js/sdk 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -16
- package/dist/binding-types.d.ts +18 -2
- package/dist/binding.browser.d.ts +2 -2
- package/dist/binding.browser.js +3 -3
- package/dist/binding.node.d.ts +2 -2
- package/dist/binding.node.js +10 -4
- package/dist/bundled-plugins/plugin_csv_v2.lixplugin +0 -0
- package/dist/bundled-plugins/plugin_markdown_incremental_v2.lixplugin +0 -0
- package/dist/bundled-plugins.js +4 -4
- package/dist/client-state.d.ts +40 -0
- package/dist/client-state.js +178 -0
- package/dist/index.d.ts +2 -1
- package/dist/lix.d.ts +44 -0
- package/dist/lix.js +369 -0
- package/dist/local-storage-adapter.d.ts +26 -0
- package/dist/local-storage-adapter.js +117 -0
- package/dist/open-lix.d.ts +3 -34
- package/dist/open-lix.js +103 -170
- package/dist/remote/client.d.ts +8 -0
- package/dist/remote/client.js +1036 -0
- package/dist/remote/protocol.d.ts +166 -0
- package/dist/remote/protocol.js +362 -0
- package/dist/remote/sse.d.ts +12 -0
- package/dist/remote/sse.js +87 -0
- package/dist/snapshot-persistence.d.ts +7 -0
- package/dist/snapshot-persistence.js +26 -0
- package/dist/types.d.ts +58 -1
- package/dist/wasm/lix_js_sdk.d.ts +16 -4
- package/dist/wasm/lix_js_sdk.js +75 -17
- package/dist/wasm/lix_js_sdk_bg.wasm +0 -0
- package/dist/wasm/lix_js_sdk_bg.wasm.d.ts +8 -2
- package/dist/worker/client.d.ts +23 -4
- package/dist/worker/client.js +287 -10
- package/dist/worker/host.js +30 -2
- package/dist/worker/protocol.d.ts +26 -2
- package/dist/workerd.js +1 -3
- package/package.json +19 -16
- package/dist/bundled-plugins/plugin_csv.lixplugin +0 -0
- package/dist/bundled-plugins/plugin_md_v2.lixplugin +0 -0
- package/dist/jco/js-component-bindgen-component.core.wasm +0 -0
- package/dist/jco/js-component-bindgen-component.core2.wasm +0 -0
- package/dist/jco/js-component-bindgen-component.js +0 -13662
- package/dist/jco-transpile.browser.d.ts +0 -14
- package/dist/jco-transpile.browser.js +0 -22
- package/dist/plugin-runtime.d.ts +0 -45
- package/dist/plugin-runtime.js +0 -124
package/dist/types.d.ts
CHANGED
|
@@ -6,8 +6,47 @@ export type LocalFilesystemOptions = {
|
|
|
6
6
|
lixDir?: string;
|
|
7
7
|
syncAllFiles: boolean;
|
|
8
8
|
};
|
|
9
|
+
export type RemoteLixFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
10
|
+
export type RemoteLixServerOptions = {
|
|
11
|
+
mode: "remote";
|
|
12
|
+
url: string | URL;
|
|
13
|
+
headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
|
|
14
|
+
fetch?: RemoteLixFetch;
|
|
15
|
+
};
|
|
16
|
+
export type LixTelemetrySpan = {
|
|
17
|
+
schemaVersion: 1;
|
|
18
|
+
name: string;
|
|
19
|
+
startedAtUnixMs: number;
|
|
20
|
+
durationMs: number;
|
|
21
|
+
status: "ok" | "error";
|
|
22
|
+
attributes: Record<string, string | number | boolean>;
|
|
23
|
+
};
|
|
24
|
+
export type LixTelemetryOptions = {
|
|
25
|
+
onSpan(span: LixTelemetrySpan): void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Persists opaque Lix snapshots under SDK-provided namespaces.
|
|
29
|
+
*
|
|
30
|
+
* Implementations must treat snapshots as bytes owned by Lix. The namespace
|
|
31
|
+
* selects one logical Lix and allows a single adapter to persist more than one
|
|
32
|
+
* instance without collisions.
|
|
33
|
+
*/
|
|
34
|
+
export interface LixSnapshotStorage {
|
|
35
|
+
load(namespace: string): Promise<Uint8Array | undefined>;
|
|
36
|
+
save(namespace: string, snapshot: Uint8Array): Promise<void>;
|
|
37
|
+
}
|
|
9
38
|
export type OpenLixOptions = {
|
|
10
|
-
storage?: import("./open-lix.js").SQLite | import("./open-lix.js").LocalFilesystem;
|
|
39
|
+
storage?: import("./open-lix.js").SQLite | import("./open-lix.js").LocalFilesystem | LixSnapshotStorage;
|
|
40
|
+
server?: never;
|
|
41
|
+
telemetry?: LixTelemetryOptions;
|
|
42
|
+
} | {
|
|
43
|
+
/**
|
|
44
|
+
* Optional client-local storage. In remote mode workspace SQL remains on
|
|
45
|
+
* the server; only `lix.clientState` is stored here.
|
|
46
|
+
*/
|
|
47
|
+
storage?: LixSnapshotStorage;
|
|
48
|
+
server: RemoteLixServerOptions;
|
|
49
|
+
telemetry?: never;
|
|
11
50
|
};
|
|
12
51
|
export type LixValue = {
|
|
13
52
|
kind: "null";
|
|
@@ -37,6 +76,21 @@ export type JsonValue = null | boolean | number | string | readonly JsonValue[]
|
|
|
37
76
|
export type SqlParam = JsonValue | Uint8Array | import("./value.js").Value;
|
|
38
77
|
export type ExecuteOptions = {
|
|
39
78
|
originKey?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Stable identity for one logical remote SQL mutation. Supply the same key
|
|
81
|
+
* when retrying after a lost response; remote Lix generates one per call
|
|
82
|
+
* when this is omitted. This is sent as `Idempotency-Key`, not SQL options.
|
|
83
|
+
*/
|
|
84
|
+
idempotencyKey?: string;
|
|
85
|
+
};
|
|
86
|
+
export type LixBatchStatement = {
|
|
87
|
+
sql: string;
|
|
88
|
+
params?: readonly SqlParam[];
|
|
89
|
+
};
|
|
90
|
+
export type LixBatchOptions = {
|
|
91
|
+
originKey?: string;
|
|
92
|
+
/** See {@link ExecuteOptions.idempotencyKey}. */
|
|
93
|
+
idempotencyKey?: string;
|
|
40
94
|
};
|
|
41
95
|
export type ExecuteResult = {
|
|
42
96
|
columns: string[];
|
|
@@ -75,6 +129,9 @@ export type CreateBranchReceipt = {
|
|
|
75
129
|
hidden: boolean;
|
|
76
130
|
commitId: string;
|
|
77
131
|
};
|
|
132
|
+
export type CreateCheckpointReceipt = {
|
|
133
|
+
commitId: string;
|
|
134
|
+
};
|
|
78
135
|
export type SwitchBranchOptions = {
|
|
79
136
|
branchId: string;
|
|
80
137
|
};
|
|
@@ -7,9 +7,15 @@ export class WasmLix {
|
|
|
7
7
|
[Symbol.dispose](): void;
|
|
8
8
|
activeBranchId(): Promise<string>;
|
|
9
9
|
beginTransaction(): Promise<WasmLixTransaction>;
|
|
10
|
+
clientStateDelete(key: string): Promise<void>;
|
|
11
|
+
clientStateEntries(): Promise<any>;
|
|
12
|
+
clientStateGet(key: string): Promise<any>;
|
|
13
|
+
clientStateSet(key: string, value: any): Promise<void>;
|
|
10
14
|
close(): Promise<void>;
|
|
11
15
|
createBranch(options: any): Promise<any>;
|
|
16
|
+
createCheckpoint(): Promise<any>;
|
|
12
17
|
execute(sql: string, params: any, options?: any | null): Promise<any>;
|
|
18
|
+
executeBatch(statements: any, options?: any | null): Promise<any>;
|
|
13
19
|
exportSnapshot(): Promise<Uint8Array>;
|
|
14
20
|
mergeBranch(options: any): Promise<any>;
|
|
15
21
|
mergeBranchPreview(options: any): Promise<any>;
|
|
@@ -34,9 +40,9 @@ export class WasmObserveEvents {
|
|
|
34
40
|
next(): Promise<any>;
|
|
35
41
|
}
|
|
36
42
|
|
|
37
|
-
export function openMemory(
|
|
43
|
+
export function openMemory(telemetry_dispatch?: Function | null): Promise<WasmLix>;
|
|
38
44
|
|
|
39
|
-
export function openMemoryFromSnapshot(
|
|
45
|
+
export function openMemoryFromSnapshot(telemetry_dispatch?: Function | null, snapshot?: Uint8Array | null): Promise<WasmLix>;
|
|
40
46
|
|
|
41
47
|
export function parseSqlScript(sql: string, provided_param_count: number): any;
|
|
42
48
|
|
|
@@ -52,9 +58,15 @@ export interface InitOutput {
|
|
|
52
58
|
readonly parseSqlScript: (a: number, b: number, c: number, d: number) => void;
|
|
53
59
|
readonly wasmlix_activeBranchId: (a: number) => number;
|
|
54
60
|
readonly wasmlix_beginTransaction: (a: number) => number;
|
|
61
|
+
readonly wasmlix_clientStateDelete: (a: number, b: number, c: number) => number;
|
|
62
|
+
readonly wasmlix_clientStateEntries: (a: number) => number;
|
|
63
|
+
readonly wasmlix_clientStateGet: (a: number, b: number, c: number) => number;
|
|
64
|
+
readonly wasmlix_clientStateSet: (a: number, b: number, c: number, d: number) => number;
|
|
55
65
|
readonly wasmlix_close: (a: number) => number;
|
|
56
66
|
readonly wasmlix_createBranch: (a: number, b: number) => number;
|
|
67
|
+
readonly wasmlix_createCheckpoint: (a: number) => number;
|
|
57
68
|
readonly wasmlix_execute: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
69
|
+
readonly wasmlix_executeBatch: (a: number, b: number, c: number) => number;
|
|
58
70
|
readonly wasmlix_exportSnapshot: (a: number) => number;
|
|
59
71
|
readonly wasmlix_mergeBranch: (a: number, b: number) => number;
|
|
60
72
|
readonly wasmlix_mergeBranchPreview: (a: number, b: number) => number;
|
|
@@ -65,8 +77,8 @@ export interface InitOutput {
|
|
|
65
77
|
readonly wasmlixtransaction_rollback: (a: number) => number;
|
|
66
78
|
readonly wasmobserveevents_close: (a: number) => void;
|
|
67
79
|
readonly wasmobserveevents_next: (a: number) => number;
|
|
68
|
-
readonly
|
|
69
|
-
readonly
|
|
80
|
+
readonly __wasm_bindgen_func_elem_111270: (a: number, b: number, c: number, d: number) => void;
|
|
81
|
+
readonly __wasm_bindgen_func_elem_111272: (a: number, b: number, c: number, d: number) => void;
|
|
70
82
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
71
83
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
72
84
|
readonly __wbindgen_export3: (a: number) => void;
|
package/dist/wasm/lix_js_sdk.js
CHANGED
|
@@ -31,6 +31,44 @@ export class WasmLix {
|
|
|
31
31
|
const ret = wasm.wasmlix_beginTransaction(this.__wbg_ptr);
|
|
32
32
|
return takeObject(ret);
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} key
|
|
36
|
+
* @returns {Promise<void>}
|
|
37
|
+
*/
|
|
38
|
+
clientStateDelete(key) {
|
|
39
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
40
|
+
const len0 = WASM_VECTOR_LEN;
|
|
41
|
+
const ret = wasm.wasmlix_clientStateDelete(this.__wbg_ptr, ptr0, len0);
|
|
42
|
+
return takeObject(ret);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @returns {Promise<any>}
|
|
46
|
+
*/
|
|
47
|
+
clientStateEntries() {
|
|
48
|
+
const ret = wasm.wasmlix_clientStateEntries(this.__wbg_ptr);
|
|
49
|
+
return takeObject(ret);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @param {string} key
|
|
53
|
+
* @returns {Promise<any>}
|
|
54
|
+
*/
|
|
55
|
+
clientStateGet(key) {
|
|
56
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
57
|
+
const len0 = WASM_VECTOR_LEN;
|
|
58
|
+
const ret = wasm.wasmlix_clientStateGet(this.__wbg_ptr, ptr0, len0);
|
|
59
|
+
return takeObject(ret);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @param {string} key
|
|
63
|
+
* @param {any} value
|
|
64
|
+
* @returns {Promise<void>}
|
|
65
|
+
*/
|
|
66
|
+
clientStateSet(key, value) {
|
|
67
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
68
|
+
const len0 = WASM_VECTOR_LEN;
|
|
69
|
+
const ret = wasm.wasmlix_clientStateSet(this.__wbg_ptr, ptr0, len0, addHeapObject(value));
|
|
70
|
+
return takeObject(ret);
|
|
71
|
+
}
|
|
34
72
|
/**
|
|
35
73
|
* @returns {Promise<void>}
|
|
36
74
|
*/
|
|
@@ -46,6 +84,13 @@ export class WasmLix {
|
|
|
46
84
|
const ret = wasm.wasmlix_createBranch(this.__wbg_ptr, addHeapObject(options));
|
|
47
85
|
return takeObject(ret);
|
|
48
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* @returns {Promise<any>}
|
|
89
|
+
*/
|
|
90
|
+
createCheckpoint() {
|
|
91
|
+
const ret = wasm.wasmlix_createCheckpoint(this.__wbg_ptr);
|
|
92
|
+
return takeObject(ret);
|
|
93
|
+
}
|
|
49
94
|
/**
|
|
50
95
|
* @param {string} sql
|
|
51
96
|
* @param {any} params
|
|
@@ -58,6 +103,15 @@ export class WasmLix {
|
|
|
58
103
|
const ret = wasm.wasmlix_execute(this.__wbg_ptr, ptr0, len0, addHeapObject(params), isLikeNone(options) ? 0 : addHeapObject(options));
|
|
59
104
|
return takeObject(ret);
|
|
60
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* @param {any} statements
|
|
108
|
+
* @param {any | null} [options]
|
|
109
|
+
* @returns {Promise<any>}
|
|
110
|
+
*/
|
|
111
|
+
executeBatch(statements, options) {
|
|
112
|
+
const ret = wasm.wasmlix_executeBatch(this.__wbg_ptr, addHeapObject(statements), isLikeNone(options) ? 0 : addHeapObject(options));
|
|
113
|
+
return takeObject(ret);
|
|
114
|
+
}
|
|
61
115
|
/**
|
|
62
116
|
* @returns {Promise<Uint8Array>}
|
|
63
117
|
*/
|
|
@@ -180,23 +234,23 @@ export class WasmObserveEvents {
|
|
|
180
234
|
if (Symbol.dispose) WasmObserveEvents.prototype[Symbol.dispose] = WasmObserveEvents.prototype.free;
|
|
181
235
|
|
|
182
236
|
/**
|
|
183
|
-
* @param {Function}
|
|
237
|
+
* @param {Function | null} [telemetry_dispatch]
|
|
184
238
|
* @returns {Promise<WasmLix>}
|
|
185
239
|
*/
|
|
186
|
-
export function openMemory(
|
|
187
|
-
const ret = wasm.openMemory(addHeapObject(
|
|
240
|
+
export function openMemory(telemetry_dispatch) {
|
|
241
|
+
const ret = wasm.openMemory(isLikeNone(telemetry_dispatch) ? 0 : addHeapObject(telemetry_dispatch));
|
|
188
242
|
return takeObject(ret);
|
|
189
243
|
}
|
|
190
244
|
|
|
191
245
|
/**
|
|
192
|
-
* @param {Function}
|
|
246
|
+
* @param {Function | null} [telemetry_dispatch]
|
|
193
247
|
* @param {Uint8Array | null} [snapshot]
|
|
194
248
|
* @returns {Promise<WasmLix>}
|
|
195
249
|
*/
|
|
196
|
-
export function openMemoryFromSnapshot(
|
|
250
|
+
export function openMemoryFromSnapshot(telemetry_dispatch, snapshot) {
|
|
197
251
|
var ptr0 = isLikeNone(snapshot) ? 0 : passArray8ToWasm0(snapshot, wasm.__wbindgen_export);
|
|
198
252
|
var len0 = WASM_VECTOR_LEN;
|
|
199
|
-
const ret = wasm.openMemoryFromSnapshot(addHeapObject(
|
|
253
|
+
const ret = wasm.openMemoryFromSnapshot(isLikeNone(telemetry_dispatch) ? 0 : addHeapObject(telemetry_dispatch), ptr0, len0);
|
|
200
254
|
return takeObject(ret);
|
|
201
255
|
}
|
|
202
256
|
|
|
@@ -364,6 +418,10 @@ function __wbg_get_imports() {
|
|
|
364
418
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
365
419
|
return addHeapObject(ret);
|
|
366
420
|
},
|
|
421
|
+
__wbg_get_de6a0f7d4d18a304: function() { return handleError(function (arg0, arg1) {
|
|
422
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
423
|
+
return addHeapObject(ret);
|
|
424
|
+
}, arguments); },
|
|
367
425
|
__wbg_get_unchecked_33f6e5c9e2f2d6b2: function(arg0, arg1) {
|
|
368
426
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
369
427
|
return addHeapObject(ret);
|
|
@@ -457,7 +515,7 @@ function __wbg_get_imports() {
|
|
|
457
515
|
const a = state0.a;
|
|
458
516
|
state0.a = 0;
|
|
459
517
|
try {
|
|
460
|
-
return
|
|
518
|
+
return __wasm_bindgen_func_elem_111272(a, state0.b, arg0, arg1);
|
|
461
519
|
} finally {
|
|
462
520
|
state0.a = a;
|
|
463
521
|
}
|
|
@@ -480,6 +538,10 @@ function __wbg_get_imports() {
|
|
|
480
538
|
const ret = Date.now();
|
|
481
539
|
return ret;
|
|
482
540
|
}, arguments); },
|
|
541
|
+
__wbg_now_190933fa139cc119: function() {
|
|
542
|
+
const ret = Date.now();
|
|
543
|
+
return ret;
|
|
544
|
+
},
|
|
483
545
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
484
546
|
const ret = getObject(arg0).now();
|
|
485
547
|
return ret;
|
|
@@ -542,10 +604,6 @@ function __wbg_get_imports() {
|
|
|
542
604
|
const ret = typeof window === 'undefined' ? null : window;
|
|
543
605
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
544
606
|
},
|
|
545
|
-
__wbg_then_18f476d590e58992: function(arg0, arg1, arg2) {
|
|
546
|
-
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
547
|
-
return addHeapObject(ret);
|
|
548
|
-
},
|
|
549
607
|
__wbg_then_ac7b025999b52837: function(arg0, arg1) {
|
|
550
608
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
551
609
|
return addHeapObject(ret);
|
|
@@ -567,8 +625,8 @@ function __wbg_get_imports() {
|
|
|
567
625
|
return addHeapObject(ret);
|
|
568
626
|
},
|
|
569
627
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
570
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
571
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
628
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 29773, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
629
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_111270);
|
|
572
630
|
return addHeapObject(ret);
|
|
573
631
|
},
|
|
574
632
|
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
@@ -617,10 +675,10 @@ function __wbg_get_imports() {
|
|
|
617
675
|
};
|
|
618
676
|
}
|
|
619
677
|
|
|
620
|
-
function
|
|
678
|
+
function __wasm_bindgen_func_elem_111270(arg0, arg1, arg2) {
|
|
621
679
|
try {
|
|
622
680
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
623
|
-
wasm.
|
|
681
|
+
wasm.__wasm_bindgen_func_elem_111270(retptr, arg0, arg1, addHeapObject(arg2));
|
|
624
682
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
625
683
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
626
684
|
if (r1) {
|
|
@@ -631,8 +689,8 @@ function __wasm_bindgen_func_elem_101667(arg0, arg1, arg2) {
|
|
|
631
689
|
}
|
|
632
690
|
}
|
|
633
691
|
|
|
634
|
-
function
|
|
635
|
-
wasm.
|
|
692
|
+
function __wasm_bindgen_func_elem_111272(arg0, arg1, arg2, arg3) {
|
|
693
|
+
wasm.__wasm_bindgen_func_elem_111272(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
636
694
|
}
|
|
637
695
|
|
|
638
696
|
const WasmLixFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
Binary file
|
|
@@ -9,9 +9,15 @@ export const openMemoryFromSnapshot: (a: number, b: number, c: number) => number
|
|
|
9
9
|
export const parseSqlScript: (a: number, b: number, c: number, d: number) => void;
|
|
10
10
|
export const wasmlix_activeBranchId: (a: number) => number;
|
|
11
11
|
export const wasmlix_beginTransaction: (a: number) => number;
|
|
12
|
+
export const wasmlix_clientStateDelete: (a: number, b: number, c: number) => number;
|
|
13
|
+
export const wasmlix_clientStateEntries: (a: number) => number;
|
|
14
|
+
export const wasmlix_clientStateGet: (a: number, b: number, c: number) => number;
|
|
15
|
+
export const wasmlix_clientStateSet: (a: number, b: number, c: number, d: number) => number;
|
|
12
16
|
export const wasmlix_close: (a: number) => number;
|
|
13
17
|
export const wasmlix_createBranch: (a: number, b: number) => number;
|
|
18
|
+
export const wasmlix_createCheckpoint: (a: number) => number;
|
|
14
19
|
export const wasmlix_execute: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
20
|
+
export const wasmlix_executeBatch: (a: number, b: number, c: number) => number;
|
|
15
21
|
export const wasmlix_exportSnapshot: (a: number) => number;
|
|
16
22
|
export const wasmlix_mergeBranch: (a: number, b: number) => number;
|
|
17
23
|
export const wasmlix_mergeBranchPreview: (a: number, b: number) => number;
|
|
@@ -22,8 +28,8 @@ export const wasmlixtransaction_execute: (a: number, b: number, c: number, d: nu
|
|
|
22
28
|
export const wasmlixtransaction_rollback: (a: number) => number;
|
|
23
29
|
export const wasmobserveevents_close: (a: number) => void;
|
|
24
30
|
export const wasmobserveevents_next: (a: number) => number;
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
31
|
+
export const __wasm_bindgen_func_elem_111270: (a: number, b: number, c: number, d: number) => void;
|
|
32
|
+
export const __wasm_bindgen_func_elem_111272: (a: number, b: number, c: number, d: number) => void;
|
|
27
33
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
28
34
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
29
35
|
export const __wbindgen_export3: (a: number) => void;
|
package/dist/worker/client.d.ts
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
1
|
-
import type { LixStorageConfig } from "../binding-types.js";
|
|
1
|
+
import type { LixBinding, LixStorageConfig } from "../binding-types.js";
|
|
2
|
+
import type { LixSnapshotStorage, LixTelemetryOptions } from "../types.js";
|
|
2
3
|
import { type WorkerConnection, type WorkerNotification, type WorkerOperation } from "./protocol.js";
|
|
3
|
-
export declare function openLixWorker(storage: LixStorageConfig, onDisposed?: () => void): Promise<LixWorkerClient>;
|
|
4
|
+
export declare function openLixWorker(storage: LixStorageConfig, onDisposed?: () => void, telemetry?: LixTelemetryOptions): Promise<LixWorkerClient>;
|
|
5
|
+
/** Opens the local worker transport behind the semantic Lix binding. */
|
|
6
|
+
export declare function openLixWorkerBinding(storage: LixStorageConfig, onDisposed?: () => void, telemetry?: LixTelemetryOptions): Promise<LixBinding>;
|
|
7
|
+
export type OpenPersistentLixWorkerBindingOptions = {
|
|
8
|
+
storage: LixSnapshotStorage;
|
|
9
|
+
namespace: string;
|
|
10
|
+
telemetry?: LixTelemetryOptions;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Opens a browser memory binding from an opaque snapshot and persists a fresh
|
|
14
|
+
* snapshot after every successful mutation. This is an internal composition
|
|
15
|
+
* seam for public storage adapters; it does not route workspace operations.
|
|
16
|
+
*/
|
|
17
|
+
export declare function openPersistentLixWorkerBinding(options: OpenPersistentLixWorkerBindingOptions): Promise<LixBinding>;
|
|
4
18
|
export declare class LixWorkerClient {
|
|
5
|
-
private readonly onDisposed?;
|
|
6
19
|
private readonly connection;
|
|
7
20
|
private nextRequestId;
|
|
8
21
|
private readonly pending;
|
|
9
22
|
private disposed;
|
|
10
|
-
|
|
23
|
+
private leased;
|
|
24
|
+
private onDisposed?;
|
|
25
|
+
private telemetry?;
|
|
26
|
+
constructor(connection?: WorkerConnection);
|
|
27
|
+
get isDisposed(): boolean;
|
|
28
|
+
beginLease(onDisposed?: () => void, telemetry?: LixTelemetryOptions): void;
|
|
29
|
+
endLease(): void;
|
|
11
30
|
request<T>(operation: WorkerOperation): Promise<T>;
|
|
12
31
|
notify(notification: WorkerNotification): void;
|
|
13
32
|
terminate(): Promise<void>;
|