tinybase 3.1.0-beta.3 → 3.1.0-beta.5

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 (99) hide show
  1. package/bin/cli.js +1 -1
  2. package/lib/cjs/tools.cjs +1 -1
  3. package/lib/cjs/tools.cjs.gz +0 -0
  4. package/lib/cjs-es6/tools.cjs +1 -1
  5. package/lib/cjs-es6/tools.cjs.gz +0 -0
  6. package/lib/debug/tools.js +14 -621
  7. package/lib/debug/ui-react.js +2 -2
  8. package/lib/es6/tools.js +1 -1
  9. package/lib/es6/tools.js.gz +0 -0
  10. package/lib/tools.js +1 -1
  11. package/lib/tools.js.gz +0 -0
  12. package/lib/{debug → types}/indexes.d.ts +1 -1
  13. package/lib/{debug → types}/metrics.d.ts +40 -41
  14. package/lib/{cjs-es6 → types}/queries.d.ts +466 -299
  15. package/lib/{debug → types}/relationships.d.ts +2 -2
  16. package/lib/{debug → types}/store.d.ts +115 -124
  17. package/lib/types/tinybase.d.ts +14 -0
  18. package/lib/{debug → types}/tools.d.ts +3 -174
  19. package/lib/{cjs-es6 → types}/ui-react.d.ts +11 -5
  20. package/lib/{cjs-es6 → types/with-schemas}/checkpoints.d.ts +20 -16
  21. package/lib/{cjs → types/with-schemas}/indexes.d.ts +44 -23
  22. package/lib/types/with-schemas/internal/queries.d.ts +15 -0
  23. package/lib/types/with-schemas/internal/store.d.ts +101 -0
  24. package/lib/types/with-schemas/internal/ui-react.d.ts +776 -0
  25. package/lib/{cjs → types/with-schemas}/metrics.d.ts +61 -55
  26. package/lib/{debug → types/with-schemas}/persisters.d.ts +31 -25
  27. package/lib/{debug → types/with-schemas}/queries.d.ts +615 -350
  28. package/lib/{cjs → types/with-schemas}/relationships.d.ts +42 -25
  29. package/lib/{cjs-es6 → types/with-schemas}/store.d.ts +758 -302
  30. package/lib/types/with-schemas/tinybase.d.ts +14 -0
  31. package/lib/{cjs-es6 → types/with-schemas}/tools.d.ts +11 -180
  32. package/lib/{cjs → types/with-schemas}/ui-react.d.ts +817 -1314
  33. package/lib/umd/tools.js +1 -1
  34. package/lib/umd/tools.js.gz +0 -0
  35. package/lib/umd-es6/tools.js +1 -1
  36. package/lib/umd-es6/tools.js.gz +0 -0
  37. package/package.json +149 -33
  38. package/readme.md +3 -3
  39. package/lib/cjs/checkpoints.d.ts +0 -959
  40. package/lib/cjs/persisters.d.ts +0 -727
  41. package/lib/cjs/queries.d.ts +0 -3024
  42. package/lib/cjs/store.d.ts +0 -5244
  43. package/lib/cjs/tinybase.d.ts +0 -14
  44. package/lib/cjs/tools.d.ts +0 -702
  45. package/lib/cjs-es6/indexes.d.ts +0 -966
  46. package/lib/cjs-es6/metrics.d.ts +0 -827
  47. package/lib/cjs-es6/relationships.d.ts +0 -1201
  48. package/lib/cjs-es6/tinybase.d.ts +0 -14
  49. package/lib/common.d.ts +0 -115
  50. package/lib/debug/checkpoints.d.ts +0 -959
  51. package/lib/debug/common.d.ts +0 -115
  52. package/lib/debug/tinybase.d.ts +0 -14
  53. package/lib/debug/ui-react.d.ts +0 -10921
  54. package/lib/es6/checkpoints.d.ts +0 -959
  55. package/lib/es6/common.d.ts +0 -115
  56. package/lib/es6/indexes.d.ts +0 -966
  57. package/lib/es6/metrics.d.ts +0 -827
  58. package/lib/es6/persisters.d.ts +0 -727
  59. package/lib/es6/queries.d.ts +0 -3024
  60. package/lib/es6/relationships.d.ts +0 -1201
  61. package/lib/es6/store.d.ts +0 -5244
  62. package/lib/es6/tinybase.d.ts +0 -14
  63. package/lib/es6/tools.d.ts +0 -702
  64. package/lib/es6/ui-react.d.ts +0 -10921
  65. package/lib/indexes.d.ts +0 -966
  66. package/lib/metrics.d.ts +0 -827
  67. package/lib/persisters.d.ts +0 -727
  68. package/lib/queries.d.ts +0 -3024
  69. package/lib/relationships.d.ts +0 -1201
  70. package/lib/store.d.ts +0 -5244
  71. package/lib/tinybase.d.ts +0 -14
  72. package/lib/tools.d.ts +0 -702
  73. package/lib/ui-react.d.ts +0 -10921
  74. package/lib/umd/checkpoints.d.ts +0 -959
  75. package/lib/umd/common.d.ts +0 -115
  76. package/lib/umd/indexes.d.ts +0 -966
  77. package/lib/umd/metrics.d.ts +0 -827
  78. package/lib/umd/persisters.d.ts +0 -727
  79. package/lib/umd/queries.d.ts +0 -3024
  80. package/lib/umd/relationships.d.ts +0 -1201
  81. package/lib/umd/store.d.ts +0 -5244
  82. package/lib/umd/tinybase.d.ts +0 -14
  83. package/lib/umd/tools.d.ts +0 -702
  84. package/lib/umd/ui-react.d.ts +0 -10921
  85. package/lib/umd-es6/checkpoints.d.ts +0 -959
  86. package/lib/umd-es6/common.d.ts +0 -115
  87. package/lib/umd-es6/indexes.d.ts +0 -966
  88. package/lib/umd-es6/metrics.d.ts +0 -827
  89. package/lib/umd-es6/persisters.d.ts +0 -727
  90. package/lib/umd-es6/queries.d.ts +0 -3024
  91. package/lib/umd-es6/relationships.d.ts +0 -1201
  92. package/lib/umd-es6/store.d.ts +0 -5244
  93. package/lib/umd-es6/tinybase.d.ts +0 -14
  94. package/lib/umd-es6/tools.d.ts +0 -702
  95. package/lib/umd-es6/ui-react.d.ts +0 -10921
  96. /package/lib/{checkpoints.d.ts → types/checkpoints.d.ts} +0 -0
  97. /package/lib/{cjs-es6 → types}/common.d.ts +0 -0
  98. /package/lib/{cjs-es6 → types}/persisters.d.ts +0 -0
  99. /package/lib/{cjs → types/with-schemas}/common.d.ts +0 -0
