@signaldb/core 2.0.0-beta.2 → 2.0.0-beta.21

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 (145) hide show
  1. package/dist/.vite/manifest.json +183 -80
  2. package/dist/AsyncDataAdapter.d.ts +53 -7
  3. package/dist/AutoFetchDataAdapter.d.ts +4 -6
  4. package/dist/Collection/Cursor.d.ts +56 -4
  5. package/dist/Collection/Observer.d.ts +33 -0
  6. package/dist/Collection/index.d.ts +66 -19
  7. package/dist/Collection/types.d.ts +9 -2
  8. package/dist/DataAdapter.d.ts +24 -6
  9. package/dist/DefaultDataAdapter.d.ts +5 -5
  10. package/dist/WorkerDataAdapter.d.ts +57 -5
  11. package/dist/WorkerDataAdapterHost.d.ts +9 -7
  12. package/dist/createIndex.d.ts +2 -2
  13. package/dist/createIndexProvider.d.ts +2 -2
  14. package/dist/createReactivityAdapter.d.ts +2 -2
  15. package/dist/createStorageAdapter.d.ts +1 -1
  16. package/dist/getIndexInfo.d.ts +3 -4
  17. package/dist/index.cjs.js +33 -31
  18. package/dist/index.d.ts +6 -1
  19. package/dist/index.mjs +17 -32
  20. package/dist/index10.cjs.js +11 -0
  21. package/dist/index10.mjs +10 -18
  22. package/dist/index11.cjs.js +23 -0
  23. package/dist/index11.mjs +22 -15
  24. package/dist/index12.cjs.js +45 -0
  25. package/dist/index12.mjs +44 -353
  26. package/dist/index13.cjs.js +22 -0
  27. package/dist/index13.mjs +21 -419
  28. package/dist/index14.cjs.js +45 -0
  29. package/dist/index14.mjs +44 -206
  30. package/dist/index15.cjs.js +86 -0
  31. package/dist/index15.mjs +85 -388
  32. package/dist/index16.cjs.js +15 -0
  33. package/dist/index16.mjs +14 -579
  34. package/dist/index17.cjs.js +141 -0
  35. package/dist/index17.mjs +140 -152
  36. package/dist/index18.cjs.js +47 -0
  37. package/dist/index18.mjs +46 -26
  38. package/dist/index19.cjs.js +15 -0
  39. package/dist/index19.mjs +14 -41
  40. package/dist/index2.cjs.js +33 -0
  41. package/dist/index2.mjs +32 -258
  42. package/dist/index20.cjs.js +23 -0
  43. package/dist/index20.mjs +22 -16
  44. package/dist/index21.cjs.js +37 -0
  45. package/dist/index21.mjs +36 -104
  46. package/dist/index22.cjs.js +35 -0
  47. package/dist/index22.mjs +34 -128
  48. package/dist/index23.cjs.js +21 -0
  49. package/dist/index23.mjs +20 -7
  50. package/dist/index24.cjs.js +19 -0
  51. package/dist/index24.mjs +18 -27
  52. package/dist/index25.cjs.js +157 -0
  53. package/dist/index25.mjs +156 -11
  54. package/dist/index26.cjs.js +38 -0
  55. package/dist/index26.mjs +37 -29
  56. package/dist/index27.cjs.js +42 -0
  57. package/dist/index27.mjs +41 -46
  58. package/dist/index28.cjs.js +347 -0
  59. package/dist/index28.mjs +345 -7
  60. package/dist/index29.cjs.js +602 -0
  61. package/dist/index29.mjs +601 -7
  62. package/dist/index3.cjs.js +19 -0
  63. package/dist/index3.mjs +18 -556
  64. package/dist/index30.cjs.js +11 -0
  65. package/dist/index30.mjs +10 -42
  66. package/dist/index31.cjs.js +11 -0
  67. package/dist/index31.mjs +10 -29
  68. package/dist/index32.cjs.js +90 -0
  69. package/dist/index32.mjs +89 -10
  70. package/dist/index33.cjs.js +53 -0
  71. package/dist/index33.mjs +52 -5
  72. package/dist/index34.cjs.js +453 -0
  73. package/dist/index34.mjs +453 -0
  74. package/dist/index35.cjs.js +72 -0
  75. package/dist/index35.mjs +72 -0
  76. package/dist/index36.cjs.js +580 -0
  77. package/dist/index36.mjs +580 -0
  78. package/dist/index37.cjs.js +21 -0
  79. package/dist/index37.mjs +21 -0
  80. package/dist/index38.cjs.js +363 -0
  81. package/dist/index38.mjs +363 -0
  82. package/dist/index39.cjs.js +513 -0
  83. package/dist/index39.mjs +513 -0
  84. package/dist/index4.cjs.js +209 -0
  85. package/dist/index4.mjs +204 -5
  86. package/dist/index5.cjs.js +187 -0
  87. package/dist/index5.mjs +186 -5
  88. package/dist/index6.cjs.js +303 -0
  89. package/dist/index6.mjs +301 -28
  90. package/dist/index7.cjs.js +125 -0
  91. package/dist/index7.mjs +124 -12
  92. package/dist/index8.cjs.js +33 -0
  93. package/dist/index8.mjs +32 -5
  94. package/dist/index9.cjs.js +12 -0
  95. package/dist/index9.mjs +11 -133
  96. package/dist/types/IndexProvider.d.ts +2 -2
  97. package/dist/types/Modifier.d.ts +1 -1
  98. package/dist/types/ReactivityAdapter.d.ts +1 -1
  99. package/dist/types/StorageAdapter.d.ts +9 -1
  100. package/dist/utils/applyQueryOptions.d.ts +15 -0
  101. package/dist/utils/createSignal.d.ts +2 -2
  102. package/dist/utils/getMatchingKeys.d.ts +2 -2
  103. package/dist/utils/idIndexQuery.d.ts +20 -0
  104. package/dist/utils/incrementalQueryUpdate.d.ts +62 -0
  105. package/dist/utils/isFieldExpression.d.ts +1 -1
  106. package/dist/utils/match.d.ts +1 -1
  107. package/dist/utils/modify.d.ts +1 -1
  108. package/dist/utils/projectItems.d.ts +12 -0
  109. package/dist/utils/queryDelta.d.ts +83 -0
  110. package/dist/utils/queryId.d.ts +2 -2
  111. package/dist/utils/reactiveOrAsync.d.ts +59 -0
  112. package/dist/utils/storageIndexQuery.d.ts +20 -0
  113. package/package.json +1 -1
  114. package/dist/index.cjs10.js +0 -18
  115. package/dist/index.cjs11.js +0 -15
  116. package/dist/index.cjs12.js +0 -353
  117. package/dist/index.cjs13.js +0 -419
  118. package/dist/index.cjs14.js +0 -206
  119. package/dist/index.cjs15.js +0 -388
  120. package/dist/index.cjs16.js +0 -579
  121. package/dist/index.cjs17.js +0 -152
  122. package/dist/index.cjs18.js +0 -26
  123. package/dist/index.cjs19.js +0 -42
  124. package/dist/index.cjs2.js +0 -259
  125. package/dist/index.cjs20.js +0 -16
  126. package/dist/index.cjs21.js +0 -104
  127. package/dist/index.cjs22.js +0 -129
  128. package/dist/index.cjs23.js +0 -7
  129. package/dist/index.cjs24.js +0 -27
  130. package/dist/index.cjs25.js +0 -10
  131. package/dist/index.cjs26.js +0 -29
  132. package/dist/index.cjs27.js +0 -46
  133. package/dist/index.cjs28.js +0 -8
  134. package/dist/index.cjs29.js +0 -7
  135. package/dist/index.cjs3.js +0 -557
  136. package/dist/index.cjs30.js +0 -42
  137. package/dist/index.cjs31.js +0 -29
  138. package/dist/index.cjs32.js +0 -9
  139. package/dist/index.cjs33.js +0 -5
  140. package/dist/index.cjs4.js +0 -5
  141. package/dist/index.cjs5.js +0 -5
  142. package/dist/index.cjs6.js +0 -29
  143. package/dist/index.cjs7.js +0 -12
  144. package/dist/index.cjs8.js +0 -5
  145. package/dist/index.cjs9.js +0 -133
