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.
Files changed (85) hide show
  1. package/lib/debug/ui-react.js +2 -2
  2. package/lib/{checkpoints.d.ts → types/checkpoints.d.ts} +13 -13
  3. package/lib/{debug → types}/indexes.d.ts +10 -16
  4. package/lib/{debug → types}/metrics.d.ts +49 -50
  5. package/lib/{debug → types}/persisters.d.ts +26 -30
  6. package/lib/{cjs-es6 → types}/queries.d.ts +474 -309
  7. package/lib/{debug → types}/relationships.d.ts +11 -17
  8. package/lib/{debug → types}/store.d.ts +180 -1038
  9. package/lib/types/tinybase.d.ts +14 -0
  10. package/lib/{debug → types}/tools.d.ts +12 -12
  11. package/lib/{debug → types}/ui-react.d.ts +11 -5
  12. package/lib/{cjs-es6 → types/with-schemas}/checkpoints.d.ts +93 -7
  13. package/lib/{cjs → types/with-schemas}/indexes.d.ts +136 -18
  14. package/lib/types/with-schemas/internal/queries.d.ts +15 -0
  15. package/lib/types/with-schemas/internal/store.d.ts +101 -0
  16. package/lib/types/with-schemas/internal/ui-react.d.ts +776 -0
  17. package/lib/{cjs → types/with-schemas}/metrics.d.ts +115 -50
  18. package/lib/{cjs → types/with-schemas}/persisters.d.ts +102 -4
  19. package/lib/{debug → types/with-schemas}/queries.d.ts +865 -346
  20. package/lib/{cjs → types/with-schemas}/relationships.d.ts +151 -20
  21. package/lib/{cjs-es6 → types/with-schemas}/store.d.ts +1082 -801
  22. package/lib/types/with-schemas/tinybase.d.ts +14 -0
  23. package/lib/{cjs-es6 → types/with-schemas}/tools.d.ts +21 -10
  24. package/lib/{cjs-es6 → types/with-schemas}/ui-react.d.ts +1871 -1314
  25. package/package.json +145 -29
  26. package/readme.md +14 -14
  27. package/lib/cjs/checkpoints.d.ts +0 -961
  28. package/lib/cjs/queries.d.ts +0 -3028
  29. package/lib/cjs/store.d.ts +0 -6143
  30. package/lib/cjs/tinybase.d.ts +0 -14
  31. package/lib/cjs/tools.d.ts +0 -536
  32. package/lib/cjs/ui-react.d.ts +0 -10921
  33. package/lib/cjs-es6/indexes.d.ts +0 -974
  34. package/lib/cjs-es6/metrics.d.ts +0 -829
  35. package/lib/cjs-es6/persisters.d.ts +0 -733
  36. package/lib/cjs-es6/relationships.d.ts +0 -1209
  37. package/lib/cjs-es6/tinybase.d.ts +0 -14
  38. package/lib/common.d.ts +0 -115
  39. package/lib/debug/checkpoints.d.ts +0 -961
  40. package/lib/debug/common.d.ts +0 -115
  41. package/lib/debug/tinybase.d.ts +0 -14
  42. package/lib/es6/checkpoints.d.ts +0 -961
  43. package/lib/es6/common.d.ts +0 -115
  44. package/lib/es6/indexes.d.ts +0 -974
  45. package/lib/es6/metrics.d.ts +0 -829
  46. package/lib/es6/persisters.d.ts +0 -733
  47. package/lib/es6/queries.d.ts +0 -3028
  48. package/lib/es6/relationships.d.ts +0 -1209
  49. package/lib/es6/store.d.ts +0 -6143
  50. package/lib/es6/tinybase.d.ts +0 -14
  51. package/lib/es6/tools.d.ts +0 -536
  52. package/lib/es6/ui-react.d.ts +0 -10921
  53. package/lib/indexes.d.ts +0 -974
  54. package/lib/metrics.d.ts +0 -829
  55. package/lib/persisters.d.ts +0 -733
  56. package/lib/queries.d.ts +0 -3028
  57. package/lib/relationships.d.ts +0 -1209
  58. package/lib/store.d.ts +0 -6143
  59. package/lib/tinybase.d.ts +0 -14
  60. package/lib/tools.d.ts +0 -536
  61. package/lib/ui-react.d.ts +0 -10921
  62. package/lib/umd/checkpoints.d.ts +0 -961
  63. package/lib/umd/common.d.ts +0 -115
  64. package/lib/umd/indexes.d.ts +0 -974
  65. package/lib/umd/metrics.d.ts +0 -829
  66. package/lib/umd/persisters.d.ts +0 -733
  67. package/lib/umd/queries.d.ts +0 -3028
  68. package/lib/umd/relationships.d.ts +0 -1209
  69. package/lib/umd/store.d.ts +0 -6143
  70. package/lib/umd/tinybase.d.ts +0 -14
  71. package/lib/umd/tools.d.ts +0 -536
  72. package/lib/umd/ui-react.d.ts +0 -10921
  73. package/lib/umd-es6/checkpoints.d.ts +0 -961
  74. package/lib/umd-es6/common.d.ts +0 -115
  75. package/lib/umd-es6/indexes.d.ts +0 -974
  76. package/lib/umd-es6/metrics.d.ts +0 -829
  77. package/lib/umd-es6/persisters.d.ts +0 -733
  78. package/lib/umd-es6/queries.d.ts +0 -3028
  79. package/lib/umd-es6/relationships.d.ts +0 -1209
  80. package/lib/umd-es6/store.d.ts +0 -6143
  81. package/lib/umd-es6/tinybase.d.ts +0 -14
  82. package/lib/umd-es6/tools.d.ts +0 -536
  83. package/lib/umd-es6/ui-react.d.ts +0 -10921
  84. /package/lib/{cjs-es6 → types}/common.d.ts +0 -0
  85. /package/lib/{cjs → types/with-schemas}/common.d.ts +0 -0
