tinybase 3.1.0-beta.5 → 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.
@@ -150,6 +150,12 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
150
150
  * The load method gets persisted data from storage, and loads it into the
151
151
  * Store with which the Persister is associated, once.
152
152
  *
153
+ * This has schema-based typing. The following is a simplified representation:
154
+ *
155
+ * ```ts override
156
+ * load(initialTables?: Tables, initialValues?: Values): Promise<Persister>;
157
+ * ```
158
+ *
153
159
  * The optional parameter allows you to specify what the initial Tables object
154
160
  * for the Store will be if there is nothing currently persisted. Using this
155
161
  * instead of the `initialTables` parameter in the regular createStore
@@ -216,6 +222,15 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
216
222
  * into the Store with which the Persister is associated, once, and then
217
223
  * continuously.
218
224
  *
225
+ * This has schema-based typing. The following is a simplified representation:
226
+ *
227
+ * ```ts override
228
+ * startAutoLoad(
229
+ * initialTables?: Tables,
230
+ * initialValues?: Values,
231
+ * ): Promise<Persister>;
232
+ * ```
233
+ *
219
234
  * The optional parameter allows you to specify what the initial Tables object
220
235
  * for the Store will be if there is nothing at first persisted. Using this
221
236
  * instead of the `initialTables` parameter in the regular createStore
@@ -274,6 +289,12 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
274
289
  * The stopAutoLoad method stops the automatic loading of data from storage
275
290
  * previously started with the startAutoLoad method.
276
291
  *
292
+ * This has schema-based typing. The following is a simplified representation:
293
+ *
294
+ * ```ts override
295
+ * stopAutoLoad(): Persister;
296
+ * ```
297
+ *
277
298
  * If the Persister is not currently set to automatically load, this method
278
299
  * has no effect.
279
300
  *
@@ -319,6 +340,12 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
319
340
  * The save method takes data from the Store with which the Persister is
320
341
  * associated and persists it into storage, once.
321
342
  *
343
+ * This has schema-based typing. The following is a simplified representation:
344
+ *
345
+ * ```ts override
346
+ * save(): Promise<Persister>;
347
+ * ```
348
+ *
322
349
  * This method is asynchronous because the persisted data may be on a remote
323
350
  * machine or a filesystem. Even for those storage types that are synchronous
324
351
  * (like browser storage) it is still recommended that you `await` calls to
@@ -348,6 +375,12 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
348
375
  * The save method takes data from the Store with which the Persister is
349
376
  * associated and persists it into storage, once, and then continuously.
350
377
  *
378
+ * This has schema-based typing. The following is a simplified representation:
379
+ *
380
+ * ```ts override
381
+ * startAutoSave(): Promise<Persister>;
382
+ * ```
383
+ *
351
384
  * This method first runs a single call to the save method to ensure the data
352
385
  * is in sync with the persisted storage. It then continues to watch for
353
386
  * changes to the Store, automatically saving the data to storage.
@@ -386,6 +419,12 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
386
419
  * The stopAutoSave method stops the automatic save of data to storage
387
420
  * previously started with the startAutoSave method.
388
421
  *
422
+ * This has schema-based typing. The following is a simplified representation:
423
+ *
424
+ * ```ts override
425
+ * stopAutoSave(): Persister;
426
+ * ```
427
+ *
389
428
  * If the Persister is not currently set to automatically save, this method
390
429
  * has no effect.
391
430
  *
@@ -424,6 +463,12 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
424
463
  * The getStore method returns a reference to the underlying Store that is
425
464
  * backing this Persister object.
426
465
  *
466
+ * This has schema-based typing. The following is a simplified representation:
467
+ *
468
+ * ```ts override
469
+ * getStore(): Store;
470
+ * ```
471
+ *
427
472
  * @returns A reference to the Store.
428
473
  * @example
429
474
  * This example creates a Persister object against a newly-created Store and
@@ -448,6 +493,12 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
448
493
  * The destroy method should be called when this Persister object is no longer
449
494
  * used.
450
495
  *
496
+ * This has schema-based typing. The following is a simplified representation:
497
+ *
498
+ * ```ts override
499
+ * destroy(): Persister;
500
+ * ```
501
+ *
451
502
  * This guarantees that all of the listeners that the object registered with