@@ -1,117 +1,143 @@
1
1
  {
2
2
  "src/AsyncDataAdapter.ts": {
3
- "file": "index.cjs13.js",
3
+ "file": "index34.cjs.js",
4
4
  "name": "AsyncDataAdapter",
5
5
  "src": "src/AsyncDataAdapter.ts",
6
+ "isDynamicEntry": true,
6
7
  "imports": [
8
+ "src/getIndexInfo.ts",
7
9
  "src/utils/deepClone.ts",
10
+ "src/utils/idIndexQuery.ts",
11
+ "src/utils/incrementalQueryUpdate.ts",
12
+ "src/utils/isEqual.ts",
8
13
  "src/utils/match.ts",
9
14
  "src/utils/modify.ts",
15
+ "src/utils/projectItems.ts",
16
+ "src/utils/queryDelta.ts",
10
17
  "src/utils/queryId.ts",
11
- "src/utils/isEqual.ts",
12
- "src/getIndexInfo.ts",
13
- "src/utils/getMatchingKeys.ts",
14
18
  "src/utils/sortItems.ts",
15
- "src/utils/project.ts"
19
+ "src/utils/storageIndexQuery.ts"
16
20
  ]
17
21
  },
18
22
  "src/AutoFetchDataAdapter.ts": {
19
- "file": "index.cjs16.js",
23
+ "file": "index39.cjs.js",
20
24
  "name": "AutoFetchDataAdapter",
21
25
  "src": "src/AutoFetchDataAdapter.ts",
26
+ "isDynamicEntry": true,
22
27
  "imports": [
28
+ "src/getIndexInfo.ts",
23
29
  "src/utils/deepClone.ts",
30
+ "src/utils/idIndexQuery.ts",
31
+ "src/utils/isEqual.ts",
24
32
  "src/utils/match.ts",
25
33
  "src/utils/modify.ts",
34
+ "src/utils/project.ts",
26
35
  "src/utils/queryId.ts",
27
- "src/utils/isEqual.ts",
28
- "src/getIndexInfo.ts",
29
- "src/utils/getMatchingKeys.ts",
30
36
  "src/utils/sortItems.ts",
31
- "src/utils/project.ts"
37
+ "src/utils/storageIndexQuery.ts"
32
38
  ]
33
39
  },
34
40
  "src/Collection/Cursor.ts": {
35
- "file": "index.cjs2.js",
41
+ "file": "index6.cjs.js",
36
42
  "name": "Collection/Cursor",
37
43
  "src": "src/Collection/Cursor.ts",
44
+ "isDynamicEntry": true,
38
45
  "imports": [
39
46
  "src/Collection/Observer.ts"
40
47
  ]
41
48
  },
42
49
  "src/Collection/Observer.ts": {
43
- "file": "index.cjs17.js",
50
+ "file": "index5.cjs.js",
44
51
  "name": "Collection/Observer",
45
52
  "src": "src/Collection/Observer.ts",
53
+ "isDynamicEntry": true,
46
54
  "imports": [
47
55
  "src/utils/isEqual.ts",
56
+ "src/utils/queryDelta.ts",
48
57
  "src/utils/uniqueBy.ts"
49
58
  ]
50
59
  },
51
60
  "src/Collection/index.ts": {
52
- "file": "index.cjs3.js",
61
+ "file": "index29.cjs.js",
53
62
  "name": "Collection/index",
54
63
  "src": "src/Collection/index.ts",
64
+ "isDynamicEntry": true,
55
65
  "imports": [
66
+ "src/Collection/Cursor.ts",
67
+ "src/DefaultDataAdapter.ts",
68
+ "src/createIndex.ts",
56
69
  "src/utils/EventEmitter.ts",
57
70
  "src/utils/createSignal.ts",
58
- "src/utils/randomId.ts",
59
- "src/DefaultDataAdapter.ts",
60
- "src/utils/modify.ts",
61
71
  "src/utils/deepClone.ts",
72
+ "src/utils/modify.ts",
62
73
  "src/utils/queryId.ts",
63
- "src/Collection/Cursor.ts"
74
+ "src/utils/randomId.ts"
64
75
  ]
65
76
  },
66
77
  "src/DefaultDataAdapter.ts": {
67
- "file": "index.cjs12.js",
78
+ "file": "index28.cjs.js",
68
79
  "name": "DefaultDataAdapter",
69
80
  "src": "src/DefaultDataAdapter.ts",
81
+ "isDynamicEntry": true,
70
82
  "imports": [
71
83
  "src/createIndex.ts",
72
84
  "src/getIndexInfo.ts",
73
- "src/utils/deepClone.ts",
74
85
  "src/utils/EventEmitter.ts",
86
+ "src/utils/deepClone.ts",
87
+ "src/utils/idIndexQuery.ts",
88
+ "src/utils/incrementalQueryUpdate.ts",
75
89
  "src/utils/isEqual.ts",
76
90
  "src/utils/match.ts",
77
91
  "src/utils/modify.ts",
78
- "src/utils/project.ts",
92
+ "src/utils/projectItems.ts",
93
+ "src/utils/queryDelta.ts",
79
94
  "src/utils/queryId.ts",
80
95
  "src/utils/serializeValue.ts",
81
96
  "src/utils/sortItems.ts"
82
97
  ]
83
98
  },
84
99
  "src/WorkerDataAdapter.ts": {
85
- "file": "index.cjs14.js",
100
+ "file": "index36.cjs.js",
86
101
  "name": "WorkerDataAdapter",
87
102
  "src": "src/WorkerDataAdapter.ts",
103
+ "isDynamicEntry": true,
88
104
  "imports": [
105
+ "src/utils/batchOnNextTick.ts",
106
+ "src/utils/deepClone.ts",
107
+ "src/utils/incrementalQueryUpdate.ts",
108
+ "src/utils/match.ts",
109
+ "src/utils/modify.ts",
110
+ "src/utils/queryDelta.ts",
89
111
  "src/utils/queryId.ts",
90
- "src/utils/randomId.ts",
91
- "src/utils/batchOnNextTick.ts"
112
+ "src/utils/randomId.ts"
92
113
  ]
93
114
  },
94
115
  "src/WorkerDataAdapterHost.ts": {
95
- "file": "index.cjs15.js",
116
+ "file": "index38.cjs.js",
96
117
  "name": "WorkerDataAdapterHost",
97
118
  "src": "src/WorkerDataAdapterHost.ts",
119
+ "isDynamicEntry": true,
98
120
  "imports": [
121
+ "src/getIndexInfo.ts",
122
+ "src/utils/compact.ts",
99
123
  "src/utils/deepClone.ts",
124
+ "src/utils/idIndexQuery.ts",
125
+ "src/utils/incrementalQueryUpdate.ts",
126
+ "src/utils/isEqual.ts",
100
127
  "src/utils/match.ts",
101
128
  "src/utils/modify.ts",
129
+ "src/utils/projectItems.ts",
130
+ "src/utils/queryDelta.ts",
102
131
  "src/utils/queryId.ts",
103
- "src/utils/isEqual.ts",
104
- "src/getIndexInfo.ts",
105
- "src/utils/getMatchingKeys.ts",
106
132
  "src/utils/sortItems.ts",
107
- "src/utils/project.ts",
108
- "src/utils/compact.ts"
133
+ "src/utils/storageIndexQuery.ts"
109
134
  ]
110
135
  },
111
136
  "src/createIndex.ts": {
112
- "file": "index.cjs21.js",
137
+ "file": "index15.cjs.js",
113
138
  "name": "createIndex",
114
139
  "src": "src/createIndex.ts",
140
+ "isDynamicEntry": true,
115
141
  "imports": [
116
142
  "src/createIndexProvider.ts",
117
143
  "src/utils/get.ts",
@@ -120,24 +146,28 @@
120
146
  ]
121
147
  },
122
148
  "src/createIndexProvider.ts": {
123
- "file": "index.cjs33.js",
149
+ "file": "index10.cjs.js",
124
150
  "name": "createIndexProvider",
125
- "src": "src/createIndexProvider.ts"
151
+ "src": "src/createIndexProvider.ts",
152
+ "isDynamicEntry": true
126
153
  },
127
154
  "src/createReactivityAdapter.ts": {
128
- "file": "index.cjs5.js",
155
+ "file": "index31.cjs.js",
129
156
  "name": "createReactivityAdapter",
130
- "src": "src/createReactivityAdapter.ts"
157
+ "src": "src/createReactivityAdapter.ts",
158
+ "isDynamicEntry": true
131
159
  },
132
160
  "src/createStorageAdapter.ts": {
133
- "file": "index.cjs4.js",
161
+ "file": "index30.cjs.js",
134
162
  "name": "createStorageAdapter",
135
- "src": "src/createStorageAdapter.ts"
163
+ "src": "src/createStorageAdapter.ts",
164
+ "isDynamicEntry": true
136
165
  },
137
166
  "src/getIndexInfo.ts": {
138
- "file": "index.cjs22.js",
167
+ "file": "index17.cjs.js",
139
168
  "name": "getIndexInfo",
140
169
  "src": "src/getIndexInfo.ts",
170
+ "isDynamicEntry": true,
141
171
  "imports": [
142
172
  "src/utils/intersection.ts"
143
173
  ]
@@ -148,130 +178,203 @@
148
178
  "src": "src/index.ts",
149
179
  "isEntry": true,
150
180
  "imports": [
181
+ "src/AsyncDataAdapter.ts",
182
+ "src/AutoFetchDataAdapter.ts",
151
183
  "src/Collection/Cursor.ts",
152
184
  "src/Collection/index.ts",
153
- "src/createStorageAdapter.ts",
185
+ "src/DefaultDataAdapter.ts",
186
+ "src/WorkerDataAdapter.ts",
187
+ "src/WorkerDataAdapterHost.ts",
154
188
  "src/createReactivityAdapter.ts",
189
+ "src/createStorageAdapter.ts",
190
+ "src/utils/EventEmitter.ts",
191
+ "src/utils/get.ts",
155
192
  "src/utils/isEqual.ts",
156
193
  "src/utils/modify.ts",
157
194
  "src/utils/randomId.ts",
158
- "src/utils/EventEmitter.ts",
159
- "src/utils/get.ts",
160
- "src/utils/serializeValue.ts",
161
- "src/DefaultDataAdapter.ts",
162
- "src/AsyncDataAdapter.ts",
163
- "src/WorkerDataAdapter.ts",
164
- "src/WorkerDataAdapterHost.ts",
165
- "src/AutoFetchDataAdapter.ts"
195
+ "src/utils/reactiveOrAsync.ts",
196
+ "src/utils/serializeValue.ts"
166
197
  ]
167
198
  },
168
199
  "src/utils/EventEmitter.ts": {
169
- "file": "index.cjs9.js",
200
+ "file": "index7.cjs.js",
170
201
  "name": "utils/EventEmitter",
171
- "src": "src/utils/EventEmitter.ts"
202
+ "src": "src/utils/EventEmitter.ts",
203
+ "isDynamicEntry": true
172
204
  },
173
205
  "src/utils/batchOnNextTick.ts": {
174
- "file": "index.cjs27.js",
206
+ "file": "index35.cjs.js",
175
207
  "name": "utils/batchOnNextTick",
176
- "src": "src/utils/batchOnNextTick.ts"
208
+ "src": "src/utils/batchOnNextTick.ts",
209
+ "isDynamicEntry": true
177
210
  },
178
211
  "src/utils/compact.ts": {
179
- "file": "index.cjs28.js",
212
+ "file": "index37.cjs.js",
180
213
  "name": "utils/compact",
181
- "src": "src/utils/compact.ts"
214
+ "src": "src/utils/compact.ts",
215
+ "isDynamicEntry": true
182
216
  },
183
217
  "src/utils/createSignal.ts": {
184
- "file": "index.cjs18.js",
218
+ "file": "index8.cjs.js",
185
219
  "name": "utils/createSignal",
186
- "src": "src/utils/createSignal.ts"
220
+ "src": "src/utils/createSignal.ts",
221
+ "isDynamicEntry": true
187
222
  },
188
223
  "src/utils/deepClone.ts": {
189
- "file": "index.cjs19.js",
224
+ "file": "index18.cjs.js",
190
225
  "name": "utils/deepClone",
191
- "src": "src/utils/deepClone.ts"
226
+ "src": "src/utils/deepClone.ts",
227
+ "isDynamicEntry": true
192
228
  },
193
229
  "src/utils/get.ts": {
194
- "file": "index.cjs10.js",
230
+ "file": "index11.cjs.js",
195
231
  "name": "utils/get",
196
- "src": "src/utils/get.ts"
232
+ "src": "src/utils/get.ts",
233
+ "isDynamicEntry": true
197
234
  },
198
235
  "src/utils/getMatchingKeys.ts": {
199
- "file": "index.cjs26.js",
236
+ "file": "index14.cjs.js",
200
237
  "name": "utils/getMatchingKeys",
201
238
  "src": "src/utils/getMatchingKeys.ts",
239
+ "isDynamicEntry": true,
202
240
  "imports": [
203
241
  "src/utils/isFieldExpression.ts",
204
242
  "src/utils/serializeValue.ts"
205
243
  ]
206
244
  },
245
+ "src/utils/idIndexQuery.ts": {
246
+ "file": "index27.cjs.js",
247
+ "name": "utils/idIndexQuery",
248
+ "src": "src/utils/idIndexQuery.ts",
249
+ "isDynamicEntry": true,
250
+ "imports": [
251
+ "src/utils/isFieldExpression.ts"
252
+ ]
253
+ },
254
+ "src/utils/incrementalQueryUpdate.ts": {
255
+ "file": "index25.cjs.js",
256
+ "name": "utils/incrementalQueryUpdate",
257
+ "src": "src/utils/incrementalQueryUpdate.ts",
258
+ "isDynamicEntry": true,
259
+ "imports": [
260
+ "src/utils/match.ts",
261
+ "src/utils/projectItems.ts",
262
+ "src/utils/sortItems.ts"
263
+ ]
264
+ },
207
265
  "src/utils/intersection.ts": {
208
- "file": "index.cjs29.js",
266
+ "file": "index16.cjs.js",
209
267
  "name": "utils/intersection",
210
- "src": "src/utils/intersection.ts"
268
+ "src": "src/utils/intersection.ts",
269
+ "isDynamicEntry": true
211
270
  },
212
271
  "src/utils/isEqual.ts": {
213
- "file": "index.cjs6.js",
272
+ "file": "index2.cjs.js",
214
273
  "name": "utils/isEqual",
215
- "src": "src/utils/isEqual.ts"
274
+ "src": "src/utils/isEqual.ts",
275
+ "isDynamicEntry": true
216
276
  },
217
277
  "src/utils/isFieldExpression.ts": {
218
- "file": "index.cjs30.js",
278
+ "file": "index12.cjs.js",
219
279
  "name": "utils/isFieldExpression",
220
- "src": "src/utils/isFieldExpression.ts"
280
+ "src": "src/utils/isFieldExpression.ts",
281
+ "isDynamicEntry": true
221
282
  },
222
283
  "src/utils/match.ts": {
223
- "file": "index.cjs23.js",
284
+ "file": "index19.cjs.js",
224
285
  "name": "utils/match",
225
- "src": "src/utils/match.ts"
286
+ "src": "src/utils/match.ts",
287
+ "isDynamicEntry": true
226
288
  },
227
289
  "src/utils/modify.ts": {
228
- "file": "index.cjs7.js",
290
+ "file": "index20.cjs.js",
229
291
  "name": "utils/modify",
230
292
  "src": "src/utils/modify.ts",
293
+ "isDynamicEntry": true,
231
294
  "imports": [
232
295
  "src/utils/deepClone.ts"
233
296
  ]
234
297
  },
235
298
  "src/utils/project.ts": {
236
- "file": "index.cjs24.js",
299
+ "file": "index22.cjs.js",
237
300
  "name": "utils/project",
238
301
  "src": "src/utils/project.ts",
302
+ "isDynamicEntry": true,
239
303
  "imports": [
240
304
  "src/utils/get.ts",
241
305
  "src/utils/set.ts"
242
306
  ]
243
307
  },
308
+ "src/utils/projectItems.ts": {
309
+ "file": "index23.cjs.js",
310
+ "name": "utils/projectItems",
311
+ "src": "src/utils/projectItems.ts",
312
+ "isDynamicEntry": true,
313
+ "imports": [
314
+ "src/utils/project.ts"
315
+ ]
316
+ },
317
+ "src/utils/queryDelta.ts": {
318
+ "file": "index4.cjs.js",
319
+ "name": "utils/queryDelta",
320
+ "src": "src/utils/queryDelta.ts",
321
+ "isDynamicEntry": true,
322
+ "imports": [
323
+ "src/utils/isEqual.ts"
324
+ ]
325
+ },
244
326
  "src/utils/queryId.ts": {
245
- "file": "index.cjs20.js",
327
+ "file": "index26.cjs.js",
246
328
  "name": "utils/queryId",
247
- "src": "src/utils/queryId.ts"
329
+ "src": "src/utils/queryId.ts",
330
+ "isDynamicEntry": true
248
331
  },
249
332
  "src/utils/randomId.ts": {
250
- "file": "index.cjs8.js",
333
+ "file": "index9.cjs.js",
251
334
  "name": "utils/randomId",
252
- "src": "src/utils/randomId.ts"
335
+ "src": "src/utils/randomId.ts",
336
+ "isDynamicEntry": true
337
+ },
338
+ "src/utils/reactiveOrAsync.ts": {
339
+ "file": "index32.cjs.js",
340
+ "name": "utils/reactiveOrAsync",
341
+ "src": "src/utils/reactiveOrAsync.ts",
342
+ "isDynamicEntry": true
253
343
  },
254
344
  "src/utils/serializeValue.ts": {
255
- "file": "index.cjs11.js",
345
+ "file": "index13.cjs.js",
256
346
  "name": "utils/serializeValue",
257
- "src": "src/utils/serializeValue.ts"
347
+ "src": "src/utils/serializeValue.ts",
348
+ "isDynamicEntry": true
258
349
  },
259
350
  "src/utils/set.ts": {
260
- "file": "index.cjs31.js",
351
+ "file": "index21.cjs.js",
261
352
  "name": "utils/set",
262
- "src": "src/utils/set.ts"
353
+ "src": "src/utils/set.ts",
354
+ "isDynamicEntry": true
263
355
  },
264
356
  "src/utils/sortItems.ts": {
265
- "file": "index.cjs25.js",
357
+ "file": "index24.cjs.js",
266
358
  "name": "utils/sortItems",
267
359
  "src": "src/utils/sortItems.ts",
360
+ "isDynamicEntry": true,
268
361
  "imports": [
269
362
  "src/utils/get.ts"
270
363
  ]
271
364
  },
365
+ "src/utils/storageIndexQuery.ts": {
366
+ "file": "index33.cjs.js",
367
+ "name": "utils/storageIndexQuery",
368
+ "src": "src/utils/storageIndexQuery.ts",
369
+ "isDynamicEntry": true,
370
+ "imports": [
371
+ "src/utils/getMatchingKeys.ts"
372
+ ]
373
+ },
272
374
  "src/utils/uniqueBy.ts": {
273
- "file": "index.cjs32.js",
375
+ "file": "index3.cjs.js",
274
376
  "name": "utils/uniqueBy",
275
- "src": "src/utils/uniqueBy.ts"
377
+ "src": "src/utils/uniqueBy.ts",
378
+ "isDynamicEntry": true
276
379
  }
277
380
  }