@@ -0,0 +1,776 @@
1
+ import {Callback, Id} from '../common';
2
+ import {CellIdFromSchema, TableIdFromSchema, ValueIdFromSchema} from './store';
3
+ import {ComponentType, ReactElement} from 'react';
4
+ import {OptionalSchemas, Store} from '../store';
5
+ import {Checkpoints} from '../checkpoints';
6
+ import {Indexes} from '../indexes';
7
+ import {Metrics} from '../metrics';
8
+ import {Queries} from '../queries';
9
+ import {Relationships} from '../relationships';
10
+
11
+ type StoreOrStoreId<Schemas extends OptionalSchemas> = Store<Schemas> | Id;
12
+
13
+ type MetricsOrMetricsId<Schemas extends OptionalSchemas> =
14
+ | Metrics<Schemas>
15
+ | Id;
16
+
17
+ type IndexesOrIndexesId<Schemas extends OptionalSchemas> =
18
+ | Indexes<Schemas>
19
+ | Id;
20
+
21
+ type RelationshipsOrRelationshipsId<Schemas extends OptionalSchemas> =
22
+ | Relationships<Schemas>
23
+ | Id;
24
+
25
+ type QueriesOrQueriesId<Schemas extends OptionalSchemas> =
26
+ | Queries<Schemas>
27
+ | Id;
28
+
29
+ type CheckpointsOrCheckpointsId<Schemas extends OptionalSchemas> =
30
+ | Checkpoints<Schemas>
31
+ | Id;
32
+
33
+ type UndoOrRedoInformation = [boolean, Callback, Id | undefined, string];
34
+
35
+ type ExtraProps = {[propName: string]: any};
36
+
37
+ type TablesProps<Schemas extends OptionalSchemas> = {
38
+ /**
39
+ * The Store to be accessed: omit for the default context Store, provide an Id
40
+ * for a named context Store, or provide an explicit reference.
41
+ */
42
+ readonly store?: StoreOrStoreId<Schemas>;
43
+ /**
44
+ * A component for rendering each Table in the Store (to override the default
45
+ * TableView component).
46
+ */
47
+ readonly tableComponent?: ComponentType<TableProps<Schemas>>;
48
+ /**
49
+ * A custom function for generating extra props for each Table component based
50
+ * on its Id.
51
+ */
52
+ readonly getTableComponentProps?: (tableId: Id) => ExtraProps;
53
+ /**
54
+ * A component or string to separate each Table component.
55
+ */
56
+ readonly separator?: ReactElement | string;
57
+ /**
58
+ * Whether the component should also render the Ids of each Table, and its
59
+ * descendent objects, to assist with debugging.
60
+ */
61
+ readonly debugIds?: boolean;
62
+ };
63
+
64
+ export type TableProps<
65
+ Schemas extends OptionalSchemas,
66
+ TableIds extends TableIdFromSchema<Schemas[0]> = TableIdFromSchema<
67
+ Schemas[0]
68
+ >,
69
+ > = TableIds extends infer TableId
70
+ ? TableId extends TableIdFromSchema<Schemas[0]>
71
+ ? {
72
+ /**
73
+ * The Id of the Table in the Store to be rendered.
74
+ */
75
+ readonly tableId: TableId;
76
+ /**
77
+ * The Store to be accessed: omit for the default context Store, provide an Id
78
+ * for a named context Store, or provide an explicit reference.
79
+ */
80
+ readonly store?: StoreOrStoreId<Schemas>;
81
+ /**
82
+ * A custom component for rendering each Row in the Table (to override the
83
+ * default RowView component).
84
+ */
85
+ readonly rowComponent?: ComponentType<RowProps<Schemas, TableId>>;
86
+ /**
87
+ * A function for generating extra props for each custom Row component based
88
+ * on its Id.
89
+ */
90
+ readonly getRowComponentProps?: (rowId: Id) => ExtraProps;
91
+ /**
92
+ * A component or string to separate each Row component.
93
+ */
94
+ readonly separator?: ReactElement | string;
95
+ /**
96
+ * Whether the component should also render the Id of the Table, and its
97
+ * descendent objects, to assist with debugging.
98
+ */
99
+ readonly debugIds?: boolean;
100
+ }
101
+ : never
102
+ : never;
103
+
104
+ export type SortedTableProps<
105
+ Schemas extends OptionalSchemas,
106
+ TableIds extends TableIdFromSchema<Schemas[0]> = TableIdFromSchema<
107
+ Schemas[0]
108
+ >,
109
+ > = TableIds extends infer TableId
110
+ ? TableId extends TableIdFromSchema<Schemas[0]>
111
+ ? {
112
+ /**
113
+ * The Id of the Table in the Store to be rendered.
114
+ */
115
+ readonly tableId: TableId;
116
+ /**
117
+ * The Id of the Cell whose values are used for the sorting. If omitted, the
118
+ * view will sort the Row Id itself.
119
+ */
120
+ readonly cellId?: CellIdFromSchema<Schemas[0], TableId>;
121
+ /**
122
+ * Whether the sorting should be in descending order.
123
+ */
124
+ readonly descending?: boolean;
125
+ /**
126
+ * The number of Row Ids to skip for pagination purposes.
127
+ */
128
+ readonly offset?: number;
129
+ /**
130
+ * The maximum number of Row Ids to return.
131
+ */
132
+ readonly limit?: number;
133
+ /**
134
+ * The Store to be accessed: omit for the default context Store, provide an Id
135
+ * for a named context Store, or provide an explicit reference.
136
+ */
137
+ readonly store?: StoreOrStoreId<Schemas>;
138
+ /**
139
+ * A custom component for rendering each Row in the Table (to override the
140
+ * default RowView component).
141
+ */
142
+ readonly rowComponent?: ComponentType<RowProps<Schemas, TableId>>;
143
+ /**
144
+ * A function for generating extra props for each custom Row component based
145
+ * on its Id.
146
+ */
147
+ readonly getRowComponentProps?: (rowId: Id) => ExtraProps;
148
+ /**
149
+ * A component or string to separate each Row component.
150
+ */
151
+ readonly separator?: ReactElement | string;
152
+ /**
153
+ * Whether the component should also render the Id of the Table, and its
154
+ * descendent objects, to assist with debugging.
155
+ */
156
+ readonly debugIds?: boolean;
157
+ }
158
+ : never
159
+ : never;
160
+
161
+ export type RowProps<
162
+ Schemas extends OptionalSchemas,
163
+ TableIds extends TableIdFromSchema<Schemas[0]> = TableIdFromSchema<
164
+ Schemas[0]
165
+ >,
166
+ > = TableIds extends infer TableId
167
+ ? TableId extends TableIdFromSchema<Schemas[0]>
168
+ ? {
169
+ /**
170
+ * The Id of the Table in the Store.
171
+ */
172
+ readonly tableId: TableId;
173
+ /**
174
+ * The Id of the Row in the Table to be rendered.
175
+ */
176
+ readonly rowId: Id;
177
+ /**
178
+ * The Store to be accessed: omit for the default context Store, provide an Id
179
+ * for a named context Store, or provide an explicit reference.
180
+ */
181
+ readonly store?: StoreOrStoreId<Schemas>;
182
+ /**
183
+ * A custom component for rendering each Cell in the Row (to override the
184
+ * default CellView component).
185
+ */
186
+ readonly cellComponent?: ComponentType<CellProps<Schemas, TableId>>;
187
+ /**
188
+ * A function for generating extra props for each custom Cell component based
189
+ * on its Id.
190
+ */
191
+ readonly getCellComponentProps?: (cellId: Id) => ExtraProps;
192
+ /**
193
+ * A component or string to separate each Cell component.
194
+ */
195
+ readonly separator?: ReactElement | string;
196
+ /**
197
+ * Whether the component should also render the Id of the Row, and its
198
+ * descendent objects, to assist with debugging.
199
+ */
200
+ readonly debugIds?: boolean;
201
+ }
202
+ : never
203
+ : never;
204
+
205
+ export type CellProps<
206
+ Schemas extends OptionalSchemas,
207
+ TableIds extends TableIdFromSchema<Schemas[0]> = TableIdFromSchema<
208
+ Schemas[0]
209
+ >,
210
+ > = TableIds extends infer TableId
211
+ ? TableId extends TableIdFromSchema<Schemas[0]>
212
+ ? {
213
+ /**
214
+ * The Id of the Table in the Store.
215
+ */
216
+ readonly tableId: TableId;
217
+ /**
218
+ * The Id of the Row in the Table.
219
+ */
220
+ readonly rowId: Id;
221
+ /**
222
+ * The Id of the Cell in the Row to be rendered.
223
+ */
224
+ readonly cellId: CellIdFromSchema<Schemas[0], TableId>;
225
+ /**
226
+ * The Store to be accessed: omit for the default context Store, provide an Id
227
+ * for a named context Store, or provide an explicit reference.
228
+ */
229
+ readonly store?: StoreOrStoreId<Schemas>;
230
+ /**
231
+ * Whether the component should also render the Id of the Cell to assist with
232
+ * debugging.
233
+ */
234
+ readonly debugIds?: boolean;
235
+ }
236
+ : never
237
+ : never;
238
+
239
+ export type ValuesProps<Schemas extends OptionalSchemas> = {
240
+ /**
241
+ * The Store to be accessed: omit for the default context Store, provide an Id
242
+ * for a named context Store, or provide an explicit reference.
243
+ */
244
+ readonly store?: StoreOrStoreId<Schemas>;
245
+ /**
246
+ * A custom component for rendering each Value in the Store (to override the
247
+ * default ValueView component).
248
+ */
249
+ readonly valueComponent?: ComponentType<ValueProps<Schemas>>;
250
+ /**
251
+ * A function for generating extra props for each custom Value component based
252
+ * on its Id.
253
+ */
254
+ readonly getValueComponentProps?: (valueId: Id) => ExtraProps;
255
+ /**
256
+ * A component or string to separate each Value component.
257
+ */
258
+ readonly separator?: ReactElement | string;
259
+ /**
260
+ * Whether the component should also render the Ids of each Value to assist
261
+ * with debugging.
262
+ */
263
+ readonly debugIds?: boolean;
264
+ };
265
+
266
+ export type ValueProps<Schemas extends OptionalSchemas> = {
267
+ /**
268
+ * The Id of the Value in the Row to be rendered.
269
+ */
270
+ readonly valueId: ValueIdFromSchema<Schemas[1]>;
271
+ /**
272
+ * The Store to be accessed: omit for the default context Store, provide an Id
273
+ * for a named context Store, or provide an explicit reference.
274
+ */
275
+ readonly store?: StoreOrStoreId<Schemas>;
276
+ /**
277
+ * Whether the component should also render the Id of the Value to assist with
278
+ * debugging.
279
+ */
280
+ readonly debugIds?: boolean;
281
+ };
282
+
283
+ export type MetricProps<Schemas extends OptionalSchemas> = {
284
+ /**
285
+ * The Id of the Metric in the Metrics object to be rendered.
286
+ */
287
+ readonly metricId: Id;
288
+ /**
289
+ * The Metrics object to be accessed: omit for the default context Metrics
290
+ * object, provide an Id for a named context Metrics object, or provide an
291
+ * explicit reference.
292
+ */
293
+ readonly metrics?: MetricsOrMetricsId<Schemas>;
294
+ /**
295
+ * Whether the component should also render the Id of the Metric to assist
296
+ * with debugging.
297
+ */
298
+ readonly debugIds?: boolean;
299
+ };
300
+
301
+ export type IndexProps<Schemas extends OptionalSchemas> = {
302
+ /**
303
+ * The Id of the Index in the Indexes object to be rendered.
304
+ */
305
+ readonly indexId: Id;
306
+ /**
307
+ * The Indexes object to be accessed: omit for the default context Indexes
308
+ * object, provide an Id for a named context Indexes object, or provide an
309
+ * explicit reference.
310
+ */
311
+ readonly indexes?: IndexesOrIndexesId<Schemas>;
312
+ /**
313
+ * A component for rendering each Slice in the Index.
314
+ */
315
+ readonly sliceComponent?: ComponentType<SliceProps<Schemas>>;
316
+ /**
317
+ * A function for generating extra props for each Slice component based on its
318
+ * Id.
319
+ */
320
+ readonly getSliceComponentProps?: (sliceId: Id) => ExtraProps;
321
+ /**
322
+ * A component or string to separate each Slice component.
323
+ */
324
+ readonly separator?: ReactElement | string;
325
+ /**
326
+ * Whether the component should also render the Id of the Index, and its
327
+ * descendent objects, to assist with debugging.
328
+ */
329
+ readonly debugIds?: boolean;
330
+ };
331
+
332
+ export type SliceProps<Schemas extends OptionalSchemas> = {
333
+ /**
334
+ * The Id of the Index in the Indexes object.
335
+ */
336
+ readonly indexId: Id;
337
+ /**
338
+ * The Id of the Slice in the Index to be rendered.
339
+ */
340
+ readonly sliceId: Id;
341
+ /**
342
+ * The Indexes object to be accessed: omit for the default context Indexes
343
+ * object, provide an Id for a named context Indexes object, or provide an
344
+ * explicit reference.
345
+ */
346
+ readonly indexes?: IndexesOrIndexesId<Schemas>;
347
+ /**
348
+ * A component for rendering each Row in the Index.
349
+ */
350
+ readonly rowComponent?: ComponentType<RowProps<Schemas>>;
351
+ /**
352
+ * A function for generating extra props for each Row component based on its
353
+ * Id.
354
+ */
355
+ readonly getRowComponentProps?: (rowId: Id) => ExtraProps;
356
+ /**
357
+ * A component or string to separate each Row component.
358
+ */
359
+ readonly separator?: ReactElement | string;
360
+ /**
361
+ * Whether the component should also render the Id of the Slice, and its
362
+ * descendent objects, to assist with debugging.
363
+ */
364
+ readonly debugIds?: boolean;
365
+ };
366
+
367
+ export type RemoteRowProps<Schemas extends OptionalSchemas> = {
368
+ /**
369
+ * The Id of the Relationship in the Relationships object.
370
+ */
371
+ readonly relationshipId: Id;
372
+ /**
373
+ * The Id of the local Row for which to render the remote Row.
374
+ */
375
+ readonly localRowId: Id;
376
+ /**
377
+ * The Relationships object to be accessed: omit for the default context
378
+ * Relationships object, provide an Id for a named context Relationships
379
+ * object, or provide an explicit reference.
380
+ */
381
+ readonly relationships?: RelationshipsOrRelationshipsId<Schemas>;
382
+ /**
383
+ * A component for rendering each (remote, local, or linked) Row in the
384
+ * Relationship.
385
+ */
386
+ readonly rowComponent?: ComponentType<RowProps<Schemas>>;
387
+ /**
388
+ * A function for generating extra props for each Row component based on its
389
+ * Id.
390
+ */
391
+ readonly getRowComponentProps?: (rowId: Id) => ExtraProps;
392
+ /**
393
+ * Whether the component should also render the Id of the Row in the
394
+ * Relationship, and its descendent objects, to assist with debugging.
395
+ */
396
+ readonly debugIds?: boolean;
397
+ };
398
+
399
+ export type LocalRowsProps<Schemas extends OptionalSchemas> = {
400
+ /**
401
+ * The Id of the Relationship in the Relationships object.
402
+ */
403
+ readonly relationshipId: Id;
404
+ /**
405
+ * The Id of the remote Row for which to render the local Rows.
406
+ */
407
+ readonly remoteRowId: Id;
408
+ /**
409
+ * The Relationships object to be accessed: omit for the default context
410
+ * Relationships object, provide an Id for a named context Relationships
411
+ * object, or provide an explicit reference.
412
+ */
413
+ readonly relationships?: RelationshipsOrRelationshipsId<Schemas>;
414
+ /**
415
+ * A component for rendering each (remote, local, or linked) Row in the
416
+ * Relationship.
417
+ */
418
+ readonly rowComponent?: ComponentType<RowProps<Schemas>>;
419
+ /**
420
+ * A function for generating extra props for each Row component based on its
421
+ * Id.
422
+ */
423
+ readonly getRowComponentProps?: (rowId: Id) => ExtraProps;
424
+ /**
425
+ * A component or string to separate each Row component.
426
+ */
427
+ readonly separator?: ReactElement | string;
428
+ /**
429
+ * Whether the component should also render the Id of the Row in the
430
+ * Relationship, and its descendent objects, to assist with debugging.
431
+ */
432
+ readonly debugIds?: boolean;
433
+ };
434
+
435
+ export type LinkedRowsProps<Schemas extends OptionalSchemas> = {
436
+ /**
437
+ * The Id of the Relationship in the Relationships object.
438
+ */
439
+ readonly relationshipId: Id;
440
+ /**
441
+ * The Id of the first Row in the linked list Relationship.
442
+ */
443
+ readonly firstRowId: Id;
444
+ /**
445
+ * The Relationships object to be accessed: omit for the default context
446
+ * Relationships object, provide an Id for a named context Relationships
447
+ * object, or provide an explicit reference.
448
+ */
449
+ readonly relationships?: RelationshipsOrRelationshipsId<Schemas>;
450
+ /**
451
+ * A component for rendering each (remote, local, or linked) Row in the
452
+ * Relationship.
453
+ */
454
+ readonly rowComponent?: ComponentType<RowProps<Schemas>>;
455
+ /**
456
+ * A function for generating extra props for each Row component based on its
457
+ * Id.
458
+ */
459
+ readonly getRowComponentProps?: (rowId: Id) => ExtraProps;
460
+ /**
461
+ * A component or string to separate each Row component.
462
+ */
463
+ readonly separator?: ReactElement | string;
464
+ /**
465
+ * Whether the component should also render the Id of the Row in the
466
+ * Relationship, and its descendent objects, to assist with debugging.
467
+ */
468
+ readonly debugIds?: boolean;
469
+ };
470
+
471
+ export type ResultTableProps<Schemas extends OptionalSchemas> = {
472
+ /**
473
+ * The Id of the query in the Queries object for which the result Table will
474
+ * be rendered.
475
+ */
476
+ readonly queryId: Id;
477
+ /**
478
+ * The Queries object to be accessed: omit for the default context Queries
479
+ * object, provide an Id for a named context Queries object, or provide an
480
+ * explicit reference.
481
+ */
482
+ readonly queries?: QueriesOrQueriesId<Schemas>;
483
+ /**
484
+ * A custom component for rendering each Row in the Table (to override the
485
+ * default ResultRowView component).
486
+ */
487
+ readonly resultRowComponent?: ComponentType<ResultRowProps<Schemas>>;
488
+ /**
489
+ * A function for generating extra props for each custom Row component based
490
+ * on its Id.
491
+ */
492
+ readonly getResultRowComponentProps?: (rowId: Id) => ExtraProps;
493
+ /**
494
+ * A component or string to separate each Row component.
495
+ */
496
+ readonly separator?: ReactElement | string;
497
+ /**
498
+ * Whether the component should also render the Id of the query, and its
499
+ * descendent objects, to assist with debugging.
500
+ */
501
+ readonly debugIds?: boolean;
502
+ };
503
+
504
+ export type ResultSortedTableProps<Schemas extends OptionalSchemas> = {
505
+ /**
506
+ * The Id of the query in the Queries object for which the sorted result Table
507
+ * will be rendered.
508
+ */
509
+ readonly queryId: Id;
510
+ /**
511
+ * The Id of the Cell whose values are used for the sorting. If omitted, the
512
+ * view will sort the Row Id itself.
513
+ */
514
+ readonly cellId?: Id;
515
+ /**
516
+ * Whether the sorting should be in descending order.
517
+ */
518
+ readonly descending?: boolean;
519
+ /**
520
+ * The number of Row Ids to skip for pagination purposes.
521
+ */
522
+ readonly offset?: number;
523
+ /**
524
+ * The maximum number of Row Ids to return.
525
+ */
526
+ readonly limit?: number;
527
+ /**
528
+ * The Queries object to be accessed: omit for the default context Queries
529
+ * object, provide an Id for a named context Queries object, or provide an
530
+ * explicit reference.
531
+ */
532
+ readonly queries?: QueriesOrQueriesId<Schemas>;
533
+ /**
534
+ * A custom component for rendering each Row in the Table (to override the
535
+ * default ResultRowView component).
536
+ */
537
+ readonly resultRowComponent?: ComponentType<ResultRowProps<Schemas>>;
538
+ /**
539
+ * A function for generating extra props for each custom Row component based
540
+ * on its Id.
541
+ */
542
+ readonly getResultRowComponentProps?: (rowId: Id) => ExtraProps;
543
+ /**
544
+ * A component or string to separate each Row component.
545
+ */
546
+ readonly separator?: ReactElement | string;
547
+ /**
548
+ * Whether the component should also render the Id of the query, and its
549
+ * descendent objects, to assist with debugging.
550
+ */
551
+ readonly debugIds?: boolean;
552
+ };
553
+
554
+ export type ResultRowProps<Schemas extends OptionalSchemas> = {
555
+ /**
556
+ * The Id of the query in the Queries object for which the result Table will
557
+ * be rendered.
558
+ */
559
+ readonly queryId: Id;
560
+ /**
561
+ * The Id of the Row in the result Table to be rendered.
562
+ */
563
+ readonly rowId: Id;
564
+ /**
565
+ * The Queries object to be accessed: omit for the default context Queries
566
+ * object, provide an Id for a named context Queries object, or provide an
567
+ * explicit reference.
568
+ */
569
+ readonly queries?: QueriesOrQueriesId<Schemas>;
570
+ /**
571
+ * A custom component for rendering each Cell in the Row (to override the
572
+ * default CellView component).
573
+ */
574
+ readonly resultCellComponent?: ComponentType<ResultCellProps<Schemas>>;
575
+ /**
576
+ * A function for generating extra props for each custom Cell component based
577
+ * on its Id.
578
+ */
579
+ readonly getResultCellComponentProps?: (cellId: Id) => ExtraProps;
580
+ /**
581
+ * A component or string to separate each Cell component.
582
+ */
583
+ readonly separator?: ReactElement | string;
584
+ /**
585
+ * Whether the component should also render the Id of the Row, and its
586
+ * descendent objects, to assist with debugging.
587
+ */
588
+ readonly debugIds?: boolean;
589
+ };
590
+
591
+ export type ResultCellProps<Schemas extends OptionalSchemas> = {
592
+ /**
593
+ * The Id of the query in the Queries object for which the result Table will
594
+ * be rendered.
595
+ */
596
+ readonly queryId: Id;
597
+ /**
598
+ * The Id of the Row in the Table.
599
+ */
600
+ readonly rowId: Id;
601
+ /**
602
+ * The Id of the Cell in the Row to be rendered.
603
+ */
604
+ readonly cellId: Id;
605
+ /**
606
+ * The Queries object to be accessed: omit for the default context Queries
607
+ * object, provide an Id for a named context Queries object, or provide an
608
+ * explicit reference.
609
+ */
610
+ readonly queries?: QueriesOrQueriesId<Schemas>;
611
+ /**
612
+ * Whether the component should also render the Id of the Cell to assist with
613
+ * debugging.
614
+ */
615
+ readonly debugIds?: boolean;
616
+ };
617
+
618
+ export type CheckpointProps<Schemas extends OptionalSchemas> = {
619
+ /**
620
+ * The Id of the checkpoint in the Checkpoints object.
621
+ */
622
+ readonly checkpointId: Id;
623
+ /**
624
+ * The Checkpoints object to be accessed: omit for the default context
625
+ * Checkpoints object, provide an Id for a named context Checkpoints object,
626
+ * or provide an explicit reference.
627
+ */
628
+ readonly checkpoints?: CheckpointsOrCheckpointsId<Schemas>;
629
+ /**
630
+ * Whether the component should also render the Id of the checkpoint to assist
631
+ * with debugging.
632
+ */
633
+ readonly debugIds?: boolean;
634
+ };
635
+
636
+ export type BackwardCheckpointsProps<Schemas extends OptionalSchemas> = {
637
+ /**
638
+ * The Checkpoints object to be accessed: omit for the default context
639
+ * Checkpoints object, provide an Id for a named context Checkpoints object,
640
+ * or provide an explicit reference.
641
+ */
642
+ readonly checkpoints?: CheckpointsOrCheckpointsId<Schemas>;
643
+ /**
644
+ * A component for rendering each checkpoint in the Checkpoints object.
645
+ */
646
+ readonly checkpointComponent?: ComponentType<CheckpointProps<Schemas>>;
647
+ /**
648
+ * A function for generating extra props for each checkpoint component based
649
+ * on its Id.
650
+ */
651
+ readonly getCheckpointComponentProps?: (checkpointId: Id) => ExtraProps;
652
+ /**
653
+ * A component or string to separate each Checkpoint component.
654
+ */
655
+ readonly separator?: ReactElement | string;
656
+ /**
657
+ * Whether the component should also render the Ids of the checkpoints to
658
+ * assist with debugging.
659
+ */
660
+ readonly debugIds?: boolean;
661
+ };
662
+
663
+ export type CurrentCheckpointProps<Schemas extends OptionalSchemas> = {
664
+ /**
665
+ * The Checkpoints object to be accessed: omit for the default context
666
+ * Checkpoints object, provide an Id for a named context Checkpoints object,
667
+ * or provide an explicit reference.
668
+ */
669
+ readonly checkpoints?: CheckpointsOrCheckpointsId<Schemas>;
670
+ /**
671
+ * A component for rendering each checkpoint in the Checkpoints object.
672
+ */
673
+ readonly checkpointComponent?: ComponentType<CheckpointProps<Schemas>>;
674
+ /**
675
+ * A function for generating extra props for each checkpoint component based
676
+ * on its Id.
677
+ */
678
+ readonly getCheckpointComponentProps?: (checkpointId: Id) => ExtraProps;
679
+ /**
680
+ * Whether the component should also render the Ids of the checkpoints to
681
+ * assist with debugging.
682
+ */
683
+ readonly debugIds?: boolean;
684
+ };
685
+
686
+ export type ForwardCheckpointsProps<Schemas extends OptionalSchemas> = {
687
+ /**
688
+ * The Checkpoints object to be accessed: omit for the default context
689
+ * Checkpoints object, provide an Id for a named context Checkpoints object,
690
+ * or provide an explicit reference.
691
+ */
692
+ readonly checkpoints?: CheckpointsOrCheckpointsId<Schemas>;
693
+ /**
694
+ * A component for rendering each checkpoint in the Checkpoints object.
695
+ */
696
+ readonly checkpointComponent?: ComponentType<CheckpointProps<Schemas>>;
697
+ /**
698
+ * A function for generating extra props for each checkpoint component based
699
+ * on its Id.
700
+ */
701
+ readonly getCheckpointComponentProps?: (checkpointId: Id) => ExtraProps;
702
+ /**
703
+ * A component or string to separate each Checkpoint component.
704
+ */
705
+ readonly separator?: ReactElement | string;
706
+ /**
707
+ * Whether the component should also render the Ids of the checkpoints to
708
+ * assist with debugging.
709
+ */
710
+ readonly debugIds?: boolean;
711
+ };
712
+
713
+ export type ProviderProps<Schemas extends OptionalSchemas> = {
714
+ /**
715
+ * A default single Store object that will be available within the Provider
716
+ * context.
717
+ */
718
+ readonly store?: Store<Schemas>;
719
+ /**
720
+ * An object containing multiple Store objects that will be available within
721
+ * the Provider context by their Id.
722
+ */
723
+ readonly storesById?: {[storeId: Id]: Store<Schemas>};
724
+ /**
725
+ * A default single Metrics object that will be available within the Provider
726
+ * context.
727
+ */
728
+ readonly metrics?: Metrics<Schemas>;
729
+ /**
730
+ * An object containing multiple Metrics objects that will be available within
731
+ * the Provider context by their Id.
732
+ */
733
+ readonly metricsById?: {[metricsId: Id]: Metrics<Schemas>};
734
+ /**
735
+ * A default single Indexes object that will be available within the Provider
736
+ * context.
737
+ */
738
+ readonly indexes?: Indexes<Schemas>;
739
+ /**
740
+ * An object containing multiple Indexes objects that will be available within
741
+ * the Provider context by their Id.
742
+ */
743
+ readonly indexesById?: {[indexesId: Id]: Indexes<Schemas>};
744
+ /**
745
+ * A default single Relationships object that will be available within the
746
+ * Provider context.
747
+ */
748
+ readonly relationships?: Relationships<Schemas>;
749
+ /**
750
+ * An object containing multiple Relationships objects that will be available
751
+ * within the Provider context by their Id.
752
+ */
753
+ readonly relationshipsById?: {[relationshipsId: Id]: Relationships<Schemas>};
754
+ /**
755
+ * A default single Queries object that will be available within the Provider
756
+ * context, since v2.0.0.
757
+ */
758
+ readonly queries?: Queries<Schemas>;
759
+ /**
760
+ * An object containing multiple Queries objects that will be available within
761
+ * the Provider context by their Id, since v2.0.0.
762
+ */
763
+ readonly queriesById?: {[queriesId: Id]: Queries<Schemas>};
764
+ /**
765
+ * A default single Checkpoints object that will be available within the
766
+ * Provider context.
767
+ */
768
+ readonly checkpoints?: Checkpoints<Schemas>;
769
+ /**
770
+ * An object containing multiple Checkpoints objects that will be available
771
+ * within the Provider context by their Id.
772
+ */
773
+ readonly checkpointsById?: {[checkpointsId: Id]: Checkpoints<Schemas>};
774
+ };
775
+
776
+ export type ComponentReturnType = ReactElement<any, any> | null;