tinybase 5.0.0-beta.27 → 5.0.0-beta.28
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/@types/_internal/ui-react/with-schemas/index.d.cts +274 -0
- package/@types/_internal/ui-react/with-schemas/index.d.ts +274 -0
- package/@types/checkpoints/index.d.cts +30 -1
- package/@types/checkpoints/index.d.ts +30 -1
- package/@types/checkpoints/with-schemas/index.d.cts +30 -1
- package/@types/checkpoints/with-schemas/index.d.ts +30 -1
- package/@types/common/index.d.cts +9 -0
- package/@types/common/index.d.ts +9 -0
- package/@types/common/with-schemas/index.d.cts +9 -0
- package/@types/common/with-schemas/index.d.ts +9 -0
- package/@types/index.d.cts +1 -0
- package/@types/index.d.ts +1 -0
- package/@types/indexes/index.d.cts +32 -1
- package/@types/indexes/index.d.ts +32 -1
- package/@types/indexes/with-schemas/index.d.cts +32 -1
- package/@types/indexes/with-schemas/index.d.ts +32 -1
- package/@types/mergeable-store/index.d.cts +0 -2
- package/@types/mergeable-store/index.d.ts +0 -2
- package/@types/mergeable-store/with-schemas/index.d.cts +2 -2
- package/@types/mergeable-store/with-schemas/index.d.ts +2 -2
- package/@types/metrics/index.d.cts +30 -4
- package/@types/metrics/index.d.ts +30 -4
- package/@types/metrics/with-schemas/index.d.cts +30 -4
- package/@types/metrics/with-schemas/index.d.ts +30 -4
- package/@types/persisters/index.d.cts +87 -25
- package/@types/persisters/index.d.ts +87 -25
- package/@types/persisters/persister-automerge/index.d.cts +4 -4
- package/@types/persisters/persister-automerge/index.d.ts +4 -4
- package/@types/persisters/persister-automerge/with-schemas/index.d.cts +4 -4
- package/@types/persisters/persister-automerge/with-schemas/index.d.ts +4 -4
- package/@types/persisters/persister-browser/index.d.cts +7 -4
- package/@types/persisters/persister-browser/index.d.ts +7 -4
- package/@types/persisters/persister-browser/with-schemas/index.d.cts +7 -4
- package/@types/persisters/persister-browser/with-schemas/index.d.ts +7 -4
- package/@types/persisters/persister-cr-sqlite-wasm/index.d.cts +4 -4
- package/@types/persisters/persister-cr-sqlite-wasm/index.d.ts +4 -4
- package/@types/persisters/persister-cr-sqlite-wasm/with-schemas/index.d.cts +4 -4
- package/@types/persisters/persister-cr-sqlite-wasm/with-schemas/index.d.ts +4 -4
- package/@types/persisters/persister-electric-sql/index.d.cts +4 -4
- package/@types/persisters/persister-electric-sql/index.d.ts +4 -4
- package/@types/persisters/persister-electric-sql/with-schemas/index.d.cts +4 -4
- package/@types/persisters/persister-electric-sql/with-schemas/index.d.ts +4 -4
- package/@types/persisters/persister-expo-sqlite/index.d.cts +4 -4
- package/@types/persisters/persister-expo-sqlite/index.d.ts +4 -4
- package/@types/persisters/persister-expo-sqlite/with-schemas/index.d.cts +4 -4
- package/@types/persisters/persister-expo-sqlite/with-schemas/index.d.ts +4 -4
- package/@types/persisters/persister-file/index.d.cts +6 -4
- package/@types/persisters/persister-file/index.d.ts +6 -4
- package/@types/persisters/persister-file/with-schemas/index.d.cts +6 -4
- package/@types/persisters/persister-file/with-schemas/index.d.ts +6 -4
- package/@types/persisters/persister-indexed-db/index.d.cts +5 -4
- package/@types/persisters/persister-indexed-db/index.d.ts +5 -4
- package/@types/persisters/persister-indexed-db/with-schemas/index.d.cts +5 -4
- package/@types/persisters/persister-indexed-db/with-schemas/index.d.ts +5 -4
- package/@types/persisters/persister-libsql/index.d.cts +5 -4
- package/@types/persisters/persister-libsql/index.d.ts +5 -4
- package/@types/persisters/persister-libsql/with-schemas/index.d.cts +5 -4
- package/@types/persisters/persister-libsql/with-schemas/index.d.ts +5 -4
- package/@types/persisters/persister-partykit-client/index.d.cts +12 -6
- package/@types/persisters/persister-partykit-client/index.d.ts +12 -6
- package/@types/persisters/persister-partykit-client/with-schemas/index.d.cts +12 -6
- package/@types/persisters/persister-partykit-client/with-schemas/index.d.ts +12 -6
- package/@types/persisters/persister-partykit-server/index.d.cts +11 -3
- package/@types/persisters/persister-partykit-server/index.d.ts +11 -3
- package/@types/persisters/persister-partykit-server/with-schemas/index.d.cts +11 -3
- package/@types/persisters/persister-partykit-server/with-schemas/index.d.ts +11 -3
- package/@types/persisters/persister-powersync/index.d.cts +5 -4
- package/@types/persisters/persister-powersync/index.d.ts +5 -4
- package/@types/persisters/persister-powersync/with-schemas/index.d.cts +5 -4
- package/@types/persisters/persister-powersync/with-schemas/index.d.ts +5 -4
- package/@types/persisters/persister-remote/index.d.cts +6 -4
- package/@types/persisters/persister-remote/index.d.ts +6 -4
- package/@types/persisters/persister-remote/with-schemas/index.d.cts +6 -4
- package/@types/persisters/persister-remote/with-schemas/index.d.ts +6 -4
- package/@types/persisters/persister-sqlite-wasm/index.d.cts +4 -4
- package/@types/persisters/persister-sqlite-wasm/index.d.ts +4 -4
- package/@types/persisters/persister-sqlite-wasm/with-schemas/index.d.cts +4 -4
- package/@types/persisters/persister-sqlite-wasm/with-schemas/index.d.ts +4 -4
- package/@types/persisters/persister-sqlite3/index.d.cts +4 -4
- package/@types/persisters/persister-sqlite3/index.d.ts +4 -4
- package/@types/persisters/persister-sqlite3/with-schemas/index.d.cts +4 -4
- package/@types/persisters/persister-sqlite3/with-schemas/index.d.ts +4 -4
- package/@types/persisters/persister-yjs/index.d.cts +4 -4
- package/@types/persisters/persister-yjs/index.d.ts +4 -4
- package/@types/persisters/persister-yjs/with-schemas/index.d.cts +4 -4
- package/@types/persisters/persister-yjs/with-schemas/index.d.ts +4 -4
- package/@types/persisters/with-schemas/index.d.cts +87 -25
- package/@types/persisters/with-schemas/index.d.ts +87 -25
- package/@types/queries/index.d.cts +64 -4
- package/@types/queries/index.d.ts +64 -4
- package/@types/queries/with-schemas/index.d.cts +64 -4
- package/@types/queries/with-schemas/index.d.ts +64 -4
- package/@types/relationships/index.d.cts +34 -1
- package/@types/relationships/index.d.ts +34 -1
- package/@types/relationships/with-schemas/index.d.cts +34 -1
- package/@types/relationships/with-schemas/index.d.ts +34 -1
- package/@types/store/index.d.cts +125 -0
- package/@types/store/index.d.ts +125 -0
- package/@types/store/with-schemas/index.d.cts +125 -0
- package/@types/store/with-schemas/index.d.ts +125 -0
- package/@types/synchronizers/index.d.cts +32 -10
- package/@types/synchronizers/index.d.ts +32 -10
- package/@types/synchronizers/synchronizer-broadcast-channel/index.d.cts +114 -0
- package/@types/synchronizers/synchronizer-broadcast-channel/index.d.ts +114 -0
- package/@types/synchronizers/synchronizer-broadcast-channel/with-schemas/index.d.cts +128 -0
- package/@types/synchronizers/synchronizer-broadcast-channel/with-schemas/index.d.ts +128 -0
- package/@types/synchronizers/synchronizer-local/index.d.cts +16 -17
- package/@types/synchronizers/synchronizer-local/index.d.ts +16 -17
- package/@types/synchronizers/synchronizer-local/with-schemas/index.d.cts +16 -17
- package/@types/synchronizers/synchronizer-local/with-schemas/index.d.ts +16 -17
- package/@types/synchronizers/synchronizer-ws-client/index.d.cts +66 -6
- package/@types/synchronizers/synchronizer-ws-client/index.d.ts +66 -6
- package/@types/synchronizers/synchronizer-ws-client/with-schemas/index.d.cts +77 -6
- package/@types/synchronizers/synchronizer-ws-client/with-schemas/index.d.ts +77 -6
- package/@types/synchronizers/synchronizer-ws-server/index.d.cts +486 -7
- package/@types/synchronizers/synchronizer-ws-server/index.d.ts +486 -7
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.cts +486 -7
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +486 -7
- package/@types/synchronizers/with-schemas/index.d.cts +29 -11
- package/@types/synchronizers/with-schemas/index.d.ts +29 -11
- package/@types/tools/index.d.cts +22 -0
- package/@types/tools/index.d.ts +22 -0
- package/@types/tools/with-schemas/index.d.cts +22 -0
- package/@types/tools/with-schemas/index.d.ts +22 -0
- package/@types/ui-react/index.d.cts +375 -1
- package/@types/ui-react/index.d.ts +375 -1
- package/@types/ui-react/with-schemas/index.d.cts +100 -1
- package/@types/ui-react/with-schemas/index.d.ts +100 -1
- package/@types/ui-react-dom/index.d.cts +112 -0
- package/@types/ui-react-dom/index.d.ts +112 -0
- package/@types/ui-react-dom/with-schemas/index.d.cts +112 -0
- package/@types/ui-react-dom/with-schemas/index.d.ts +112 -0
- package/@types/ui-react-inspector/index.d.cts +6 -2
- package/@types/ui-react-inspector/index.d.ts +6 -2
- package/@types/ui-react-inspector/with-schemas/index.d.cts +118 -2
- package/@types/ui-react-inspector/with-schemas/index.d.ts +118 -2
- package/@types/with-schemas/index.d.cts +1 -0
- package/@types/with-schemas/index.d.ts +1 -0
- package/cjs/es6/index.cjs +2 -2
- package/cjs/es6/min/synchronizers/synchronizer-broadcast-channel/index.cjs +1 -0
- package/cjs/es6/min/synchronizers/synchronizer-broadcast-channel/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +1 -0
- package/cjs/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-client/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-client/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/synchronizers/index.cjs +2 -2
- package/cjs/es6/synchronizers/synchronizer-broadcast-channel/index.cjs +628 -0
- package/cjs/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +628 -0
- package/cjs/es6/synchronizers/synchronizer-local/index.cjs +4 -4
- package/cjs/es6/synchronizers/synchronizer-local/with-schemas/index.cjs +4 -4
- package/cjs/es6/synchronizers/synchronizer-ws-client/index.cjs +15 -21
- package/cjs/es6/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +15 -21
- package/cjs/es6/synchronizers/with-schemas/index.cjs +2 -2
- package/cjs/es6/with-schemas/index.cjs +2 -2
- package/cjs/index.cjs +2 -2
- package/cjs/min/synchronizers/synchronizer-broadcast-channel/index.cjs +1 -0
- package/cjs/min/synchronizers/synchronizer-broadcast-channel/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +1 -0
- package/cjs/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-client/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-client/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs.gz +0 -0
- package/cjs/synchronizers/index.cjs +2 -2
- package/cjs/synchronizers/synchronizer-broadcast-channel/index.cjs +500 -0
- package/cjs/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +500 -0
- package/cjs/synchronizers/synchronizer-local/index.cjs +4 -4
- package/cjs/synchronizers/synchronizer-local/with-schemas/index.cjs +4 -4
- package/cjs/synchronizers/synchronizer-ws-client/index.cjs +15 -21
- package/cjs/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +15 -21
- package/cjs/synchronizers/with-schemas/index.cjs +2 -2
- package/cjs/with-schemas/index.cjs +2 -2
- package/es6/index.js +2 -2
- package/es6/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -0
- package/es6/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -0
- package/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/es6/synchronizers/index.js +2 -2
- package/es6/synchronizers/synchronizer-broadcast-channel/index.js +626 -0
- package/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +626 -0
- package/es6/synchronizers/synchronizer-local/index.js +4 -4
- package/es6/synchronizers/synchronizer-local/with-schemas/index.js +4 -4
- package/es6/synchronizers/synchronizer-ws-client/index.js +15 -21
- package/es6/synchronizers/synchronizer-ws-client/with-schemas/index.js +15 -21
- package/es6/synchronizers/with-schemas/index.js +2 -2
- package/es6/with-schemas/index.js +2 -2
- package/index.js +2 -2
- package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -0
- package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -0
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/package.json +105 -1
- package/readme.md +9 -9
- package/releases.md +4 -4
- package/synchronizers/index.js +2 -2
- package/synchronizers/synchronizer-broadcast-channel/index.js +498 -0
- package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +498 -0
- package/synchronizers/synchronizer-local/index.js +4 -4
- package/synchronizers/synchronizer-local/with-schemas/index.js +4 -4
- package/synchronizers/synchronizer-ws-client/index.js +15 -21
- package/synchronizers/synchronizer-ws-client/with-schemas/index.js +15 -21
- package/synchronizers/with-schemas/index.js +2 -2
- package/umd/es6/index.js +2 -2
- package/umd/es6/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -0
- package/umd/es6/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -0
- package/umd/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/umd/es6/synchronizers/index.js +2 -2
- package/umd/es6/synchronizers/synchronizer-broadcast-channel/index.js +654 -0
- package/umd/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +654 -0
- package/umd/es6/synchronizers/synchronizer-local/index.js +4 -4
- package/umd/es6/synchronizers/synchronizer-local/with-schemas/index.js +4 -4
- package/umd/es6/synchronizers/synchronizer-ws-client/index.js +15 -21
- package/umd/es6/synchronizers/synchronizer-ws-client/with-schemas/index.js +15 -21
- package/umd/es6/synchronizers/with-schemas/index.js +2 -2
- package/umd/es6/with-schemas/index.js +2 -2
- package/umd/index.js +2 -2
- package/umd/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -0
- package/umd/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -0
- package/umd/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/umd/synchronizers/index.js +2 -2
- package/umd/synchronizers/synchronizer-broadcast-channel/index.js +516 -0
- package/umd/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +516 -0
- package/umd/synchronizers/synchronizer-local/index.js +4 -4
- package/umd/synchronizers/synchronizer-local/with-schemas/index.js +4 -4
- package/umd/synchronizers/synchronizer-ws-client/index.js +15 -21
- package/umd/synchronizers/synchronizer-ws-client/with-schemas/index.js +15 -21
- package/umd/synchronizers/with-schemas/index.js +2 -2
- package/umd/with-schemas/index.js +2 -2
- package/with-schemas/index.js +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The synchronizers module of the TinyBase project lets you synchronize
|
|
3
3
|
* MergeableStore data to and from other MergeableStore instances.
|
|
4
|
-
* @see
|
|
4
|
+
* @see Synchronization guide
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
* @module synchronizers
|
|
7
7
|
* @since v5.0.0
|
|
@@ -33,35 +33,51 @@ import type {MergeableStore} from '../../mergeable-store/with-schemas/index.d.ts
|
|
|
33
33
|
export const enum Message {
|
|
34
34
|
/**
|
|
35
35
|
* A message that is a response to a previous request.
|
|
36
|
+
* @category Enum
|
|
37
|
+
* @since v5.0.0
|
|
36
38
|
*/
|
|
37
39
|
Response = 0,
|
|
38
40
|
/**
|
|
39
41
|
* A message that is a request to get ContentHashes from another
|
|
40
42
|
* MergeableStore.
|
|
43
|
+
* @category Enum
|
|
44
|
+
* @since v5.0.0
|
|
41
45
|
*/
|
|
42
46
|
GetContentHashes = 1,
|
|
43
47
|
/**
|
|
44
48
|
* A message that contains ContentHashes.
|
|
49
|
+
* @category Enum
|
|
50
|
+
* @since v5.0.0
|
|
45
51
|
*/
|
|
46
52
|
ContentHashes = 2,
|
|
47
53
|
/**
|
|
48
54
|
* A message that contains a ContentDiff.
|
|
55
|
+
* @category Enum
|
|
56
|
+
* @since v5.0.0
|
|
49
57
|
*/
|
|
50
58
|
ContentDiff = 3,
|
|
51
59
|
/**
|
|
52
60
|
* A message that is a request to get a TableDiff from another MergeableStore.
|
|
61
|
+
* @category Enum
|
|
62
|
+
* @since v5.0.0
|
|
53
63
|
*/
|
|
54
64
|
GetTableDiff = 4,
|
|
55
65
|
/**
|
|
56
66
|
* A message that is a request to get a RowDiff from another MergeableStore.
|
|
67
|
+
* @category Enum
|
|
68
|
+
* @since v5.0.0
|
|
57
69
|
*/
|
|
58
70
|
GetRowDiff = 5,
|
|
59
71
|
/**
|
|
60
72
|
* A message that is a request to get a CellDiff from another MergeableStore.
|
|
73
|
+
* @category Enum
|
|
74
|
+
* @since v5.0.0
|
|
61
75
|
*/
|
|
62
76
|
GetCellDiff = 6,
|
|
63
77
|
/**
|
|
64
78
|
* A message that is a request to get a ValueDiff from another MergeableStore.
|
|
79
|
+
* @category Enum
|
|
80
|
+
* @since v5.0.0
|
|
65
81
|
*/
|
|
66
82
|
GetValueDiff = 7,
|
|
67
83
|
}
|
|
@@ -127,7 +143,7 @@ export type SynchronizerStats = {
|
|
|
127
143
|
};
|
|
128
144
|
|
|
129
145
|
/**
|
|
130
|
-
*
|
|
146
|
+
* A Synchronizer object lets you synchronize MergeableStore data with another
|
|
131
147
|
* TinyBase client or system.
|
|
132
148
|
*
|
|
133
149
|
* This is useful for sharing data between users, or between devices of a single
|
|
@@ -376,7 +392,7 @@ export interface Synchronizer<Schemas extends OptionalSchemas>
|
|
|
376
392
|
* createCustomSynchronizer(
|
|
377
393
|
* store: MergeableStore,
|
|
378
394
|
* send: Send,
|
|
379
|
-
*
|
|
395
|
+
* registerReceive: (receive: Receive) => void,
|
|
380
396
|
* destroy: () => void,
|
|
381
397
|
* requestTimeoutSeconds: number,
|
|
382
398
|
* onIgnoredError?: (error: any) => void,
|
|
@@ -389,9 +405,9 @@ export interface Synchronizer<Schemas extends OptionalSchemas>
|
|
|
389
405
|
* medium of communication used.
|
|
390
406
|
* @param store The MergeableStore to synchronize.
|
|
391
407
|
* @param send A Send function for sending a message.
|
|
392
|
-
* @param
|
|
393
|
-
* that is passed a Receive function that you need to ensure
|
|
394
|
-
* messages.
|
|
408
|
+
* @param registerReceive A callback (called once when the Synchronizer is
|
|
409
|
+
* created) that is passed a Receive function that you need to ensure will
|
|
410
|
+
* receive messages addressed or broadcast to this client.
|
|
395
411
|
* @param destroy A function called when destroying the Persister which can be
|
|
396
412
|
* used to clean up underlying resources.
|
|
397
413
|
* @param requestTimeoutSeconds An number of seconds before a request sent from
|
|
@@ -427,7 +443,7 @@ export interface Synchronizer<Schemas extends OptionalSchemas>
|
|
|
427
443
|
* remoteBus.push([clientId, requestId, message, body]);
|
|
428
444
|
* },
|
|
429
445
|
* (receive) => {
|
|
430
|
-
* //
|
|
446
|
+
* // registerReceive
|
|
431
447
|
* timer = setInterval(() => {
|
|
432
448
|
* if (localBus.length > 0) {
|
|
433
449
|
* receive(...localBus.shift());
|
|
@@ -449,11 +465,13 @@ export interface Synchronizer<Schemas extends OptionalSchemas>
|
|
|
449
465
|
* await synchronizer2.startSync();
|
|
450
466
|
*
|
|
451
467
|
* store1.setTables({pets: {fido: {species: 'dog'}}});
|
|
468
|
+
* store2.setTables({pets: {felix: {species: 'cat'}}});
|
|
469
|
+
*
|
|
452
470
|
* // ...
|
|
453
471
|
* console.log(store1.getTables());
|
|
454
|
-
* // -> {pets: {fido: {species: 'dog'}}}
|
|
472
|
+
* // -> {pets: {fido: {species: 'dog'}, felix: {species: 'cat'}}}
|
|
455
473
|
* console.log(store2.getTables());
|
|
456
|
-
* // -> {pets: {fido: {species: 'dog'}}}
|
|
474
|
+
* // -> {pets: {fido: {species: 'dog'}, felix: {species: 'cat'}}}
|
|
457
475
|
*
|
|
458
476
|
* synchronizer1.destroy();
|
|
459
477
|
* synchronizer2.destroy();
|
|
@@ -464,7 +482,7 @@ export interface Synchronizer<Schemas extends OptionalSchemas>
|
|
|
464
482
|
export function createCustomSynchronizer<Schemas extends OptionalSchemas>(
|
|
465
483
|
store: MergeableStore<Schemas>,
|
|
466
484
|
send: Send,
|
|
467
|
-
|
|
485
|
+
registerReceive: (receive: Receive) => void,
|
|
468
486
|
destroy: () => void,
|
|
469
487
|
requestTimeoutSeconds: number,
|
|
470
488
|
onIgnoredError?: (error: any) => void,
|
package/@types/tools/index.d.cts
CHANGED
|
@@ -23,28 +23,40 @@ import type {Id} from '../common/index.d.cts';
|
|
|
23
23
|
export type StoreStats = {
|
|
24
24
|
/**
|
|
25
25
|
* The number of Table objects in the Store.
|
|
26
|
+
* @category Stat
|
|
27
|
+
* @since v2.2.0
|
|
26
28
|
*/
|
|
27
29
|
totalTables: number;
|
|
28
30
|
/**
|
|
29
31
|
* The number of Row objects in the Store, across all Table objects.
|
|
32
|
+
* @category Stat
|
|
33
|
+
* @since v2.2.0
|
|
30
34
|
*/
|
|
31
35
|
totalRows: number;
|
|
32
36
|
/**
|
|
33
37
|
* The number of Cell objects in the Store, across all Row objects, across all
|
|
34
38
|
* Table objects.
|
|
39
|
+
* @category Stat
|
|
40
|
+
* @since v2.2.0
|
|
35
41
|
*/
|
|
36
42
|
totalCells: number;
|
|
37
43
|
/**
|
|
38
44
|
* The number of Value objects in the Store, since v3.0.
|
|
45
|
+
* @category Stat
|
|
46
|
+
* @since v2.2.0
|
|
39
47
|
*/
|
|
40
48
|
totalValues: number;
|
|
41
49
|
/**
|
|
42
50
|
* The string length of the Store when serialized to JSON.
|
|
51
|
+
* @category Stat
|
|
52
|
+
* @since v2.2.0
|
|
43
53
|
*/
|
|
44
54
|
jsonLength: number;
|
|
45
55
|
/**
|
|
46
56
|
* Additional detailed statistics about the Store if the `detail` flag is
|
|
47
57
|
* specified in the getStoreStats method.
|
|
58
|
+
* @category Stat
|
|
59
|
+
* @since v2.2.0
|
|
48
60
|
*/
|
|
49
61
|
detail?: StoreStatsDetail;
|
|
50
62
|
};
|
|
@@ -61,6 +73,8 @@ export type StoreStats = {
|
|
|
61
73
|
export type StoreStatsDetail = {
|
|
62
74
|
/**
|
|
63
75
|
* Information about each Table in the Store.
|
|
76
|
+
* @category Stat
|
|
77
|
+
* @since v2.2.0
|
|
64
78
|
*/
|
|
65
79
|
tables: {[tableId: Id]: StoreStatsTableDetail};
|
|
66
80
|
};
|
|
@@ -74,14 +88,20 @@ export type StoreStatsDetail = {
|
|
|
74
88
|
export type StoreStatsTableDetail = {
|
|
75
89
|
/**
|
|
76
90
|
* The number of Row objects in the Table.
|
|
91
|
+
* @category Stat
|
|
92
|
+
* @since v2.2.0
|
|
77
93
|
*/
|
|
78
94
|
tableRows: number;
|
|
79
95
|
/**
|
|
80
96
|
* The number of Cell objects in the Table, across all Row objects.
|
|
97
|
+
* @category Stat
|
|
98
|
+
* @since v2.2.0
|
|
81
99
|
*/
|
|
82
100
|
tableCells: number;
|
|
83
101
|
/**
|
|
84
102
|
* Detail about the Table object.
|
|
103
|
+
* @category Stat
|
|
104
|
+
* @since v2.2.0
|
|
85
105
|
*/
|
|
86
106
|
rows: {[rowId: Id]: StoreStatsRowDetail};
|
|
87
107
|
};
|
|
@@ -95,6 +115,8 @@ export type StoreStatsTableDetail = {
|
|
|
95
115
|
export type StoreStatsRowDetail = {
|
|
96
116
|
/**
|
|
97
117
|
* The number of Cell objects in the Row.
|
|
118
|
+
* @category Stat
|
|
119
|
+
* @since v2.2.0
|
|
98
120
|
*/
|
|
99
121
|
rowCells: number;
|
|
100
122
|
};
|
package/@types/tools/index.d.ts
CHANGED
|
@@ -23,28 +23,40 @@ import type {Id} from '../common/index.d.ts';
|
|
|
23
23
|
export type StoreStats = {
|
|
24
24
|
/**
|
|
25
25
|
* The number of Table objects in the Store.
|
|
26
|
+
* @category Stat
|
|
27
|
+
* @since v2.2.0
|
|
26
28
|
*/
|
|
27
29
|
totalTables: number;
|
|
28
30
|
/**
|
|
29
31
|
* The number of Row objects in the Store, across all Table objects.
|
|
32
|
+
* @category Stat
|
|
33
|
+
* @since v2.2.0
|
|
30
34
|
*/
|
|
31
35
|
totalRows: number;
|
|
32
36
|
/**
|
|
33
37
|
* The number of Cell objects in the Store, across all Row objects, across all
|
|
34
38
|
* Table objects.
|
|
39
|
+
* @category Stat
|
|
40
|
+
* @since v2.2.0
|
|
35
41
|
*/
|
|
36
42
|
totalCells: number;
|
|
37
43
|
/**
|
|
38
44
|
* The number of Value objects in the Store, since v3.0.
|
|
45
|
+
* @category Stat
|
|
46
|
+
* @since v2.2.0
|
|
39
47
|
*/
|
|
40
48
|
totalValues: number;
|
|
41
49
|
/**
|
|
42
50
|
* The string length of the Store when serialized to JSON.
|
|
51
|
+
* @category Stat
|
|
52
|
+
* @since v2.2.0
|
|
43
53
|
*/
|
|
44
54
|
jsonLength: number;
|
|
45
55
|
/**
|
|
46
56
|
* Additional detailed statistics about the Store if the `detail` flag is
|
|
47
57
|
* specified in the getStoreStats method.
|
|
58
|
+
* @category Stat
|
|
59
|
+
* @since v2.2.0
|
|
48
60
|
*/
|
|
49
61
|
detail?: StoreStatsDetail;
|
|
50
62
|
};
|
|
@@ -61,6 +73,8 @@ export type StoreStats = {
|
|
|
61
73
|
export type StoreStatsDetail = {
|
|
62
74
|
/**
|
|
63
75
|
* Information about each Table in the Store.
|
|
76
|
+
* @category Stat
|
|
77
|
+
* @since v2.2.0
|
|
64
78
|
*/
|
|
65
79
|
tables: {[tableId: Id]: StoreStatsTableDetail};
|
|
66
80
|
};
|
|
@@ -74,14 +88,20 @@ export type StoreStatsDetail = {
|
|
|
74
88
|
export type StoreStatsTableDetail = {
|
|
75
89
|
/**
|
|
76
90
|
* The number of Row objects in the Table.
|
|
91
|
+
* @category Stat
|
|
92
|
+
* @since v2.2.0
|
|
77
93
|
*/
|
|
78
94
|
tableRows: number;
|
|
79
95
|
/**
|
|
80
96
|
* The number of Cell objects in the Table, across all Row objects.
|
|
97
|
+
* @category Stat
|
|
98
|
+
* @since v2.2.0
|
|
81
99
|
*/
|
|
82
100
|
tableCells: number;
|
|
83
101
|
/**
|
|
84
102
|
* Detail about the Table object.
|
|
103
|
+
* @category Stat
|
|
104
|
+
* @since v2.2.0
|
|
85
105
|
*/
|
|
86
106
|
rows: {[rowId: Id]: StoreStatsRowDetail};
|
|
87
107
|
};
|
|
@@ -95,6 +115,8 @@ export type StoreStatsTableDetail = {
|
|
|
95
115
|
export type StoreStatsRowDetail = {
|
|
96
116
|
/**
|
|
97
117
|
* The number of Cell objects in the Row.
|
|
118
|
+
* @category Stat
|
|
119
|
+
* @since v2.2.0
|
|
98
120
|
*/
|
|
99
121
|
rowCells: number;
|
|
100
122
|
};
|
|
@@ -23,28 +23,40 @@ import type {Id} from '../../common/with-schemas/index.d.cts';
|
|
|
23
23
|
export type StoreStats = {
|
|
24
24
|
/**
|
|
25
25
|
* The number of Table objects in the Store.
|
|
26
|
+
* @category Stat
|
|
27
|
+
* @since v2.2.0
|
|
26
28
|
*/
|
|
27
29
|
totalTables: number;
|
|
28
30
|
/**
|
|
29
31
|
* The number of Row objects in the Store, across all Table objects.
|
|
32
|
+
* @category Stat
|
|
33
|
+
* @since v2.2.0
|
|
30
34
|
*/
|
|
31
35
|
totalRows: number;
|
|
32
36
|
/**
|
|
33
37
|
* The number of Cell objects in the Store, across all Row objects, across all
|
|
34
38
|
* Table objects.
|
|
39
|
+
* @category Stat
|
|
40
|
+
* @since v2.2.0
|
|
35
41
|
*/
|
|
36
42
|
totalCells: number;
|
|
37
43
|
/**
|
|
38
44
|
* The number of Value objects in the Store, since v3.0.
|
|
45
|
+
* @category Stat
|
|
46
|
+
* @since v2.2.0
|
|
39
47
|
*/
|
|
40
48
|
totalValues: number;
|
|
41
49
|
/**
|
|
42
50
|
* The string length of the Store when serialized to JSON.
|
|
51
|
+
* @category Stat
|
|
52
|
+
* @since v2.2.0
|
|
43
53
|
*/
|
|
44
54
|
jsonLength: number;
|
|
45
55
|
/**
|
|
46
56
|
* Additional detailed statistics about the Store if the `detail` flag is
|
|
47
57
|
* specified in the getStoreStats method.
|
|
58
|
+
* @category Stat
|
|
59
|
+
* @since v2.2.0
|
|
48
60
|
*/
|
|
49
61
|
detail?: StoreStatsDetail;
|
|
50
62
|
};
|
|
@@ -61,6 +73,8 @@ export type StoreStats = {
|
|
|
61
73
|
export type StoreStatsDetail = {
|
|
62
74
|
/**
|
|
63
75
|
* Information about each Table in the Store.
|
|
76
|
+
* @category Stat
|
|
77
|
+
* @since v2.2.0
|
|
64
78
|
*/
|
|
65
79
|
tables: {[tableId: Id]: StoreStatsTableDetail};
|
|
66
80
|
};
|
|
@@ -74,14 +88,20 @@ export type StoreStatsDetail = {
|
|
|
74
88
|
export type StoreStatsTableDetail = {
|
|
75
89
|
/**
|
|
76
90
|
* The number of Row objects in the Table.
|
|
91
|
+
* @category Stat
|
|
92
|
+
* @since v2.2.0
|
|
77
93
|
*/
|
|
78
94
|
tableRows: number;
|
|
79
95
|
/**
|
|
80
96
|
* The number of Cell objects in the Table, across all Row objects.
|
|
97
|
+
* @category Stat
|
|
98
|
+
* @since v2.2.0
|
|
81
99
|
*/
|
|
82
100
|
tableCells: number;
|
|
83
101
|
/**
|
|
84
102
|
* Detail about the Table object.
|
|
103
|
+
* @category Stat
|
|
104
|
+
* @since v2.2.0
|
|
85
105
|
*/
|
|
86
106
|
rows: {[rowId: Id]: StoreStatsRowDetail};
|
|
87
107
|
};
|
|
@@ -95,6 +115,8 @@ export type StoreStatsTableDetail = {
|
|
|
95
115
|
export type StoreStatsRowDetail = {
|
|
96
116
|
/**
|
|
97
117
|
* The number of Cell objects in the Row.
|
|
118
|
+
* @category Stat
|
|
119
|
+
* @since v2.2.0
|
|
98
120
|
*/
|
|
99
121
|
rowCells: number;
|
|
100
122
|
};
|
|
@@ -23,28 +23,40 @@ import type {Id} from '../../common/with-schemas/index.d.ts';
|
|
|
23
23
|
export type StoreStats = {
|
|
24
24
|
/**
|
|
25
25
|
* The number of Table objects in the Store.
|
|
26
|
+
* @category Stat
|
|
27
|
+
* @since v2.2.0
|
|
26
28
|
*/
|
|
27
29
|
totalTables: number;
|
|
28
30
|
/**
|
|
29
31
|
* The number of Row objects in the Store, across all Table objects.
|
|
32
|
+
* @category Stat
|
|
33
|
+
* @since v2.2.0
|
|
30
34
|
*/
|
|
31
35
|
totalRows: number;
|
|
32
36
|
/**
|
|
33
37
|
* The number of Cell objects in the Store, across all Row objects, across all
|
|
34
38
|
* Table objects.
|
|
39
|
+
* @category Stat
|
|
40
|
+
* @since v2.2.0
|
|
35
41
|
*/
|
|
36
42
|
totalCells: number;
|
|
37
43
|
/**
|
|
38
44
|
* The number of Value objects in the Store, since v3.0.
|
|
45
|
+
* @category Stat
|
|
46
|
+
* @since v2.2.0
|
|
39
47
|
*/
|
|
40
48
|
totalValues: number;
|
|
41
49
|
/**
|
|
42
50
|
* The string length of the Store when serialized to JSON.
|
|
51
|
+
* @category Stat
|
|
52
|
+
* @since v2.2.0
|
|
43
53
|
*/
|
|
44
54
|
jsonLength: number;
|
|
45
55
|
/**
|
|
46
56
|
* Additional detailed statistics about the Store if the `detail` flag is
|
|
47
57
|
* specified in the getStoreStats method.
|
|
58
|
+
* @category Stat
|
|
59
|
+
* @since v2.2.0
|
|
48
60
|
*/
|
|
49
61
|
detail?: StoreStatsDetail;
|
|
50
62
|
};
|
|
@@ -61,6 +73,8 @@ export type StoreStats = {
|
|
|
61
73
|
export type StoreStatsDetail = {
|
|
62
74
|
/**
|
|
63
75
|
* Information about each Table in the Store.
|
|
76
|
+
* @category Stat
|
|
77
|
+
* @since v2.2.0
|
|
64
78
|
*/
|
|
65
79
|
tables: {[tableId: Id]: StoreStatsTableDetail};
|
|
66
80
|
};
|
|
@@ -74,14 +88,20 @@ export type StoreStatsDetail = {
|
|
|
74
88
|
export type StoreStatsTableDetail = {
|
|
75
89
|
/**
|
|
76
90
|
* The number of Row objects in the Table.
|
|
91
|
+
* @category Stat
|
|
92
|
+
* @since v2.2.0
|
|
77
93
|
*/
|
|
78
94
|
tableRows: number;
|
|
79
95
|
/**
|
|
80
96
|
* The number of Cell objects in the Table, across all Row objects.
|
|
97
|
+
* @category Stat
|
|
98
|
+
* @since v2.2.0
|
|
81
99
|
*/
|
|
82
100
|
tableCells: number;
|
|
83
101
|
/**
|
|
84
102
|
* Detail about the Table object.
|
|
103
|
+
* @category Stat
|
|
104
|
+
* @since v2.2.0
|
|
85
105
|
*/
|
|
86
106
|
rows: {[rowId: Id]: StoreStatsRowDetail};
|
|
87
107
|
};
|
|
@@ -95,6 +115,8 @@ export type StoreStatsTableDetail = {
|
|
|
95
115
|
export type StoreStatsRowDetail = {
|
|
96
116
|
/**
|
|
97
117
|
* The number of Cell objects in the Row.
|
|
118
|
+
* @category Stat
|
|
119
|
+
* @since v2.2.0
|
|
98
120
|
*/
|
|
99
121
|
rowCells: number;
|
|
100
122
|
};
|