tinybase 3.1.0-beta.4 → 3.1.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/lib/debug/ui-react.js +2 -2
- package/lib/{checkpoints.d.ts → types/checkpoints.d.ts} +13 -13
- package/lib/{debug → types}/indexes.d.ts +10 -16
- package/lib/{debug → types}/metrics.d.ts +49 -50
- package/lib/{debug → types}/persisters.d.ts +26 -30
- package/lib/{cjs-es6 → types}/queries.d.ts +474 -309
- package/lib/{debug → types}/relationships.d.ts +11 -17
- package/lib/{debug → types}/store.d.ts +180 -1038
- package/lib/types/tinybase.d.ts +14 -0
- package/lib/{debug → types}/tools.d.ts +12 -12
- package/lib/{debug → types}/ui-react.d.ts +11 -5
- package/lib/{cjs-es6 → types/with-schemas}/checkpoints.d.ts +93 -7
- package/lib/{cjs → types/with-schemas}/indexes.d.ts +136 -18
- package/lib/types/with-schemas/internal/queries.d.ts +15 -0
- package/lib/types/with-schemas/internal/store.d.ts +101 -0
- package/lib/types/with-schemas/internal/ui-react.d.ts +776 -0
- package/lib/{cjs → types/with-schemas}/metrics.d.ts +115 -50
- package/lib/{cjs → types/with-schemas}/persisters.d.ts +102 -4
- package/lib/{debug → types/with-schemas}/queries.d.ts +865 -346
- package/lib/{cjs → types/with-schemas}/relationships.d.ts +151 -20
- package/lib/{cjs-es6 → types/with-schemas}/store.d.ts +1082 -801
- package/lib/types/with-schemas/tinybase.d.ts +14 -0
- package/lib/{cjs-es6 → types/with-schemas}/tools.d.ts +21 -10
- package/lib/{cjs-es6 → types/with-schemas}/ui-react.d.ts +1871 -1314
- package/package.json +145 -29
- package/readme.md +14 -14
- package/lib/cjs/checkpoints.d.ts +0 -961
- package/lib/cjs/queries.d.ts +0 -3028
- package/lib/cjs/store.d.ts +0 -6143
- package/lib/cjs/tinybase.d.ts +0 -14
- package/lib/cjs/tools.d.ts +0 -536
- package/lib/cjs/ui-react.d.ts +0 -10921
- package/lib/cjs-es6/indexes.d.ts +0 -974
- package/lib/cjs-es6/metrics.d.ts +0 -829
- package/lib/cjs-es6/persisters.d.ts +0 -733
- package/lib/cjs-es6/relationships.d.ts +0 -1209
- package/lib/cjs-es6/tinybase.d.ts +0 -14
- package/lib/common.d.ts +0 -115
- package/lib/debug/checkpoints.d.ts +0 -961
- package/lib/debug/common.d.ts +0 -115
- package/lib/debug/tinybase.d.ts +0 -14
- package/lib/es6/checkpoints.d.ts +0 -961
- package/lib/es6/common.d.ts +0 -115
- package/lib/es6/indexes.d.ts +0 -974
- package/lib/es6/metrics.d.ts +0 -829
- package/lib/es6/persisters.d.ts +0 -733
- package/lib/es6/queries.d.ts +0 -3028
- package/lib/es6/relationships.d.ts +0 -1209
- package/lib/es6/store.d.ts +0 -6143
- package/lib/es6/tinybase.d.ts +0 -14
- package/lib/es6/tools.d.ts +0 -536
- package/lib/es6/ui-react.d.ts +0 -10921
- package/lib/indexes.d.ts +0 -974
- package/lib/metrics.d.ts +0 -829
- package/lib/persisters.d.ts +0 -733
- package/lib/queries.d.ts +0 -3028
- package/lib/relationships.d.ts +0 -1209
- package/lib/store.d.ts +0 -6143
- package/lib/tinybase.d.ts +0 -14
- package/lib/tools.d.ts +0 -536
- package/lib/ui-react.d.ts +0 -10921
- package/lib/umd/checkpoints.d.ts +0 -961
- package/lib/umd/common.d.ts +0 -115
- package/lib/umd/indexes.d.ts +0 -974
- package/lib/umd/metrics.d.ts +0 -829
- package/lib/umd/persisters.d.ts +0 -733
- package/lib/umd/queries.d.ts +0 -3028
- package/lib/umd/relationships.d.ts +0 -1209
- package/lib/umd/store.d.ts +0 -6143
- package/lib/umd/tinybase.d.ts +0 -14
- package/lib/umd/tools.d.ts +0 -536
- package/lib/umd/ui-react.d.ts +0 -10921
- package/lib/umd-es6/checkpoints.d.ts +0 -961
- package/lib/umd-es6/common.d.ts +0 -115
- package/lib/umd-es6/indexes.d.ts +0 -974
- package/lib/umd-es6/metrics.d.ts +0 -829
- package/lib/umd-es6/persisters.d.ts +0 -733
- package/lib/umd-es6/queries.d.ts +0 -3028
- package/lib/umd-es6/relationships.d.ts +0 -1209
- package/lib/umd-es6/store.d.ts +0 -6143
- package/lib/umd-es6/tinybase.d.ts +0 -14
- package/lib/umd-es6/tools.d.ts +0 -536
- package/lib/umd-es6/ui-react.d.ts +0 -10921
- /package/lib/{cjs-es6 → types}/common.d.ts +0 -0
- /package/lib/{cjs → types/with-schemas}/common.d.ts +0 -0
|
@@ -26,7 +26,7 @@ import {Id, IdOrNull, Ids, Json} from './common.d';
|
|
|
26
26
|
* `pets`, in which each Row may contain a string `species` Cell, and is
|
|
27
27
|
* guaranteed to contain a boolean `sold` Cell that defaults to `false`.
|
|
28
28
|
*
|
|
29
|
-
|
|
29
|
+
* ```js
|
|
30
30
|
* const tableSchema: TablesSchema = {
|
|
31
31
|
* pets: {
|
|
32
32
|
* species: {type: 'string'},
|
|
@@ -57,7 +57,7 @@ export type TablesSchema = {[tableId: Id]: {[cellId: Id]: CellSchema}};
|
|
|
57
57
|
* When applied to a Store, this CellSchema ensures a boolean Cell is always
|
|
58
58
|
* present, and defaults it to `false`.
|
|
59
59
|
*
|
|
60
|
-
|
|
60
|
+
* ```js
|
|
61
61
|
* const requiredBoolean: CellSchema = {type: 'boolean', default: false};
|
|
62
62
|
* ```
|
|
63
63
|
* @category Schema
|
|
@@ -78,7 +78,7 @@ export type CellSchema =
|
|
|
78
78
|
* When applied to a Store, this ValuesSchema only allows one boolean Value
|
|
79
79
|
* called `open`, that defaults to `false`.
|
|
80
80
|
*
|
|
81
|
-
|
|
81
|
+
* ```js
|
|
82
82
|
* const valuesSchema: ValuesSchema = {
|
|
83
83
|
* open: {type: 'boolean', default: false},
|
|
84
84
|
* };
|
|
@@ -107,7 +107,7 @@ export type ValuesSchema = {[valueId: Id]: ValueSchema};
|
|
|
107
107
|
* When applied to a Store, this ValueSchema ensures a boolean Value is always
|
|
108
108
|
* present, and defaults it to `false`.
|
|
109
109
|
*
|
|
110
|
-
|
|
110
|
+
* ```js
|
|
111
111
|
* const requiredBoolean: ValueSchema = {type: 'boolean', default: false};
|
|
112
112
|
* ```
|
|
113
113
|
* @category Schema
|
|
@@ -122,10 +122,7 @@ export type ValueSchema =
|
|
|
122
122
|
* The NoTablesSchema type is a TablesSchema-like type for when one has not been
|
|
123
123
|
* provided.
|
|
124
124
|
*
|
|
125
|
-
*
|
|
126
|
-
* expected to need to use it directly.
|
|
127
|
-
*
|
|
128
|
-
* @category Internal
|
|
125
|
+
* @category Schema
|
|
129
126
|
*/
|
|
130
127
|
export type NoTablesSchema = {[tableId: Id]: {[cellId: Id]: {type: 'any'}}};
|
|
131
128
|
|
|
@@ -133,10 +130,7 @@ export type NoTablesSchema = {[tableId: Id]: {[cellId: Id]: {type: 'any'}}};
|
|
|
133
130
|
* The NoValuesSchema type is a ValuesSchema-like type for when one has not been
|
|
134
131
|
* provided.
|
|
135
132
|
*
|
|
136
|
-
*
|
|
137
|
-
* expected to need to use it directly.
|
|
138
|
-
*
|
|
139
|
-
* @category Internal
|
|
133
|
+
* @category Schema
|
|
140
134
|
*/
|
|
141
135
|
export type NoValuesSchema = {[valueId: Id]: {type: 'any'}};
|
|
142
136
|
|
|
@@ -176,10 +170,6 @@ export type NoSchemas = [NoTablesSchema, NoValuesSchema];
|
|
|
176
170
|
* The Tables type is the data structure representing all of the data in a
|
|
177
171
|
* Store.
|
|
178
172
|
*
|
|
179
|
-
* ```ts override
|
|
180
|
-
* {[tableId: Id]: Table}
|
|
181
|
-
* ```
|
|
182
|
-
*
|
|
183
173
|
* A Tables object is used when setting all of the tables together with the
|
|
184
174
|
* setTables method, and when getting them back out again with the getTables
|
|
185
175
|
* method. A Tables object is a regular JavaScript object containing individual
|
|
@@ -200,18 +190,11 @@ export type NoSchemas = [NoTablesSchema, NoValuesSchema];
|
|
|
200
190
|
* ```
|
|
201
191
|
* @category Store
|
|
202
192
|
*/
|
|
203
|
-
export type Tables
|
|
204
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
205
|
-
WhenSet extends boolean = false,
|
|
206
|
-
> = TablesFromSchema<Schema, WhenSet>;
|
|
193
|
+
export type Tables = {[tableId: Id]: Table};
|
|
207
194
|
|
|
208
195
|
/**
|
|
209
196
|
* The Table type is the data structure representing the data in a single table.
|
|
210
197
|
*
|
|
211
|
-
* ```ts override
|
|
212
|
-
* {[rowId: Id]: Row}
|
|
213
|
-
* ```
|
|
214
|
-
*
|
|
215
198
|
* A Table is used when setting a table with the setTable method, and when
|
|
216
199
|
* getting it back out again with the getTable method. A Table object is a
|
|
217
200
|
* regular JavaScript object containing individual Row objects, keyed by their
|
|
@@ -226,19 +209,11 @@ export type Tables<
|
|
|
226
209
|
* ```
|
|
227
210
|
* @category Store
|
|
228
211
|
*/
|
|
229
|
-
export type Table
|
|
230
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
231
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
232
|
-
WhenSet extends boolean = false,
|
|
233
|
-
> = TableFromSchema<Schema, TableId, WhenSet>;
|
|
212
|
+
export type Table = {[rowId: Id]: Row};
|
|
234
213
|
|
|
235
214
|
/**
|
|
236
215
|
* The Row type is the data structure representing the data in a single row.
|
|
237
216
|
*
|
|
238
|
-
* ```ts override
|
|
239
|
-
* {[cellId: Id]: Cell}
|
|
240
|
-
* ```
|
|
241
|
-
*
|
|
242
217
|
* A Row is used when setting a row with the setRow method, and when getting it
|
|
243
218
|
* back out again with the getRow method. A Row object is a regular JavaScript
|
|
244
219
|
* object containing individual Cell objects, keyed by their Id.
|
|
@@ -249,19 +224,11 @@ export type Table<
|
|
|
249
224
|
* ```
|
|
250
225
|
* @category Store
|
|
251
226
|
*/
|
|
252
|
-
export type Row
|
|
253
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
254
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
255
|
-
WhenSet extends boolean = false,
|
|
256
|
-
> = RowFromSchema<Schema, TableId, WhenSet>;
|
|
227
|
+
export type Row = {[cellId: Id]: Cell};
|
|
257
228
|
|
|
258
229
|
/**
|
|
259
230
|
* The Cell type is the data structure representing the data in a single cell.
|
|
260
231
|
*
|
|
261
|
-
* ```ts override
|
|
262
|
-
* string | number | boolean
|
|
263
|
-
* ```
|
|
264
|
-
*
|
|
265
232
|
* A Cell is used when setting a cell with the setCell method, and when getting
|
|
266
233
|
* it back out again with the getCell method. A Cell is a JavaScript string,
|
|
267
234
|
* number, or boolean.
|
|
@@ -272,14 +239,7 @@ export type Row<
|
|
|
272
239
|
* ```
|
|
273
240
|
* @category Store
|
|
274
241
|
*/
|
|
275
|
-
export type Cell
|
|
276
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
277
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
278
|
-
CellId extends CellIdFromSchema<Schema, TableId> = CellIdFromSchema<
|
|
279
|
-
Schema,
|
|
280
|
-
TableId
|
|
281
|
-
>,
|
|
282
|
-
> = CellFromSchema<Schema, TableId, CellId>;
|
|
242
|
+
export type Cell = string | number | boolean;
|
|
283
243
|
|
|
284
244
|
/**
|
|
285
245
|
* The CellOrUndefined type is a data structure representing the data in a
|
|
@@ -291,24 +251,12 @@ export type Cell<
|
|
|
291
251
|
*
|
|
292
252
|
* @category Store
|
|
293
253
|
*/
|
|
294
|
-
export type CellOrUndefined
|
|
295
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
296
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
297
|
-
CellId extends CellIdFromSchema<Schema, TableId> = CellIdFromSchema<
|
|
298
|
-
Schema,
|
|
299
|
-
TableId
|
|
300
|
-
>,
|
|
301
|
-
Cell = CellFromSchema<Schema, TableId, CellId>,
|
|
302
|
-
> = Cell | undefined;
|
|
254
|
+
export type CellOrUndefined = Cell | undefined;
|
|
303
255
|
|
|
304
256
|
/**
|
|
305
257
|
* The Values type is the data structure representing all the keyed values in a
|
|
306
258
|
* Store.
|
|
307
259
|
*
|
|
308
|
-
* ```ts override
|
|
309
|
-
* {[valueId: Id]: Value}
|
|
310
|
-
* ```
|
|
311
|
-
*
|
|
312
260
|
* A Values object is used when setting values with the setValues method, and
|
|
313
261
|
* when getting them back out again with the getValues method. A Values object
|
|
314
262
|
* is a regular JavaScript object containing individual Value objects, keyed by
|
|
@@ -321,19 +269,12 @@ export type CellOrUndefined<
|
|
|
321
269
|
* @category Store
|
|
322
270
|
* @since v3.0.0
|
|
323
271
|
*/
|
|
324
|
-
export type Values
|
|
325
|
-
Schema extends OptionalValuesSchema = NoValuesSchema,
|
|
326
|
-
WhenSet extends boolean = false,
|
|
327
|
-
> = ValuesFromSchema<Schema, WhenSet>;
|
|
272
|
+
export type Values = {[valueId: Id]: Value};
|
|
328
273
|
|
|
329
274
|
/**
|
|
330
275
|
* The Value type is the data structure representing the data in a single keyed
|
|
331
276
|
* value.
|
|
332
277
|
*
|
|
333
|
-
* ```ts override
|
|
334
|
-
* string | number | boolean
|
|
335
|
-
* ```
|
|
336
|
-
*
|
|
337
278
|
* A Value is used when setting a value with the setValue method, and when
|
|
338
279
|
* getting it back out again with the getValue method. A Value is a JavaScript
|
|
339
280
|
* string, number, or boolean.
|
|
@@ -345,10 +286,7 @@ export type Values<
|
|
|
345
286
|
* @category Store
|
|
346
287
|
* @since v3.0.0
|
|
347
288
|
*/
|
|
348
|
-
export type Value
|
|
349
|
-
Schema extends OptionalValuesSchema = NoValuesSchema,
|
|
350
|
-
ValueId extends ValueIdFromSchema<Schema> = ValueIdFromSchema<Schema>,
|
|
351
|
-
> = ValueFromSchema<Schema, ValueId>;
|
|
289
|
+
export type Value = string | number | boolean;
|
|
352
290
|
|
|
353
291
|
/**
|
|
354
292
|
* The ValueOrUndefined type is a data structure representing the data in a
|
|
@@ -361,11 +299,7 @@ export type Value<
|
|
|
361
299
|
* @category Store
|
|
362
300
|
* @since v3.0.0
|
|
363
301
|
*/
|
|
364
|
-
export type ValueOrUndefined
|
|
365
|
-
Schema extends OptionalValuesSchema = NoValuesSchema,
|
|
366
|
-
ValueId extends ValueIdFromSchema<Schema> = ValueIdFromSchema<Schema>,
|
|
367
|
-
Value = ValueFromSchema<Schema, ValueId>,
|
|
368
|
-
> = Value | undefined;
|
|
302
|
+
export type ValueOrUndefined = Value | undefined;
|
|
369
303
|
|
|
370
304
|
/**
|
|
371
305
|
* The TableCallback type describes a function that takes a Table's Id and a
|
|
@@ -380,12 +314,9 @@ export type ValueOrUndefined<
|
|
|
380
314
|
* in this Table.
|
|
381
315
|
* @category Callback
|
|
382
316
|
*/
|
|
383
|
-
export type TableCallback
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
> = (
|
|
387
|
-
tableId: TableId,
|
|
388
|
-
forEachRow: (rowCallback: RowCallback<Schema, TableId>) => void,
|
|
317
|
+
export type TableCallback = (
|
|
318
|
+
tableId: Id,
|
|
319
|
+
forEachRow: (rowCallback: RowCallback) => void,
|
|
389
320
|
) => void;
|
|
390
321
|
|
|
391
322
|
/**
|
|
@@ -401,12 +332,9 @@ export type TableCallback<
|
|
|
401
332
|
* in this Row.
|
|
402
333
|
* @category Callback
|
|
403
334
|
*/
|
|
404
|
-
export type RowCallback
|
|
405
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
406
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
407
|
-
> = (
|
|
335
|
+
export type RowCallback = (
|
|
408
336
|
rowId: Id,
|
|
409
|
-
forEachCell: (cellCallback: CellCallback
|
|
337
|
+
forEachCell: (cellCallback: CellCallback) => void,
|
|
410
338
|
) => void;
|
|
411
339
|
|
|
412
340
|
/**
|
|
@@ -421,14 +349,7 @@ export type RowCallback<
|
|
|
421
349
|
* @param cell The value of the Cell.
|
|
422
350
|
* @category Callback
|
|
423
351
|
*/
|
|
424
|
-
export type CellCallback
|
|
425
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
426
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
427
|
-
CellId extends CellIdFromSchema<Schema, TableId> = CellIdFromSchema<
|
|
428
|
-
Schema,
|
|
429
|
-
TableId
|
|
430
|
-
>,
|
|
431
|
-
> = (cellId: CellId, cell: Cell<Schema, TableId, CellId>) => void;
|
|
352
|
+
export type CellCallback = (cellId: Id, cell: Cell) => void;
|
|
432
353
|
|
|
433
354
|
/**
|
|
434
355
|
* The ValueCallback type describes a function that takes a Value's Id and its
|
|
@@ -443,10 +364,7 @@ export type CellCallback<
|
|
|
443
364
|
* @category Callback
|
|
444
365
|
* @since v3.0.0
|
|
445
366
|
*/
|
|
446
|
-
export type ValueCallback
|
|
447
|
-
Schema extends OptionalValuesSchema = NoValuesSchema,
|
|
448
|
-
ValueId extends ValueIdFromSchema<Schema> = ValueIdFromSchema<Schema>,
|
|
449
|
-
> = (valueId: ValueId, value: Value<Schema, ValueId>) => void;
|
|
367
|
+
export type ValueCallback = (valueId: Id, value: Value) => void;
|
|
450
368
|
|
|
451
369
|
/**
|
|
452
370
|
* The MapCell type describes a function that takes an existing Cell value and
|
|
@@ -459,16 +377,7 @@ export type ValueCallback<
|
|
|
459
377
|
* @param cell The current value of the Cell to map to a new value.
|
|
460
378
|
* @category Callback
|
|
461
379
|
*/
|
|
462
|
-
export type MapCell
|
|
463
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
464
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
465
|
-
CellId extends CellIdFromSchema<Schema, TableId> = CellIdFromSchema<
|
|
466
|
-
Schema,
|
|
467
|
-
TableId
|
|
468
|
-
>,
|
|
469
|
-
> = (
|
|
470
|
-
cell: CellOrUndefined<Schema, TableId, CellId>,
|
|
471
|
-
) => Cell<Schema, TableId, CellId>;
|
|
380
|
+
export type MapCell = (cell: CellOrUndefined) => Cell;
|
|
472
381
|
|
|
473
382
|
/**
|
|
474
383
|
* The MapValue type describes a function that takes an existing Value and
|
|
@@ -482,10 +391,7 @@ export type MapCell<
|
|
|
482
391
|
* @category Callback
|
|
483
392
|
* @since v3.0.0
|
|
484
393
|
*/
|
|
485
|
-
export type MapValue
|
|
486
|
-
Schema extends OptionalValuesSchema = NoValuesSchema,
|
|
487
|
-
ValueId extends ValueIdFromSchema<Schema> = ValueIdFromSchema<Schema>,
|
|
488
|
-
> = (value: ValueOrUndefined<Schema, ValueId>) => Value<Schema, ValueId>;
|
|
394
|
+
export type MapValue = (value: ValueOrUndefined) => Value;
|
|
489
395
|
|
|
490
396
|
/**
|
|
491
397
|
* The GetCell type describes a function that takes a Id and returns the Cell
|
|
@@ -498,14 +404,7 @@ export type MapValue<
|
|
|
498
404
|
* @param cellId The Id of the Cell to fetch the value for.
|
|
499
405
|
* @category Callback
|
|
500
406
|
*/
|
|
501
|
-
export type GetCell
|
|
502
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
503
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
504
|
-
CellId extends CellIdFromSchema<Schema, TableId> = CellIdFromSchema<
|
|
505
|
-
Schema,
|
|
506
|
-
TableId
|
|
507
|
-
>,
|
|
508
|
-
> = (cellId: CellId) => CellOrUndefined<Schema, TableId, CellId>;
|
|
407
|
+
export type GetCell = (cellId: Id) => CellOrUndefined;
|
|
509
408
|
|
|
510
409
|
/**
|
|
511
410
|
* The DoRollback type describes a function that you can use to rollback the
|
|
@@ -526,14 +425,10 @@ export type GetCell<
|
|
|
526
425
|
* @param invalidValues Any invalid attempts to change Values, since v3.0.0.
|
|
527
426
|
* @category Callback
|
|
528
427
|
*/
|
|
529
|
-
export type DoRollback
|
|
530
|
-
|
|
531
|
-
TablesSchema extends OptionalTablesSchema = Schemas[0],
|
|
532
|
-
ValuesSchema extends OptionalValuesSchema = Schemas[1],
|
|
533
|
-
> = (
|
|
534
|
-
changedCells: ChangedCells<TablesSchema>,
|
|
428
|
+
export type DoRollback = (
|
|
429
|
+
changedCells: ChangedCells,
|
|
535
430
|
invalidCells: InvalidCells,
|
|
536
|
-
changedValues: ChangedValues
|
|
431
|
+
changedValues: ChangedValues,
|
|
537
432
|
invalidValues: InvalidValues,
|
|
538
433
|
) => boolean;
|
|
539
434
|
|
|
@@ -563,8 +458,8 @@ export type DoRollback<
|
|
|
563
458
|
* since v3.0.0.
|
|
564
459
|
* @category Listener
|
|
565
460
|
*/
|
|
566
|
-
export type TransactionListener
|
|
567
|
-
store: Store
|
|
461
|
+
export type TransactionListener = (
|
|
462
|
+
store: Store,
|
|
568
463
|
cellsTouched: boolean,
|
|
569
464
|
valuesTouched: boolean,
|
|
570
465
|
) => void;
|
|
@@ -589,12 +484,9 @@ export type TransactionListener<Schemas extends OptionalSchemas = NoSchemas> = (
|
|
|
589
484
|
* changes.
|
|
590
485
|
* @category Listener
|
|
591
486
|
*/
|
|
592
|
-
export type TablesListener
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
> = (
|
|
596
|
-
store: Store<Schemas>,
|
|
597
|
-
getCellChange: GetCellChange<TablesSchema> | undefined,
|
|
487
|
+
export type TablesListener = (
|
|
488
|
+
store: Store,
|
|
489
|
+
getCellChange: GetCellChange | undefined,
|
|
598
490
|
) => void;
|
|
599
491
|
|
|
600
492
|
/**
|
|
@@ -609,9 +501,7 @@ export type TablesListener<
|
|
|
609
501
|
* @param store A reference to the Store that changed.
|
|
610
502
|
* @category Listener
|
|
611
503
|
*/
|
|
612
|
-
export type TableIdsListener
|
|
613
|
-
store: Store<Schemas>,
|
|
614
|
-
) => void;
|
|
504
|
+
export type TableIdsListener = (store: Store) => void;
|
|
615
505
|
|
|
616
506
|
/**
|
|
617
507
|
* The TableListener type describes a function that is used to listen to changes
|
|
@@ -634,19 +524,10 @@ export type TableIdsListener<Schemas extends OptionalSchemas = NoSchemas> = (
|
|
|
634
524
|
* changes.
|
|
635
525
|
* @category Listener
|
|
636
526
|
*/
|
|
637
|
-
export type TableListener
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
> | null = TableIdFromSchema<Schemas[0]> | null,
|
|
642
|
-
TableId = TableIdOrNull extends null
|
|
643
|
-
? TableIdFromSchema<Schemas[0]>
|
|
644
|
-
: TableIdOrNull,
|
|
645
|
-
TablesSchema extends OptionalTablesSchema = Schemas[0],
|
|
646
|
-
> = (
|
|
647
|
-
store: Store<Schemas>,
|
|
648
|
-
tableId: TableId,
|
|
649
|
-
getCellChange: GetCellChange<TablesSchema> | undefined,
|
|
527
|
+
export type TableListener = (
|
|
528
|
+
store: Store,
|
|
529
|
+
tableId: Id,
|
|
530
|
+
getCellChange: GetCellChange | undefined,
|
|
650
531
|
) => void;
|
|
651
532
|
|
|
652
533
|
/**
|
|
@@ -663,15 +544,7 @@ export type TableListener<
|
|
|
663
544
|
* @param tableId The Id of the Table that changed.
|
|
664
545
|
* @category Listener
|
|
665
546
|
*/
|
|
666
|
-
export type RowIdsListener
|
|
667
|
-
Schemas extends OptionalSchemas = NoSchemas,
|
|
668
|
-
TableIdOrNull extends TableIdFromSchema<
|
|
669
|
-
Schemas[0]
|
|
670
|
-
> | null = TableIdFromSchema<Schemas[0]> | null,
|
|
671
|
-
TableId = TableIdOrNull extends null
|
|
672
|
-
? TableIdFromSchema<Schemas[0]>
|
|
673
|
-
: TableIdOrNull,
|
|
674
|
-
> = (store: Store<Schemas>, tableId: TableId) => void;
|
|
547
|
+
export type RowIdsListener = (store: Store, tableId: Id) => void;
|
|
675
548
|
|
|
676
549
|
/**
|
|
677
550
|
* The SortedRowIdsListener type describes a function that is used to listen to
|
|
@@ -697,22 +570,13 @@ export type RowIdsListener<
|
|
|
697
570
|
* @category Listener
|
|
698
571
|
* @since v2.0.0
|
|
699
572
|
*/
|
|
700
|
-
export type SortedRowIdsListener
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
Offset extends number = number,
|
|
708
|
-
Limit extends number | undefined = number | undefined,
|
|
709
|
-
> = (
|
|
710
|
-
store: Store<Schemas>,
|
|
711
|
-
tableId: TableId,
|
|
712
|
-
cellId: CellId,
|
|
713
|
-
descending: Descending,
|
|
714
|
-
offset: Offset,
|
|
715
|
-
limit: Limit,
|
|
573
|
+
export type SortedRowIdsListener = (
|
|
574
|
+
store: Store,
|
|
575
|
+
tableId: Id,
|
|
576
|
+
cellId: Id | undefined,
|
|
577
|
+
descending: boolean,
|
|
578
|
+
offset: number,
|
|
579
|
+
limit: number | undefined,
|
|
716
580
|
sortedRowIds: Ids,
|
|
717
581
|
) => void;
|
|
718
582
|
|
|
@@ -739,22 +603,11 @@ export type SortedRowIdsListener<
|
|
|
739
603
|
* changes.
|
|
740
604
|
* @category Listener
|
|
741
605
|
*/
|
|
742
|
-
export type RowListener
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
RowIdOrNull extends IdOrNull = IdOrNull,
|
|
748
|
-
TableId = TableIdOrNull extends null
|
|
749
|
-
? TableIdFromSchema<Schemas[0]>
|
|
750
|
-
: TableIdOrNull,
|
|
751
|
-
RowId = RowIdOrNull extends null ? Id : RowIdOrNull,
|
|
752
|
-
TablesSchema extends OptionalTablesSchema = Schemas[0],
|
|
753
|
-
> = (
|
|
754
|
-
store: Store<Schemas>,
|
|
755
|
-
tableId: TableId,
|
|
756
|
-
rowId: RowId,
|
|
757
|
-
getCellChange: GetCellChange<TablesSchema> | undefined,
|
|
606
|
+
export type RowListener = (
|
|
607
|
+
store: Store,
|
|
608
|
+
tableId: Id,
|
|
609
|
+
rowId: Id,
|
|
610
|
+
getCellChange: GetCellChange | undefined,
|
|
758
611
|
) => void;
|
|
759
612
|
|
|
760
613
|
/**
|
|
@@ -772,17 +625,7 @@ export type RowListener<
|
|
|
772
625
|
* @param rowId The Id of the Row that changed.
|
|
773
626
|
* @category Listener
|
|
774
627
|
*/
|
|
775
|
-
export type CellIdsListener
|
|
776
|
-
Schemas extends OptionalSchemas = NoSchemas,
|
|
777
|
-
TableIdOrNull extends TableIdFromSchema<
|
|
778
|
-
Schemas[0]
|
|
779
|
-
> | null = TableIdFromSchema<Schemas[0]> | null,
|
|
780
|
-
RowIdOrNull extends IdOrNull = null,
|
|
781
|
-
TableId = TableIdOrNull extends null
|
|
782
|
-
? TableIdFromSchema<Schemas[0]>
|
|
783
|
-
: TableIdOrNull,
|
|
784
|
-
RowId = RowIdOrNull extends null ? Id : RowIdOrNull,
|
|
785
|
-
> = (store: Store<Schemas>, tableId: TableId, rowId: RowId) => void;
|
|
628
|
+
export type CellIdsListener = (store: Store, tableId: Id, rowId: Id) => void;
|
|
786
629
|
|
|
787
630
|
/**
|
|
788
631
|
* The CellListener type describes a function that is used to listen to changes
|
|
@@ -812,40 +655,14 @@ export type CellIdsListener<
|
|
|
812
655
|
* changes.
|
|
813
656
|
* @category Listener
|
|
814
657
|
*/
|
|
815
|
-
export type CellListener
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
RowIdOrNull extends IdOrNull = IdOrNull,
|
|
821
|
-
CellIdOrNull extends
|
|
822
|
-
| (TableIdOrNull extends TableIdFromSchema<Schemas[0]>
|
|
823
|
-
? CellIdFromSchema<Schemas[0], TableIdOrNull>
|
|
824
|
-
: AllCellIdFromSchema<Schemas[0]>)
|
|
825
|
-
| null =
|
|
826
|
-
| (TableIdOrNull extends TableIdFromSchema<Schemas[0]>
|
|
827
|
-
? CellIdFromSchema<Schemas[0], TableIdOrNull>
|
|
828
|
-
: AllCellIdFromSchema<Schemas[0]>)
|
|
829
|
-
| null,
|
|
830
|
-
TableId extends Id = TableIdOrNull extends null
|
|
831
|
-
? TableIdFromSchema<Schemas[0]>
|
|
832
|
-
: TableIdOrNull,
|
|
833
|
-
RowId = RowIdOrNull extends null ? Id : RowIdOrNull,
|
|
834
|
-
CellId extends Id = CellIdOrNull extends null
|
|
835
|
-
? TableIdOrNull extends TableIdFromSchema<Schemas[0]>
|
|
836
|
-
? CellIdFromSchema<Schemas[0], TableIdOrNull>
|
|
837
|
-
: AllCellIdFromSchema<Schemas[0]>
|
|
838
|
-
: CellIdOrNull,
|
|
839
|
-
Cell = CellFromSchema<Schemas[0], TableId, CellId>,
|
|
840
|
-
TablesSchema extends OptionalTablesSchema = Schemas[0],
|
|
841
|
-
> = (
|
|
842
|
-
store: Store<Schemas>,
|
|
843
|
-
tableId: TableId,
|
|
844
|
-
rowId: RowId,
|
|
845
|
-
cellId: CellId,
|
|
658
|
+
export type CellListener = (
|
|
659
|
+
store: Store,
|
|
660
|
+
tableId: Id,
|
|
661
|
+
rowId: Id,
|
|
662
|
+
cellId: Id,
|
|
846
663
|
newCell: Cell,
|
|
847
664
|
oldCell: Cell,
|
|
848
|
-
getCellChange: GetCellChange
|
|
665
|
+
getCellChange: GetCellChange | undefined,
|
|
849
666
|
) => void;
|
|
850
667
|
|
|
851
668
|
/**
|
|
@@ -868,12 +685,9 @@ export type CellListener<
|
|
|
868
685
|
* changes.
|
|
869
686
|
* @category Listener
|
|
870
687
|
*/
|
|
871
|
-
export type ValuesListener
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
> = (
|
|
875
|
-
store: Store<Schemas>,
|
|
876
|
-
getValueChange: GetValueChange<ValuesSchema> | undefined,
|
|
688
|
+
export type ValuesListener = (
|
|
689
|
+
store: Store,
|
|
690
|
+
getValueChange: GetValueChange | undefined,
|
|
877
691
|
) => void;
|
|
878
692
|
|
|
879
693
|
/**
|
|
@@ -888,9 +702,7 @@ export type ValuesListener<
|
|
|
888
702
|
* @param store A reference to the Store that changed.
|
|
889
703
|
* @category Listener
|
|
890
704
|
*/
|
|
891
|
-
export type ValueIdsListener
|
|
892
|
-
store: Store<Schemas>,
|
|
893
|
-
) => void;
|
|
705
|
+
export type ValueIdsListener = (store: Store) => void;
|
|
894
706
|
|
|
895
707
|
/**
|
|
896
708
|
* The ValueListener type describes a function that is used to listen to changes
|
|
@@ -918,22 +730,12 @@ export type ValueIdsListener<Schemas extends OptionalSchemas = NoSchemas> = (
|
|
|
918
730
|
* @category Listener
|
|
919
731
|
* @since v3.0.0
|
|
920
732
|
*/
|
|
921
|
-
export type ValueListener
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
Schemas[1]
|
|
925
|
-
> | null = ValueIdFromSchema<Schemas[1]> | null,
|
|
926
|
-
ValueId extends Id = ValueIdOrNull extends null
|
|
927
|
-
? ValueIdFromSchema<Schemas[1]>
|
|
928
|
-
: ValueIdOrNull,
|
|
929
|
-
Value = ValueFromSchema<Schemas[1], ValueId>,
|
|
930
|
-
ValuesSchema extends OptionalValuesSchema = Schemas[1],
|
|
931
|
-
> = (
|
|
932
|
-
store: Store<Schemas>,
|
|
933
|
-
valueId: ValueId,
|
|
733
|
+
export type ValueListener = (
|
|
734
|
+
store: Store,
|
|
735
|
+
valueId: Id,
|
|
934
736
|
newValue: Value,
|
|
935
737
|
oldValue: Value,
|
|
936
|
-
getValueChange: GetValueChange
|
|
738
|
+
getValueChange: GetValueChange | undefined,
|
|
937
739
|
) => void;
|
|
938
740
|
|
|
939
741
|
/**
|
|
@@ -958,8 +760,8 @@ export type ValueListener<
|
|
|
958
760
|
* @category Listener
|
|
959
761
|
* @since v1.1.0
|
|
960
762
|
*/
|
|
961
|
-
export type InvalidCellListener
|
|
962
|
-
store: Store
|
|
763
|
+
export type InvalidCellListener = (
|
|
764
|
+
store: Store,
|
|
963
765
|
tableId: Id,
|
|
964
766
|
rowId: Id,
|
|
965
767
|
cellId: Id,
|
|
@@ -986,8 +788,11 @@ export type InvalidCellListener<Schemas extends OptionalSchemas = NoSchemas> = (
|
|
|
986
788
|
* @category Listener
|
|
987
789
|
* @since v3.0.0
|
|
988
790
|
*/
|
|
989
|
-
export type InvalidValueListener
|
|
990
|
-
|
|
791
|
+
export type InvalidValueListener = (
|
|
792
|
+
store: Store,
|
|
793
|
+
valueId: Id,
|
|
794
|
+
invalidValues: any[],
|
|
795
|
+
) => void;
|
|
991
796
|
|
|
992
797
|
/**
|
|
993
798
|
* The GetCellChange type describes a function that returns information about
|
|
@@ -1004,16 +809,7 @@ export type InvalidValueListener<Schemas extends OptionalSchemas = NoSchemas> =
|
|
|
1004
809
|
* @returns A CellChange array containing information about the Cell's changes.
|
|
1005
810
|
* @category Listener
|
|
1006
811
|
*/
|
|
1007
|
-
export type GetCellChange
|
|
1008
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
1009
|
-
> = <
|
|
1010
|
-
TableId extends TableIdFromSchema<Schema>,
|
|
1011
|
-
CellId extends CellIdFromSchema<Schema, TableId>,
|
|
1012
|
-
>(
|
|
1013
|
-
tableId: TableId,
|
|
1014
|
-
rowId: Id,
|
|
1015
|
-
cellId: CellId,
|
|
1016
|
-
) => CellChange<Schema, TableId, CellId>;
|
|
812
|
+
export type GetCellChange = (tableId: Id, rowId: Id, cellId: Id) => CellChange;
|
|
1017
813
|
|
|
1018
814
|
/**
|
|
1019
815
|
* The CellChange type describes a Cell's changes during a transaction.
|
|
@@ -1025,15 +821,11 @@ export type GetCellChange<
|
|
|
1025
821
|
*
|
|
1026
822
|
* @category Listener
|
|
1027
823
|
*/
|
|
1028
|
-
export type CellChange
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
TableId
|
|
1034
|
-
>,
|
|
1035
|
-
CellOrUndefined = Cell<Schema, TableId, CellId> | undefined,
|
|
1036
|
-
> = [changed: boolean, oldCell: CellOrUndefined, newCell: CellOrUndefined];
|
|
824
|
+
export type CellChange = [
|
|
825
|
+
changed: boolean,
|
|
826
|
+
oldCell: CellOrUndefined,
|
|
827
|
+
newCell: CellOrUndefined,
|
|
828
|
+
];
|
|
1037
829
|
|
|
1038
830
|
/**
|
|
1039
831
|
* The GetValueChange type describes a function that returns information about
|
|
@@ -1049,11 +841,7 @@ export type CellChange<
|
|
|
1049
841
|
* changes.
|
|
1050
842
|
* @category Listener
|
|
1051
843
|
*/
|
|
1052
|
-
export type GetValueChange
|
|
1053
|
-
Schema extends OptionalValuesSchema = NoValuesSchema,
|
|
1054
|
-
> = <ValueId extends ValueIdFromSchema<Schema>>(
|
|
1055
|
-
valueId: ValueId,
|
|
1056
|
-
) => ValueChange<Schema, ValueId>;
|
|
844
|
+
export type GetValueChange = (valueId: Id) => ValueChange;
|
|
1057
845
|
|
|
1058
846
|
/**
|
|
1059
847
|
* The ValueChange type describes a Value's changes during a transaction.
|
|
@@ -1065,27 +853,17 @@ export type GetValueChange<
|
|
|
1065
853
|
*
|
|
1066
854
|
* @category Listener
|
|
1067
855
|
*/
|
|
1068
|
-
export type ValueChange
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
ValueOrUndefined
|
|
1072
|
-
|
|
856
|
+
export type ValueChange = [
|
|
857
|
+
changed: boolean,
|
|
858
|
+
oldValue: ValueOrUndefined,
|
|
859
|
+
newValue: ValueOrUndefined,
|
|
860
|
+
];
|
|
1073
861
|
|
|
1074
862
|
/**
|
|
1075
863
|
* The ChangedCells type describes the Cell values that have been changed during
|
|
1076
864
|
* a transaction, primarily used so that you can indicate whether the
|
|
1077
865
|
* transaction should be rolled back.
|
|
1078
866
|
*
|
|
1079
|
-
* ```ts override
|
|
1080
|
-
* {
|
|
1081
|
-
* [tableId: Id]: {
|
|
1082
|
-
* [rowId: Id]: {
|
|
1083
|
-
* [cellId: Id]: [CellOrUndefined, CellOrUndefined],
|
|
1084
|
-
* },
|
|
1085
|
-
* },
|
|
1086
|
-
* }
|
|
1087
|
-
* ```
|
|
1088
|
-
*
|
|
1089
867
|
* A ChangedCells object is provided to the `doRollback` callback when using the
|
|
1090
868
|
* transaction method and the finishTransaction method. See those methods for
|
|
1091
869
|
* specific examples.
|
|
@@ -1106,17 +884,13 @@ export type ValueChange<
|
|
|
1106
884
|
* @category Transaction
|
|
1107
885
|
* @since v1.2.0
|
|
1108
886
|
*/
|
|
1109
|
-
export type ChangedCells
|
|
1110
|
-
{
|
|
1111
|
-
[
|
|
1112
|
-
[
|
|
1113
|
-
[CellId in CellIdFromSchema<Schema, TableId>]?: [
|
|
1114
|
-
CellOrUndefined<Schema, TableId, CellId>,
|
|
1115
|
-
CellOrUndefined<Schema, TableId, CellId>,
|
|
1116
|
-
];
|
|
1117
|
-
};
|
|
887
|
+
export type ChangedCells = {
|
|
888
|
+
[tableId: Id]: {
|
|
889
|
+
[rowId: Id]: {
|
|
890
|
+
[cellId: Id]: [CellOrUndefined, CellOrUndefined];
|
|
1118
891
|
};
|
|
1119
892
|
};
|
|
893
|
+
};
|
|
1120
894
|
|
|
1121
895
|
/**
|
|
1122
896
|
* The InvalidCells type describes the invalid Cell values that have been
|
|
@@ -1148,10 +922,6 @@ export type InvalidCells = {
|
|
|
1148
922
|
* transaction, primarily used so that you can indicate whether the transaction
|
|
1149
923
|
* should be rolled back.
|
|
1150
924
|
*
|
|
1151
|
-
* ```ts override
|
|
1152
|
-
* {[valueId: Id]: [ValueOrUndefined, ValueOrUndefined]}
|
|
1153
|
-
* ```
|
|
1154
|
-
*
|
|
1155
925
|
* A ChangedValues object is provided to the `doRollback` callback when using
|
|
1156
926
|
* the transaction method and the finishTransaction method. See those methods
|
|
1157
927
|
* for specific examples.
|
|
@@ -1171,14 +941,10 @@ export type InvalidCells = {
|
|
|
1171
941
|
* @category Transaction
|
|
1172
942
|
* @since v3.0.0
|
|
1173
943
|
*/
|
|
1174
|
-
export type ChangedValues
|
|
1175
|
-
|
|
1176
|
-
> = {
|
|
1177
|
-
[ValueId in ValueIdFromSchema<Schema>]?: [
|
|
1178
|
-
ValueOrUndefined<Schema, ValueId>,
|
|
1179
|
-
ValueOrUndefined<Schema, ValueId>,
|
|
1180
|
-
];
|
|
944
|
+
export type ChangedValues = {
|
|
945
|
+
[valueId: Id]: [ValueOrUndefined, ValueOrUndefined];
|
|
1181
946
|
};
|
|
947
|
+
|
|
1182
948
|
/**
|
|
1183
949
|
* The InvalidValues type describes the invalid Values that have been attempted
|
|
1184
950
|
* during a transaction, primarily used so that you can indicate whether the
|
|
@@ -1406,13 +1172,6 @@ export type StoreListenerStats = {
|
|
|
1406
1172
|
* getSchemaJson method, and remove the schemas altogether with the
|
|
1407
1173
|
* delValuesSchema method and delTablesSchema method.
|
|
1408
1174
|
*
|
|
1409
|
-
* Throughout this API documentation, you will see the generic type parameter
|
|
1410
|
-
* `Schemas`, which refers to a pair of TablesSchema and ValuesSchema
|
|
1411
|
-
* respectively. These can be used on the Store interface to constrain its
|
|
1412
|
-
* methods, for example. This type parameter is defaulted if not provided, and
|
|
1413
|
-
* so if you are using a Store without schemas, you can ignore it and use the
|
|
1414
|
-
* Store type bare.
|
|
1415
|
-
*
|
|
1416
1175
|
* Read more about schemas in the Using Schemas guide.
|
|
1417
1176
|
*
|
|
1418
1177
|
* # Convenience methods
|
|
@@ -1459,7 +1218,8 @@ export type StoreListenerStats = {
|
|
|
1459
1218
|
* @see Todo App demos
|
|
1460
1219
|
* @category Store
|
|
1461
1220
|
*/
|
|
1462
|
-
export interface Store
|
|
1221
|
+
export interface Store {
|
|
1222
|
+
//
|
|
1463
1223
|
/**
|
|
1464
1224
|
* The getTables method returns a Tables object containing the entire data of
|
|
1465
1225
|
* the Store.
|
|
@@ -1489,13 +1249,9 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1489
1249
|
* console.log(store.getTables());
|
|
1490
1250
|
* // -> {}
|
|
1491
1251
|
* ```
|
|
1492
|
-
* @see
|
|
1493
|
-
* # Guides
|
|
1494
|
-
* Creating a Store
|
|
1495
|
-
* @see Indexes
|
|
1496
1252
|
* @category Getter
|
|
1497
1253
|
*/
|
|
1498
|
-
getTables
|
|
1254
|
+
getTables(): Tables;
|
|
1499
1255
|
|
|
1500
1256
|
/**
|
|
1501
1257
|
* The getTableIds method returns the Ids of every Table in the Store.
|
|
@@ -1526,7 +1282,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1526
1282
|
* ```
|
|
1527
1283
|
* @category Getter
|
|
1528
1284
|
*/
|
|
1529
|
-
getTableIds
|
|
1285
|
+
getTableIds(): Ids;
|
|
1530
1286
|
|
|
1531
1287
|
/**
|
|
1532
1288
|
* The getTable method returns an object containing the entire data of a
|
|
@@ -1560,12 +1316,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1560
1316
|
* ```
|
|
1561
1317
|
* @category Getter
|
|
1562
1318
|
*/
|
|
1563
|
-
getTable
|
|
1564
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
1565
|
-
Table = TableFromSchema<Schemas[0]>,
|
|
1566
|
-
>(
|
|
1567
|
-
tableId: TableId,
|
|
1568
|
-
): Table;
|
|
1319
|
+
getTable(tableId: Id): Table;
|
|
1569
1320
|
|
|
1570
1321
|
/**
|
|
1571
1322
|
* The getRowIds method returns the Ids of every Row in a given Table.
|
|
@@ -1599,9 +1350,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1599
1350
|
* ```
|
|
1600
1351
|
* @category Getter
|
|
1601
1352
|
*/
|
|
1602
|
-
getRowIds
|
|
1603
|
-
tableId: TableId,
|
|
1604
|
-
): Ids;
|
|
1353
|
+
getRowIds(tableId: Id): Ids;
|
|
1605
1354
|
|
|
1606
1355
|
/**
|
|
1607
1356
|
* The getSortedRowIds method returns the Ids of every Row in a given Table,
|
|
@@ -1702,12 +1451,9 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1702
1451
|
* @category Getter
|
|
1703
1452
|
* @since v2.0.0
|
|
1704
1453
|
*/
|
|
1705
|
-
getSortedRowIds
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
>(
|
|
1709
|
-
tableId: TableId,
|
|
1710
|
-
cellId?: CellId,
|
|
1454
|
+
getSortedRowIds(
|
|
1455
|
+
tableId: Id,
|
|
1456
|
+
cellId?: Id,
|
|
1711
1457
|
descending?: boolean,
|
|
1712
1458
|
offset?: number,
|
|
1713
1459
|
limit?: number,
|
|
@@ -1748,13 +1494,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1748
1494
|
* ```
|
|
1749
1495
|
* @category Getter
|
|
1750
1496
|
*/
|
|
1751
|
-
getRow
|
|
1752
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
1753
|
-
Row = RowFromSchema<Schemas[0], TableId>,
|
|
1754
|
-
>(
|
|
1755
|
-
tableId: TableId,
|
|
1756
|
-
rowId: Id,
|
|
1757
|
-
): Row;
|
|
1497
|
+
getRow(tableId: Id, rowId: Id): Row;
|
|
1758
1498
|
|
|
1759
1499
|
/**
|
|
1760
1500
|
* The getCellIds method returns the Ids of every Cell in a given Row, in a
|
|
@@ -1789,13 +1529,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1789
1529
|
* ```
|
|
1790
1530
|
* @category Getter
|
|
1791
1531
|
*/
|
|
1792
|
-
getCellIds
|
|
1793
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
1794
|
-
Ids extends CellIdFromSchema<Schemas[0], TableId>[],
|
|
1795
|
-
>(
|
|
1796
|
-
tableId: TableId,
|
|
1797
|
-
rowId: Id,
|
|
1798
|
-
): Ids;
|
|
1532
|
+
getCellIds(tableId: Id, rowId: Id): Ids;
|
|
1799
1533
|
|
|
1800
1534
|
/**
|
|
1801
1535
|
* The getCell method returns the value of a single Cell in a given Row, in a
|
|
@@ -1825,15 +1559,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1825
1559
|
* ```
|
|
1826
1560
|
* @category Getter
|
|
1827
1561
|
*/
|
|
1828
|
-
getCell
|
|
1829
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
1830
|
-
CellId extends CellIdFromSchema<Schemas[0], TableId>,
|
|
1831
|
-
CellOrUndefined = CellFromSchema<Schemas[0], TableId, CellId> | undefined,
|
|
1832
|
-
>(
|
|
1833
|
-
tableId: TableId,
|
|
1834
|
-
rowId: Id,
|
|
1835
|
-
cellId: CellId,
|
|
1836
|
-
): CellOrUndefined;
|
|
1562
|
+
getCell(tableId: Id, rowId: Id, cellId: Id): CellOrUndefined;
|
|
1837
1563
|
|
|
1838
1564
|
/**
|
|
1839
1565
|
* The getValues method returns an object containing the entire set of keyed
|
|
@@ -1864,7 +1590,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1864
1590
|
* @category Getter
|
|
1865
1591
|
* @since v3.0.0
|
|
1866
1592
|
*/
|
|
1867
|
-
getValues
|
|
1593
|
+
getValues(): Values;
|
|
1868
1594
|
|
|
1869
1595
|
/**
|
|
1870
1596
|
* The getValueIds method returns the Ids of every Value in a Store.
|
|
@@ -1893,7 +1619,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1893
1619
|
* @category Getter
|
|
1894
1620
|
* @since v3.0.0
|
|
1895
1621
|
*/
|
|
1896
|
-
getValueIds
|
|
1622
|
+
getValueIds(): Ids;
|
|
1897
1623
|
|
|
1898
1624
|
/**
|
|
1899
1625
|
* The getValue method returns a single keyed Value in the Store.
|
|
@@ -1919,12 +1645,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1919
1645
|
* @category Getter
|
|
1920
1646
|
* @since v3.0.0
|
|
1921
1647
|
*/
|
|
1922
|
-
getValue
|
|
1923
|
-
ValueId extends ValueIdFromSchema<Schemas[1]>,
|
|
1924
|
-
ValueOrUndefined = ValueFromSchema<Schemas[1], ValueId> | undefined,
|
|
1925
|
-
>(
|
|
1926
|
-
valueId: ValueId,
|
|
1927
|
-
): ValueOrUndefined;
|
|
1648
|
+
getValue(valueId: Id): ValueOrUndefined;
|
|
1928
1649
|
|
|
1929
1650
|
/**
|
|
1930
1651
|
* The hasTables method returns a boolean indicating whether any Table objects
|
|
@@ -1964,9 +1685,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1964
1685
|
* ```
|
|
1965
1686
|
* @category Getter
|
|
1966
1687
|
*/
|
|
1967
|
-
hasTable
|
|
1968
|
-
tableId: TableId,
|
|
1969
|
-
): boolean;
|
|
1688
|
+
hasTable(tableId: Id): boolean;
|
|
1970
1689
|
|
|
1971
1690
|
/**
|
|
1972
1691
|
* The hasRow method returns a boolean indicating whether a given Row exists
|
|
@@ -1987,10 +1706,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
1987
1706
|
* ```
|
|
1988
1707
|
* @category Getter
|
|
1989
1708
|
*/
|
|
1990
|
-
hasRow
|
|
1991
|
-
tableId: TableId,
|
|
1992
|
-
rowId: Id,
|
|
1993
|
-
): boolean;
|
|
1709
|
+
hasRow(tableId: Id, rowId: Id): boolean;
|
|
1994
1710
|
|
|
1995
1711
|
/**
|
|
1996
1712
|
* The hasCell method returns a boolean indicating whether a given Cell exists
|
|
@@ -2012,14 +1728,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2012
1728
|
* ```
|
|
2013
1729
|
* @category Getter
|
|
2014
1730
|
*/
|
|
2015
|
-
hasCell
|
|
2016
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
2017
|
-
CellId extends CellIdFromSchema<Schemas[0], TableId>,
|
|
2018
|
-
>(
|
|
2019
|
-
tableId: TableId,
|
|
2020
|
-
rowId: Id,
|
|
2021
|
-
cellId: CellId,
|
|
2022
|
-
): boolean;
|
|
1731
|
+
hasCell(tableId: Id, rowId: Id, cellId: Id): boolean;
|
|
2023
1732
|
|
|
2024
1733
|
/**
|
|
2025
1734
|
* The hasTables method returns a boolean indicating whether any Values exist
|
|
@@ -2061,9 +1770,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2061
1770
|
* @category Getter
|
|
2062
1771
|
* @since v3.0.0
|
|
2063
1772
|
*/
|
|
2064
|
-
hasValue
|
|
2065
|
-
valueId: ValueId,
|
|
2066
|
-
): boolean;
|
|
1773
|
+
hasValue(valueId: Id): boolean;
|
|
2067
1774
|
|
|
2068
1775
|
/**
|
|
2069
1776
|
* The getTablesJson method returns a string serialization of all of the
|
|
@@ -2302,9 +2009,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2302
2009
|
* ```
|
|
2303
2010
|
* @category Setter
|
|
2304
2011
|
*/
|
|
2305
|
-
setTables
|
|
2306
|
-
tables: Tables,
|
|
2307
|
-
): Store<Schemas>;
|
|
2012
|
+
setTables(tables: Tables): Store;
|
|
2308
2013
|
|
|
2309
2014
|
/**
|
|
2310
2015
|
* The setTable method takes an object and sets the entire data of a single
|
|
@@ -2355,13 +2060,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2355
2060
|
* ```
|
|
2356
2061
|
* @category Setter
|
|
2357
2062
|
*/
|
|
2358
|
-
setTable
|
|
2359
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
2360
|
-
Table = TableFromSchema<Schemas[0], TableId, true>,
|
|
2361
|
-
>(
|
|
2362
|
-
tableId: TableId,
|
|
2363
|
-
table: Table,
|
|
2364
|
-
): Store<Schemas>;
|
|
2063
|
+
setTable(tableId: Id, table: Table): Store;
|
|
2365
2064
|
|
|
2366
2065
|
/**
|
|
2367
2066
|
* The setRow method takes an object and sets the entire data of a single Row
|
|
@@ -2411,14 +2110,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2411
2110
|
* ```
|
|
2412
2111
|
* @category Setter
|
|
2413
2112
|
*/
|
|
2414
|
-
setRow
|
|
2415
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
2416
|
-
Row = RowFromSchema<Schemas[0], TableId, true>,
|
|
2417
|
-
>(
|
|
2418
|
-
tableId: TableId,
|
|
2419
|
-
rowId: Id,
|
|
2420
|
-
row: Row,
|
|
2421
|
-
): Store<Schemas>;
|
|
2113
|
+
setRow(tableId: Id, rowId: Id, row: Row): Store;
|
|
2422
2114
|
|
|
2423
2115
|
/**
|
|
2424
2116
|
* The addRow method takes an object and creates a new Row in the Store,
|
|
@@ -2471,13 +2163,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2471
2163
|
* ```
|
|
2472
2164
|
* @category Setter
|
|
2473
2165
|
*/
|
|
2474
|
-
addRow
|
|
2475
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
2476
|
-
Row = RowFromSchema<Schemas[0], TableId, true>,
|
|
2477
|
-
>(
|
|
2478
|
-
tableId: TableId,
|
|
2479
|
-
row: Row,
|
|
2480
|
-
): Id | undefined;
|
|
2166
|
+
addRow(tableId: Id, row: Row): Id | undefined;
|
|
2481
2167
|
|
|
2482
2168
|
/**
|
|
2483
2169
|
* The setPartialRow method takes an object and sets partial data of a single
|
|
@@ -2529,14 +2215,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2529
2215
|
* ```
|
|
2530
2216
|
* @category Setter
|
|
2531
2217
|
*/
|
|
2532
|
-
setPartialRow
|
|
2533
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
2534
|
-
Row = RowFromSchema<Schemas[0], TableId, true>,
|
|
2535
|
-
>(
|
|
2536
|
-
tableId: TableId,
|
|
2537
|
-
rowId: Id,
|
|
2538
|
-
partialRow: Row,
|
|
2539
|
-
): Store<Schemas>;
|
|
2218
|
+
setPartialRow(tableId: Id, rowId: Id, partialRow: Row): Store;
|
|
2540
2219
|
|
|
2541
2220
|
/**
|
|
2542
2221
|
* The setCell method sets the value of a single Cell in the Store.
|
|
@@ -2594,17 +2273,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2594
2273
|
* ```
|
|
2595
2274
|
* @category Setter
|
|
2596
2275
|
*/
|
|
2597
|
-
setCell
|
|
2598
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
2599
|
-
CellId extends CellIdFromSchema<Schemas[0], TableId>,
|
|
2600
|
-
Cell = CellFromSchema<Schemas[0], TableId, CellId>,
|
|
2601
|
-
MapCell = (cell: Cell | undefined) => Cell,
|
|
2602
|
-
>(
|
|
2603
|
-
tableId: TableId,
|
|
2604
|
-
rowId: Id,
|
|
2605
|
-
cellId: CellId,
|
|
2606
|
-
cell: Cell | MapCell,
|
|
2607
|
-
): Store<Schemas>;
|
|
2276
|
+
setCell(tableId: Id, rowId: Id, cellId: Id, cell: Cell | MapCell): Store;
|
|
2608
2277
|
|
|
2609
2278
|
/**
|
|
2610
2279
|
* The setValues method takes an object and sets all the Values in the Store.
|
|
@@ -2652,9 +2321,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2652
2321
|
* @category Setter
|
|
2653
2322
|
* @since v3.0.0
|
|
2654
2323
|
*/
|
|
2655
|
-
setValues
|
|
2656
|
-
values: Values,
|
|
2657
|
-
): Store<Schemas>;
|
|
2324
|
+
setValues(values: Values): Store;
|
|
2658
2325
|
|
|
2659
2326
|
/**
|
|
2660
2327
|
* The setPartialValues method takes an object and sets its Values in the
|
|
@@ -2704,9 +2371,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2704
2371
|
* @category Setter
|
|
2705
2372
|
* @since v3.0.0
|
|
2706
2373
|
*/
|
|
2707
|
-
setPartialValues
|
|
2708
|
-
partialValues: Values,
|
|
2709
|
-
): Store<Schemas>;
|
|
2374
|
+
setPartialValues(partialValues: Values): Store;
|
|
2710
2375
|
|
|
2711
2376
|
/**
|
|
2712
2377
|
* The setValue method sets a single keyed Value in the Store.
|
|
@@ -2760,14 +2425,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2760
2425
|
* @category Setter
|
|
2761
2426
|
* @since v3.0.0
|
|
2762
2427
|
*/
|
|
2763
|
-
setValue
|
|
2764
|
-
ValueId extends ValueIdFromSchema<Schemas[1]>,
|
|
2765
|
-
Value = ValueFromSchema<Schemas[1], ValueId>,
|
|
2766
|
-
MapValue = (value: Value | undefined) => Value,
|
|
2767
|
-
>(
|
|
2768
|
-
valueId: ValueId,
|
|
2769
|
-
value: Value | MapValue,
|
|
2770
|
-
): Store<Schemas>;
|
|
2428
|
+
setValue(valueId: Id, value: Value | MapValue): Store;
|
|
2771
2429
|
|
|
2772
2430
|
/**
|
|
2773
2431
|
* The setTablesJson method takes a string serialization of all of the Tables
|
|
@@ -2802,7 +2460,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2802
2460
|
* @category Setter
|
|
2803
2461
|
* @since v3.0.0
|
|
2804
2462
|
*/
|
|
2805
|
-
setTablesJson(tablesJson: Json): Store
|
|
2463
|
+
setTablesJson(tablesJson: Json): Store;
|
|
2806
2464
|
|
|
2807
2465
|
/**
|
|
2808
2466
|
* The setValuesJson method takes a string serialization of all of the Values
|
|
@@ -2837,7 +2495,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2837
2495
|
* @category Setter
|
|
2838
2496
|
* @since v3.0.0
|
|
2839
2497
|
*/
|
|
2840
|
-
setValuesJson(valuesJson: Json): Store
|
|
2498
|
+
setValuesJson(valuesJson: Json): Store;
|
|
2841
2499
|
|
|
2842
2500
|
/**
|
|
2843
2501
|
* The setJson method takes a string serialization of all of the Tables and
|
|
@@ -2896,24 +2554,16 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2896
2554
|
* ```
|
|
2897
2555
|
* @category Setter
|
|
2898
2556
|
*/
|
|
2899
|
-
setJson(tablesAndValuesJson: Json): Store
|
|
2557
|
+
setJson(tablesAndValuesJson: Json): Store;
|
|
2900
2558
|
|
|
2901
2559
|
/**
|
|
2902
2560
|
* The setTablesSchema method lets you specify the TablesSchema of the tabular
|
|
2903
2561
|
* part of the Store.
|
|
2904
2562
|
*
|
|
2905
|
-
* ```ts override
|
|
2906
|
-
* setTablesSchema(tablesSchema: TablesSchema): Store<Schemas>
|
|
2907
|
-
* ```
|
|
2908
|
-
*
|
|
2909
2563
|
* Note that this may result in a change to data in the Store, as defaults are
|
|
2910
2564
|
* applied or as invalid Table, Row, or Cell objects are removed. These
|
|
2911
2565
|
* changes will fire any listeners to that data, as expected.
|
|
2912
2566
|
*
|
|
2913
|
-
* This method will return a Store that is typed according to the schema that
|
|
2914
|
-
* you provided. To benefit from that, you may wish to assign it to a new
|
|
2915
|
-
* variable so that TypeScript is able to reason about its subsequent usage.
|
|
2916
|
-
*
|
|
2917
2567
|
* When no longer needed, you can also completely remove an existing
|
|
2918
2568
|
* TablesSchema with the delTablesSchema method.
|
|
2919
2569
|
*
|
|
@@ -2937,29 +2587,16 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2937
2587
|
* @category Setter
|
|
2938
2588
|
* @since v3.0.0
|
|
2939
2589
|
*/
|
|
2940
|
-
setTablesSchema
|
|
2941
|
-
TablesSchema extends TablesSchemaAlias,
|
|
2942
|
-
ValuesSchema extends OptionalValuesSchema = Schemas[1],
|
|
2943
|
-
>(
|
|
2944
|
-
tablesSchema: TablesSchema,
|
|
2945
|
-
): Store<[typeof tablesSchema, ValuesSchema]>;
|
|
2590
|
+
setTablesSchema(tablesSchema: TablesSchema): Store;
|
|
2946
2591
|
|
|
2947
2592
|
/**
|
|
2948
2593
|
* The setValuesSchema method lets you specify the ValuesSchema of the keyed
|
|
2949
2594
|
* Values part of the Store.
|
|
2950
2595
|
*
|
|
2951
|
-
* ```ts override
|
|
2952
|
-
* setValuesSchema(valuesSchema: ValuesSchema): Store<Schemas>
|
|
2953
|
-
* ```
|
|
2954
|
-
*
|
|
2955
2596
|
* Note that this may result in a change to data in the Store, as defaults are
|
|
2956
2597
|
* applied or as invalid Values are removed. These changes will fire any
|
|
2957
2598
|
* listeners to that data, as expected.
|
|
2958
2599
|
*
|
|
2959
|
-
* This method will return a Store that is typed according to the schema that
|
|
2960
|
-
* you provided. To benefit from that, you may wish to assign it to a new
|
|
2961
|
-
* variable so that TypeScript is able to reason about its subsequent usage.
|
|
2962
|
-
*
|
|
2963
2600
|
* When no longer needed, you can also completely remove an existing
|
|
2964
2601
|
* ValuesSchema with the delValuesSchema method.
|
|
2965
2602
|
*
|
|
@@ -2980,32 +2617,16 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
2980
2617
|
* @category Setter
|
|
2981
2618
|
* @since v3.0.0
|
|
2982
2619
|
*/
|
|
2983
|
-
setValuesSchema
|
|
2984
|
-
ValuesSchema extends ValuesSchemaAlias,
|
|
2985
|
-
TablesSchema extends OptionalTablesSchema = Schemas[0],
|
|
2986
|
-
>(
|
|
2987
|
-
valuesSchema: ValuesSchema,
|
|
2988
|
-
): Store<[TablesSchema, typeof valuesSchema]>;
|
|
2620
|
+
setValuesSchema(valuesSchema: ValuesSchema): Store;
|
|
2989
2621
|
|
|
2990
2622
|
/**
|
|
2991
2623
|
* The setSchema method lets you specify the TablesSchema and ValuesSchema of
|
|
2992
2624
|
* the Store.
|
|
2993
2625
|
*
|
|
2994
|
-
* ```ts override
|
|
2995
|
-
* setSchema(
|
|
2996
|
-
* tablesSchema: TablesSchema,
|
|
2997
|
-
* valuesSchema?: ValuesSchema,
|
|
2998
|
-
* ): Store<Schemas>
|
|
2999
|
-
* ```
|
|
3000
|
-
*
|
|
3001
2626
|
* Note that this may result in a change to data in the Store, as defaults are
|
|
3002
2627
|
* applied or as invalid Table, Row, Cell, or Value objects are removed. These
|
|
3003
2628
|
* changes will fire any listeners to that data, as expected.
|
|
3004
2629
|
*
|
|
3005
|
-
* This method will return a Store that is typed according to the schemas that
|
|
3006
|
-
* you provided. To benefit from that, you may wish to assign it to a new
|
|
3007
|
-
* variable so that TypeScript is able to reason about its subsequent usage.
|
|
3008
|
-
*
|
|
3009
2630
|
* From v3.0.0 onwards, this method takes two arguments. The first is the
|
|
3010
2631
|
* TablesSchema object, the second the ValuesSchema. In previous versions
|
|
3011
2632
|
* (before the existence of the ValuesSchema data structure), only the first
|
|
@@ -3055,20 +2676,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3055
2676
|
* ```
|
|
3056
2677
|
* @category Setter
|
|
3057
2678
|
*/
|
|
3058
|
-
setSchema
|
|
3059
|
-
TablesSchema extends TablesSchemaAlias,
|
|
3060
|
-
ValuesSchema extends ValuesSchemaAlias,
|
|
3061
|
-
>(
|
|
3062
|
-
tablesSchema: TablesSchema,
|
|
3063
|
-
valuesSchema?: ValuesSchema,
|
|
3064
|
-
): Store<
|
|
3065
|
-
[
|
|
3066
|
-
typeof tablesSchema,
|
|
3067
|
-
Exclude<ValuesSchemaAlias, typeof valuesSchema> extends never
|
|
3068
|
-
? NoValuesSchema
|
|
3069
|
-
: NonNullable<typeof valuesSchema>,
|
|
3070
|
-
]
|
|
3071
|
-
>;
|
|
2679
|
+
setSchema(tablesSchema: TablesSchema, valuesSchema?: ValuesSchema): Store;
|
|
3072
2680
|
|
|
3073
2681
|
/**
|
|
3074
2682
|
* The delTables method lets you remove all of the data in a Store.
|
|
@@ -3086,7 +2694,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3086
2694
|
* ```
|
|
3087
2695
|
* @category Deleter
|
|
3088
2696
|
*/
|
|
3089
|
-
delTables(): Store
|
|
2697
|
+
delTables(): Store;
|
|
3090
2698
|
|
|
3091
2699
|
/**
|
|
3092
2700
|
* The delTable method lets you remove a single Table from the Store.
|
|
@@ -3108,9 +2716,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3108
2716
|
* ```
|
|
3109
2717
|
* @category Deleter
|
|
3110
2718
|
*/
|
|
3111
|
-
delTable
|
|
3112
|
-
tableId: TableId,
|
|
3113
|
-
): Store<Schemas>;
|
|
2719
|
+
delTable(tableId: Id): Store;
|
|
3114
2720
|
|
|
3115
2721
|
/**
|
|
3116
2722
|
* The delRow method lets you remove a single Row from a Table.
|
|
@@ -3134,10 +2740,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3134
2740
|
* ```
|
|
3135
2741
|
* @category Deleter
|
|
3136
2742
|
*/
|
|
3137
|
-
delRow
|
|
3138
|
-
tableId: TableId,
|
|
3139
|
-
rowId: Id,
|
|
3140
|
-
): Store<Schemas>;
|
|
2743
|
+
delRow(tableId: Id, rowId: Id): Store;
|
|
3141
2744
|
|
|
3142
2745
|
/**
|
|
3143
2746
|
* The delCell method lets you remove a single Cell from a Row.
|
|
@@ -3221,15 +2824,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3221
2824
|
* ```
|
|
3222
2825
|
* @category Deleter
|
|
3223
2826
|
*/
|
|
3224
|
-
delCell
|
|
3225
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
3226
|
-
CellId extends CellIdFromSchema<Schemas[0], TableId>,
|
|
3227
|
-
>(
|
|
3228
|
-
tableId: TableId,
|
|
3229
|
-
rowId: Id,
|
|
3230
|
-
cellId: CellId,
|
|
3231
|
-
forceDel?: boolean,
|
|
3232
|
-
): Store<Schemas>;
|
|
2827
|
+
delCell(tableId: Id, rowId: Id, cellId: Id, forceDel?: boolean): Store;
|
|
3233
2828
|
|
|
3234
2829
|
/**
|
|
3235
2830
|
* The delValues method lets you remove all the Values from a Store.
|
|
@@ -3268,7 +2863,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3268
2863
|
* @category Deleter
|
|
3269
2864
|
* @since v3.0.0
|
|
3270
2865
|
*/
|
|
3271
|
-
delValues(): Store
|
|
2866
|
+
delValues(): Store;
|
|
3272
2867
|
|
|
3273
2868
|
/**
|
|
3274
2869
|
* The delValue method lets you remove a single Value from a Store.
|
|
@@ -3308,9 +2903,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3308
2903
|
* @category Deleter
|
|
3309
2904
|
* @since v3.0.0
|
|
3310
2905
|
*/
|
|
3311
|
-
delValue
|
|
3312
|
-
valueId: ValueId,
|
|
3313
|
-
): Store<Schemas>;
|
|
2906
|
+
delValue(valueId: Id): Store;
|
|
3314
2907
|
|
|
3315
2908
|
/**
|
|
3316
2909
|
* The delTablesSchema method lets you remove the TablesSchema of the Store.
|
|
@@ -3329,9 +2922,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3329
2922
|
* ```
|
|
3330
2923
|
* @category Deleter
|
|
3331
2924
|
*/
|
|
3332
|
-
delTablesSchema
|
|
3333
|
-
ValuesSchema extends OptionalValuesSchema = Schemas[1],
|
|
3334
|
-
>(): Store<[NoTablesSchema, ValuesSchema]>;
|
|
2925
|
+
delTablesSchema(): Store;
|
|
3335
2926
|
|
|
3336
2927
|
/**
|
|
3337
2928
|
* The delValuesSchema method lets you remove the ValuesSchema of the Store.
|
|
@@ -3351,9 +2942,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3351
2942
|
* @category Deleter
|
|
3352
2943
|
* @since v3.0.0
|
|
3353
2944
|
*/
|
|
3354
|
-
delValuesSchema
|
|
3355
|
-
TablesSchema extends OptionalTablesSchema = Schemas[0],
|
|
3356
|
-
>(): Store<[TablesSchema, NoValuesSchema]>;
|
|
2945
|
+
delValuesSchema(): Store;
|
|
3357
2946
|
|
|
3358
2947
|
/**
|
|
3359
2948
|
* The delSchema method lets you remove both the TablesSchema and ValuesSchema
|
|
@@ -3380,7 +2969,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3380
2969
|
* @category Deleter
|
|
3381
2970
|
* @since v3.0.0
|
|
3382
2971
|
*/
|
|
3383
|
-
delSchema(): Store
|
|
2972
|
+
delSchema(): Store;
|
|
3384
2973
|
|
|
3385
2974
|
/**
|
|
3386
2975
|
* The transaction method takes a function that makes multiple mutations to
|
|
@@ -3508,10 +3097,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3508
3097
|
* ```
|
|
3509
3098
|
* @category Transaction
|
|
3510
3099
|
*/
|
|
3511
|
-
transaction<Return>(
|
|
3512
|
-
actions: () => Return,
|
|
3513
|
-
doRollback?: DoRollback<Schemas>,
|
|
3514
|
-
): Return;
|
|
3100
|
+
transaction<Return>(actions: () => Return, doRollback?: DoRollback): Return;
|
|
3515
3101
|
|
|
3516
3102
|
/**
|
|
3517
3103
|
* The startTransaction method allows you to explicitly start a transaction
|
|
@@ -3562,7 +3148,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3562
3148
|
* @category Transaction
|
|
3563
3149
|
* @since v1.3.0
|
|
3564
3150
|
*/
|
|
3565
|
-
startTransaction(): Store
|
|
3151
|
+
startTransaction(): Store;
|
|
3566
3152
|
|
|
3567
3153
|
/**
|
|
3568
3154
|
* The finishTransaction method allows you to explicitly finish a transaction
|
|
@@ -3660,7 +3246,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3660
3246
|
* @category Transaction
|
|
3661
3247
|
* @since v1.3.0
|
|
3662
3248
|
*/
|
|
3663
|
-
finishTransaction(doRollback?: DoRollback
|
|
3249
|
+
finishTransaction(doRollback?: DoRollback): Store;
|
|
3664
3250
|
|
|
3665
3251
|
/**
|
|
3666
3252
|
* The forEachTable method takes a function that it will then call for each
|
|
@@ -3693,9 +3279,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3693
3279
|
* ```
|
|
3694
3280
|
* @category Iterator
|
|
3695
3281
|
*/
|
|
3696
|
-
forEachTable
|
|
3697
|
-
tableCallback: TableCallback,
|
|
3698
|
-
): void;
|
|
3282
|
+
forEachTable(tableCallback: TableCallback): void;
|
|
3699
3283
|
|
|
3700
3284
|
/**
|
|
3701
3285
|
* The forEachRow method takes a function that it will then call for each Row
|
|
@@ -3730,13 +3314,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3730
3314
|
* ```
|
|
3731
3315
|
* @category Iterator
|
|
3732
3316
|
*/
|
|
3733
|
-
forEachRow
|
|
3734
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
3735
|
-
RowCallback = RowCallbackAlias<Schemas[0], TableId>,
|
|
3736
|
-
>(
|
|
3737
|
-
tableId: TableId,
|
|
3738
|
-
rowCallback: RowCallback,
|
|
3739
|
-
): void;
|
|
3317
|
+
forEachRow(tableId: Id, rowCallback: RowCallback): void;
|
|
3740
3318
|
|
|
3741
3319
|
/**
|
|
3742
3320
|
* The forEachCell method takes a function that it will then call for each
|
|
@@ -3764,14 +3342,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3764
3342
|
* ```
|
|
3765
3343
|
* @category Iterator
|
|
3766
3344
|
*/
|
|
3767
|
-
forEachCell
|
|
3768
|
-
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
3769
|
-
CellCallback = CellCallbackAlias<Schemas[0], TableId>,
|
|
3770
|
-
>(
|
|
3771
|
-
tableId: TableId,
|
|
3772
|
-
rowId: Id,
|
|
3773
|
-
cellCallback: CellCallback,
|
|
3774
|
-
): void;
|
|
3345
|
+
forEachCell(tableId: Id, rowId: Id, cellCallback: CellCallback): void;
|
|
3775
3346
|
|
|
3776
3347
|
/**
|
|
3777
3348
|
* The forEachValue method takes a function that it will then call for each
|
|
@@ -3796,9 +3367,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3796
3367
|
* @category Iterator
|
|
3797
3368
|
* @since v3.0.0
|
|
3798
3369
|
*/
|
|
3799
|
-
forEachValue
|
|
3800
|
-
valueCallback: ValueCallback,
|
|
3801
|
-
): void;
|
|
3370
|
+
forEachValue(valueCallback: ValueCallback): void;
|
|
3802
3371
|
|
|
3803
3372
|
/**
|
|
3804
3373
|
* The addTablesListener method registers a listener function with the Store
|
|
@@ -3862,7 +3431,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3862
3431
|
* ```
|
|
3863
3432
|
* @category Listener
|
|
3864
3433
|
*/
|
|
3865
|
-
addTablesListener(listener: TablesListener
|
|
3434
|
+
addTablesListener(listener: TablesListener, mutator?: boolean): Id;
|
|
3866
3435
|
|
|
3867
3436
|
/**
|
|
3868
3437
|
* The addTableIdsListener method registers a listener function with the Store
|
|
@@ -3925,10 +3494,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
3925
3494
|
* ```
|
|
3926
3495
|
* @category Listener
|
|
3927
3496
|
*/
|
|
3928
|
-
addTableIdsListener(
|
|
3929
|
-
listener: TableIdsListener<Schemas>,
|
|
3930
|
-
mutator?: boolean,
|
|
3931
|
-
): Id;
|
|
3497
|
+
addTableIdsListener(listener: TableIdsListener, mutator?: boolean): Id;
|
|
3932
3498
|
|
|
3933
3499
|
/**
|
|
3934
3500
|
* The addTableListener method registers a listener function with the Store
|
|
@@ -4021,9 +3587,9 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4021
3587
|
* ```
|
|
4022
3588
|
* @category Listener
|
|
4023
3589
|
*/
|
|
4024
|
-
addTableListener
|
|
4025
|
-
tableId:
|
|
4026
|
-
listener: TableListener
|
|
3590
|
+
addTableListener(
|
|
3591
|
+
tableId: IdOrNull,
|
|
3592
|
+
listener: TableListener,
|
|
4027
3593
|
mutator?: boolean,
|
|
4028
3594
|
): Id;
|
|
4029
3595
|
|
|
@@ -4113,9 +3679,9 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4113
3679
|
* ```
|
|
4114
3680
|
* @category Listener
|
|
4115
3681
|
*/
|
|
4116
|
-
addRowIdsListener
|
|
4117
|
-
tableId:
|
|
4118
|
-
listener: RowIdsListener
|
|
3682
|
+
addRowIdsListener(
|
|
3683
|
+
tableId: IdOrNull,
|
|
3684
|
+
listener: RowIdsListener,
|
|
4119
3685
|
mutator?: boolean,
|
|
4120
3686
|
): Id;
|
|
4121
3687
|
|
|
@@ -4335,26 +3901,13 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4335
3901
|
* @category Listener
|
|
4336
3902
|
* @since v2.0.0
|
|
4337
3903
|
*/
|
|
4338
|
-
addSortedRowIdsListener
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
tableId: TableId,
|
|
4346
|
-
cellId: CellId,
|
|
4347
|
-
descending: Descending,
|
|
4348
|
-
offset: Offset,
|
|
4349
|
-
limit: Limit,
|
|
4350
|
-
listener: SortedRowIdsListener<
|
|
4351
|
-
Schemas,
|
|
4352
|
-
TableId,
|
|
4353
|
-
CellId,
|
|
4354
|
-
Descending,
|
|
4355
|
-
Offset,
|
|
4356
|
-
Limit
|
|
4357
|
-
>,
|
|
3904
|
+
addSortedRowIdsListener(
|
|
3905
|
+
tableId: Id,
|
|
3906
|
+
cellId: Id | undefined,
|
|
3907
|
+
descending: boolean,
|
|
3908
|
+
offset: number,
|
|
3909
|
+
limit: number | undefined,
|
|
3910
|
+
listener: SortedRowIdsListener,
|
|
4358
3911
|
mutator?: boolean,
|
|
4359
3912
|
): Id;
|
|
4360
3913
|
|
|
@@ -4461,13 +4014,10 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4461
4014
|
* ```
|
|
4462
4015
|
* @category Listener
|
|
4463
4016
|
*/
|
|
4464
|
-
addRowListener
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
tableId: TableIdOrNull,
|
|
4469
|
-
rowId: RowIdOrNull,
|
|
4470
|
-
listener: RowListener<Schemas, TableIdOrNull, RowIdOrNull>,
|
|
4017
|
+
addRowListener(
|
|
4018
|
+
tableId: IdOrNull,
|
|
4019
|
+
rowId: IdOrNull,
|
|
4020
|
+
listener: RowListener,
|
|
4471
4021
|
mutator?: boolean,
|
|
4472
4022
|
): Id;
|
|
4473
4023
|
|
|
@@ -4570,13 +4120,10 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4570
4120
|
* ```
|
|
4571
4121
|
* @category Listener
|
|
4572
4122
|
*/
|
|
4573
|
-
addCellIdsListener
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
tableId: TableIdOrNull,
|
|
4578
|
-
rowId: RowIdOrNull,
|
|
4579
|
-
listener: CellIdsListener<Schemas, TableIdOrNull, RowIdOrNull>,
|
|
4123
|
+
addCellIdsListener(
|
|
4124
|
+
tableId: IdOrNull,
|
|
4125
|
+
rowId: IdOrNull,
|
|
4126
|
+
listener: CellIdsListener,
|
|
4580
4127
|
mutator?: boolean,
|
|
4581
4128
|
): Id;
|
|
4582
4129
|
|
|
@@ -4692,24 +4239,10 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4692
4239
|
* ```
|
|
4693
4240
|
* @category Listener
|
|
4694
4241
|
*/
|
|
4695
|
-
addCellListener
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
| (TableIdOrNull extends TableIdFromSchema<Schemas[0]>
|
|
4700
|
-
? CellIdFromSchema<Schemas[0], TableIdOrNull>
|
|
4701
|
-
: AllCellIdFromSchema<Schemas[0]>)
|
|
4702
|
-
| null,
|
|
4703
|
-
CellListener extends CellListenerAlias<
|
|
4704
|
-
Schemas,
|
|
4705
|
-
TableIdOrNull,
|
|
4706
|
-
RowIdOrNull,
|
|
4707
|
-
CellIdOrNull
|
|
4708
|
-
>,
|
|
4709
|
-
>(
|
|
4710
|
-
tableId: TableIdOrNull,
|
|
4711
|
-
rowId: RowIdOrNull,
|
|
4712
|
-
cellId: CellIdOrNull,
|
|
4242
|
+
addCellListener(
|
|
4243
|
+
tableId: IdOrNull,
|
|
4244
|
+
rowId: IdOrNull,
|
|
4245
|
+
cellId: IdOrNull,
|
|
4713
4246
|
listener: CellListener,
|
|
4714
4247
|
mutator?: boolean,
|
|
4715
4248
|
): Id;
|
|
@@ -4773,7 +4306,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4773
4306
|
* @category Listener
|
|
4774
4307
|
* @since v3.0.0
|
|
4775
4308
|
*/
|
|
4776
|
-
addValuesListener(listener: ValuesListener
|
|
4309
|
+
addValuesListener(listener: ValuesListener, mutator?: boolean): Id;
|
|
4777
4310
|
|
|
4778
4311
|
/**
|
|
4779
4312
|
* The addValueIdsListener method registers a listener function with the Store
|
|
@@ -4837,10 +4370,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4837
4370
|
* @category Listener
|
|
4838
4371
|
* @since v3.0.0
|
|
4839
4372
|
*/
|
|
4840
|
-
addValueIdsListener(
|
|
4841
|
-
listener: ValueIdsListener<Schemas>,
|
|
4842
|
-
mutator?: boolean,
|
|
4843
|
-
): Id;
|
|
4373
|
+
addValueIdsListener(listener: ValueIdsListener, mutator?: boolean): Id;
|
|
4844
4374
|
|
|
4845
4375
|
/**
|
|
4846
4376
|
* The addValueListener method registers a listener function with the Store
|
|
@@ -4929,11 +4459,8 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
4929
4459
|
* @category Listener
|
|
4930
4460
|
* @since v3.0.0
|
|
4931
4461
|
*/
|
|
4932
|
-
addValueListener
|
|
4933
|
-
|
|
4934
|
-
ValueListener = ValueListenerAlias<Schemas, ValueIdOrNull>,
|
|
4935
|
-
>(
|
|
4936
|
-
valueId: ValueIdOrNull,
|
|
4462
|
+
addValueListener(
|
|
4463
|
+
valueId: IdOrNull,
|
|
4937
4464
|
listener: ValueListener,
|
|
4938
4465
|
mutator?: boolean,
|
|
4939
4466
|
): Id;
|
|
@@ -5165,7 +4692,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
5165
4692
|
tableId: IdOrNull,
|
|
5166
4693
|
rowId: IdOrNull,
|
|
5167
4694
|
cellId: IdOrNull,
|
|
5168
|
-
listener: InvalidCellListener
|
|
4695
|
+
listener: InvalidCellListener,
|
|
5169
4696
|
mutator?: boolean,
|
|
5170
4697
|
): Id;
|
|
5171
4698
|
|
|
@@ -5341,7 +4868,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
5341
4868
|
*/
|
|
5342
4869
|
addInvalidValueListener(
|
|
5343
4870
|
valueId: IdOrNull,
|
|
5344
|
-
listener: InvalidValueListener
|
|
4871
|
+
listener: InvalidValueListener,
|
|
5345
4872
|
mutator?: boolean,
|
|
5346
4873
|
): Id;
|
|
5347
4874
|
|
|
@@ -5435,7 +4962,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
5435
4962
|
* @category Listener
|
|
5436
4963
|
* @since v1.3.0
|
|
5437
4964
|
*/
|
|
5438
|
-
addWillFinishTransactionListener(listener: TransactionListener
|
|
4965
|
+
addWillFinishTransactionListener(listener: TransactionListener): Id;
|
|
5439
4966
|
|
|
5440
4967
|
/**
|
|
5441
4968
|
* The addDidFinishTransactionListener method registers a listener function
|
|
@@ -5528,7 +5055,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
5528
5055
|
* @category Listener
|
|
5529
5056
|
* @since v1.3.0
|
|
5530
5057
|
*/
|
|
5531
|
-
addDidFinishTransactionListener(listener: TransactionListener
|
|
5058
|
+
addDidFinishTransactionListener(listener: TransactionListener): Id;
|
|
5532
5059
|
|
|
5533
5060
|
/**
|
|
5534
5061
|
* The callListener method provides a way for you to manually provoke a
|
|
@@ -5645,7 +5172,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
5645
5172
|
* ```
|
|
5646
5173
|
* @category Listener
|
|
5647
5174
|
*/
|
|
5648
|
-
callListener(listenerId: Id): Store
|
|
5175
|
+
callListener(listenerId: Id): Store;
|
|
5649
5176
|
|
|
5650
5177
|
/**
|
|
5651
5178
|
* The delListener method removes a listener that was previously added to the
|
|
@@ -5678,7 +5205,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
5678
5205
|
* ```
|
|
5679
5206
|
* @category Listener
|
|
5680
5207
|
*/
|
|
5681
|
-
delListener(listenerId: Id): Store
|
|
5208
|
+
delListener(listenerId: Id): Store;
|
|
5682
5209
|
|
|
5683
5210
|
/**
|
|
5684
5211
|
* The getListenerStats method provides a set of statistics about the
|
|
@@ -5710,6 +5237,7 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
5710
5237
|
* @category Development
|
|
5711
5238
|
*/
|
|
5712
5239
|
getListenerStats(): StoreListenerStats;
|
|
5240
|
+
//
|
|
5713
5241
|
}
|
|
5714
5242
|
|
|
5715
5243
|
/**
|
|
@@ -5755,389 +5283,3 @@ export interface Store<Schemas extends OptionalSchemas = NoSchemas> {
|
|
|
5755
5283
|
* @category Creation
|
|
5756
5284
|
*/
|
|
5757
5285
|
export function createStore(): Store;
|
|
5758
|
-
|
|
5759
|
-
/**
|
|
5760
|
-
* The TablesFromSchema type is a utility for determining a Tables structure
|
|
5761
|
-
* from a provided TablesSchema.
|
|
5762
|
-
*
|
|
5763
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5764
|
-
* expected to need to use it directly.
|
|
5765
|
-
*
|
|
5766
|
-
* @category Internal
|
|
5767
|
-
*/
|
|
5768
|
-
export type TablesFromSchema<
|
|
5769
|
-
Schema extends OptionalTablesSchema,
|
|
5770
|
-
WhenSet extends boolean = false,
|
|
5771
|
-
> = {
|
|
5772
|
-
-readonly [TableId in TableIdFromSchema<Schema>]?: TableFromSchema<
|
|
5773
|
-
Schema,
|
|
5774
|
-
TableId,
|
|
5775
|
-
WhenSet
|
|
5776
|
-
>;
|
|
5777
|
-
};
|
|
5778
|
-
|
|
5779
|
-
/**
|
|
5780
|
-
* The TableIdFromSchema type is a utility for determining the Id of Tables from
|
|
5781
|
-
* a provided TablesSchema.
|
|
5782
|
-
*
|
|
5783
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5784
|
-
* expected to need to use it directly.
|
|
5785
|
-
*
|
|
5786
|
-
* @category Internal
|
|
5787
|
-
*/
|
|
5788
|
-
export type TableIdFromSchema<Schema extends OptionalTablesSchema> = AsId<
|
|
5789
|
-
keyof Schema
|
|
5790
|
-
>;
|
|
5791
|
-
|
|
5792
|
-
/**
|
|
5793
|
-
* The TableFromSchema type is a utility for determining a Table structure from
|
|
5794
|
-
* a provided TablesSchema.
|
|
5795
|
-
*
|
|
5796
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5797
|
-
* expected to need to use it directly.
|
|
5798
|
-
*
|
|
5799
|
-
* @category Internal
|
|
5800
|
-
*/
|
|
5801
|
-
export type TableFromSchema<
|
|
5802
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
5803
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
5804
|
-
WhenSet extends boolean = false,
|
|
5805
|
-
> = {[rowId: Id]: RowFromSchema<Schema, TableId, WhenSet>};
|
|
5806
|
-
|
|
5807
|
-
/**
|
|
5808
|
-
* The RowFromSchema type is a utility for determining a Row structure from a
|
|
5809
|
-
* provided TablesSchema.
|
|
5810
|
-
*
|
|
5811
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5812
|
-
* expected to need to use it directly.
|
|
5813
|
-
*
|
|
5814
|
-
* @category Internal
|
|
5815
|
-
*/
|
|
5816
|
-
export type RowFromSchema<
|
|
5817
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
5818
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
5819
|
-
WhenSet extends boolean = false,
|
|
5820
|
-
> = (WhenSet extends true
|
|
5821
|
-
? {
|
|
5822
|
-
-readonly [CellId in DefaultCellIdFromSchema<
|
|
5823
|
-
Schema,
|
|
5824
|
-
TableId
|
|
5825
|
-
>]?: CellFromSchema<Schema, TableId, CellId>;
|
|
5826
|
-
}
|
|
5827
|
-
: {
|
|
5828
|
-
-readonly [CellId in DefaultCellIdFromSchema<
|
|
5829
|
-
Schema,
|
|
5830
|
-
TableId
|
|
5831
|
-
>]: CellFromSchema<Schema, TableId, CellId>;
|
|
5832
|
-
}) & {
|
|
5833
|
-
-readonly [CellId in DefaultCellIdFromSchema<
|
|
5834
|
-
Schema,
|
|
5835
|
-
TableId,
|
|
5836
|
-
false
|
|
5837
|
-
>]?: CellFromSchema<Schema, TableId, CellId>;
|
|
5838
|
-
};
|
|
5839
|
-
|
|
5840
|
-
/**
|
|
5841
|
-
* The CellIdFromSchema type is a utility for determining the Id of Cells from a
|
|
5842
|
-
* provided TablesSchema.
|
|
5843
|
-
*
|
|
5844
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5845
|
-
* expected to need to use it directly.
|
|
5846
|
-
*
|
|
5847
|
-
* @category Internal
|
|
5848
|
-
*/
|
|
5849
|
-
export type CellIdFromSchema<
|
|
5850
|
-
Schema extends OptionalTablesSchema,
|
|
5851
|
-
TableId extends TableIdFromSchema<Schema>,
|
|
5852
|
-
> = AsId<keyof Schema[TableId]>;
|
|
5853
|
-
|
|
5854
|
-
/**
|
|
5855
|
-
* The DefaultCellIdFromSchema type is a utility for determining Cells with or
|
|
5856
|
-
* without default status from a provided TablesSchema.
|
|
5857
|
-
*
|
|
5858
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5859
|
-
* expected to need to use it directly.
|
|
5860
|
-
*
|
|
5861
|
-
* @category Internal
|
|
5862
|
-
*/
|
|
5863
|
-
export type DefaultCellIdFromSchema<
|
|
5864
|
-
Schema extends OptionalTablesSchema,
|
|
5865
|
-
TableId extends TableIdFromSchema<Schema>,
|
|
5866
|
-
IsDefaulted extends boolean = true,
|
|
5867
|
-
> = AsId<
|
|
5868
|
-
{
|
|
5869
|
-
[CellId in CellIdFromSchema<
|
|
5870
|
-
Schema,
|
|
5871
|
-
TableId
|
|
5872
|
-
>]: Schema[TableId][CellId] extends {
|
|
5873
|
-
default: string | number | boolean;
|
|
5874
|
-
}
|
|
5875
|
-
? IsDefaulted extends true
|
|
5876
|
-
? CellId
|
|
5877
|
-
: never
|
|
5878
|
-
: IsDefaulted extends true
|
|
5879
|
-
? never
|
|
5880
|
-
: CellId;
|
|
5881
|
-
}[CellIdFromSchema<Schema, TableId>]
|
|
5882
|
-
>;
|
|
5883
|
-
|
|
5884
|
-
/**
|
|
5885
|
-
* The AllCellIdFromSchema type is a utility for determining the Id of Cells
|
|
5886
|
-
* across all Tables, from a provided TablesSchema.
|
|
5887
|
-
*
|
|
5888
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5889
|
-
* expected to need to use it directly.
|
|
5890
|
-
*
|
|
5891
|
-
* @category Internal
|
|
5892
|
-
*/
|
|
5893
|
-
export type AllCellIdFromSchema<
|
|
5894
|
-
Schema extends OptionalTablesSchema,
|
|
5895
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
5896
|
-
> = TableId extends TableIdFromSchema<Schema>
|
|
5897
|
-
? CellIdFromSchema<Schema, TableId>
|
|
5898
|
-
: never;
|
|
5899
|
-
|
|
5900
|
-
/**
|
|
5901
|
-
* The CellFromSchema type is a utility for determining a Cell type from a
|
|
5902
|
-
* provided TablesSchema.
|
|
5903
|
-
*
|
|
5904
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5905
|
-
* expected to need to use it directly.
|
|
5906
|
-
*
|
|
5907
|
-
* @category Internal
|
|
5908
|
-
*/
|
|
5909
|
-
export type CellFromSchema<
|
|
5910
|
-
Schema extends OptionalTablesSchema,
|
|
5911
|
-
TableId extends TableIdFromSchema<Schema>,
|
|
5912
|
-
CellId extends CellIdFromSchema<Schema, TableId>,
|
|
5913
|
-
CellType = Schema[TableId][CellId]['type'],
|
|
5914
|
-
> = CellType extends 'string'
|
|
5915
|
-
? string
|
|
5916
|
-
: CellType extends 'number'
|
|
5917
|
-
? number
|
|
5918
|
-
: CellType extends 'boolean'
|
|
5919
|
-
? boolean
|
|
5920
|
-
: string | number | boolean;
|
|
5921
|
-
|
|
5922
|
-
/**
|
|
5923
|
-
* The ValuesFromSchema type is a utility for determining a Values structure
|
|
5924
|
-
* from a provided ValuesSchema.
|
|
5925
|
-
*
|
|
5926
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5927
|
-
* expected to need to use it directly.
|
|
5928
|
-
*
|
|
5929
|
-
* @category Internal
|
|
5930
|
-
*/
|
|
5931
|
-
export type ValuesFromSchema<
|
|
5932
|
-
Schema extends OptionalValuesSchema,
|
|
5933
|
-
WhenSet extends boolean = false,
|
|
5934
|
-
> = (WhenSet extends true
|
|
5935
|
-
? {
|
|
5936
|
-
-readonly [ValueId in DefaultValueIdFromSchema<Schema>]?: ValueFromSchema<
|
|
5937
|
-
Schema,
|
|
5938
|
-
ValueId
|
|
5939
|
-
>;
|
|
5940
|
-
}
|
|
5941
|
-
: {
|
|
5942
|
-
-readonly [ValueId in DefaultValueIdFromSchema<Schema>]: ValueFromSchema<
|
|
5943
|
-
Schema,
|
|
5944
|
-
ValueId
|
|
5945
|
-
>;
|
|
5946
|
-
}) & {
|
|
5947
|
-
-readonly [ValueId in DefaultValueIdFromSchema<
|
|
5948
|
-
Schema,
|
|
5949
|
-
false
|
|
5950
|
-
>]?: ValueFromSchema<Schema, ValueId>;
|
|
5951
|
-
};
|
|
5952
|
-
|
|
5953
|
-
/**
|
|
5954
|
-
* The ValueIdFromSchema type is a utility for determining the Id of Values from
|
|
5955
|
-
* a provided ValuesSchema.
|
|
5956
|
-
*
|
|
5957
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5958
|
-
* expected to need to use it directly.
|
|
5959
|
-
*
|
|
5960
|
-
* @category Internal
|
|
5961
|
-
*/
|
|
5962
|
-
export type ValueIdFromSchema<Schema extends OptionalValuesSchema> = AsId<
|
|
5963
|
-
keyof Schema
|
|
5964
|
-
>;
|
|
5965
|
-
|
|
5966
|
-
/**
|
|
5967
|
-
* The DefaultValueIdFromSchema type is a utility for determining Values with or
|
|
5968
|
-
* without default status from a provided ValuesSchema.
|
|
5969
|
-
*
|
|
5970
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5971
|
-
* expected to need to use it directly.
|
|
5972
|
-
*
|
|
5973
|
-
* @category Internal
|
|
5974
|
-
*/
|
|
5975
|
-
export type DefaultValueIdFromSchema<
|
|
5976
|
-
Schema extends OptionalValuesSchema,
|
|
5977
|
-
IsDefaulted extends boolean = true,
|
|
5978
|
-
> = {
|
|
5979
|
-
[ValueId in ValueIdFromSchema<Schema>]: Schema[ValueId] extends {
|
|
5980
|
-
default: string | number | boolean;
|
|
5981
|
-
}
|
|
5982
|
-
? IsDefaulted extends true
|
|
5983
|
-
? ValueId
|
|
5984
|
-
: never
|
|
5985
|
-
: IsDefaulted extends true
|
|
5986
|
-
? never
|
|
5987
|
-
: ValueId;
|
|
5988
|
-
}[ValueIdFromSchema<Schema>];
|
|
5989
|
-
|
|
5990
|
-
/**
|
|
5991
|
-
* The ValueFromSchema type is a utility for determining a Value type from a
|
|
5992
|
-
* provided ValuesSchema.
|
|
5993
|
-
*
|
|
5994
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
5995
|
-
* expected to need to use it directly.
|
|
5996
|
-
*
|
|
5997
|
-
* @category Internal
|
|
5998
|
-
*/
|
|
5999
|
-
export type ValueFromSchema<
|
|
6000
|
-
Schema extends OptionalValuesSchema,
|
|
6001
|
-
ValueId extends ValueIdFromSchema<Schema>,
|
|
6002
|
-
ValueType = Schema[ValueId]['type'],
|
|
6003
|
-
> = ValueType extends 'string'
|
|
6004
|
-
? string
|
|
6005
|
-
: ValueType extends 'number'
|
|
6006
|
-
? number
|
|
6007
|
-
: ValueType extends 'boolean'
|
|
6008
|
-
? boolean
|
|
6009
|
-
: string | number | boolean;
|
|
6010
|
-
|
|
6011
|
-
/**
|
|
6012
|
-
* The AsId type is a utility for coercing keys to be Id-like.
|
|
6013
|
-
*
|
|
6014
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6015
|
-
* expected to need to use it directly.
|
|
6016
|
-
*
|
|
6017
|
-
* @category Internal
|
|
6018
|
-
*/
|
|
6019
|
-
export type AsId<Key> = Exclude<Key & Id, number>;
|
|
6020
|
-
|
|
6021
|
-
/**
|
|
6022
|
-
* The TablesSchemaAlias type is a duplicate of TablesSchema, used to mask
|
|
6023
|
-
* complex generics from documentation.
|
|
6024
|
-
*
|
|
6025
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6026
|
-
* expected to need to use it directly.
|
|
6027
|
-
*
|
|
6028
|
-
* @category Internal
|
|
6029
|
-
*/
|
|
6030
|
-
export type TablesSchemaAlias = TablesSchema;
|
|
6031
|
-
|
|
6032
|
-
/**
|
|
6033
|
-
* The ValuesSchemaAlias type is a duplicate of ValuesSchema, used to mask
|
|
6034
|
-
* complex generics from documentation.
|
|
6035
|
-
*
|
|
6036
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6037
|
-
* expected to need to use it directly.
|
|
6038
|
-
*
|
|
6039
|
-
* @category Internal
|
|
6040
|
-
*/
|
|
6041
|
-
export type ValuesSchemaAlias = ValuesSchema;
|
|
6042
|
-
|
|
6043
|
-
/**
|
|
6044
|
-
* The TableCallbackAlias type is a duplicate of TableCallback, used to mask
|
|
6045
|
-
* complex generics from documentation.
|
|
6046
|
-
*
|
|
6047
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6048
|
-
* expected to need to use it directly.
|
|
6049
|
-
*
|
|
6050
|
-
* @category Internal
|
|
6051
|
-
*/
|
|
6052
|
-
export type TableCallbackAlias<
|
|
6053
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
6054
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
6055
|
-
> = TableCallback<Schema, TableId>;
|
|
6056
|
-
|
|
6057
|
-
/**
|
|
6058
|
-
* The RowCallbackAlias type is a duplicate of RowCallback, used to mask complex
|
|
6059
|
-
* generics from documentation.
|
|
6060
|
-
*
|
|
6061
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6062
|
-
* expected to need to use it directly.
|
|
6063
|
-
*
|
|
6064
|
-
* @category Internal
|
|
6065
|
-
*/
|
|
6066
|
-
export type RowCallbackAlias<
|
|
6067
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
6068
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
6069
|
-
> = RowCallback<Schema, TableId>;
|
|
6070
|
-
|
|
6071
|
-
/**
|
|
6072
|
-
* The CellCallbackAlias type is a duplicate of CellCallback, used to mask
|
|
6073
|
-
* complex generics from documentation.
|
|
6074
|
-
*
|
|
6075
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6076
|
-
* expected to need to use it directly.
|
|
6077
|
-
*
|
|
6078
|
-
* @category Internal
|
|
6079
|
-
*/
|
|
6080
|
-
export type CellCallbackAlias<
|
|
6081
|
-
Schema extends OptionalTablesSchema = NoTablesSchema,
|
|
6082
|
-
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
6083
|
-
CellId extends CellIdFromSchema<Schema, TableId> = CellIdFromSchema<
|
|
6084
|
-
Schema,
|
|
6085
|
-
TableId
|
|
6086
|
-
>,
|
|
6087
|
-
> = CellCallback<Schema, TableId, CellId>;
|
|
6088
|
-
|
|
6089
|
-
/**
|
|
6090
|
-
* The ValueCallbackAlias type is a duplicate of ValueCallback, used to mask
|
|
6091
|
-
* complex generics from documentation.
|
|
6092
|
-
*
|
|
6093
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6094
|
-
* expected to need to use it directly.
|
|
6095
|
-
*
|
|
6096
|
-
* @category Internal
|
|
6097
|
-
*/
|
|
6098
|
-
export type ValueCallbackAlias<
|
|
6099
|
-
Schema extends OptionalValuesSchema = NoValuesSchema,
|
|
6100
|
-
ValueId extends ValueIdFromSchema<Schema> = ValueIdFromSchema<Schema>,
|
|
6101
|
-
> = ValueCallback<Schema, ValueId>;
|
|
6102
|
-
|
|
6103
|
-
/**
|
|
6104
|
-
* The CellListenerAlias type is a duplicate of CellListener, used to mask
|
|
6105
|
-
* complex generics from documentation.
|
|
6106
|
-
*
|
|
6107
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6108
|
-
* expected to need to use it directly.
|
|
6109
|
-
*
|
|
6110
|
-
* @category Internal
|
|
6111
|
-
*/
|
|
6112
|
-
export type CellListenerAlias<
|
|
6113
|
-
Schemas extends OptionalSchemas = NoSchemas,
|
|
6114
|
-
TableIdOrNull extends TableIdFromSchema<
|
|
6115
|
-
Schemas[0]
|
|
6116
|
-
> | null = TableIdFromSchema<Schemas[0]> | null,
|
|
6117
|
-
RowIdOrNull extends IdOrNull = IdOrNull,
|
|
6118
|
-
CellIdOrNull extends
|
|
6119
|
-
| (TableIdOrNull extends TableIdFromSchema<Schemas[0]>
|
|
6120
|
-
? CellIdFromSchema<Schemas[0], TableIdOrNull>
|
|
6121
|
-
: AllCellIdFromSchema<Schemas[0]>)
|
|
6122
|
-
| null =
|
|
6123
|
-
| (TableIdOrNull extends TableIdFromSchema<Schemas[0]>
|
|
6124
|
-
? CellIdFromSchema<Schemas[0], TableIdOrNull>
|
|
6125
|
-
: AllCellIdFromSchema<Schemas[0]>)
|
|
6126
|
-
| null,
|
|
6127
|
-
> = CellListener<Schemas, TableIdOrNull, RowIdOrNull, CellIdOrNull>;
|
|
6128
|
-
|
|
6129
|
-
/**
|
|
6130
|
-
* The ValueListenerAlias type is a duplicate of ValueListener, used to mask
|
|
6131
|
-
* complex generics from documentation.
|
|
6132
|
-
*
|
|
6133
|
-
* This type is used internally to the TinyBase type system and you are not
|
|
6134
|
-
* expected to need to use it directly.
|
|
6135
|
-
*
|
|
6136
|
-
* @category Internal
|
|
6137
|
-
*/
|
|
6138
|
-
export type ValueListenerAlias<
|
|
6139
|
-
Schemas extends OptionalSchemas = NoSchemas,
|
|
6140
|
-
ValueIdOrNull extends ValueIdFromSchema<
|
|
6141
|
-
Schemas[1]
|
|
6142
|
-
> | null = ValueIdFromSchema<Schemas[1]> | null,
|
|
6143
|
-
> = ValueListener<Schemas, ValueIdOrNull>;
|