@evolu/common 8.10.0 → 8.12.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/dist/src/Bytes.d.ts +39 -2
- package/dist/src/Bytes.d.ts.map +1 -1
- package/dist/src/Bytes.js +50 -2
- package/dist/src/Config.d.ts +22 -22
- package/dist/src/Config.d.ts.map +1 -1
- package/dist/src/Console.d.ts +62 -7
- package/dist/src/Console.d.ts.map +1 -1
- package/dist/src/Console.js +20 -4
- package/dist/src/Crypto.d.ts +76 -4
- package/dist/src/Crypto.d.ts.map +1 -1
- package/dist/src/Crypto.js +55 -4
- package/dist/src/Error.d.ts +45 -0
- package/dist/src/Error.d.ts.map +1 -1
- package/dist/src/Error.js +69 -0
- package/dist/src/Fs.d.ts +92 -18
- package/dist/src/Fs.d.ts.map +1 -1
- package/dist/src/Fs.js +2 -0
- package/dist/src/Identicon.d.ts +2 -2
- package/dist/src/Identicon.js +2 -2
- package/dist/src/LeakDetector.d.ts +22 -3
- package/dist/src/LeakDetector.d.ts.map +1 -1
- package/dist/src/LeakDetector.js +12 -2
- package/dist/src/LockManager.d.ts +8 -0
- package/dist/src/LockManager.d.ts.map +1 -1
- package/dist/src/LockManager.js +6 -0
- package/dist/src/Object.d.ts.map +1 -1
- package/dist/src/Object.js +5 -0
- package/dist/src/Platform.d.ts +47 -7
- package/dist/src/Platform.d.ts.map +1 -1
- package/dist/src/Platform.js +24 -5
- package/dist/src/Random.d.ts +25 -2
- package/dist/src/Random.d.ts.map +1 -1
- package/dist/src/Random.js +14 -2
- package/dist/src/Resource.d.ts +156 -1
- package/dist/src/Resource.d.ts.map +1 -1
- package/dist/src/Resource.js +201 -72
- package/dist/src/Schedule.d.ts +11 -10
- package/dist/src/Schedule.d.ts.map +1 -1
- package/dist/src/Schedule.js +1 -1
- package/dist/src/Sqlite.d.ts +132 -16
- package/dist/src/Sqlite.d.ts.map +1 -1
- package/dist/src/Sqlite.js +63 -9
- package/dist/src/Task.d.ts +15 -4
- package/dist/src/Task.d.ts.map +1 -1
- package/dist/src/Task.js +41 -15
- package/dist/src/Test.d.ts +9 -0
- package/dist/src/Test.d.ts.map +1 -1
- package/dist/src/Test.js +4 -0
- package/dist/src/Time.d.ts +106 -9
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Time.js +55 -4
- package/dist/src/Type.d.ts +1455 -1310
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +1274 -517
- package/dist/src/WebSocket.d.ts +164 -13
- package/dist/src/WebSocket.d.ts.map +1 -1
- package/dist/src/WebSocket.js +133 -24
- package/dist/src/Worker.d.ts +90 -8
- package/dist/src/Worker.d.ts.map +1 -1
- package/dist/src/Worker.js +28 -2
- package/dist/src/index.d.ts +6 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -3
- package/dist/src/local-first/Db.d.ts +52 -3
- package/dist/src/local-first/Db.d.ts.map +1 -1
- package/dist/src/local-first/Db.js +412 -137
- package/dist/src/local-first/Evolu.d.ts +412 -213
- package/dist/src/local-first/Evolu.d.ts.map +1 -1
- package/dist/src/local-first/Evolu.js +181 -18
- package/dist/src/local-first/Owner.d.ts +13 -30
- package/dist/src/local-first/Owner.d.ts.map +1 -1
- package/dist/src/local-first/Owner.js +13 -30
- package/dist/src/local-first/Protocol.d.ts +106 -19
- package/dist/src/local-first/Protocol.d.ts.map +1 -1
- package/dist/src/local-first/Protocol.js +162 -60
- package/dist/src/local-first/Query.d.ts +8 -15
- package/dist/src/local-first/Query.d.ts.map +1 -1
- package/dist/src/local-first/Relay.d.ts.map +1 -1
- package/dist/src/local-first/Relay.js +4 -2
- package/dist/src/local-first/Schema.d.ts +346 -23
- package/dist/src/local-first/Schema.d.ts.map +1 -1
- package/dist/src/local-first/Schema.js +214 -17
- package/dist/src/local-first/Shared.d.ts +537 -22
- package/dist/src/local-first/Shared.d.ts.map +1 -1
- package/dist/src/local-first/Shared.js +1437 -234
- package/dist/src/local-first/Storage.d.ts +195 -17
- package/dist/src/local-first/Storage.d.ts.map +1 -1
- package/dist/src/local-first/Storage.js +85 -22
- package/dist/src/local-first/Timestamp.d.ts +392 -41
- package/dist/src/local-first/Timestamp.d.ts.map +1 -1
- package/dist/src/local-first/Timestamp.js +403 -81
- package/dist/src/local-first/index.d.ts +0 -1
- package/dist/src/local-first/index.d.ts.map +1 -1
- package/dist/src/local-first/index.js +0 -1
- package/package.json +1 -1
- package/src/Assert.test.ts +2 -5
- package/src/Bytes.test.ts +27 -0
- package/src/Bytes.ts +58 -2
- package/src/Config.test.ts +2 -6
- package/src/Config.ts +133 -133
- package/src/Console.ts +62 -7
- package/src/Crypto.ts +76 -4
- package/src/Eq.test.ts +2 -3
- package/src/Error.test.ts +76 -3
- package/src/Error.ts +71 -0
- package/src/Fs.ts +92 -18
- package/src/Identicon.ts +2 -2
- package/src/LeakDetector.ts +22 -3
- package/src/LockManager.ts +8 -0
- package/src/Object.test.ts +27 -12
- package/src/Object.ts +5 -0
- package/src/Platform.ts +50 -8
- package/src/Random.ts +25 -2
- package/src/Resource.test.ts +837 -0
- package/src/Resource.ts +235 -15
- package/src/Schedule.test.ts +50 -12
- package/src/Schedule.ts +24 -14
- package/src/Sqlite.ts +137 -17
- package/src/Task.test.ts +189 -8
- package/src/Task.ts +56 -17
- package/src/Test.ts +9 -0
- package/src/Time.ts +106 -9
- package/src/Type.test.ts +946 -1028
- package/src/Type.ts +4195 -3136
- package/src/Types.test.ts +4 -14
- package/src/WebSocket.ts +313 -40
- package/src/Worker.ts +90 -8
- package/src/index.ts +20 -6
- package/src/local-first/Db.ts +644 -339
- package/src/local-first/Evolu.test.ts +994 -22
- package/src/local-first/Evolu.ts +625 -232
- package/src/local-first/Owner.ts +13 -30
- package/src/local-first/Protocol.test.ts +634 -10
- package/src/local-first/Protocol.ts +255 -109
- package/src/local-first/Query.ts +8 -15
- package/src/local-first/Relay.ts +4 -2
- package/src/local-first/Schema.test.ts +143 -0
- package/src/local-first/Schema.ts +376 -26
- package/src/local-first/Shared.test.ts +7731 -559
- package/src/local-first/Shared.ts +2036 -267
- package/src/local-first/Storage.ts +224 -36
- package/src/local-first/Timestamp.test.ts +344 -70
- package/src/local-first/Timestamp.ts +434 -118
- package/src/local-first/index.ts +0 -1
- package/dist/src/local-first/Error.d.ts +0 -12
- package/dist/src/local-first/Error.d.ts.map +0 -1
- package/dist/src/local-first/Error.js +0 -6
- package/dist/src/local-first/LocalAuth.d.ts +0 -150
- package/dist/src/local-first/LocalAuth.d.ts.map +0 -1
- package/dist/src/local-first/LocalAuth.js +0 -179
- package/src/local-first/Error.ts +0 -17
- package/src/local-first/LocalAuth.ts +0 -457
package/src/Worker.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { disposable } from "./Function.ts";
|
|
|
12
12
|
/**
|
|
13
13
|
* Typed, disposable Worker.
|
|
14
14
|
*
|
|
15
|
+
* @group Core
|
|
15
16
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Worker
|
|
16
17
|
*/
|
|
17
18
|
export interface Worker<Input, Output = never> extends MessagePort<
|
|
@@ -25,6 +26,7 @@ export interface Worker<Input, Output = never> extends MessagePort<
|
|
|
25
26
|
* A shared worker is shared across multiple clients (tabs, windows, iframes)
|
|
26
27
|
* and provides a port for bidirectional communication with each client.
|
|
27
28
|
*
|
|
29
|
+
* @group Core
|
|
28
30
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker
|
|
29
31
|
*/
|
|
30
32
|
export interface SharedWorker<Input, Output = never> extends Disposable {
|
|
@@ -41,6 +43,7 @@ export interface SharedWorker<Input, Output = never> extends Disposable {
|
|
|
41
43
|
* end periodically sends "alive" messages and stale ports are pruned after a
|
|
42
44
|
* timeout.
|
|
43
45
|
*
|
|
46
|
+
* @group Core
|
|
44
47
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MessagePort
|
|
45
48
|
*/
|
|
46
49
|
export interface MessagePort<Input, Output = never> extends Disposable {
|
|
@@ -92,6 +95,8 @@ export interface MessagePort<Input, Output = never> extends Disposable {
|
|
|
92
95
|
* Intentionally scoped to types Evolu uses. The web platform defines additional
|
|
93
96
|
* transferable types (`ImageBitmap`, `OffscreenCanvas`, `ReadableStream`, etc.)
|
|
94
97
|
* that can be added here if needed.
|
|
98
|
+
*
|
|
99
|
+
* @group Core
|
|
95
100
|
*/
|
|
96
101
|
export type Transferable = NativeMessagePort<any, any> | ArrayBuffer;
|
|
97
102
|
|
|
@@ -101,6 +106,8 @@ export type Transferable = NativeMessagePort<any, any> | ArrayBuffer;
|
|
|
101
106
|
* Exists because `postMessage` transfer requires the native object itself, not
|
|
102
107
|
* a wrapper. Ensures type-safe wiring between {@link MessagePort.native} and
|
|
103
108
|
* {@link CreateMessagePort} without exposing platform details.
|
|
109
|
+
*
|
|
110
|
+
* @group Core
|
|
104
111
|
*/
|
|
105
112
|
export type NativeMessagePort<
|
|
106
113
|
Input = unknown,
|
|
@@ -113,16 +120,29 @@ export type NativeMessagePort<
|
|
|
113
120
|
declare const nativeMessagePortInput: unique symbol;
|
|
114
121
|
declare const nativeMessagePortOutput: unique symbol;
|
|
115
122
|
|
|
116
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Factory function to create a {@link MessagePort} from a native port.
|
|
125
|
+
*
|
|
126
|
+
* @group Construction
|
|
127
|
+
*/
|
|
117
128
|
export type CreateMessagePort = <Input, Output = never>(
|
|
118
129
|
nativePort: NativeMessagePort<Input, Output>,
|
|
119
130
|
) => MessagePort<Input, Output>;
|
|
120
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Dependency wrapper for {@link CreateMessagePort}.
|
|
134
|
+
*
|
|
135
|
+
* @group Construction
|
|
136
|
+
*/
|
|
121
137
|
export interface CreateMessagePortDep {
|
|
122
138
|
readonly createMessagePort: CreateMessagePort;
|
|
123
139
|
}
|
|
124
140
|
|
|
125
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* Common dependencies for worker entry points.
|
|
143
|
+
*
|
|
144
|
+
* @group Core
|
|
145
|
+
*/
|
|
126
146
|
export type WorkerDeps = ConsoleDep &
|
|
127
147
|
ConsoleStoreOutputEntryDep &
|
|
128
148
|
CreateMessagePortDep;
|
|
@@ -221,6 +241,7 @@ export type WorkerDeps = ConsoleDep &
|
|
|
221
241
|
* ]);
|
|
222
242
|
* ```
|
|
223
243
|
*
|
|
244
|
+
* @group Core
|
|
224
245
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel
|
|
225
246
|
*/
|
|
226
247
|
export interface MessageChannel<Input, Output = never> extends Disposable {
|
|
@@ -231,12 +252,21 @@ export interface MessageChannel<Input, Output = never> extends Disposable {
|
|
|
231
252
|
readonly port2: MessagePort<Output, Input>;
|
|
232
253
|
}
|
|
233
254
|
|
|
234
|
-
/**
|
|
255
|
+
/**
|
|
256
|
+
* Factory function to create a {@link MessageChannel}.
|
|
257
|
+
*
|
|
258
|
+
* @group Construction
|
|
259
|
+
*/
|
|
235
260
|
export type CreateMessageChannel = <Input, Output = never>() => MessageChannel<
|
|
236
261
|
Input,
|
|
237
262
|
Output
|
|
238
263
|
>;
|
|
239
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Dependency wrapper for {@link CreateMessageChannel}.
|
|
267
|
+
*
|
|
268
|
+
* @group Construction
|
|
269
|
+
*/
|
|
240
270
|
export interface CreateMessageChannelDep {
|
|
241
271
|
readonly createMessageChannel: CreateMessageChannel;
|
|
242
272
|
}
|
|
@@ -247,6 +277,7 @@ export interface CreateMessageChannelDep {
|
|
|
247
277
|
* Broadcast channels deliver messages to other channels opened with the same
|
|
248
278
|
* name. The sending channel does not receive its own messages.
|
|
249
279
|
*
|
|
280
|
+
* @group Core
|
|
250
281
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
|
|
251
282
|
*/
|
|
252
283
|
export interface BroadcastChannel<Input, Output = Input> extends Disposable {
|
|
@@ -257,11 +288,20 @@ export interface BroadcastChannel<Input, Output = Input> extends Disposable {
|
|
|
257
288
|
onMessage: ((message: Output) => void) | null;
|
|
258
289
|
}
|
|
259
290
|
|
|
260
|
-
/**
|
|
291
|
+
/**
|
|
292
|
+
* Factory function to create a {@link BroadcastChannel}.
|
|
293
|
+
*
|
|
294
|
+
* @group Construction
|
|
295
|
+
*/
|
|
261
296
|
export type CreateBroadcastChannel = <Input, Output = Input>(
|
|
262
297
|
name: string,
|
|
263
298
|
) => BroadcastChannel<Input, Output>;
|
|
264
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Dependency wrapper for {@link CreateBroadcastChannel}.
|
|
302
|
+
*
|
|
303
|
+
* @group Construction
|
|
304
|
+
*/
|
|
265
305
|
export interface CreateBroadcastChannelDep {
|
|
266
306
|
readonly createBroadcastChannel: CreateBroadcastChannel;
|
|
267
307
|
}
|
|
@@ -271,6 +311,8 @@ export interface CreateBroadcastChannelDep {
|
|
|
271
311
|
*
|
|
272
312
|
* This is the worker-side counterpart to {@link Worker} — a typed
|
|
273
313
|
* {@link MessagePort} that wraps `self` inside the worker.
|
|
314
|
+
*
|
|
315
|
+
* @group Core
|
|
274
316
|
*/
|
|
275
317
|
export interface WorkerSelf<Input, Output = never> extends MessagePort<
|
|
276
318
|
Output,
|
|
@@ -282,6 +324,8 @@ export interface WorkerSelf<Input, Output = never> extends MessagePort<
|
|
|
282
324
|
*
|
|
283
325
|
* This is the worker-side counterpart to {@link SharedWorker}. It wraps `self`
|
|
284
326
|
* inside the shared worker, providing typed `onConnect` callbacks.
|
|
327
|
+
*
|
|
328
|
+
* @group Core
|
|
285
329
|
*/
|
|
286
330
|
export interface SharedWorkerSelf<Input, Output = never> extends Disposable {
|
|
287
331
|
onConnect: ((port: MessagePort<Output, Input>) => void) | null;
|
|
@@ -292,6 +336,8 @@ export interface SharedWorkerSelf<Input, Output = never> extends Disposable {
|
|
|
292
336
|
*
|
|
293
337
|
* This is a memory-only fallback for platforms without native worker support.
|
|
294
338
|
* Message delivery is asynchronous in-process.
|
|
339
|
+
*
|
|
340
|
+
* @group Construction
|
|
295
341
|
*/
|
|
296
342
|
export const createWorker = <Input, Output = never>(
|
|
297
343
|
initWorker: (self: WorkerSelf<Input, Output>) => void,
|
|
@@ -309,6 +355,8 @@ export const createWorker = <Input, Output = never>(
|
|
|
309
355
|
* in-process.
|
|
310
356
|
*
|
|
311
357
|
* Intended usage is one shared worker instance per process/app runtime.
|
|
358
|
+
*
|
|
359
|
+
* @group Construction
|
|
312
360
|
*/
|
|
313
361
|
export const createSharedWorker = <Input, Output = never>(
|
|
314
362
|
initWorker: (self: SharedWorkerSelf<Input, Output>) => void,
|
|
@@ -329,6 +377,8 @@ export const createSharedWorker = <Input, Output = never>(
|
|
|
329
377
|
*
|
|
330
378
|
* This is a memory-only fallback for platforms without native MessageChannel
|
|
331
379
|
* support. Message delivery is asynchronous in-process.
|
|
380
|
+
*
|
|
381
|
+
* @group Construction
|
|
332
382
|
*/
|
|
333
383
|
export const createMessageChannel: CreateMessageChannel = <
|
|
334
384
|
Input,
|
|
@@ -386,6 +436,8 @@ export const createMessageChannel: CreateMessageChannel = <
|
|
|
386
436
|
*
|
|
387
437
|
* This is a memory-only fallback for platforms without native MessagePort
|
|
388
438
|
* support. Message delivery through returned ports is asynchronous in-process.
|
|
439
|
+
*
|
|
440
|
+
* @group Construction
|
|
389
441
|
*/
|
|
390
442
|
export const createMessagePort: CreateMessagePort = <Input, Output = never>(
|
|
391
443
|
nativePort: NativeMessagePort<Input, Output>,
|
|
@@ -400,6 +452,8 @@ export const createMessagePort: CreateMessagePort = <Input, Output = never>(
|
|
|
400
452
|
*
|
|
401
453
|
* This is a memory-only fallback for platforms without native BroadcastChannel
|
|
402
454
|
* support. Message delivery is asynchronous in-process.
|
|
455
|
+
*
|
|
456
|
+
* @group Construction
|
|
403
457
|
*/
|
|
404
458
|
export const createBroadcastChannel: CreateBroadcastChannel = <
|
|
405
459
|
Input,
|
|
@@ -468,6 +522,8 @@ const broadcastChannelDispatchesByName = new Map<
|
|
|
468
522
|
* Test {@link Worker} with access to its paired worker-side `self`.
|
|
469
523
|
*
|
|
470
524
|
* Use `self` to simulate messages and behavior from inside the worker.
|
|
525
|
+
*
|
|
526
|
+
* @group Testing
|
|
471
527
|
*/
|
|
472
528
|
export interface TestWorker<Input, Output = never> extends Worker<
|
|
473
529
|
Input,
|
|
@@ -482,6 +538,8 @@ export interface TestWorker<Input, Output = never> extends Worker<
|
|
|
482
538
|
*
|
|
483
539
|
* Call `connect()` to simulate a client connection and trigger
|
|
484
540
|
* `self.onConnect`.
|
|
541
|
+
*
|
|
542
|
+
* @group Testing
|
|
485
543
|
*/
|
|
486
544
|
export interface TestSharedWorker<Input, Output = never> extends SharedWorker<
|
|
487
545
|
Input,
|
|
@@ -491,7 +549,11 @@ export interface TestSharedWorker<Input, Output = never> extends SharedWorker<
|
|
|
491
549
|
readonly connect: () => void;
|
|
492
550
|
}
|
|
493
551
|
|
|
494
|
-
/**
|
|
552
|
+
/**
|
|
553
|
+
* {@link MessageChannel} with disposal tracking for testing.
|
|
554
|
+
*
|
|
555
|
+
* @group Testing
|
|
556
|
+
*/
|
|
495
557
|
export interface TestMessageChannel<
|
|
496
558
|
Input,
|
|
497
559
|
Output = never,
|
|
@@ -499,7 +561,11 @@ export interface TestMessageChannel<
|
|
|
499
561
|
readonly isDisposed: () => boolean;
|
|
500
562
|
}
|
|
501
563
|
|
|
502
|
-
/**
|
|
564
|
+
/**
|
|
565
|
+
* {@link BroadcastChannel} with disposal tracking for testing.
|
|
566
|
+
*
|
|
567
|
+
* @group Testing
|
|
568
|
+
*/
|
|
503
569
|
export interface TestBroadcastChannel<
|
|
504
570
|
Input,
|
|
505
571
|
Output = Input,
|
|
@@ -512,6 +578,8 @@ export interface TestBroadcastChannel<
|
|
|
512
578
|
*
|
|
513
579
|
* The returned worker includes its typed {@link TestWorker.self} counterpart, so
|
|
514
580
|
* tests can exercise dedicated worker communication without a real thread.
|
|
581
|
+
*
|
|
582
|
+
* @group Testing
|
|
515
583
|
*/
|
|
516
584
|
export const testCreateWorker = <Input, Output = never>(): TestWorker<
|
|
517
585
|
Input,
|
|
@@ -531,6 +599,8 @@ export const testCreateWorker = <Input, Output = never>(): TestWorker<
|
|
|
531
599
|
*
|
|
532
600
|
* The returned worker includes `self` and `connect` so tests can exercise the
|
|
533
601
|
* full worker ↔ client pipeline without a real worker thread.
|
|
602
|
+
*
|
|
603
|
+
* @group Testing
|
|
534
604
|
*/
|
|
535
605
|
export const testCreateSharedWorker = <
|
|
536
606
|
Input,
|
|
@@ -554,6 +624,8 @@ export const testCreateSharedWorker = <
|
|
|
554
624
|
*
|
|
555
625
|
* Both ports are registered in the native port registry so
|
|
556
626
|
* {@link testCreateMessagePort} can look them up by their native token.
|
|
627
|
+
*
|
|
628
|
+
* @group Testing
|
|
557
629
|
*/
|
|
558
630
|
export const testCreateMessageChannel = <
|
|
559
631
|
Input,
|
|
@@ -572,12 +644,20 @@ export const testCreateMessageChannel = <
|
|
|
572
644
|
};
|
|
573
645
|
};
|
|
574
646
|
|
|
575
|
-
/**
|
|
647
|
+
/**
|
|
648
|
+
* Creates an in-memory {@link CreateMessagePort} for testing.
|
|
649
|
+
*
|
|
650
|
+
* @group Testing
|
|
651
|
+
*/
|
|
576
652
|
export const testCreateMessagePort: CreateMessagePort = <Input, Output = never>(
|
|
577
653
|
nativePort: NativeMessagePort<Input, Output>,
|
|
578
654
|
): MessagePort<Input, Output> => createMessagePort(nativePort);
|
|
579
655
|
|
|
580
|
-
/**
|
|
656
|
+
/**
|
|
657
|
+
* Creates an in-memory {@link BroadcastChannel} for testing.
|
|
658
|
+
*
|
|
659
|
+
* @group Testing
|
|
660
|
+
*/
|
|
581
661
|
export const testCreateBroadcastChannel = <Input, Output = Input>(
|
|
582
662
|
name: string,
|
|
583
663
|
): TestBroadcastChannel<Input, Output> => {
|
|
@@ -605,6 +685,8 @@ export const testCreateBroadcastChannel = <Input, Output = Input>(
|
|
|
605
685
|
* This observes actual transport tasks instead of waiting for an arbitrary
|
|
606
686
|
* duration. It also waits through message handlers that schedule more worker
|
|
607
687
|
* tasks before the current microtask checkpoint completes.
|
|
688
|
+
*
|
|
689
|
+
* @group Testing
|
|
608
690
|
*/
|
|
609
691
|
export const testWaitForWorkerMessage = (): Promise<void> =>
|
|
610
692
|
new Promise((resolve) => {
|
package/src/index.ts
CHANGED
|
@@ -51,16 +51,21 @@ export * from "./WebSocket.ts";
|
|
|
51
51
|
export * from "./Worker.ts";
|
|
52
52
|
|
|
53
53
|
// Local-first essentials.
|
|
54
|
-
export type {
|
|
55
|
-
export {
|
|
54
|
+
export type { UnsupportedDbVersionError } from "./local-first/Db.ts";
|
|
55
|
+
export {
|
|
56
|
+
AppName,
|
|
57
|
+
createEvolu,
|
|
58
|
+
maxMutationSize,
|
|
59
|
+
testAppName,
|
|
60
|
+
} from "./local-first/Evolu.ts";
|
|
56
61
|
export type {
|
|
57
62
|
AppNameError,
|
|
58
63
|
Evolu,
|
|
59
64
|
EvoluConfig,
|
|
60
65
|
EvoluDeps,
|
|
66
|
+
EvoluError,
|
|
61
67
|
UnuseOwner,
|
|
62
68
|
} from "./local-first/Evolu.ts";
|
|
63
|
-
export * from "./local-first/LocalAuth.ts";
|
|
64
69
|
export * from "./local-first/Owner.ts";
|
|
65
70
|
export type { SyncOwner } from "./local-first/Owner.ts";
|
|
66
71
|
export {
|
|
@@ -75,7 +80,17 @@ export {
|
|
|
75
80
|
type QueryRows,
|
|
76
81
|
type Row,
|
|
77
82
|
} from "./local-first/Query.ts";
|
|
78
|
-
export {
|
|
83
|
+
export {
|
|
84
|
+
createQueryBuilder,
|
|
85
|
+
QuarantineOrigin,
|
|
86
|
+
QuarantineReason,
|
|
87
|
+
testEvoluSchema,
|
|
88
|
+
testLocalOnlyEvoluSchema,
|
|
89
|
+
TestProjectId,
|
|
90
|
+
testProjectId,
|
|
91
|
+
TestTodoId,
|
|
92
|
+
testTodoId,
|
|
93
|
+
} from "./local-first/Schema.ts";
|
|
79
94
|
export type {
|
|
80
95
|
AnyStandardSchemaV1,
|
|
81
96
|
EvoluSchema,
|
|
@@ -88,6 +103,7 @@ export type {
|
|
|
88
103
|
OptionalColumnKeys,
|
|
89
104
|
RequiredColumnKeys,
|
|
90
105
|
TableSchema,
|
|
106
|
+
TestEvoluSchema,
|
|
91
107
|
UpdateValues,
|
|
92
108
|
UpsertValues,
|
|
93
109
|
} from "./local-first/Schema.ts";
|
|
@@ -104,8 +120,6 @@ export {
|
|
|
104
120
|
} from "./local-first/Timestamp.ts";
|
|
105
121
|
export type {
|
|
106
122
|
TimestampBytes,
|
|
107
|
-
TimestampCounterOverflowError,
|
|
108
123
|
TimestampDriftError,
|
|
109
124
|
TimestampError,
|
|
110
|
-
TimestampTimeOutOfRangeError,
|
|
111
125
|
} from "./local-first/Timestamp.ts";
|