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,14 @@
1
+ /**
2
+ * This is everything.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+
7
+ export * from './checkpoints.d';
8
+ export * from './common.d';
9
+ export * from './indexes.d';
10
+ export * from './metrics.d';
11
+ export * from './persisters.d';
12
+ export * from './queries.d';
13
+ export * from './relationships.d';
14
+ export * from './store.d';
@@ -10,13 +10,7 @@
10
10
  * @since v2.2.0
11
11
  */
12
12
 
13
- import {
14
- NoSchemas,
15
- OptionalSchemas,
16
- Store,
17
- TablesSchema,
18
- ValuesSchema,
19
- } from './store.d';
13
+ import {OptionalSchemas, Store} from './store.d';
20
14
  import {Id} from './common.d';
21
15
 
22
16
  /**
@@ -90,6 +84,9 @@ export type StoreStatsTableDetail = {
90
84
  * The number of Cell objects in the Table, across all Row objects.
91
85
  */
92
86
  tableCells: number;
87
+ /**
88
+ * Detail about the Table object.
89
+ */
93
90
  rows: {[rowId: Id]: StoreStatsRowDetail};
94
91
  };
95
92
 
@@ -115,7 +112,7 @@ export type StoreStatsRowDetail = {
115
112
  * @category Tools
116
113
  * @since v2.2.0
117
114
  */
118
- export interface Tools<Schemas extends OptionalSchemas = NoSchemas> {
115
+ export interface Tools<in out Schemas extends OptionalSchemas> {
119
116
  /* eslint-disable max-len */
120
117
  /**
121
118
  * The getStoreStats method provides a set of statistics about the Store, and
@@ -174,6 +171,7 @@ export interface Tools<Schemas extends OptionalSchemas = NoSchemas> {
174
171
  * @since v2.2.0
175
172
  */
176
173
  getStoreStats(detail?: boolean): StoreStats;
174
+
177
175
  /* eslint-enable max-len */
178
176
 
179
177
  /**
@@ -236,7 +234,7 @@ export interface Tools<Schemas extends OptionalSchemas = NoSchemas> {
236
234
  * @category Modelling
237
235
  * @since v3.0.0
238
236
  */
239
- getStoreTablesSchema(): TablesSchema;
237
+ getStoreTablesSchema(): Schemas[0];
240
238
 
241
239
  /**
242
240
  * The getStoreValuesSchema method returns the ValuesSchema of the Store as an
@@ -275,7 +273,7 @@ export interface Tools<Schemas extends OptionalSchemas = NoSchemas> {
275
273
  * @category Modelling
276
274
  * @since v3.0.0
277
275
  */
278
- getStoreValuesSchema(): ValuesSchema;
276
+ getStoreValuesSchema(): Schemas[1];
279
277
 
280
278
  /**
281
279
  * The getStoreApi method returns code-generated `.d.ts` and `.ts(x)` files
@@ -469,6 +467,12 @@ export interface Tools<Schemas extends OptionalSchemas = NoSchemas> {
469
467
  * The getStore method returns a reference to the underlying Store that is
470
468
  * backing this Tools object.
471
469
  *
470
+ * This has schema-based typing. The following is a simplified representation:
471
+ *
472
+ * ```ts override
473
+ * getStore(): Store;
474
+ * ```
475
+ *
472
476
  * @returns A reference to the Store.
473
477
  * @example
474
478
  * This example creates a Tools object against a newly-created Store and
@@ -491,6 +495,12 @@ export interface Tools<Schemas extends OptionalSchemas = NoSchemas> {
491
495
  * The createTools function creates a Tools object, and is the main entry point
492
496
  * into the tools module.
493
497
  *
498
+ * This has schema-based typing. The following is a simplified representation:
499
+ *
500
+ * ```ts override
501
+ * createTools(store: Store): Tools;
502
+ * ```
503
+ *
494
504
  * A given Store can only have one Tools object associated with it. If you call
495
505
  * this function twice on the same Store, your second call will return a
496
506
  * reference to the Tools object created by the first.
@@ -533,4 +543,5 @@ export interface Tools<Schemas extends OptionalSchemas = NoSchemas> {
533
543
  export function createTools<Schemas extends OptionalSchemas>(
534
544
  store: Store<Schemas>,
535
545
  ): Tools<Schemas>;
546
+
536
547
  /* eslint-enable max-len */