@@ -1,115 +0,0 @@
1
- /**
2
- * The common module of the TinyBase project provides a small collection of
3
- * common types used across other modules.
4
- *
5
- * @packageDocumentation
6
- * @module common
7
- */
8
-
9
- /**
10
- * The Json type is a simple alias for a string, but is used to indicate that
11
- * the string should be considered to be a JSON serialization of an object.
12
- *
13
- * @category General
14
- */
15
- export type Json = string;
16
-
17
- /**
18
- * The Ids type is a simple alias for an array of strings, but is used to
19
- * indicate that the strings should be considered to be the keys of objects
20
- * (such as the Row Id strings used in a Table).
21
- *
22
- * @category Identity
23
- */
24
- export type Ids = Id[];
25
-
26
- /**
27
- * The Id type is a simple alias for a string, but is used to indicate that the
28
- * string should be considered to be the key of an object (such as a Row Id
29
- * string used in a Table).
30
- *
31
- * @category Identity
32
- */
33
- export type Id = string;
34
-
35
- /**
36
- * The Id type is a simple alias for the union of a string or `null` value,
37
- * where the string should be considered to be the key of an objects (such as a
38
- * Row Id string used in a Table), and typically `null` indicates a wildcard -
39
- * such as when used in the Store addRowListener method.
40
- *
41
- * @category Identity
42
- */
43
- export type IdOrNull = Id | null;
44
-
45
- /**
46
- * The ParameterizedCallback type represents a generic function that will take
47
- * an optional parameter - such as the handler of a DOM event.
48
- *
49
- * @category Callback
50
- */
51
- export type ParameterizedCallback<Parameter> = (parameter?: Parameter) => void;
52
-
53
- /**
54
- * The Callback type represents a function that is used as a callback and which
55
- * does not take a parameter.
56
- *
57
- * @category Callback
58
- */
59
- export type Callback = () => void;
60
-
61
- /**
62
- * The SortKey type represents a value that can be used by a sort function.
63
- *
64
- * @category Parameter
65
- */
66
- export type SortKey = string | number | boolean;
67
-
68
- /**
69
- * The defaultSorter function is provided as a convenience to sort keys
70
- * alphanumerically, and can be provided to the `sliceIdSorter` and
71
- * `rowIdSorter` parameters of the setIndexDefinition method in the indexes
72
- * module, for example.
73
- *
74
- * @param sortKey1 The first item of the pair to compare.
75
- * @param sortKey2 The second item of the pair to compare.
76
- * @returns A number indicating how to sort the pair.
77
- * @example
78
- * This example creates an Indexes object.
79
- *
80
- * ```js
81
- * const store = createStore();
82
- * const indexes = createIndexes(store);
83
- * console.log(indexes.getIndexIds());
84
- * // -> []
85
- * ```
86
- * @example
87
- * This example creates a Store, creates an Indexes object, and defines an
88
- * Index based on the first letter of the pets' names. The Slice Ids (and Row
89
- * Ids within them) are alphabetically sorted using the defaultSorter function.
90
- *
91
- * ```js
92
- * const store = createStore().setTable('pets', {
93
- * fido: {species: 'dog'},
94
- * felix: {species: 'cat'},
95
- * cujo: {species: 'dog'},
96
- * });
97
- *
98
- * const indexes = createIndexes(store);
99
- * indexes.setIndexDefinition(
100
- * 'byFirst', // indexId
101
- * 'pets', // tableId
102
- * (_, rowId) => rowId[0], // each Row's Slice Id
103
- * (_, rowId) => rowId, // each Row's sort key
104
- * defaultSorter, // sort Slice Ids
105
- * defaultSorter, // sort Row Ids by sort key
106
- * );
107
- *
108
- * console.log(indexes.getSliceIds('byFirst'));
109
- * // -> ['c', 'f']
110
- * console.log(indexes.getSliceRowIds('byFirst', 'f'));
111
- * // -> ['felix', 'fido']
112
- * ```
113
- * @category Convenience
114
- */
115
- export function defaultSorter(sortKey1: SortKey, sortKey2: SortKey): number;