@@ -1,8 +1,6 @@
1
- import type { BaseItem } from './Collection';
2
- import type Collection from './Collection';
3
- import type DataAdapter from './DataAdapter';
4
- import type { CollectionBackend } from './DataAdapter';
5
- import type StorageAdapter from './types/StorageAdapter';
1
+ import { BaseItem, default as Collection } from './Collection';
2
+ import { default as DataAdapter, CollectionBackend } from './DataAdapter';
3
+ import { default as StorageAdapter } from './types/StorageAdapter';
6
4
  export interface AsyncDataAdapterOptions {
7
5
  /** Factory to obtain a StorageAdapter per collection name */
8
6
  storage: (name: string) => StorageAdapter<any, any>;
@@ -10,6 +8,30 @@ export interface AsyncDataAdapterOptions {
10
8
  id?: string;
11
9
  /** Optional error hook (mirrors WorkerDataAdapterHost) */
12
10
  onError?: (error: Error) => void;
11
+ /**
12
+ * How often a failing query is retried before it is published as `'error'`.
13
+ * A query that fails is otherwise a dead end for the rest of the session —
14
+ * cursors only requery on `'complete'`, so they keep serving their neutral
15
+ * empty value, which consumers cannot tell apart from "there is no data".
16
+ */
17
+ retry?: {
18
+ /** Total attempts including the first one. Default 3. */
19
+ attempts?: number;
20
+ /** Delay in ms before attempt N+1. Default 100 * 4 ** (attempt - 1). */
21
+ delay?: (attempt: number) => number;
22
+ };
23
+ }
24
+ /**
25
+ * Carries the context needed to act on a failed query. The bare storage error
26
+ * on its own does not say which collection or selector produced it, which made
27
+ * the default `console.error` hook close to useless.
28
+ */
29
+ export declare class QueryError extends Error {
30
+ readonly collectionName: string;
31
+ readonly selector: unknown;
32
+ readonly options: unknown;
33
+ readonly attempts: number;
34
+ constructor(collectionName: string, selector: unknown, options: unknown, attempts: number, cause: unknown);
13
35
  }
14
36
  /**
15
37
  * AsyncDataAdapter
@@ -22,6 +44,8 @@ export default class AsyncDataAdapter implements DataAdapter {
22
44
  private options;
23
45
  private id;
24
46
  private onError;
47
+ private retryAttempts;
48
+ private retryDelay;
25
49
  private storageAdapters;
26
50
  private storageAdapterReady;
27
51
  private collectionIndices;
@@ -37,22 +61,44 @@ export default class AsyncDataAdapter implements DataAdapter {
37
61
  * @param options - query options
38
62
  */
39
63
  private fulfillQuery;
64
+ /**
65
+ * Executes a query, retrying transient failures before giving up. The state
66
+ * stays `'active'` across retries — consumers should see "still loading",
67
+ * not "failed", until we actually stop trying. Only the final failure is
68
+ * published as `'error'` and reported through `onError`; previously that
69
+ * error was swallowed entirely (`fulfillQuery` caught it internally, so the
70
+ * `.catch(this.onError)` on its call site was unreachable) and the query
71
+ * stayed dead for the rest of the session.
72
+ * @param collectionName - name of the collection
73
+ * @param selector - query selector
74
+ * @param options - query options
75
+ */
76
+ private runQuery;
40
77
  /**
41
78
  * Notify listeners about state changes and keep the cache updated
42
79
  * @param collectionName - name of the collection
43
80
  * @param qid - query id
44
81
  * @param state - new state
45
82
  * @param error - error if state is 'error', null otherwise
83
+ * @param delta - what changed about the result, when that is known
46
84
  */
47
85
  private publishState;
48
86
  private publishResult;
87
+ private queryItemIds;
49
88
  private getIndexInfo;
50
89
  private queryItems;
51
90
  private executeQuery;
52
91
  /**
53
- * After mutations, recompute and push updates for affected active queries
92
+ * After mutations, bring every affected active query up to date.
93
+ *
94
+ * A query whose previous result is enough to answer the change is brought up to date from that
95
+ * result alone — no round trip to the storage, and no detour through `'active'`, because there is
96
+ * no window in which the query is stale. Only a query the change cannot be reasoned about
97
+ * locally — a window onto a larger set, or one that has never been answered — goes back to the
98
+ * store, and that one gets the same retry and reporting behaviour a freshly registered query
99
+ * gets: a refresh that fails silently leaves exactly the same dead cursor.
54
100
  * @param collectionName - name of the collection
55
- * @param changedItems - items that were inserted/updated/replaced/removed
101
+ * @param changes - the items the write created, updated or removed
56
102
  */
57
103
  private checkQueryUpdates;
58
104
  private insert;
@@ -1,9 +1,7 @@
1
- import type { BaseItem } from './Collection';
2
- import type Collection from './Collection';
3
- import type DataAdapter from './DataAdapter';
4
- import type { CollectionBackend } from './DataAdapter';
5
- import type StorageAdapter from './types/StorageAdapter';
6
- import type Selector from './types/Selector';
1
+ import { BaseItem, default as Collection } from './Collection';
2
+ import { default as DataAdapter, CollectionBackend } from './DataAdapter';
3
+ import { default as StorageAdapter } from './types/StorageAdapter';
4
+ import { default as Selector } from './types/Selector';
7
5
  /**
8
6
  * AutoFetchDataAdapterOptions
9
7
  *
@@ -1,15 +1,33 @@
1
- import type ReactivityAdapter from '../types/ReactivityAdapter';
2
- import type { BaseItem, FindOptions, Transform } from './types';
3
- import type { ObserveCallbacks } from './Observer';
1
+ import { default as ReactivityAdapter } from '../types/ReactivityAdapter';
2
+ import { QueryDelta } from '../utils/queryDelta';
3
+ import { BaseItem, FindOptions, Transform } from './types';
4
+ import { ObserveCallbacks } from './Observer';
4
5
  /**
5
6
  * Checks if the current scope is reactive, considering the provided reactivity adapter.
6
7
  * @param reactivity - The reactivity adapter or a boolean indicating whether reactivity is enabled.
7
8
  * @returns A boolean indicating if the current scope is reactive.
8
9
  */
9
10
  export declare function isInReactiveScope(reactivity: ReactivityAdapter | undefined | false): boolean;
11
+ /**
12
+ * Reports whether the query a cursor stands for has produced an outcome yet.
13
+ * Supplied by the collection, which owns the query registration; a cursor
14
+ * built without one simply never reports itself as loading.
15
+ */
16
+ export interface QueryStateAccessor {
17
+ /**
18
+ * Whether the query has settled — completed or failed — at least once
19
+ * since it was registered.
20
+ */
21
+ hasSettled: () => boolean;
22
+ /**
23
+ * Subscribes to the query settling. Returns a cleanup function.
24
+ */
25
+ onSettled: (callback: () => void) => () => void;
26
+ }
10
27
  export interface CursorOptions<T extends BaseItem, U = T, Async extends boolean = false> extends FindOptions<T, Async> {
11
28
  transform?: Transform<T, U>;
12
- bindEvents?: (requery: () => void) => () => void;
29
+ bindEvents?: (requery: () => void, applyDelta: (delta: QueryDelta<T>) => void) => () => void;
30
+ queryState?: QueryStateAccessor;
13
31
  }
14
32
  /**
15
33
  * Represents a cursor for querying and observing a filtered, sorted, and transformed
@@ -90,6 +108,31 @@ export default class Cursor<T extends BaseItem, U = T, Async extends boolean = f
90
108
  * @returns The total number of items in the result set.
91
109
  */
92
110
  count(): Async extends true ? Promise<number> : number;
111
+ /**
112
+ * Whether this cursor's query has yet to deliver a first result.
113
+ * ⚡️ this function is reactive!
114
+ *
115
+ * An asynchronous data adapter answers a newly registered query only after a
116
+ * round trip, and serves a neutral empty result until it does — which a
117
+ * consumer cannot otherwise tell apart from "there is nothing to show". This
118
+ * is that distinction, per query rather than per collection, so one screen
119
+ * waiting on its own data says nothing about any other query.
120
+ *
121
+ * Follows the usual `isLoading`/`isFetching` split: it reports "no result
122
+ * yet", not "an execution is in flight". A write that re-runs an
123
+ * already-settled query drives it through `'active'` again while this stays
124
+ * `false`, so a list does not fall back to a loading state every time one of
125
+ * its rows changes.
126
+ *
127
+ * A query that fails counts as settled — the `query.error` event on the
128
+ * collection is what surfaces the failure, and a loading state that never
129
+ * ends is the worse answer. Reading this registers the query if nothing else
130
+ * has, so it cannot wait on something nobody asked for. It is always `false`
131
+ * for an `{ async: true }` cursor, whose `fetch()` awaits the real result
132
+ * anyway, and for a data adapter that answers synchronously.
133
+ * @returns A boolean indicating whether the first result is still pending.
134
+ */
135
+ isLoading(): boolean;
93
136
  /**
94
137
  * Observes changes to the cursor's result set and triggers the specified callbacks
95
138
  * when items are added, removed, or updated. Supports reactivity and transformation.
@@ -110,4 +153,13 @@ export default class Cursor<T extends BaseItem, U = T, Async extends boolean = f
110
153
  * criteria have changed, and you want to ensure the cursor reflects the latest state.
111
154
  */
112
155
  requery(): void;
156
+ /**
157
+ * Brings the cursor up to date from a description of what changed, rather than by re-running the
158
+ * query and comparing the result with the previous one.
159
+ *
160
+ * Falls back to `requery` when the delta does not fit the result the cursor currently holds, so
161
+ * a caller never has to decide which of the two is safe.
162
+ * @param delta - The change to apply.
163
+ */
164
+ applyDelta(delta: QueryDelta<T>): void;
113
165
  }