@evolu/common 7.4.0 → 8.0.0-next.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 +4 -61
- package/dist/src/Array.d.ts +343 -102
- package/dist/src/Array.d.ts.map +1 -1
- package/dist/src/Array.js +181 -85
- package/dist/src/Assert.d.ts +57 -11
- package/dist/src/Assert.d.ts.map +1 -1
- package/dist/src/Assert.js +47 -11
- package/dist/src/BigInt.d.ts +6 -1
- package/dist/src/BigInt.d.ts.map +1 -1
- package/dist/src/BigInt.js +5 -0
- package/dist/src/Brand.d.ts +40 -12
- package/dist/src/Brand.d.ts.map +1 -1
- package/dist/src/Brand.js +5 -0
- package/dist/src/Buffer.d.ts +6 -1
- package/dist/src/Buffer.d.ts.map +1 -1
- package/dist/src/Buffer.js +7 -2
- package/dist/src/Cache.d.ts +10 -2
- package/dist/src/Cache.d.ts.map +1 -1
- package/dist/src/Cache.js +6 -0
- package/dist/src/Callbacks.d.ts +10 -7
- package/dist/src/Callbacks.d.ts.map +1 -1
- package/dist/src/Callbacks.js +23 -13
- package/dist/src/Console.d.ts +361 -69
- package/dist/src/Console.d.ts.map +1 -1
- package/dist/src/Console.js +217 -117
- package/dist/src/Crypto.d.ts +70 -21
- package/dist/src/Crypto.d.ts.map +1 -1
- package/dist/src/Crypto.js +72 -27
- package/dist/src/Eq.d.ts +22 -2
- package/dist/src/Eq.d.ts.map +1 -1
- package/dist/src/Eq.js +21 -1
- package/dist/src/Error.d.ts +23 -12
- package/dist/src/Error.d.ts.map +1 -1
- package/dist/src/Error.js +27 -11
- package/dist/src/Function.d.ts +128 -56
- package/dist/src/Function.d.ts.map +1 -1
- package/dist/src/Function.js +118 -14
- package/dist/src/Identicon.d.ts +5 -0
- package/dist/src/Identicon.d.ts.map +1 -1
- package/dist/src/Identicon.js +6 -1
- package/dist/src/Lookup.d.ts +160 -0
- package/dist/src/Lookup.d.ts.map +1 -0
- package/dist/src/Lookup.js +192 -0
- package/dist/src/Microtask.d.ts +21 -0
- package/dist/src/Microtask.d.ts.map +1 -0
- package/dist/src/Microtask.js +37 -0
- package/dist/src/Number.d.ts +18 -4
- package/dist/src/Number.d.ts.map +1 -1
- package/dist/src/Number.js +23 -1
- package/dist/src/Object.d.ts +110 -5
- package/dist/src/Object.d.ts.map +1 -1
- package/dist/src/Object.js +108 -5
- package/dist/src/Option.d.ts +58 -0
- package/dist/src/Option.d.ts.map +1 -0
- package/dist/src/Option.js +43 -0
- package/dist/src/Order.d.ts +5 -0
- package/dist/src/Order.d.ts.map +1 -1
- package/dist/src/Order.js +8 -3
- package/dist/src/Platform.d.ts +36 -2
- package/dist/src/Platform.d.ts.map +1 -1
- package/dist/src/Platform.js +10 -6
- package/dist/src/Polyfills.d.ts +27 -0
- package/dist/src/Polyfills.d.ts.map +1 -0
- package/dist/src/Polyfills.js +299 -0
- package/dist/src/Random.d.ts +18 -7
- package/dist/src/Random.d.ts.map +1 -1
- package/dist/src/Random.js +9 -7
- package/dist/src/Redacted.d.ts +7 -4
- package/dist/src/Redacted.d.ts.map +1 -1
- package/dist/src/Redacted.js +5 -0
- package/dist/src/Ref.d.ts +31 -16
- package/dist/src/Ref.d.ts.map +1 -1
- package/dist/src/Ref.js +35 -7
- package/dist/src/RefCount.d.ts +62 -0
- package/dist/src/RefCount.d.ts.map +1 -0
- package/dist/src/RefCount.js +83 -0
- package/dist/src/Relation.d.ts +84 -29
- package/dist/src/Relation.d.ts.map +1 -1
- package/dist/src/Relation.js +83 -105
- package/dist/src/Resource.d.ts +263 -0
- package/dist/src/Resource.d.ts.map +1 -0
- package/dist/src/Resource.js +389 -0
- package/dist/src/Result.d.ts +390 -374
- package/dist/src/Result.d.ts.map +1 -1
- package/dist/src/Result.js +142 -70
- package/dist/src/Schedule.d.ts +953 -0
- package/dist/src/Schedule.d.ts.map +1 -0
- package/dist/src/Schedule.js +1199 -0
- package/dist/src/Set.d.ts +181 -0
- package/dist/src/Set.d.ts.map +1 -0
- package/dist/src/Set.js +137 -0
- package/dist/src/Skiplist.d.ts +6 -1
- package/dist/src/Skiplist.d.ts.map +1 -1
- package/dist/src/Skiplist.js +5 -0
- package/dist/src/Sqlite.d.ts +160 -60
- package/dist/src/Sqlite.d.ts.map +1 -1
- package/dist/src/Sqlite.js +290 -190
- package/dist/src/Store.d.ts +36 -28
- package/dist/src/Store.d.ts.map +1 -1
- package/dist/src/Store.js +55 -15
- package/dist/src/String.d.ts +5 -0
- package/dist/src/String.d.ts.map +1 -1
- package/dist/src/String.js +5 -0
- package/dist/src/Task.d.ts +2263 -423
- package/dist/src/Task.d.ts.map +1 -1
- package/dist/src/Task.js +1488 -348
- package/dist/src/Test.d.ts +122 -0
- package/dist/src/Test.d.ts.map +1 -0
- package/dist/src/Test.js +66 -0
- package/dist/src/Time.d.ts +201 -48
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Time.js +190 -86
- package/dist/src/Tracer.d.ts +48 -0
- package/dist/src/Tracer.d.ts.map +1 -0
- package/dist/src/Tracer.js +6 -0
- package/dist/src/Type.d.ts +582 -209
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +362 -240
- package/dist/src/Types.d.ts +160 -6
- package/dist/src/Types.d.ts.map +1 -1
- package/dist/src/Types.js +22 -2
- package/dist/src/WebSocket.d.ts +113 -58
- package/dist/src/WebSocket.d.ts.map +1 -1
- package/dist/src/WebSocket.js +210 -118
- package/dist/src/Worker.d.ts +245 -60
- package/dist/src/Worker.d.ts.map +1 -1
- package/dist/src/Worker.js +220 -64
- package/dist/src/index.d.ts +25 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +19 -3
- package/dist/src/local-first/Db.d.ts +24 -213
- package/dist/src/local-first/Db.d.ts.map +1 -1
- package/dist/src/local-first/Db.js +622 -293
- package/dist/src/local-first/Error.d.ts +12 -0
- package/dist/src/local-first/Error.d.ts.map +1 -0
- package/dist/src/local-first/Error.js +6 -0
- package/dist/src/local-first/Evolu.d.ts +330 -285
- package/dist/src/local-first/Evolu.d.ts.map +1 -1
- package/dist/src/local-first/Evolu.js +472 -402
- package/dist/src/local-first/LocalAuth.d.ts +10 -10
- package/dist/src/local-first/LocalAuth.d.ts.map +1 -1
- package/dist/src/local-first/LocalAuth.js +6 -1
- package/dist/src/local-first/Owner.d.ts +70 -27
- package/dist/src/local-first/Owner.d.ts.map +1 -1
- package/dist/src/local-first/Owner.js +27 -14
- package/dist/src/local-first/Protocol.d.ts +58 -50
- package/dist/src/local-first/Protocol.d.ts.map +1 -1
- package/dist/src/local-first/Protocol.js +253 -155
- package/dist/src/local-first/Query.d.ts +133 -43
- package/dist/src/local-first/Query.d.ts.map +1 -1
- package/dist/src/local-first/Query.js +139 -90
- package/dist/src/local-first/Relay.d.ts +18 -38
- package/dist/src/local-first/Relay.d.ts.map +1 -1
- package/dist/src/local-first/Relay.js +59 -171
- package/dist/src/local-first/Schema.d.ts +139 -144
- package/dist/src/local-first/Schema.d.ts.map +1 -1
- package/dist/src/local-first/Schema.js +78 -163
- package/dist/src/local-first/Shared.d.ts +125 -0
- package/dist/src/local-first/Shared.d.ts.map +1 -0
- package/dist/src/local-first/Shared.js +569 -0
- package/dist/src/local-first/Storage.d.ts +50 -53
- package/dist/src/local-first/Storage.d.ts.map +1 -1
- package/dist/src/local-first/Storage.js +121 -173
- package/dist/src/local-first/Timestamp.d.ts +28 -35
- package/dist/src/local-first/Timestamp.d.ts.map +1 -1
- package/dist/src/local-first/Timestamp.js +24 -25
- package/dist/src/local-first/index.d.ts +2 -15
- package/dist/src/local-first/index.d.ts.map +1 -1
- package/dist/src/local-first/index.js +2 -15
- package/package.json +36 -26
- package/src/Array.ts +467 -106
- package/src/Assert.ts +87 -12
- package/src/BigInt.ts +7 -1
- package/src/Brand.ts +41 -12
- package/src/Buffer.ts +10 -4
- package/src/Cache.ts +11 -2
- package/src/Callbacks.ts +33 -23
- package/src/Console.ts +567 -178
- package/src/Crypto.ts +111 -62
- package/src/Eq.ts +30 -3
- package/src/Error.ts +50 -34
- package/src/Function.ts +140 -68
- package/src/Identicon.ts +7 -1
- package/src/Lookup.ts +415 -0
- package/src/Microtask.ts +58 -0
- package/src/Number.ts +40 -7
- package/src/Object.ts +155 -16
- package/src/Option.ts +74 -0
- package/src/Order.ts +11 -3
- package/src/Platform.ts +43 -7
- package/src/Polyfills.ts +465 -0
- package/src/Random.ts +25 -11
- package/src/Redacted.ts +8 -4
- package/src/Ref.ts +72 -21
- package/src/RefCount.ts +170 -0
- package/src/Relation.ts +188 -136
- package/src/Resource.ts +864 -0
- package/src/Result.ts +548 -381
- package/src/Schedule.ts +1471 -0
- package/src/Set.ts +247 -0
- package/src/Skiplist.ts +7 -1
- package/src/Sqlite.ts +409 -304
- package/src/Store.ts +94 -48
- package/src/String.ts +6 -0
- package/src/Task.ts +3685 -740
- package/src/Test.ts +162 -0
- package/src/Time.ts +348 -145
- package/src/Tracer.ts +54 -0
- package/src/Type.ts +1064 -630
- package/src/Types.ts +202 -7
- package/src/WebSocket.ts +311 -178
- package/src/Worker.ts +527 -147
- package/src/index.ts +74 -3
- package/src/local-first/Db.ts +871 -597
- package/src/local-first/Error.ts +17 -0
- package/src/local-first/Evolu.ts +884 -823
- package/src/local-first/LocalAuth.ts +10 -10
- package/src/local-first/Owner.ts +94 -42
- package/src/local-first/Protocol.ts +440 -303
- package/src/local-first/Query.ts +243 -194
- package/src/local-first/Relay.ts +91 -252
- package/src/local-first/Schema.ts +284 -394
- package/src/local-first/Shared.ts +932 -0
- package/src/local-first/Storage.ts +209 -282
- package/src/local-first/Timestamp.ts +38 -45
- package/src/local-first/index.ts +2 -16
- package/LICENSE +0 -21
- package/dist/src/Instances.d.ts +0 -34
- package/dist/src/Instances.d.ts.map +0 -1
- package/dist/src/Instances.js +0 -44
- package/dist/src/Resources.d.ts +0 -118
- package/dist/src/Resources.d.ts.map +0 -1
- package/dist/src/Resources.js +0 -197
- package/dist/src/local-first/Platform.d.ts +0 -25
- package/dist/src/local-first/Platform.d.ts.map +0 -1
- package/dist/src/local-first/Platform.js +0 -1
- package/dist/src/local-first/Public.d.ts +0 -22
- package/dist/src/local-first/Public.d.ts.map +0 -1
- package/dist/src/local-first/Public.js +0 -15
- package/dist/src/local-first/PublicKysely.d.ts +0 -148
- package/dist/src/local-first/PublicKysely.d.ts.map +0 -1
- package/dist/src/local-first/PublicKysely.js +0 -184
- package/dist/src/local-first/Sync.d.ts +0 -112
- package/dist/src/local-first/Sync.d.ts.map +0 -1
- package/dist/src/local-first/Sync.js +0 -529
- package/src/Instances.ts +0 -90
- package/src/Resources.ts +0 -367
- package/src/local-first/Platform.ts +0 -27
- package/src/local-first/Public.ts +0 -42
- package/src/local-first/PublicKysely.ts +0 -239
- package/src/local-first/Sync.ts +0 -960
|
@@ -1,218 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { Worker } from "../Worker.js";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
* The instance name is used as the SQLite database filename for persistent
|
|
24
|
-
* storage, ensuring that database files are separated and invisible to each
|
|
25
|
-
* other.
|
|
26
|
-
*
|
|
27
|
-
* The default value is: `Evolu`.
|
|
28
|
-
*
|
|
29
|
-
* ### Example
|
|
30
|
-
*
|
|
31
|
-
* ```ts
|
|
32
|
-
* // name: SimpleName.orThrow("MyApp")
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
readonly name: SimpleName;
|
|
36
|
-
/**
|
|
37
|
-
* Transport configuration for data sync and backup. Supports single transport
|
|
38
|
-
* or multiple transports simultaneously for redundancy.
|
|
39
|
-
*
|
|
40
|
-
* **Redundancy:** The ideal setup uses at least two completely independent
|
|
41
|
-
* relays - for example, a home relay and a geographically separate relay.
|
|
42
|
-
* Data is sent to both relays simultaneously, providing true redundancy
|
|
43
|
-
* similar to using two independent clouds. This eliminates vendor lock-in and
|
|
44
|
-
* ensures your app continues working regardless of circumstances - whether
|
|
45
|
-
* home relay hardware is stolen or a remote relay provider shuts down.
|
|
46
|
-
*
|
|
47
|
-
* Currently supports:
|
|
48
|
-
*
|
|
49
|
-
* - WebSocket: Real-time bidirectional communication with relay servers
|
|
50
|
-
*
|
|
51
|
-
* Empty transports create local-only instances. Transports can be dynamically
|
|
52
|
-
* added and removed for any owner (including {@link AppOwner}) via
|
|
53
|
-
* {@link Evolu#useOwner}.
|
|
54
|
-
*
|
|
55
|
-
* Use {@link createOwnerWebSocketTransport} to create WebSocket transport
|
|
56
|
-
* configurations with proper URL formatting and {@link OwnerId} inclusion. The
|
|
57
|
-
* {@link OwnerId} in the URL enables relay authentication, allowing relay
|
|
58
|
-
* servers to control access (e.g., for paid tiers or private instances).
|
|
59
|
-
*
|
|
60
|
-
* The default value is:
|
|
61
|
-
*
|
|
62
|
-
* `{ type: "WebSocket", url: "wss://free.evoluhq.com" }`.
|
|
63
|
-
*
|
|
64
|
-
* ### Example
|
|
65
|
-
*
|
|
66
|
-
* ```ts
|
|
67
|
-
* // Single WebSocket relay
|
|
68
|
-
* transports: [{ type: "WebSocket", url: "wss://relay1.example.com" }];
|
|
69
|
-
*
|
|
70
|
-
* // Multiple WebSocket relays for redundancy
|
|
71
|
-
* transports: [
|
|
72
|
-
* { type: "WebSocket", url: "wss://relay1.example.com" },
|
|
73
|
-
* { type: "WebSocket", url: "wss://relay2.example.com" },
|
|
74
|
-
* { type: "WebSocket", url: "wss://relay3.example.com" },
|
|
75
|
-
* ];
|
|
76
|
-
*
|
|
77
|
-
* // Local-only instance (no sync) - useful for device settings or when relay
|
|
78
|
-
* // URL will be provided later (e.g., after authentication), allowing users
|
|
79
|
-
* // to work offline before the app connects
|
|
80
|
-
* transports: [];
|
|
81
|
-
*
|
|
82
|
-
* // Using createOwnerWebSocketTransport helper for relay authentication
|
|
83
|
-
* transports: [
|
|
84
|
-
* createOwnerWebSocketTransport({
|
|
85
|
-
* url: "ws://localhost:4000",
|
|
86
|
-
* ownerId,
|
|
87
|
-
* }),
|
|
88
|
-
* ];
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
readonly transports: ReadonlyArray<OwnerTransport>;
|
|
92
|
-
/**
|
|
93
|
-
* External AppOwner to use when creating Evolu instance. Use this when you
|
|
94
|
-
* want to manage AppOwner creation and persistence externally (e.g., with
|
|
95
|
-
* your own authentication system). If omitted, Evolu will automatically
|
|
96
|
-
* create and persist an AppOwner locally.
|
|
97
|
-
*
|
|
98
|
-
* For device-specific settings and account management state, we can use a
|
|
99
|
-
* separate local-only Evolu instance via `transports: []`.
|
|
100
|
-
*
|
|
101
|
-
* ### Example
|
|
102
|
-
*
|
|
103
|
-
* ```ts
|
|
104
|
-
* const ConfigId = id("Config");
|
|
105
|
-
* type ConfigId = typeof ConfigId.Type;
|
|
106
|
-
*
|
|
107
|
-
* const DeviceSchema = {
|
|
108
|
-
* config: {
|
|
109
|
-
* id: ConfigId,
|
|
110
|
-
* key: NonEmptyString50,
|
|
111
|
-
* value: NonEmptyString50,
|
|
112
|
-
* },
|
|
113
|
-
* };
|
|
114
|
-
*
|
|
115
|
-
* // Local-only instance for device settings (no sync)
|
|
116
|
-
* const deviceEvolu = createEvolu(evoluReactWebDeps)(DeviceSchema, {
|
|
117
|
-
* name: SimpleName.orThrow("MyApp-Device"),
|
|
118
|
-
* transports: [], // No sync - stays local to device
|
|
119
|
-
* });
|
|
120
|
-
*
|
|
121
|
-
* // Main synced instance for user data
|
|
122
|
-
* const evolu = createEvolu(evoluReactWebDeps)(MainSchema, {
|
|
123
|
-
* name: SimpleName.orThrow("MyApp"),
|
|
124
|
-
* // Default transports for sync
|
|
125
|
-
* });
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
|
-
readonly externalAppOwner?: AppOwner;
|
|
129
|
-
/**
|
|
130
|
-
* Use in-memory SQLite database instead of persistent storage. Useful for
|
|
131
|
-
* testing or temporary data that doesn't need persistence.
|
|
132
|
-
*
|
|
133
|
-
* In-memory databases exist only in RAM and are completely destroyed when the
|
|
134
|
-
* process ends, making them forensically safe for sensitive data.
|
|
135
|
-
*
|
|
136
|
-
* The default value is: `false`.
|
|
137
|
-
*/
|
|
138
|
-
readonly inMemory?: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Encryption key for the SQLite database.
|
|
141
|
-
*
|
|
142
|
-
* Note: If an unencrypted SQLite database already exists and you provide an
|
|
143
|
-
* encryptionKey, SQLite will throw an error.
|
|
144
|
-
*
|
|
145
|
-
* @experimental
|
|
146
|
-
*/
|
|
147
|
-
readonly encryptionKey?: EncryptionKey;
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic Evolu DbWorker.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ConsoleLevel } from "../Console.js";
|
|
7
|
+
import { EncryptionKey, type RandomBytesDep } from "../Crypto.js";
|
|
8
|
+
import type { CreateSqliteDriverDep, SqliteSchema } from "../Sqlite.js";
|
|
9
|
+
import { type LeaderLockDep, type Task } from "../Task.js";
|
|
10
|
+
import type { Name } from "../Type.js";
|
|
11
|
+
import type { NativeMessagePort, Worker, WorkerDeps, WorkerSelf } from "../Worker.js";
|
|
12
|
+
import type { DbWorkerInput, DbWorkerOutput } from "./Shared.js";
|
|
13
|
+
export type DbWorker = Worker<DbWorkerInit>;
|
|
14
|
+
export interface DbWorkerInit {
|
|
15
|
+
readonly type: "Init";
|
|
16
|
+
readonly name: Name;
|
|
17
|
+
readonly consoleLevel: ConsoleLevel;
|
|
18
|
+
readonly sqliteSchema: SqliteSchema;
|
|
19
|
+
readonly encryptionKey: EncryptionKey;
|
|
20
|
+
readonly memoryOnly: boolean;
|
|
21
|
+
readonly port: NativeMessagePort<DbWorkerOutput, DbWorkerInput>;
|
|
148
22
|
}
|
|
149
|
-
export
|
|
150
|
-
export type DbWorker = Worker<DbWorkerInput, DbWorkerOutput>;
|
|
151
|
-
export type CreateDbWorker = (name: SimpleName) => DbWorker;
|
|
23
|
+
export type CreateDbWorker = () => DbWorker;
|
|
152
24
|
export interface CreateDbWorkerDep {
|
|
153
25
|
readonly createDbWorker: CreateDbWorker;
|
|
154
26
|
}
|
|
155
|
-
export type
|
|
156
|
-
|
|
157
|
-
readonly config: DbConfig;
|
|
158
|
-
readonly dbSchema: DbSchema;
|
|
159
|
-
} | {
|
|
160
|
-
readonly type: "getAppOwner";
|
|
161
|
-
} | {
|
|
162
|
-
readonly type: "mutate";
|
|
163
|
-
readonly tabId: Id;
|
|
164
|
-
readonly changes: NonEmptyReadonlyArray<MutationChange>;
|
|
165
|
-
readonly onCompleteIds: ReadonlyArray<CallbackId>;
|
|
166
|
-
readonly subscribedQueries: ReadonlyArray<Query>;
|
|
167
|
-
} | {
|
|
168
|
-
readonly type: "query";
|
|
169
|
-
readonly tabId: Id;
|
|
170
|
-
readonly queries: NonEmptyReadonlyArray<Query>;
|
|
171
|
-
} | {
|
|
172
|
-
readonly type: "reset";
|
|
173
|
-
readonly onCompleteId: CallbackId;
|
|
174
|
-
readonly reload: boolean;
|
|
175
|
-
readonly restore?: {
|
|
176
|
-
readonly dbSchema: DbSchema;
|
|
177
|
-
readonly mnemonic: Mnemonic;
|
|
178
|
-
};
|
|
179
|
-
} | {
|
|
180
|
-
readonly type: "ensureDbSchema";
|
|
181
|
-
readonly dbSchema: DbSchema;
|
|
182
|
-
} | {
|
|
183
|
-
readonly type: "export";
|
|
184
|
-
readonly onCompleteId: CallbackId;
|
|
185
|
-
} | {
|
|
186
|
-
readonly type: "useOwner";
|
|
187
|
-
readonly use: boolean;
|
|
188
|
-
readonly owner: SyncOwner;
|
|
189
|
-
};
|
|
190
|
-
export type DbWorkerOutput = {
|
|
191
|
-
readonly type: "onError";
|
|
192
|
-
readonly error: ProtocolError | SqliteError | SymmetricCryptoDecryptError | TimestampError | TransferableError;
|
|
193
|
-
} | {
|
|
194
|
-
readonly type: "onGetAppOwner";
|
|
195
|
-
readonly appOwner: AppOwner;
|
|
196
|
-
} | {
|
|
197
|
-
readonly type: "onQueryPatches";
|
|
198
|
-
readonly tabId: Id;
|
|
199
|
-
readonly queryPatches: ReadonlyArray<QueryPatches>;
|
|
200
|
-
readonly onCompleteIds: ReadonlyArray<CallbackId>;
|
|
201
|
-
} | {
|
|
202
|
-
readonly type: "refreshQueries";
|
|
203
|
-
readonly tabId?: Id;
|
|
204
|
-
} | {
|
|
205
|
-
readonly type: "onReset";
|
|
206
|
-
readonly onCompleteId: CallbackId;
|
|
207
|
-
readonly reload: boolean;
|
|
208
|
-
} | {
|
|
209
|
-
readonly type: "onExport";
|
|
210
|
-
readonly onCompleteId: CallbackId;
|
|
211
|
-
readonly file: Uint8Array;
|
|
212
|
-
};
|
|
213
|
-
export type DbWorkerPlatformDeps = ConsoleDep & CreateSqliteDriverDep & CreateWebSocketDep & RandomBytesDep & RandomDep & TimeDep;
|
|
214
|
-
export interface PostMessageDep {
|
|
215
|
-
readonly postMessage: (message: DbWorkerOutput) => void;
|
|
216
|
-
}
|
|
217
|
-
export declare const createDbWorkerForPlatform: (platformDeps: DbWorkerPlatformDeps) => DbWorker;
|
|
27
|
+
export type DbWorkerDeps = WorkerDeps & LeaderLockDep & CreateSqliteDriverDep & RandomBytesDep;
|
|
28
|
+
export declare const startDbWorker: (self: WorkerSelf<DbWorkerInit>) => Task<void, never, DbWorkerDeps>;
|
|
218
29
|
//# sourceMappingURL=Db.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Db.d.ts","sourceRoot":"","sources":["../../../src/local-first/Db.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Db.d.ts","sourceRoot":"","sources":["../../../src/local-first/Db.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EACL,aAAa,EAEb,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EACV,qBAAqB,EAGrB,YAAY,EACb,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AASvC,OAAO,KAAK,EACV,iBAAiB,EACjB,MAAM,EACN,UAAU,EACV,UAAU,EACX,MAAM,cAAc,CAAC;AAqBtB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA8BjE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;CACjE;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,QAAQ,CAAC;AAE5C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACzC;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,GACnC,aAAa,GACb,qBAAqB,GACrB,cAAc,CAAC;AAEjB,eAAO,MAAM,aAAa,GACvB,MAAM,UAAU,CAAC,YAAY,CAAC,KAAG,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,YAAY,CAmO/D,CAAC"}
|