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
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* directly, and register listeners for when they change.
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
* @module relationships
|
|
11
|
+
* @since v1.0.0
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import type {
|
|
@@ -40,6 +41,7 @@ import type {Id, IdOrNull, Ids} from '../../common/with-schemas/index.d.ts';
|
|
|
40
41
|
* instead enumerate and access its structure with the getRemoteRowId method,
|
|
41
42
|
* the getLocalRowIds method, and the getLinkedRowIds method.
|
|
42
43
|
* @category Concept
|
|
44
|
+
* @since v1.0.0
|
|
43
45
|
*/
|
|
44
46
|
export type Relationship = {
|
|
45
47
|
remoteRowId: {[localRowId: Id]: Id};
|
|
@@ -68,6 +70,7 @@ export type Relationship = {
|
|
|
68
70
|
* @param forEachRow A function that will let you iterate over the local Row
|
|
69
71
|
* objects in this Relationship.
|
|
70
72
|
* @category Callback
|
|
73
|
+
* @since v1.0.0
|
|
71
74
|
*/
|
|
72
75
|
export type RelationshipCallback<Schema extends OptionalTablesSchema> = (
|
|
73
76
|
relationshipId: Id,
|
|
@@ -91,6 +94,7 @@ export type RelationshipCallback<Schema extends OptionalTablesSchema> = (
|
|
|
91
94
|
* Relationships object.
|
|
92
95
|
* @param relationships A reference to the Relationships object that changed.
|
|
93
96
|
* @category Listener
|
|
97
|
+
* @since v1.0.0
|
|
94
98
|
*/
|
|
95
99
|
export type RelationshipIdsListener<Schemas extends OptionalSchemas> = (
|
|
96
100
|
relationships: Relationships<Schemas>,
|
|
@@ -120,6 +124,7 @@ export type RelationshipIdsListener<Schemas extends OptionalSchemas> = (
|
|
|
120
124
|
* @param relationshipId The Id of the Relationship that changed.
|
|
121
125
|
* @param localRowId The Id of the local Row whose remote Row Id changed.
|
|
122
126
|
* @category Listener
|
|
127
|
+
* @since v1.0.0
|
|
123
128
|
*/
|
|
124
129
|
export type RemoteRowIdListener<Schemas extends OptionalSchemas> = (
|
|
125
130
|
relationships: Relationships<Schemas>,
|
|
@@ -151,6 +156,7 @@ export type RemoteRowIdListener<Schemas extends OptionalSchemas> = (
|
|
|
151
156
|
* @param relationshipId The Id of the Relationship that changed.
|
|
152
157
|
* @param remoteRowId The Id of the remote Row whose local Row Ids changed.
|
|
153
158
|
* @category Listener
|
|
159
|
+
* @since v1.0.0
|
|
154
160
|
*/
|
|
155
161
|
export type LocalRowIdsListener<Schemas extends OptionalSchemas> = (
|
|
156
162
|
relationships: Relationships<Schemas>,
|
|
@@ -183,6 +189,7 @@ export type LocalRowIdsListener<Schemas extends OptionalSchemas> = (
|
|
|
183
189
|
* @param firstRowId The Id of the first Row of the the linked list whose
|
|
184
190
|
* members changed.
|
|
185
191
|
* @category Listener
|
|
192
|
+
* @since v1.0.0
|
|
186
193
|
*/
|
|
187
194
|
export type LinkedRowIdsListener<Schemas extends OptionalSchemas> = (
|
|
188
195
|
relationships: Relationships<Schemas>,
|
|
@@ -198,21 +205,28 @@ export type LinkedRowIdsListener<Schemas extends OptionalSchemas> = (
|
|
|
198
205
|
* A RelationshipsListenerStats object is returned from the getListenerStats
|
|
199
206
|
* method.
|
|
200
207
|
* @category Development
|
|
208
|
+
* @since v1.0.0
|
|
201
209
|
*/
|
|
202
210
|
export type RelationshipsListenerStats = {
|
|
203
211
|
/**
|
|
204
212
|
* The number of RemoteRowIdListener functions registered with the
|
|
205
213
|
* Relationships object.
|
|
214
|
+
* @category Stat
|
|
215
|
+
* @since v1.0.0
|
|
206
216
|
*/
|
|
207
217
|
remoteRowId: number;
|
|
208
218
|
/**
|
|
209
219
|
* The number of LocalRowIdsListener functions registered with the
|
|
210
220
|
* Relationships object.
|
|
221
|
+
* @category Stat
|
|
222
|
+
* @since v1.0.0
|
|
211
223
|
*/
|
|
212
224
|
localRowIds: number;
|
|
213
225
|
/**
|
|
214
226
|
* The number of LinkedRowId functions registered with the Relationships
|
|
215
227
|
* object.
|
|
228
|
+
* @category Stat
|
|
229
|
+
* @since v1.0.0
|
|
216
230
|
*/
|
|
217
231
|
linkedRowIds: number;
|
|
218
232
|
};
|
|
@@ -307,9 +321,10 @@ export type RelationshipsListenerStats = {
|
|
|
307
321
|
* relationships.delListener(listenerId2);
|
|
308
322
|
* relationships.destroy();
|
|
309
323
|
* ```
|
|
310
|
-
* @see Relationships
|
|
324
|
+
* @see Using Relationships guide
|
|
311
325
|
* @see Drawing demo
|
|
312
326
|
* @category Relationships
|
|
327
|
+
* @since v1.0.0
|
|
313
328
|
*/
|
|
314
329
|
export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
315
330
|
/**
|
|
@@ -409,6 +424,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
409
424
|
* // -> ['fido', 'felix', 'cujo']
|
|
410
425
|
* ```
|
|
411
426
|
* @category Configuration
|
|
427
|
+
* @since v1.0.0
|
|
412
428
|
*/
|
|
413
429
|
setRelationshipDefinition<LocalTableId extends TableIdFromSchema<Schemas[0]>>(
|
|
414
430
|
relationshipId: Id,
|
|
@@ -462,6 +478,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
462
478
|
* // -> []
|
|
463
479
|
* ```
|
|
464
480
|
* @category Configuration
|
|
481
|
+
* @since v1.0.0
|
|
465
482
|
*/
|
|
466
483
|
delRelationshipDefinition(relationshipId: Id): Relationships<Schemas>;
|
|
467
484
|
|
|
@@ -493,6 +510,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
493
510
|
* // -> 'dog'
|
|
494
511
|
* ```
|
|
495
512
|
* @category Getter
|
|
513
|
+
* @since v1.0.0
|
|
496
514
|
*/
|
|
497
515
|
getStore(): Store<Schemas>;
|
|
498
516
|
|
|
@@ -513,6 +531,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
513
531
|
* // -> ['petSpecies', 'petSequence']
|
|
514
532
|
* ```
|
|
515
533
|
* @category Getter
|
|
534
|
+
* @since v1.0.0
|
|
516
535
|
*/
|
|
517
536
|
getRelationshipIds(): Ids;
|
|
518
537
|
|
|
@@ -562,6 +581,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
562
581
|
* // -> '- cujo'
|
|
563
582
|
* ```
|
|
564
583
|
* @category Iterator
|
|
584
|
+
* @since v1.0.0
|
|
565
585
|
*/
|
|
566
586
|
forEachRelationship(
|
|
567
587
|
relationshipCallback: RelationshipCallback<Schemas[0]>,
|
|
@@ -587,6 +607,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
587
607
|
* // -> false
|
|
588
608
|
* ```
|
|
589
609
|
* @category Getter
|
|
610
|
+
* @since v1.0.0
|
|
590
611
|
*/
|
|
591
612
|
hasRelationship(relationshipId: Id): boolean;
|
|
592
613
|
|
|
@@ -625,6 +646,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
625
646
|
* // -> undefined
|
|
626
647
|
* ```
|
|
627
648
|
* @category Getter
|
|
649
|
+
* @since v1.0.0
|
|
628
650
|
*/
|
|
629
651
|
getLocalTableId<TableId extends TableIdFromSchema<Schemas[0]>>(
|
|
630
652
|
relationshipId: Id,
|
|
@@ -665,6 +687,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
665
687
|
* // -> undefined
|
|
666
688
|
* ```
|
|
667
689
|
* @category Getter
|
|
690
|
+
* @since v1.0.0
|
|
668
691
|
*/
|
|
669
692
|
getRemoteTableId<TableId extends TableIdFromSchema<Schemas[0]>>(
|
|
670
693
|
relationshipId: Id,
|
|
@@ -714,6 +737,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
714
737
|
* // -> undefined
|
|
715
738
|
* ```
|
|
716
739
|
* @category Getter
|
|
740
|
+
* @since v1.0.0
|
|
717
741
|
*/
|
|
718
742
|
getRemoteRowId(relationshipId: Id, localRowId: Id): Id | undefined;
|
|
719
743
|
|
|
@@ -761,6 +785,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
761
785
|
* // -> []
|
|
762
786
|
* ```
|
|
763
787
|
* @category Getter
|
|
788
|
+
* @since v1.0.0
|
|
764
789
|
*/
|
|
765
790
|
getLocalRowIds(relationshipId: Id, remoteRowId: Id): Ids;
|
|
766
791
|
|
|
@@ -810,6 +835,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
810
835
|
* // -> ['fido']
|
|
811
836
|
* ```
|
|
812
837
|
* @category Getter
|
|
838
|
+
* @since v1.0.0
|
|
813
839
|
*/
|
|
814
840
|
getLinkedRowIds(relationshipId: Id, firstRowId: Id): Ids;
|
|
815
841
|
|
|
@@ -1006,6 +1032,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1006
1032
|
* relationships.delListener(listenerId);
|
|
1007
1033
|
* ```
|
|
1008
1034
|
* @category Listener
|
|
1035
|
+
* @since v1.0.0
|
|
1009
1036
|
*/
|
|
1010
1037
|
addRemoteRowIdListener(
|
|
1011
1038
|
relationshipId: IdOrNull,
|
|
@@ -1143,6 +1170,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1143
1170
|
* relationships.delListener(listenerId);
|
|
1144
1171
|
* ```
|
|
1145
1172
|
* @category Listener
|
|
1173
|
+
* @since v1.0.0
|
|
1146
1174
|
*/
|
|
1147
1175
|
addLocalRowIdsListener(
|
|
1148
1176
|
relationshipId: IdOrNull,
|
|
@@ -1224,6 +1252,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1224
1252
|
* relationships.delListener(listenerId);
|
|
1225
1253
|
* ```
|
|
1226
1254
|
* @category Listener
|
|
1255
|
+
* @since v1.0.0
|
|
1227
1256
|
*/
|
|
1228
1257
|
addLinkedRowIdsListener(
|
|
1229
1258
|
relationshipId: Id,
|
|
@@ -1290,6 +1319,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1290
1319
|
* // The listener is not called.
|
|
1291
1320
|
* ```
|
|
1292
1321
|
* @category Listener
|
|
1322
|
+
* @since v1.0.0
|
|
1293
1323
|
*/
|
|
1294
1324
|
delListener(listenerId: Id): Relationships<Schemas>;
|
|
1295
1325
|
|
|
@@ -1334,6 +1364,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1334
1364
|
* // -> 0
|
|
1335
1365
|
* ```
|
|
1336
1366
|
* @category Lifecycle
|
|
1367
|
+
* @since v1.0.0
|
|
1337
1368
|
*/
|
|
1338
1369
|
destroy(): void;
|
|
1339
1370
|
|
|
@@ -1370,6 +1401,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1370
1401
|
* // -> 1
|
|
1371
1402
|
* ```
|
|
1372
1403
|
* @category Development
|
|
1404
|
+
* @since v1.0.0
|
|
1373
1405
|
*/
|
|
1374
1406
|
getListenerStats(): RelationshipsListenerStats;
|
|
1375
1407
|
}
|
|
@@ -1412,6 +1444,7 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1412
1444
|
* // -> true
|
|
1413
1445
|
* ```
|
|
1414
1446
|
* @category Creation
|
|
1447
|
+
* @since v1.0.0
|
|
1415
1448
|
*/
|
|
1416
1449
|
export function createRelationships<Schemas extends OptionalSchemas>(
|
|
1417
1450
|
store: Store<Schemas>,
|