tinybase 4.0.0-beta.4 → 4.0.0-beta.5.1
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/lib/cjs/persisters/persister-automerge.cjs +1 -0
- package/lib/cjs/persisters/persister-automerge.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-browser.cjs +1 -0
- package/lib/cjs/persisters/persister-browser.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-cr-sqlite-wasm.cjs +1 -0
- package/lib/cjs/persisters/persister-cr-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-file.cjs +1 -0
- package/lib/cjs/persisters/persister-file.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-remote.cjs +1 -0
- package/lib/cjs/persisters/persister-remote.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-sqlite-wasm.cjs +1 -0
- package/lib/cjs/persisters/persister-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-sqlite3.cjs +1 -0
- package/lib/cjs/persisters/persister-sqlite3.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-yjs.cjs +1 -0
- package/lib/cjs/persisters/persister-yjs.cjs.gz +0 -0
- package/lib/cjs/persisters.cjs +1 -1
- package/lib/cjs/persisters.cjs.gz +0 -0
- package/lib/cjs/store.cjs +1 -1
- package/lib/cjs/store.cjs.gz +0 -0
- package/lib/cjs/tinybase.cjs +1 -1
- package/lib/cjs/tinybase.cjs.gz +0 -0
- package/lib/cjs/tools.cjs +1 -1
- package/lib/cjs/tools.cjs.gz +0 -0
- package/lib/cjs/ui-react.cjs +1 -1
- package/lib/cjs/ui-react.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-automerge.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-automerge.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-browser.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-browser.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-cr-sqlite-wasm.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-cr-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-file.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-file.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-remote.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-remote.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-sqlite-wasm.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-sqlite3.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-sqlite3.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-yjs.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-yjs.cjs.gz +0 -0
- package/lib/cjs-es6/persisters.cjs +1 -1
- package/lib/cjs-es6/persisters.cjs.gz +0 -0
- package/lib/cjs-es6/store.cjs +1 -1
- package/lib/cjs-es6/store.cjs.gz +0 -0
- package/lib/cjs-es6/tinybase.cjs +1 -1
- package/lib/cjs-es6/tinybase.cjs.gz +0 -0
- package/lib/cjs-es6/tools.cjs +1 -1
- package/lib/cjs-es6/tools.cjs.gz +0 -0
- package/lib/cjs-es6/ui-react.cjs +1 -1
- package/lib/cjs-es6/ui-react.cjs.gz +0 -0
- package/lib/debug/{persister-automerge.js → persisters/persister-automerge.js} +58 -31
- package/lib/debug/{persister-browser.js → persisters/persister-browser.js} +49 -20
- package/lib/debug/persisters/persister-cr-sqlite-wasm.js +665 -0
- package/lib/debug/{persister-file.js → persisters/persister-file.js} +51 -25
- package/lib/debug/{persister-remote.js → persisters/persister-remote.js} +48 -19
- package/lib/debug/persisters/persister-sqlite-wasm.js +673 -0
- package/lib/debug/persisters/persister-sqlite3.js +676 -0
- package/lib/debug/{persister-yjs.js → persisters/persister-yjs.js} +49 -20
- package/lib/debug/persisters.js +47 -18
- package/lib/debug/store.js +79 -29
- package/lib/debug/tinybase.js +123 -46
- package/lib/debug/tools.js +121 -27
- package/lib/debug/ui-react.js +24 -0
- package/lib/es6/persisters/persister-automerge.js +1 -0
- package/lib/es6/persisters/persister-automerge.js.gz +0 -0
- package/lib/es6/persisters/persister-browser.js +1 -0
- package/lib/es6/persisters/persister-browser.js.gz +0 -0
- package/lib/es6/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/es6/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/es6/persisters/persister-file.js +1 -0
- package/lib/es6/persisters/persister-file.js.gz +0 -0
- package/lib/es6/persisters/persister-remote.js +1 -0
- package/lib/es6/persisters/persister-remote.js.gz +0 -0
- package/lib/es6/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/es6/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/es6/persisters/persister-sqlite3.js +1 -0
- package/lib/es6/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/es6/persisters/persister-yjs.js +1 -0
- package/lib/es6/persisters/persister-yjs.js.gz +0 -0
- package/lib/es6/persisters.js +1 -1
- package/lib/es6/persisters.js.gz +0 -0
- package/lib/es6/store.js +1 -1
- package/lib/es6/store.js.gz +0 -0
- package/lib/es6/tinybase.js +1 -1
- package/lib/es6/tinybase.js.gz +0 -0
- package/lib/es6/tools.js +1 -1
- package/lib/es6/tools.js.gz +0 -0
- package/lib/es6/ui-react.js +1 -1
- package/lib/es6/ui-react.js.gz +0 -0
- package/lib/persisters/persister-automerge.js +1 -0
- package/lib/persisters/persister-automerge.js.gz +0 -0
- package/lib/persisters/persister-browser.js +1 -0
- package/lib/persisters/persister-browser.js.gz +0 -0
- package/lib/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/persisters/persister-file.js +1 -0
- package/lib/persisters/persister-file.js.gz +0 -0
- package/lib/persisters/persister-remote.js +1 -0
- package/lib/persisters/persister-remote.js.gz +0 -0
- package/lib/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/persisters/persister-sqlite3.js +1 -0
- package/lib/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/persisters/persister-yjs.js +1 -0
- package/lib/persisters/persister-yjs.js.gz +0 -0
- package/lib/persisters.js +1 -1
- package/lib/persisters.js.gz +0 -0
- package/lib/store.js +1 -1
- package/lib/store.js.gz +0 -0
- package/lib/tinybase.js +1 -1
- package/lib/tinybase.js.gz +0 -0
- package/lib/tools.js +1 -1
- package/lib/tools.js.gz +0 -0
- package/lib/types/checkpoints.d.ts +0 -27
- package/lib/types/common.d.ts +0 -9
- package/lib/types/indexes.d.ts +0 -26
- package/lib/types/metrics.d.ts +0 -23
- package/lib/types/{persister-automerge.d.ts → persisters/persister-automerge.d.ts} +4 -6
- package/lib/types/{persister-browser.d.ts → persisters/persister-browser.d.ts} +2 -5
- package/lib/types/persisters/persister-cr-sqlite-wasm.d.ts +95 -0
- package/lib/types/{persister-file.d.ts → persisters/persister-file.d.ts} +3 -5
- package/lib/types/{persister-remote.d.ts → persisters/persister-remote.d.ts} +2 -4
- package/lib/types/persisters/persister-sqlite-wasm.d.ts +102 -0
- package/lib/types/persisters/persister-sqlite3.d.ts +109 -0
- package/lib/types/{persister-yjs.d.ts → persisters/persister-yjs.d.ts} +4 -6
- package/lib/types/persisters.d.ts +517 -27
- package/lib/types/queries.d.ts +52 -127
- package/lib/types/relationships.d.ts +0 -26
- package/lib/types/store.d.ts +347 -196
- package/lib/types/tinybase.d.ts +0 -1
- package/lib/types/tools.d.ts +15 -28
- package/lib/types/ui-react.d.ts +196 -181
- package/lib/types/with-schemas/checkpoints.d.ts +5 -32
- package/lib/types/with-schemas/common.d.ts +0 -9
- package/lib/types/with-schemas/indexes.d.ts +9 -35
- package/lib/types/with-schemas/metrics.d.ts +9 -32
- package/lib/types/with-schemas/{persister-automerge.d.ts → persisters/persister-automerge.d.ts} +4 -6
- package/lib/types/with-schemas/{persister-browser.d.ts → persisters/persister-browser.d.ts} +2 -5
- package/lib/types/with-schemas/persisters/persister-cr-sqlite-wasm.d.ts +105 -0
- package/lib/types/with-schemas/{persister-file.d.ts → persisters/persister-file.d.ts} +3 -5
- package/lib/types/with-schemas/{persister-remote.d.ts → persisters/persister-remote.d.ts} +2 -4
- package/lib/types/with-schemas/persisters/persister-sqlite-wasm.d.ts +113 -0
- package/lib/types/with-schemas/persisters/persister-sqlite3.d.ts +119 -0
- package/lib/types/with-schemas/{persister-yjs.d.ts → persisters/persister-yjs.d.ts} +4 -6
- package/lib/types/with-schemas/persisters.d.ts +534 -29
- package/lib/types/with-schemas/queries.d.ts +61 -224
- package/lib/types/with-schemas/relationships.d.ts +9 -35
- package/lib/types/with-schemas/store.d.ts +488 -239
- package/lib/types/with-schemas/tinybase.d.ts +0 -1
- package/lib/types/with-schemas/tools.d.ts +19 -32
- package/lib/types/with-schemas/ui-react.d.ts +221 -186
- package/lib/ui-react.js +1 -1
- package/lib/ui-react.js.gz +0 -0
- package/lib/umd/persisters/persister-automerge.js +1 -0
- package/lib/umd/persisters/persister-automerge.js.gz +0 -0
- package/lib/umd/persisters/persister-browser.js +1 -0
- package/lib/umd/persisters/persister-browser.js.gz +0 -0
- package/lib/umd/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/umd/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/umd/persisters/persister-file.js +1 -0
- package/lib/umd/persisters/persister-file.js.gz +0 -0
- package/lib/umd/persisters/persister-remote.js +1 -0
- package/lib/umd/persisters/persister-remote.js.gz +0 -0
- package/lib/umd/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/umd/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/umd/persisters/persister-sqlite3.js +1 -0
- package/lib/umd/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/umd/persisters/persister-yjs.js +1 -0
- package/lib/umd/persisters/persister-yjs.js.gz +0 -0
- package/lib/umd/persisters.js +1 -1
- package/lib/umd/persisters.js.gz +0 -0
- package/lib/umd/store.js +1 -1
- package/lib/umd/store.js.gz +0 -0
- package/lib/umd/tinybase.js +1 -1
- package/lib/umd/tinybase.js.gz +0 -0
- package/lib/umd/tools.js +1 -1
- package/lib/umd/tools.js.gz +0 -0
- package/lib/umd/ui-react.js +1 -1
- package/lib/umd/ui-react.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-automerge.js +1 -0
- package/lib/umd-es6/persisters/persister-automerge.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-browser.js +1 -0
- package/lib/umd-es6/persisters/persister-browser.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/umd-es6/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-file.js +1 -0
- package/lib/umd-es6/persisters/persister-file.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-remote.js +1 -0
- package/lib/umd-es6/persisters/persister-remote.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/umd-es6/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-sqlite3.js +1 -0
- package/lib/umd-es6/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-yjs.js +1 -0
- package/lib/umd-es6/persisters/persister-yjs.js.gz +0 -0
- package/lib/umd-es6/persisters.js +1 -1
- package/lib/umd-es6/persisters.js.gz +0 -0
- package/lib/umd-es6/store.js +1 -1
- package/lib/umd-es6/store.js.gz +0 -0
- package/lib/umd-es6/tinybase.js +1 -1
- package/lib/umd-es6/tinybase.js.gz +0 -0
- package/lib/umd-es6/tools.js +1 -1
- package/lib/umd-es6/tools.js.gz +0 -0
- package/lib/umd-es6/ui-react.js +1 -1
- package/lib/umd-es6/ui-react.js.gz +0 -0
- package/package.json +39 -22
- package/readme.md +3 -3
- package/lib/cjs/persister-automerge.cjs +0 -1
- package/lib/cjs/persister-automerge.cjs.gz +0 -0
- package/lib/cjs/persister-browser.cjs +0 -1
- package/lib/cjs/persister-browser.cjs.gz +0 -0
- package/lib/cjs/persister-file.cjs +0 -1
- package/lib/cjs/persister-file.cjs.gz +0 -0
- package/lib/cjs/persister-remote.cjs +0 -1
- package/lib/cjs/persister-remote.cjs.gz +0 -0
- package/lib/cjs/persister-yjs.cjs +0 -1
- package/lib/cjs/persister-yjs.cjs.gz +0 -0
- package/lib/cjs-es6/persister-automerge.cjs +0 -1
- package/lib/cjs-es6/persister-automerge.cjs.gz +0 -0
- package/lib/cjs-es6/persister-browser.cjs +0 -1
- package/lib/cjs-es6/persister-browser.cjs.gz +0 -0
- package/lib/cjs-es6/persister-file.cjs +0 -1
- package/lib/cjs-es6/persister-file.cjs.gz +0 -0
- package/lib/cjs-es6/persister-remote.cjs +0 -1
- package/lib/cjs-es6/persister-remote.cjs.gz +0 -0
- package/lib/cjs-es6/persister-yjs.cjs +0 -1
- package/lib/cjs-es6/persister-yjs.cjs.gz +0 -0
- package/lib/es6/persister-automerge.js +0 -1
- package/lib/es6/persister-automerge.js.gz +0 -0
- package/lib/es6/persister-browser.js +0 -1
- package/lib/es6/persister-browser.js.gz +0 -0
- package/lib/es6/persister-file.js +0 -1
- package/lib/es6/persister-file.js.gz +0 -0
- package/lib/es6/persister-remote.js +0 -1
- package/lib/es6/persister-remote.js.gz +0 -0
- package/lib/es6/persister-yjs.js +0 -1
- package/lib/es6/persister-yjs.js.gz +0 -0
- package/lib/persister-automerge.js +0 -1
- package/lib/persister-automerge.js.gz +0 -0
- package/lib/persister-browser.js +0 -1
- package/lib/persister-browser.js.gz +0 -0
- package/lib/persister-file.js +0 -1
- package/lib/persister-file.js.gz +0 -0
- package/lib/persister-remote.js +0 -1
- package/lib/persister-remote.js.gz +0 -0
- package/lib/persister-yjs.js +0 -1
- package/lib/persister-yjs.js.gz +0 -0
- package/lib/umd/persister-automerge.js +0 -1
- package/lib/umd/persister-automerge.js.gz +0 -0
- package/lib/umd/persister-browser.js +0 -1
- package/lib/umd/persister-browser.js.gz +0 -0
- package/lib/umd/persister-file.js +0 -1
- package/lib/umd/persister-file.js.gz +0 -0
- package/lib/umd/persister-remote.js +0 -1
- package/lib/umd/persister-remote.js.gz +0 -0
- package/lib/umd/persister-yjs.js +0 -1
- package/lib/umd/persister-yjs.js.gz +0 -0
- package/lib/umd-es6/persister-automerge.js +0 -1
- package/lib/umd-es6/persister-automerge.js.gz +0 -0
- package/lib/umd-es6/persister-browser.js +0 -1
- package/lib/umd-es6/persister-browser.js.gz +0 -0
- package/lib/umd-es6/persister-file.js +0 -1
- package/lib/umd-es6/persister-file.js.gz +0 -0
- package/lib/umd-es6/persister-remote.js +0 -1
- package/lib/umd-es6/persister-remote.js.gz +0 -0
- package/lib/umd-es6/persister-yjs.js +0 -1
- package/lib/umd-es6/persister-yjs.js.gz +0 -0
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* which returns a new Relationships object. From there, you can create new
|
|
7
7
|
* Relationship definitions, access the associations within those Relationships
|
|
8
8
|
* directly, and register listeners for when they change.
|
|
9
|
-
*
|
|
10
9
|
* @packageDocumentation
|
|
11
10
|
* @module relationships
|
|
12
11
|
*/
|
|
@@ -37,7 +36,6 @@ import {Id, IdOrNull, Ids} from './common.d';
|
|
|
37
36
|
* Note that the Relationship type is not actually used in the API, and you
|
|
38
37
|
* instead enumerate and access its structure with the getRemoteRowId method,
|
|
39
38
|
* the getLocalRowIds method, and the getLinkedRowIds method.
|
|
40
|
-
*
|
|
41
39
|
* @category Concept
|
|
42
40
|
*/
|
|
43
41
|
export type Relationship = {
|
|
@@ -62,7 +60,6 @@ export type Relationship = {
|
|
|
62
60
|
* A RelationshipCallback is provided when using the forEachRelationship method,
|
|
63
61
|
* so that you can do something based on every Relationship in the Relationships
|
|
64
62
|
* object. See that method for specific examples.
|
|
65
|
-
*
|
|
66
63
|
* @param relationshipId The Id of the Relationship that the callback can
|
|
67
64
|
* operate on.
|
|
68
65
|
* @param forEachRow A function that will let you iterate over the local Row
|
|
@@ -94,7 +91,6 @@ export type RelationshipCallback<Schema extends OptionalTablesSchema> = (
|
|
|
94
91
|
* When called, a RemoteRowIdListener is given a reference to the Relationships
|
|
95
92
|
* object, the Id of the Relationship that changed, and the Id of the local Row
|
|
96
93
|
* whose remote Row Id changed.
|
|
97
|
-
*
|
|
98
94
|
* @param relationships A reference to the Relationships object that changed.
|
|
99
95
|
* @param relationshipId The Id of the Relationship that changed.
|
|
100
96
|
* @param localRowId The Id of the local Row whose remote Row Id changed.
|
|
@@ -126,7 +122,6 @@ export type RemoteRowIdListener<Schemas extends OptionalSchemas> = (
|
|
|
126
122
|
* When called, a LocalRowIdsListener is given a reference to the Relationships
|
|
127
123
|
* object, the Id of the Relationship that changed, and the Id of the remote Row
|
|
128
124
|
* whose local Row Ids changed.
|
|
129
|
-
*
|
|
130
125
|
* @param relationships A reference to the Relationships object that changed.
|
|
131
126
|
* @param relationshipId The Id of the Relationship that changed.
|
|
132
127
|
* @param remoteRowId The Id of the remote Row whose local Row Ids changed.
|
|
@@ -158,7 +153,6 @@ export type LocalRowIdsListener<Schemas extends OptionalSchemas> = (
|
|
|
158
153
|
* When called, a LinkedRowIdsListener is given a reference to the Relationships
|
|
159
154
|
* object, the Id of the Relationship that changed, and the Id of the first Row
|
|
160
155
|
* of the the linked list whose members changed.
|
|
161
|
-
*
|
|
162
156
|
* @param relationships A reference to the Relationships object that changed.
|
|
163
157
|
* @param relationshipId The Id of the Relationship that changed.
|
|
164
158
|
* @param firstRowId The Id of the first Row of the the linked list whose
|
|
@@ -178,7 +172,6 @@ export type LinkedRowIdsListener<Schemas extends OptionalSchemas> = (
|
|
|
178
172
|
*
|
|
179
173
|
* A RelationshipsListenerStats object is returned from the getListenerStats
|
|
180
174
|
* method, and is only populated in a debug build.
|
|
181
|
-
*
|
|
182
175
|
* @category Development
|
|
183
176
|
*/
|
|
184
177
|
export type RelationshipsListenerStats = {
|
|
@@ -218,7 +211,6 @@ export type RelationshipsListenerStats = {
|
|
|
218
211
|
* This module defaults to creating relationships between Row objects by using
|
|
219
212
|
* one of their Cell values. However, far more complex relationships can be
|
|
220
213
|
* configured with a custom function.
|
|
221
|
-
*
|
|
222
214
|
* @example
|
|
223
215
|
* This example shows a very simple lifecycle of a Relationships object: from
|
|
224
216
|
* creation, to adding definitions (both local/remote table and linked list),
|
|
@@ -327,7 +319,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
327
319
|
* Cell values contains the (remote) Row Id, using the `getRemoteRowId`
|
|
328
320
|
* parameter. Alternatively, a custom function can be provided that produces
|
|
329
321
|
* your own remote Row Id from the local Row as a whole.
|
|
330
|
-
*
|
|
331
322
|
* @param relationshipId The Id of the Relationship to define.
|
|
332
323
|
* @param localTableId The Id of the local Table for the Relationship.
|
|
333
324
|
* @param remoteTableId The Id of the remote Table for the Relationship (or
|
|
@@ -403,6 +394,11 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
403
394
|
/**
|
|
404
395
|
* The delRelationshipDefinition method removes an existing Relationship
|
|
405
396
|
* definition.
|
|
397
|
+
* @param relationshipId The Id of the Relationship to remove.
|
|
398
|
+
* @returns A reference to the Relationships object.
|
|
399
|
+
* @example
|
|
400
|
+
* This example creates a Store, creates a Relationships object, defines a
|
|
401
|
+
* simple Relationship, and then removes it.
|
|
406
402
|
*
|
|
407
403
|
* This has schema-based typing. The following is a simplified representation:
|
|
408
404
|
*
|
|
@@ -410,12 +406,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
410
406
|
* delRelationshipDefinition(relationshipId: Id): Relationships;
|
|
411
407
|
* ```
|
|
412
408
|
*
|
|
413
|
-
* @param relationshipId The Id of the Relationship to remove.
|
|
414
|
-
* @returns A reference to the Relationships object.
|
|
415
|
-
* @example
|
|
416
|
-
* This example creates a Store, creates a Relationships object, defines a
|
|
417
|
-
* simple Relationship, and then removes it.
|
|
418
|
-
*
|
|
419
409
|
* ```js
|
|
420
410
|
* const store = createStore()
|
|
421
411
|
* .setTable('pets', {
|
|
@@ -449,6 +439,10 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
449
439
|
/**
|
|
450
440
|
* The getStore method returns a reference to the underlying Store that is
|
|
451
441
|
* backing this Relationships object.
|
|
442
|
+
* @returns A reference to the Store.
|
|
443
|
+
* @example
|
|
444
|
+
* This example creates a Relationships object against a newly-created Store
|
|
445
|
+
* and then gets its reference in order to update its data.
|
|
452
446
|
*
|
|
453
447
|
* This has schema-based typing. The following is a simplified representation:
|
|
454
448
|
*
|
|
@@ -456,11 +450,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
456
450
|
* getStore(): Store;
|
|
457
451
|
* ```
|
|
458
452
|
*
|
|
459
|
-
* @returns A reference to the Store.
|
|
460
|
-
* @example
|
|
461
|
-
* This example creates a Relationships object against a newly-created Store
|
|
462
|
-
* and then gets its reference in order to update its data.
|
|
463
|
-
*
|
|
464
453
|
* ```js
|
|
465
454
|
* const relationships = createRelationships(createStore());
|
|
466
455
|
* relationships.setRelationshipDefinition(
|
|
@@ -480,7 +469,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
480
469
|
/**
|
|
481
470
|
* The getRelationshipIds method returns an array of the Relationship Ids
|
|
482
471
|
* registered with this Relationships object.
|
|
483
|
-
*
|
|
484
472
|
* @returns An array of Ids.
|
|
485
473
|
* @example
|
|
486
474
|
* This example creates a Relationships object with two definitions, and then
|
|
@@ -512,7 +500,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
512
500
|
* RelationshipCallback function that will be called with the Id of each
|
|
513
501
|
* Relationship, and with a function that can then be used to iterate over
|
|
514
502
|
* each local Row involved in the Relationship.
|
|
515
|
-
*
|
|
516
503
|
* @param relationshipCallback The function that should be called for every
|
|
517
504
|
* Relationship.
|
|
518
505
|
* @example
|
|
@@ -551,7 +538,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
551
538
|
/**
|
|
552
539
|
* The hasRelationship method returns a boolean indicating whether a given
|
|
553
540
|
* Relationship exists in the Relationships object.
|
|
554
|
-
*
|
|
555
541
|
* @param relationshipId The Id of a possible Relationship in the
|
|
556
542
|
* Relationships object.
|
|
557
543
|
* @returns Whether a Relationship with that Id exists.
|
|
@@ -582,7 +568,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
582
568
|
* ```
|
|
583
569
|
*
|
|
584
570
|
* If the Relationship Id is invalid, the method returns `undefined`.
|
|
585
|
-
*
|
|
586
571
|
* @param relationshipId The Id of a Relationship.
|
|
587
572
|
* @returns The Id of the local Table backing the Relationship, or
|
|
588
573
|
* `undefined`.
|
|
@@ -622,7 +607,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
622
607
|
* ```
|
|
623
608
|
*
|
|
624
609
|
* If the Relationship Id is invalid, the method returns `undefined`.
|
|
625
|
-
*
|
|
626
610
|
* @param relationshipId The Id of a Relationship.
|
|
627
611
|
* @returns The Id of the remote Table backing the Relationship, or
|
|
628
612
|
* `undefined`.
|
|
@@ -657,7 +641,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
657
641
|
*
|
|
658
642
|
* If the identified Relationship or Row does not exist (or if the definition
|
|
659
643
|
* references a Table that does not exist) then `undefined` is returned.
|
|
660
|
-
*
|
|
661
644
|
* @param relationshipId The Id of the Relationship.
|
|
662
645
|
* @param localRowId The Id of the local Row in the Relationship.
|
|
663
646
|
* @returns The remote Row Id in the Relationship, or `undefined`.
|
|
@@ -704,7 +687,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
704
687
|
*
|
|
705
688
|
* If the identified Relationship or Row does not exist (or if the definition
|
|
706
689
|
* references a Table that does not exist) then an empty array is returned.
|
|
707
|
-
*
|
|
708
690
|
* @param relationshipId The Id of the Relationship.
|
|
709
691
|
* @param remoteRowId The Id of the remote Row in the Relationship.
|
|
710
692
|
* @returns The local Row Ids in the Relationship, or an empty array.
|
|
@@ -756,7 +738,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
756
738
|
* If the identified Relationship or Row does not exist (or if the definition
|
|
757
739
|
* references a Table that does not exist) then an array containing just the
|
|
758
740
|
* first Row Id is returned.
|
|
759
|
-
*
|
|
760
741
|
* @param relationshipId The Id of the Relationship.
|
|
761
742
|
* @param firstRowId The Id of the first Row in the linked list Relationship.
|
|
762
743
|
* @returns The linked Row Ids in the Relationship.
|
|
@@ -822,7 +803,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
822
803
|
* The provided listener is a RemoteRowIdListener function, and will be called
|
|
823
804
|
* with a reference to the Relationships object, the Id of the Relationship,
|
|
824
805
|
* and the Id of the local Row that had its remote Row change.
|
|
825
|
-
*
|
|
826
806
|
* @param relationshipId The Id of the Relationship to listen to, or `null` as
|
|
827
807
|
* a wildcard.
|
|
828
808
|
* @param localRowId The Id of the local Row to listen to, or `null` as a
|
|
@@ -963,7 +943,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
963
943
|
* The provided listener is a LocalRowIdsListener function, and will be called
|
|
964
944
|
* with a reference to the Relationships object, the Id of the Relationship,
|
|
965
945
|
* and the Id of the remote Row that had its local Row objects change.
|
|
966
|
-
*
|
|
967
946
|
* @param relationshipId The Id of the Relationship to listen to, or `null` as
|
|
968
947
|
* a wildcard.
|
|
969
948
|
* @param remoteRowId The Id of the remote Row to listen to, or `null` as a
|
|
@@ -1102,7 +1081,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1102
1081
|
* The provided listener is a LinkedRowIdsListener function, and will be
|
|
1103
1082
|
* called with a reference to the Relationships object, the Id of the
|
|
1104
1083
|
* Relationship, and the Id of the first Row that had its linked list change.
|
|
1105
|
-
*
|
|
1106
1084
|
* @param relationshipId The Id of the Relationship to listen to.
|
|
1107
1085
|
* @param firstRowId The Id of the first Row of the linked list to listen to.
|
|
1108
1086
|
* @param listener The function that will be called whenever the linked Row
|
|
@@ -1165,7 +1143,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1165
1143
|
* Use the Id returned by whichever method was used to add the listener. Note
|
|
1166
1144
|
* that the Relationships object may re-use this Id for future listeners added
|
|
1167
1145
|
* to it.
|
|
1168
|
-
*
|
|
1169
1146
|
* @param listenerId The Id of the listener to remove.
|
|
1170
1147
|
* @returns A reference to the Relationships object.
|
|
1171
1148
|
* @example
|
|
@@ -1220,7 +1197,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1220
1197
|
*
|
|
1221
1198
|
* This guarantees that all of the listeners that the object registered with
|
|
1222
1199
|
* the underlying Store are removed and it can be correctly garbage collected.
|
|
1223
|
-
*
|
|
1224
1200
|
* @example
|
|
1225
1201
|
* This example creates a Store, adds a Relationships object with a
|
|
1226
1202
|
* definition (that registers a RowListener with the underlying Store),
|
|
@@ -1270,7 +1246,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1270
1246
|
* return an empty object. The method is intended to be used during
|
|
1271
1247
|
* development to ensure your application is not leaking listener
|
|
1272
1248
|
* registrations, for example.
|
|
1273
|
-
*
|
|
1274
1249
|
* @returns A RelationshipsListenerStats object containing Relationships
|
|
1275
1250
|
* listener statistics.
|
|
1276
1251
|
* @example
|
|
@@ -1310,7 +1285,6 @@ export interface Relationships<in out Schemas extends OptionalSchemas> {
|
|
|
1310
1285
|
* A given Store can only have one Relationships object associated with it. If
|
|
1311
1286
|
* you call this function twice on the same Store, your second call will return
|
|
1312
1287
|
* a reference to the Relationships object created by the first.
|
|
1313
|
-
*
|
|
1314
1288
|
* @param store The Store for which to register Relationships.
|
|
1315
1289
|
* @returns A reference to the new Relationships object.
|
|
1316
1290
|
* @example
|