tinybase 3.0.4 → 3.0.6

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 (80) hide show
  1. package/lib/debug/ui-react.js +2 -2
  2. package/lib/{debug → types}/persisters.d.ts +2 -2
  3. package/lib/{debug → types}/store.d.ts +1 -1
  4. package/lib/{cjs-es6 → types}/ui-react.d.ts +4 -3
  5. package/package.json +21 -20
  6. package/readme.md +2 -2
  7. package/lib/cjs/checkpoints.d.ts +0 -959
  8. package/lib/cjs/common.d.ts +0 -115
  9. package/lib/cjs/indexes.d.ts +0 -966
  10. package/lib/cjs/metrics.d.ts +0 -827
  11. package/lib/cjs/persisters.d.ts +0 -727
  12. package/lib/cjs/queries.d.ts +0 -3024
  13. package/lib/cjs/relationships.d.ts +0 -1201
  14. package/lib/cjs/store.d.ts +0 -5244
  15. package/lib/cjs/tinybase.d.ts +0 -14
  16. package/lib/cjs/tools.d.ts +0 -512
  17. package/lib/cjs/ui-react.d.ts +0 -10921
  18. package/lib/cjs-es6/checkpoints.d.ts +0 -959
  19. package/lib/cjs-es6/persisters.d.ts +0 -727
  20. package/lib/cjs-es6/store.d.ts +0 -5244
  21. package/lib/common.d.ts +0 -115
  22. package/lib/debug/checkpoints.d.ts +0 -959
  23. package/lib/debug/common.d.ts +0 -115
  24. package/lib/debug/indexes.d.ts +0 -966
  25. package/lib/debug/metrics.d.ts +0 -827
  26. package/lib/debug/queries.d.ts +0 -3024
  27. package/lib/debug/relationships.d.ts +0 -1201
  28. package/lib/debug/tinybase.d.ts +0 -14
  29. package/lib/debug/tools.d.ts +0 -512
  30. package/lib/debug/ui-react.d.ts +0 -10921
  31. package/lib/es6/checkpoints.d.ts +0 -959
  32. package/lib/es6/common.d.ts +0 -115
  33. package/lib/es6/indexes.d.ts +0 -966
  34. package/lib/es6/metrics.d.ts +0 -827
  35. package/lib/es6/persisters.d.ts +0 -727
  36. package/lib/es6/queries.d.ts +0 -3024
  37. package/lib/es6/relationships.d.ts +0 -1201
  38. package/lib/es6/store.d.ts +0 -5244
  39. package/lib/es6/tinybase.d.ts +0 -14
  40. package/lib/es6/tools.d.ts +0 -512
  41. package/lib/es6/ui-react.d.ts +0 -10921
  42. package/lib/indexes.d.ts +0 -966
  43. package/lib/metrics.d.ts +0 -827
  44. package/lib/persisters.d.ts +0 -727
  45. package/lib/queries.d.ts +0 -3024
  46. package/lib/relationships.d.ts +0 -1201
  47. package/lib/store.d.ts +0 -5244
  48. package/lib/tinybase.d.ts +0 -14
  49. package/lib/tools.d.ts +0 -512
  50. package/lib/ui-react.d.ts +0 -10921
  51. package/lib/umd/checkpoints.d.ts +0 -959
  52. package/lib/umd/common.d.ts +0 -115
  53. package/lib/umd/indexes.d.ts +0 -966
  54. package/lib/umd/metrics.d.ts +0 -827
  55. package/lib/umd/persisters.d.ts +0 -727
  56. package/lib/umd/queries.d.ts +0 -3024
  57. package/lib/umd/relationships.d.ts +0 -1201
  58. package/lib/umd/store.d.ts +0 -5244
  59. package/lib/umd/tinybase.d.ts +0 -14
  60. package/lib/umd/tools.d.ts +0 -512
  61. package/lib/umd/ui-react.d.ts +0 -10921
  62. package/lib/umd-es6/checkpoints.d.ts +0 -959
  63. package/lib/umd-es6/common.d.ts +0 -115
  64. package/lib/umd-es6/indexes.d.ts +0 -966
  65. package/lib/umd-es6/metrics.d.ts +0 -827
  66. package/lib/umd-es6/persisters.d.ts +0 -727
  67. package/lib/umd-es6/queries.d.ts +0 -3024
  68. package/lib/umd-es6/relationships.d.ts +0 -1201
  69. package/lib/umd-es6/store.d.ts +0 -5244
  70. package/lib/umd-es6/tinybase.d.ts +0 -14
  71. package/lib/umd-es6/tools.d.ts +0 -512
  72. package/lib/umd-es6/ui-react.d.ts +0 -10921
  73. /package/lib/{checkpoints.d.ts → types/checkpoints.d.ts} +0 -0
  74. /package/lib/{cjs-es6 → types}/common.d.ts +0 -0
  75. /package/lib/{cjs-es6 → types}/indexes.d.ts +0 -0
  76. /package/lib/{cjs-es6 → types}/metrics.d.ts +0 -0
  77. /package/lib/{cjs-es6 → types}/queries.d.ts +0 -0
  78. /package/lib/{cjs-es6 → types}/relationships.d.ts +0 -0
  79. /package/lib/{cjs-es6 → types}/tinybase.d.ts +0 -0
  80. /package/lib/{cjs-es6 → types}/tools.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;