452
503
  * the underlying Store and storage are removed and it can be correctly
453
504
  * garbage collected. It is equivalent to running the stopAutoLoad method and
@@ -525,6 +576,15 @@ export interface Persister<in out Schemas extends OptionalSchemas> {
525
576
  * The createSessionPersister function creates a Persister object that can
526
577
  * persist the Store to the browser's session storage.
527
578
  *
579
+ * This has schema-based typing. The following is a simplified representation:
580
+ *
581
+ * ```ts override
582
+ * createSessionPersister(
583
+ * store: Store,
584
+ * storageName: string,
585
+ * ): Persister;
586
+ * ```
587
+ *
528
588
  * As well as providing a reference to the Store to persist, you must provide a
529
589
  * `storageName` parameter which is unique to your application. This is the key
530
590
  * that the browser uses to identify the storage location.
@@ -558,6 +618,15 @@ export function createSessionPersister<Schemas extends OptionalSchemas>(
558
618
  * The createLocalPersister function creates a Persister object that can
559
619
  * persist the Store to the browser's local storage.
560
620
  *
621
+ * This has schema-based typing. The following is a simplified representation:
622
+ *
623
+ * ```ts override
624
+ * createLocalPersister(
625
+ * store: Store,
626
+ * storageName: string,
627
+ * ): Persister;
628
+ * ```
629
+ *
561
630
  * As well as providing a reference to the Store to persist, you must provide a
562
631
  * `storageName` parameter which is unique to your application. This is the key
563
632
  * that the browser uses to identify the storage location.
@@ -591,6 +660,17 @@ export function createLocalPersister<Schemas extends OptionalSchemas>(
591
660
  * The createRemotePersister function creates a Persister object that can
592
661
  * persist the Store to a remote server.
593
662
  *
663
+ * This has schema-based typing. The following is a simplified representation:
664
+ *
665
+ * ```ts override
666
+ * createRemotePersister(
667
+ * store: Store,
668
+ * loadUrl: string,
669
+ * saveUrl: string,
670
+ * autoLoadIntervalSeconds: number,
671
+ * ): Persister;
672
+ * ```
673
+ *
594
674
  * As well as providing a reference to the Store to persist, you must provide
595
675
  * `loadUrl` and `saveUrl` parameters. These identify the endpoints of the
596
676
  * server that support the `GET` method (to fetch the Store JSON to load) and
@@ -640,6 +720,12 @@ export function createRemotePersister<Schemas extends OptionalSchemas>(
640
720
  * The createFilePersister function creates a Persister object that can persist
641
721
  * the Store to a local file (in an appropriate environment).
642
722
  *
723
+ * This has schema-based typing. The following is a simplified representation:
724
+ *
725
+ * ```ts override
726
+ * createFilePersister(store: Store, filePath: string): Persister;
727
+ * ```
728
+ *
643
729
  * As well as providing a reference to the Store to persist, you must provide
644
730
  * `filePath` parameter which identifies the file to persist it to.
645
731
  *
@@ -673,6 +759,18 @@ export function createFilePersister<Schemas extends OptionalSchemas>(
673
759
  * The createCustomPersister function creates a Persister object that you can
674
760
  * configure to persist the Store in any way you wish.
675
761
  *
762
+ * This has schema-based typing. The following is a simplified representation:
763
+ *
764
+ * ```ts override
765
+ * createCustomPersister(
766
+ * store: Store,
767
+ * getPersisted: () => Promise<string | null | undefined>,
768
+ * setPersisted: (json: string) => Promise<void>,
769
+ * startListeningToPersisted: (didChange: Callback) => void,
770
+ * stopListeningToPersisted: Callback,
771
+ * ): Persister;
772
+ * ```
773
+ *
676
774
  * As well as providing a reference to the Store to persist, you must provide
677
775
  * functions that handle how to fetch, write, and listen to, the persistence
678
776
  * layer.
@@ -266,6 +266,16 @@ export type ResultCellCallback = (cellId: Id, cell: ResultCell) => void;
266
266
  * The ResultTableListener type describes a function that is used to listen to
267
267
  * changes to a query's ResultTable.
268
268
  *
269
+ * This has schema-based typing. The following is a simplified representation:
270
+ *
271
+ * ```ts override
272
+ * (
273
+ * queries: Queries,
274
+ * tableId: Id,
275
+ * getCellChange: GetCellResultChange,
276
+ * ) => void;
277
+ * ```
278
+ *
269
279
  * A ResultTableListener is provided when using the addResultTableListener
270
280
  * method. See that method for specific examples.
271
281
  *
@@ -292,6 +302,12 @@ export type ResultTableListener<Schemas extends OptionalSchemas> = (
292
302
  * The ResultRowIdsListener type describes a function that is used to listen to
293
303
  * changes to the ResultRow Ids in a query's ResultTable.
294
304
  *
305
+ * This has schema-based typing. The following is a simplified representation:
306
+ *
307
+ * ```ts override
308
+ * (queries: Queries, tableId: Id) => void;
309
+ * ```
310
+ *
295
311
  * A ResultRowIdsListener is provided when using the addResultRowIdsListener
296
312
  * method. See that method for specific examples.
297
313
  *
@@ -314,6 +330,20 @@ export type ResultRowIdsListener<Schemas extends OptionalSchemas> = (
314
330
  * The ResultSortedRowIdsListener type describes a function that is used to
315
331
  * listen to changes to the sorted ResultRow Ids in a query's ResultTable.
316
332
  *
333
+ * This has schema-based typing. The following is a simplified representation:
334
+ *
335
+ * ```ts override
336
+ * (
337
+ * queries: Queries,
338
+ * tableId: Id,
339
+ * cellId: Id | undefined,
340
+ * descending: boolean,
341
+ * offset: number,
342
+ * limit: number | undefined,
343
+ * sortedRowIds: Ids,
344
+ * ) => void;
345
+ * ```
346
+ *
317
347
  * A ResultSortedRowIdsListener is provided when using the
318
348
  * addResultSortedRowIdsListener method. See that method for specific examples.
319
349
  *
@@ -351,6 +381,17 @@ export type ResultSortedRowIdsListener<Schemas extends OptionalSchemas> = (
351
381
  * The ResultRowListener type describes a function that is used to listen to
352
382
  * changes to a ResultRow in a query's ResultTable.
353
383
  *
384
+ * This has schema-based typing. The following is a simplified representation:
385
+ *
386
+ * ```ts override
387
+ * (
388
+ * queries: Queries,
389
+ * tableId: Id,
390
+ * rowId: Id,
391
+ * getCellChange: GetCellResultChange,
392
+ * ) => void;
393
+ * ```
394
+ *
354
395
  * A ResultRowListener is provided when using the addResultRowListener method.
355
396
  * See that method for specific examples.
356
397
  *
@@ -379,6 +420,16 @@ export type ResultRowListener<Schemas extends OptionalSchemas> = (
379
420
  * The ResultCellIdsListener type describes a function that is used to listen to
380
421
  * changes to the ResultCell Ids in a ResultRow in a query's ResultTable.
381
422
  *
423
+ * This has schema-based typing. The following is a simplified representation:
424
+ *
425
+ * ```ts override
426
+ * (
427
+ * queries: Queries,
428
+ * tableId: Id,
429
+ * rowId: Id,
430
+ * ) => void;
431
+ * ```
432
+ *
382
433
  * A ResultCellIdsListener is provided when using the addResultCellIdsListener
383
434
  * method. See that method for specific examples.
384
435
  *
@@ -403,6 +454,20 @@ export type ResultCellIdsListener<Schemas extends OptionalSchemas> = (
403
454
  * The ResultCellListener type describes a function that is used to listen to
404
455
  * changes to a ResultCell in a query's ResultTable.
405
456
  *
457
+ * This has schema-based typing. The following is a simplified representation:
458
+ *
459
+ * ```ts override
460
+ * (
461
+ * queries: Queries,
462
+ * tableId: Id,
463
+ * rowId: Id,
464
+ * cellId: Id,
465
+ * newCell: ResultCell,
466
+ * oldCell: ResultCell,
467
+ * getCellChange: GetCellResultChange,
468
+ * ) => void;
469
+ * ```
470
+ *
406
471
  * A ResultCellListener is provided when using the addResultCellListener method.
407
472
  * See that method for specific examples.
408
473
  *
@@ -527,6 +592,12 @@ export type GetTableCell<
527
592
  * the specified Cell from the query's root Table for the Row being selected
528
593
  * or filtered.
529
594
  *
595
+ * This has schema-based typing. The following is a simplified representation:
596
+ *
597
+ * ```ts override
598
+ * (cellId: Id): CellOrUndefined;
599
+ * ```
600
+ *
530
601
  * @param cellId The Id of the Cell to fetch the value for.
531
602
  * @returns A Cell value or `undefined`.
532
603
  */
@@ -538,6 +609,13 @@ export type GetTableCell<
538
609
  * the specified Cell from a Table that has been joined in the query, for
539
610
  * the Row being selected or filtered.
540
611
  *
612
+ * This has schema-based typing. The following is a simplified representation:
613
+ *
614
+ * ```ts override
615
+ * (joinedTableId: Id, joinedCellId: Id): CellOrUndefined;
616
+ };
617
+ * ```
618
+ *
541
619
  * @param joinedTableId The Id of the Table to fetch the value from. If the
542
620
  * underlying Table was joined 'as' a different Id, that should instead be
543
621
  * used.
@@ -665,6 +743,12 @@ export type Select<
665
743
  * Calling this function with one Id parameter will indicate that the query
666
744
  * should select the value of the specified Cell from the query's root Table.
667
745
  *
746
+ * This has schema-based typing. The following is a simplified representation:
747
+ *
748
+ * ```ts override
749
+ * (cellId: Id): SelectedAs;
750
+ * ```
751
+ *
668
752
  * @param cellId The Id of the Cell to fetch the value for.
669
753
  * @returns A SelectedAs object so that the selected Cell Id can be optionally
670
754
  * aliased.
@@ -677,6 +761,12 @@ export type Select<
677
761
  * should select the value of the specified Cell from a Table that has been
678
762
  * joined in the query.
679
763
  *
764
+ * This has schema-based typing. The following is a simplified representation:
765
+ *
766
+ * ```ts override
767
+ * (joinedTableId: Id, joinedCellId: Id): SelectedAs;
768
+ * ```
769
+ *
680
770
  * @param joinedTableId The Id of the Table to fetch the value from. If the
681
771
  * underlying Table was joined 'as' a different Id, that should instead be
682
772
  * used.
@@ -693,6 +783,15 @@ export type Select<
693
783
  * query should select a calculated value, based on one or more Cell values in
694
784
  * the root Table or a joined Table, or on the root Table's Row Id.
695
785
  *
786
+ * This has schema-based typing. The following is a simplified representation:
787
+ *
788
+ * ```ts override
789
+ * (
790
+ * getCell: (getTableCell: GetTableCell, rowId: Id) => ResultCellOrUndefined,
791
+ * ): SelectedAs;
792
+ };
793
+ * ```
794
+ *
696
795
  * @param getCell A callback that takes a GetTableCell function and the main
697
796
  * Table's Row Id. These can be used to programmatically create a calculated
698
797
  * value from multiple Cell values and the Row Id.
@@ -936,6 +1035,12 @@ export type Join<
936
1035
  * a Row in an adjacent Table is made by finding its Id in a Cell of the
937
1036
  * query's root Table.
938
1037
  *
1038
+ * This has schema-based typing. The following is a simplified representation:
1039
+ *
1040
+ * ```ts override
1041
+ * (joinedTableId: Id, on: Id): JoinedAs;
1042
+ * ```
1043
+ *
939
1044
  * @param joinedTableId The Id of the Table to join to.
940
1045
  * @param on The Id of the Cell in the root Table that contains the joined
941
1046
  * Table's Row Id.
@@ -951,6 +1056,15 @@ export type Join<
951
1056
  * will indicate that the join to a Row in an adjacent Table is made by
952
1057
  * calculating its Id from the Cells and the Row Id of the query's root Table.
953
1058
  *
1059
+ * This has schema-based typing. The following is a simplified representation:
1060
+ *
1061
+ * ```ts override
1062
+ * (
1063
+ * joinedTableId: Id,
1064
+ * on: (getCell: GetCell, rowId: Id) => Id | undefined,
1065
+ * ): JoinedAs;
1066
+ * ```
1067
+ *
954
1068
  * @param joinedTableId The Id of the Table to join to.
955
1069
  * @param on A callback that takes a GetCell function and the root Table's Row
956
1070
  * Id. These can be used to programmatically calculate the joined Table's Row
@@ -967,6 +1081,12 @@ export type Join<
967
1081
  * to a Row in distant Table is made by finding its Id in a Cell of an
968
1082
  * intermediately joined Table.
969
1083
  *
1084
+ * This has schema-based typing. The following is a simplified representation:
1085
+ *
1086
+ * ```ts override
1087
+ * (joinedTableId: Id, fromIntermediateJoinedTableId: Id, on: Id): JoinedAs;
1088
+ * ```
1089
+ *
970
1090
  * @param joinedTableId The Id of the distant Table to join to.
971
1091
  * @param fromIntermediateJoinedTableId The Id of an intermediate Table (which
972
1092
  * should have been in turn joined to the main query table via other Join
@@ -995,6 +1115,20 @@ export type Join<
995
1115
  * calculating its Id from the Cells and the Row Id of an intermediately
996
1116
  * joined Table.
997
1117
  *
1118
+ * This has schema-based typing. The following is a simplified representation:
1119
+ *
1120
+ * ```ts override
1121
+ * (
1122
+ * joinedTableId: Id,
1123
+ * fromIntermediateJoinedTableId: Id,
1124
+ * on: (
1125
+ * getIntermediateJoinedCell: GetCell,
1126
+ * intermediateJoinedRowId: Id,
1127
+ * ) => Id | undefined,
1128
+ * ): JoinedAs;
1129
+ };
1130
+ * ```
1131
+ *
998
1132
  * @param joinedTableId The Id of the Table to join to.
999
1133
  * @param fromIntermediateJoinedTableId The Id of an intermediate Table (which
1000
1134
  * should have been in turn joined to the main query table via other Join
@@ -1203,6 +1337,12 @@ export type Where<
1203
1337
  * Rows for which a specified Cell in the query's root Table has a specified
1204
1338
  * value.
1205
1339
  *
1340
+ * This has schema-based typing. The following is a simplified representation:
1341
+ *
1342
+ * ```ts override
1343
+ * (cellId: Id, equals: Cell): void;
1344
+ * ```
1345
+ *
1206
1346
  * @param cellId The Id of the Cell in the query's root Table to test.
1207
1347
  * @param equals The value that the Cell has to have for the Row to be
1208
1348
  * included in the result.
@@ -1215,6 +1355,12 @@ export type Where<
1215
1355
  * Calling this function with three parameters is used to include only those
1216
1356
  * Rows for which a specified Cell in a joined Table has a specified value.
1217
1357
  *
1358
+ * This has schema-based typing. The following is a simplified representation:
1359
+ *
1360
+ * ```ts override
1361
+ * (joinedTableId: Id, joinedCellId: Id, equals: Cell): void;
1362
+ * ```
1363
+ *
1218
1364
  * @param joinedTableId The Id of the joined Table to test a value in. If the
1219
1365
  * underlying Table was joined 'as' a different Id, that should instead be
1220
1366
  * used.
@@ -1243,6 +1389,13 @@ export type Where<
1243
1389
  * those Rows which meet a calculated boolean condition, based on values in
1244
1390
  * the main and (optionally) joined Tables.
1245
1391
  *
1392
+ * This has schema-based typing. The following is a simplified representation:
1393
+ *
1394
+ * ```ts override
1395
+ * (condition: (getTableCell: GetTableCell) => boolean): void;
1396
+ };
1397
+ * ```
1398
+ *
1246
1399
  * @param condition A callback that takes a GetTableCell function and that
1247
1400
  * should return `true` for the Row to be included in the result.
1248
1401
  */
@@ -1686,6 +1839,22 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
1686
1839
  /**
1687
1840
  * The setQueryDefinition method lets you set the definition of a query.
1688
1841
  *
1842
+ * This has schema-based typing. The following is a simplified representation:
1843
+ *
1844
+ * ```ts override
1845
+ * setQueryDefinition(
1846
+ * queryId: Id,
1847
+ * tableId: Id,
1848
+ * query: (keywords: {
1849
+ * select: Select;
1850
+ * join: Join;
1851
+ * where: Where;
1852
+ * group: Group;
1853
+ * having: Having;
1854
+ * }) => void,
1855
+ * ): Queries;
1856
+ * ```
1857
+ *
1689
1858
  * Every query definition is identified by a unique Id, and if you re-use an
1690
1859
  * existing Id with this method, the previous definition is overwritten.
1691
1860
  *
@@ -1761,6 +1930,12 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
1761
1930
  /**
1762
1931
  * The delQueryDefinition method removes an existing query definition.
1763
1932
  *
1933
+ * This has schema-based typing. The following is a simplified representation:
1934
+ *
1935
+ * ```ts override
1936
+ * delQueryDefinition(queryId: Id): Queries;
1937
+ * ```
1938
+ *
1764
1939
  * @param queryId The Id of the query to remove.
1765
1940
  * @returns A reference to the Queries object.
1766
1941
  * @example
@@ -1795,6 +1970,12 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
1795
1970
  * The getStore method returns a reference to the underlying Store that is
1796
1971
  * backing this Queries object.
1797
1972
  *
1973
+ * This has schema-based typing. The following is a simplified representation:
1974
+ *
1975
+ * ```ts override
1976
+ * getStore(): Store;
1977
+ * ```
1978
+ *
1798
1979
  * @returns A reference to the Store.
1799
1980
  * @example
1800
1981
  * This example creates a Queries object against a newly-created Store and
@@ -1912,6 +2093,12 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
1912
2093
  * The getTableId method returns the Id of the underlying Table that is
1913
2094
  * backing a query.
1914
2095
  *
2096
+ * This has schema-based typing. The following is a simplified representation:
2097
+ *
2098
+ * ```ts override
2099
+ * getTableId(queryId: Id): Id | undefined;
2100
+ * ```
2101
+ *
1915
2102
  * If the query Id is invalid, the method returns `undefined`.
1916
2103
  *
1917
2104
  * @param queryId The Id of a query.
@@ -2487,6 +2674,12 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
2487
2674
  * The addResultTableListener method registers a listener function with the
2488
2675
  * Queries object that will be called whenever data in a ResultTable changes.
2489
2676
  *
2677
+ * This has schema-based typing. The following is a simplified representation:
2678
+ *
2679
+ * ```ts override
2680
+ * addResultTableListener(queryId: IdOrNull, listener: ResultTableListener): Id;
2681
+ * ```
2682
+ *
2490
2683
  * The provided listener is a ResultTableListener function, and will be called
2491
2684
  * with a reference to the Queries object, the Id of the ResultTable that
2492
2685
  * changed (which is also the query Id), and a GetCellResultChange function in
@@ -2582,6 +2775,15 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
2582
2775
  * Queries object that will be called whenever the ResultRow Ids in a
2583
2776
  * ResultTable change.
2584
2777
  *
2778
+ * This has schema-based typing. The following is a simplified representation:
2779
+ *
2780
+ * ```ts override
2781
+ * addResultRowIdsListener(
2782
+ * queryId: IdOrNull,
2783
+ * listener: ResultRowIdsListener,
2784
+ * ): Id;
2785
+ * ```
2786
+ *
2585
2787
  * The provided listener is a ResultRowIdsListener function, and will be
2586
2788
  * called with a reference to the Queries object and the Id of the ResultTable
2587
2789
  * that changed (which is also the query Id).
@@ -2680,6 +2882,19 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
2680
2882
  * the Queries object that will be called whenever sorted (and optionally,
2681
2883
  * paginated) ResultRow Ids in a ResultTable change.
2682
2884
  *
2885
+ * This has schema-based typing. The following is a simplified representation:
2886
+ *
2887
+ * ```ts override
2888
+ * addResultSortedRowIdsListener(
2889
+ * queryId: Id,
2890
+ * cellId: Id | undefined,
2891
+ * descending: boolean,
2892
+ * offset: number,
2893
+ * limit: number | undefined,
2894
+ * listener: ResultSortedRowIdsListener,
2895
+ * ): Id;
2896
+ * ```
2897
+ *
2683
2898
  * The provided listener is a ResultSortedRowIdsListener function, and will be
2684
2899
  * called with a reference to the Queries object, the Id of the ResultTable
2685
2900
  * whose ResultRow Ids sorting changed (which is also the query Id), the
@@ -2810,6 +3025,16 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
2810
3025
  * The addResultRowListener method registers a listener function with the
2811
3026
  * Queries object that will be called whenever data in a ResultRow changes.
2812
3027
  *
3028
+ * This has schema-based typing. The following is a simplified representation:
3029
+ *
3030
+ * ```ts override
3031
+ * addResultRowListener(
3032
+ * queryId: IdOrNull,
3033
+ * rowId: IdOrNull,
3034
+ * listener: ResultRowListener,
3035
+ * ): Id;
3036
+ * ```
3037
+ *
2813
3038
  * The provided listener is a ResultRowListener function, and will be called
2814
3039
  * with a reference to the Queries object, the Id of the ResultTable that
2815
3040
  * changed (which is also the query Id), and a GetCellResultChange function in
@@ -2914,6 +3139,16 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
2914
3139
  * Queries object that will be called whenever the ResultCell Ids in a
2915
3140
  * ResultRow change.
2916
3141
  *
3142
+ * This has schema-based typing. The following is a simplified representation:
3143
+ *
3144
+ * ```ts override
3145
+ * addResultCellIdsListener(
3146
+ * queryId: IdOrNull,
3147
+ * rowId: IdOrNull,
3148
+ * listener: ResultCellIdsListener,
3149
+ * ): Id;
3150
+ * ```
3151
+ *
2917
3152
  * The provided listener is a ResultCellIdsListener function, and will be
2918
3153
  * called with a reference to the Queries object, the Id of the ResultTable
2919
3154
  * (which is also the query Id), and the Id of the ResultRow that changed.
@@ -3025,6 +3260,17 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
3025
3260
  * The addResultCellListener method registers a listener function with the
3026
3261
  * Queries object that will be called whenever data in a ResultCell changes.
3027
3262
  *
3263
+ * This has schema-based typing. The following is a simplified representation:
3264
+ *
3265
+ * ```ts override
3266
+ * addResultCellListener(
3267
+ * queryId: IdOrNull,
3268
+ * rowId: IdOrNull,
3269
+ * cellId: IdOrNull,
3270
+ * listener: ResultCellListener,
3271
+ * ): Id;
3272
+ * ```
3273
+ *
3028
3274
  * The provided listener is a ResultCellListener function, and will be called
3029
3275
  * with a reference to the Queries object, the Id of the ResultTable that
3030
3276
  * changed (which is also the query Id), the Id of the ResultRow that changed,
@@ -3142,6 +3388,12 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
3142
3388
  * The delListener method removes a listener that was previously added to the
3143
3389
  * Queries object.
3144
3390
  *
3391
+ * This has schema-based typing. The following is a simplified representation:
3392
+ *
3393
+ * ```ts override
3394
+ * delListener(listenerId: Id): Queries;
3395
+ * ```
3396
+ *
3145
3397
  * Use the Id returned by the addMetricListener method. Note that the Queries
3146
3398
  * object may re-use this Id for future listeners added to it.
3147
3399
  *
@@ -3255,6 +3507,12 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
3255
3507
  * The createQueries function creates a Queries object, and is the main entry
3256
3508
  * point into the queries module.
3257
3509
  *
3510
+ * This has schema-based typing. The following is a simplified representation:
3511
+ *
3512
+ * ```ts override
3513
+ * createQueries(store: Store): Queries;
3514
+ * ```
3515
+ *
3258
3516
  * A given Store can only have one Queries object associated with it. If you
3259
3517
  * call this function twice on the same Store, your second call will return a
3260
3518
  * reference to the Queries object created by the first.