@procedures/collections 0.47.1 → 0.48.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 (238) hide show
  1. package/CHANGELOG.md +32 -8
  2. package/README.md +3 -1
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/index.d.ts +1 -59
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +3 -95
  7. package/dist/index.js.map +1 -1
  8. package/dist/storage/index.d.ts +2 -2
  9. package/dist/storage/index.d.ts.map +1 -1
  10. package/dist/storage/index.js +1 -1
  11. package/dist/storage/index.js.map +1 -1
  12. package/dist/storage/memory.d.ts +1 -1
  13. package/dist/storage/memory.d.ts.map +1 -1
  14. package/dist/storage/memory.js +1 -1
  15. package/dist/storage/memory.js.map +1 -1
  16. package/dist/testing/index.d.ts +1 -1
  17. package/dist/testing/index.d.ts.map +1 -1
  18. package/dist/testing/index.js +1 -1
  19. package/dist/testing/index.js.map +1 -1
  20. package/dist/testing/storage-contract.js +1 -1
  21. package/dist/testing/storage-contract.js.map +1 -1
  22. package/dist/undo/index.d.ts +1 -1
  23. package/dist/undo/index.js +1 -1
  24. package/dist/undo/undo-log.d.ts +1 -1
  25. package/dist/undo/undo-log.js +1 -1
  26. package/package.json +5 -5
  27. package/src/index.ts +338 -214
  28. package/src/storage/index.ts +2 -2
  29. package/src/storage/memory.ts +1 -1
  30. package/src/testing/index.ts +1 -1
  31. package/src/testing/storage-contract.ts +1 -1
  32. package/src/undo/index.ts +1 -1
  33. package/src/undo/undo-log.ts +1 -1
  34. package/dist/async/async-queue.d.ts +0 -170
  35. package/dist/async/async-queue.d.ts.map +0 -1
  36. package/dist/async/async-queue.js +0 -404
  37. package/dist/async/async-queue.js.map +0 -1
  38. package/dist/async/channels.d.ts +0 -211
  39. package/dist/async/channels.d.ts.map +0 -1
  40. package/dist/async/channels.js +0 -393
  41. package/dist/async/channels.js.map +0 -1
  42. package/dist/async/settled.d.ts +0 -23
  43. package/dist/async/settled.d.ts.map +0 -1
  44. package/dist/async/settled.js +0 -32
  45. package/dist/async/settled.js.map +0 -1
  46. package/dist/behaviors/bounded.d.ts +0 -79
  47. package/dist/behaviors/bounded.d.ts.map +0 -1
  48. package/dist/behaviors/bounded.js +0 -393
  49. package/dist/behaviors/bounded.js.map +0 -1
  50. package/dist/behaviors/composite.d.ts +0 -17
  51. package/dist/behaviors/composite.d.ts.map +0 -1
  52. package/dist/behaviors/composite.js +0 -93
  53. package/dist/behaviors/composite.js.map +0 -1
  54. package/dist/behaviors/evented.d.ts +0 -154
  55. package/dist/behaviors/evented.d.ts.map +0 -1
  56. package/dist/behaviors/evented.js +0 -299
  57. package/dist/behaviors/evented.js.map +0 -1
  58. package/dist/behaviors/lru.d.ts +0 -84
  59. package/dist/behaviors/lru.d.ts.map +0 -1
  60. package/dist/behaviors/lru.js +0 -376
  61. package/dist/behaviors/lru.js.map +0 -1
  62. package/dist/behaviors/readonly.d.ts +0 -73
  63. package/dist/behaviors/readonly.d.ts.map +0 -1
  64. package/dist/behaviors/readonly.js +0 -189
  65. package/dist/behaviors/readonly.js.map +0 -1
  66. package/dist/behaviors/safe.d.ts +0 -163
  67. package/dist/behaviors/safe.d.ts.map +0 -1
  68. package/dist/behaviors/safe.js +0 -176
  69. package/dist/behaviors/safe.js.map +0 -1
  70. package/dist/behaviors/synchronized.d.ts +0 -88
  71. package/dist/behaviors/synchronized.d.ts.map +0 -1
  72. package/dist/behaviors/synchronized.js +0 -285
  73. package/dist/behaviors/synchronized.js.map +0 -1
  74. package/dist/behaviors/ttl.d.ts +0 -118
  75. package/dist/behaviors/ttl.d.ts.map +0 -1
  76. package/dist/behaviors/ttl.js +0 -354
  77. package/dist/behaviors/ttl.js.map +0 -1
  78. package/dist/contracts/model.d.ts +0 -29
  79. package/dist/contracts/model.d.ts.map +0 -1
  80. package/dist/contracts/model.js +0 -26
  81. package/dist/contracts/model.js.map +0 -1
  82. package/dist/core/effects.d.ts +0 -176
  83. package/dist/core/effects.d.ts.map +0 -1
  84. package/dist/core/effects.js +0 -180
  85. package/dist/core/effects.js.map +0 -1
  86. package/dist/core/events.d.ts +0 -192
  87. package/dist/core/events.d.ts.map +0 -1
  88. package/dist/core/events.js +0 -291
  89. package/dist/core/events.js.map +0 -1
  90. package/dist/core/middleware.d.ts +0 -231
  91. package/dist/core/middleware.d.ts.map +0 -1
  92. package/dist/core/middleware.js +0 -161
  93. package/dist/core/middleware.js.map +0 -1
  94. package/dist/core/policies.d.ts +0 -220
  95. package/dist/core/policies.d.ts.map +0 -1
  96. package/dist/core/policies.js +0 -48
  97. package/dist/core/policies.js.map +0 -1
  98. package/dist/core/traits.d.ts +0 -142
  99. package/dist/core/traits.d.ts.map +0 -1
  100. package/dist/core/traits.js +0 -8
  101. package/dist/core/traits.js.map +0 -1
  102. package/dist/fx/collectors.d.ts +0 -193
  103. package/dist/fx/collectors.d.ts.map +0 -1
  104. package/dist/fx/collectors.js +0 -375
  105. package/dist/fx/collectors.js.map +0 -1
  106. package/dist/fx/iter.d.ts +0 -166
  107. package/dist/fx/iter.d.ts.map +0 -1
  108. package/dist/fx/iter.js +0 -421
  109. package/dist/fx/iter.js.map +0 -1
  110. package/dist/impl/array-deque.d.ts +0 -112
  111. package/dist/impl/array-deque.d.ts.map +0 -1
  112. package/dist/impl/array-deque.js +0 -380
  113. package/dist/impl/array-deque.js.map +0 -1
  114. package/dist/impl/array-list.d.ts +0 -101
  115. package/dist/impl/array-list.d.ts.map +0 -1
  116. package/dist/impl/array-list.js +0 -387
  117. package/dist/impl/array-list.js.map +0 -1
  118. package/dist/impl/hash-map.d.ts +0 -149
  119. package/dist/impl/hash-map.d.ts.map +0 -1
  120. package/dist/impl/hash-map.js +0 -473
  121. package/dist/impl/hash-map.js.map +0 -1
  122. package/dist/impl/hash-set.d.ts +0 -125
  123. package/dist/impl/hash-set.d.ts.map +0 -1
  124. package/dist/impl/hash-set.js +0 -264
  125. package/dist/impl/hash-set.js.map +0 -1
  126. package/dist/impl/linked-hash-map.d.ts +0 -141
  127. package/dist/impl/linked-hash-map.d.ts.map +0 -1
  128. package/dist/impl/linked-hash-map.js +0 -442
  129. package/dist/impl/linked-hash-map.js.map +0 -1
  130. package/dist/impl/linked-list.d.ts +0 -109
  131. package/dist/impl/linked-list.d.ts.map +0 -1
  132. package/dist/impl/linked-list.js +0 -494
  133. package/dist/impl/linked-list.js.map +0 -1
  134. package/dist/impl/priority-queue.d.ts +0 -139
  135. package/dist/impl/priority-queue.d.ts.map +0 -1
  136. package/dist/impl/priority-queue.js +0 -343
  137. package/dist/impl/priority-queue.js.map +0 -1
  138. package/dist/impl/summary-tree.d.ts +0 -146
  139. package/dist/impl/summary-tree.d.ts.map +0 -1
  140. package/dist/impl/summary-tree.js +0 -524
  141. package/dist/impl/summary-tree.js.map +0 -1
  142. package/dist/impl/tree-map.d.ts +0 -153
  143. package/dist/impl/tree-map.d.ts.map +0 -1
  144. package/dist/impl/tree-map.js +0 -788
  145. package/dist/impl/tree-map.js.map +0 -1
  146. package/dist/impl/tree-set.d.ts +0 -112
  147. package/dist/impl/tree-set.d.ts.map +0 -1
  148. package/dist/impl/tree-set.js +0 -374
  149. package/dist/impl/tree-set.js.map +0 -1
  150. package/dist/interfaces/collection.d.ts +0 -119
  151. package/dist/interfaces/collection.d.ts.map +0 -1
  152. package/dist/interfaces/collection.js +0 -8
  153. package/dist/interfaces/collection.js.map +0 -1
  154. package/dist/interfaces/list.d.ts +0 -247
  155. package/dist/interfaces/list.d.ts.map +0 -1
  156. package/dist/interfaces/list.js +0 -8
  157. package/dist/interfaces/list.js.map +0 -1
  158. package/dist/interfaces/map.d.ts +0 -344
  159. package/dist/interfaces/map.d.ts.map +0 -1
  160. package/dist/interfaces/map.js +0 -8
  161. package/dist/interfaces/map.js.map +0 -1
  162. package/dist/interfaces/queue.d.ts +0 -304
  163. package/dist/interfaces/queue.d.ts.map +0 -1
  164. package/dist/interfaces/queue.js +0 -8
  165. package/dist/interfaces/queue.js.map +0 -1
  166. package/dist/interfaces/set.d.ts +0 -137
  167. package/dist/interfaces/set.d.ts.map +0 -1
  168. package/dist/interfaces/set.js +0 -8
  169. package/dist/interfaces/set.js.map +0 -1
  170. package/dist/order/index.d.ts +0 -7
  171. package/dist/order/index.d.ts.map +0 -1
  172. package/dist/order/index.js +0 -7
  173. package/dist/order/index.js.map +0 -1
  174. package/dist/order/rank.d.ts +0 -100
  175. package/dist/order/rank.d.ts.map +0 -1
  176. package/dist/order/rank.js +0 -286
  177. package/dist/order/rank.js.map +0 -1
  178. package/dist/storage/listeners.d.ts +0 -39
  179. package/dist/storage/listeners.d.ts.map +0 -1
  180. package/dist/storage/listeners.js +0 -65
  181. package/dist/storage/listeners.js.map +0 -1
  182. package/dist/testing/check.d.ts +0 -25
  183. package/dist/testing/check.d.ts.map +0 -1
  184. package/dist/testing/check.js +0 -85
  185. package/dist/testing/check.js.map +0 -1
  186. package/dist/utils/defaults.d.ts +0 -135
  187. package/dist/utils/defaults.d.ts.map +0 -1
  188. package/dist/utils/defaults.js +0 -322
  189. package/dist/utils/defaults.js.map +0 -1
  190. package/dist/utils/factories.d.ts +0 -144
  191. package/dist/utils/factories.d.ts.map +0 -1
  192. package/dist/utils/factories.js +0 -293
  193. package/dist/utils/factories.js.map +0 -1
  194. package/dist/utils/helpers.d.ts +0 -137
  195. package/dist/utils/helpers.d.ts.map +0 -1
  196. package/dist/utils/helpers.js +0 -221
  197. package/dist/utils/helpers.js.map +0 -1
  198. package/src/async/async-queue.ts +0 -481
  199. package/src/async/channels.ts +0 -450
  200. package/src/async/settled.ts +0 -41
  201. package/src/behaviors/bounded.ts +0 -485
  202. package/src/behaviors/composite.ts +0 -99
  203. package/src/behaviors/evented.ts +0 -464
  204. package/src/behaviors/lru.ts +0 -447
  205. package/src/behaviors/readonly.ts +0 -236
  206. package/src/behaviors/safe.ts +0 -372
  207. package/src/behaviors/synchronized.ts +0 -316
  208. package/src/behaviors/ttl.ts +0 -462
  209. package/src/contracts/model.ts +0 -44
  210. package/src/core/effects.ts +0 -323
  211. package/src/core/events.ts +0 -356
  212. package/src/core/middleware.ts +0 -415
  213. package/src/core/policies.ts +0 -316
  214. package/src/core/traits.ts +0 -164
  215. package/src/fx/collectors.ts +0 -500
  216. package/src/fx/iter.ts +0 -536
  217. package/src/impl/array-deque.ts +0 -463
  218. package/src/impl/array-list.ts +0 -490
  219. package/src/impl/hash-map.ts +0 -623
  220. package/src/impl/hash-set.ts +0 -342
  221. package/src/impl/linked-hash-map.ts +0 -572
  222. package/src/impl/linked-list.ts +0 -606
  223. package/src/impl/priority-queue.ts +0 -448
  224. package/src/impl/summary-tree.ts +0 -586
  225. package/src/impl/tree-map.ts +0 -912
  226. package/src/impl/tree-set.ts +0 -469
  227. package/src/interfaces/collection.ts +0 -141
  228. package/src/interfaces/list.ts +0 -281
  229. package/src/interfaces/map.ts +0 -405
  230. package/src/interfaces/queue.ts +0 -353
  231. package/src/interfaces/set.ts +0 -158
  232. package/src/order/index.ts +0 -6
  233. package/src/order/rank.ts +0 -271
  234. package/src/storage/listeners.ts +0 -72
  235. package/src/testing/check.ts +0 -81
  236. package/src/utils/defaults.ts +0 -345
  237. package/src/utils/factories.ts +0 -357
  238. package/src/utils/helpers.ts +0 -248
package/src/index.ts CHANGED
@@ -48,242 +48,366 @@
48
48
  * )
49
49
  */
50
50
 
51
- // ============================================================================
52
- // Core types and utilities
53
- // ============================================================================
54
-
55
- export * from "./core/traits.js";
56
- export * from "./core/effects.js";
57
- export * from "./core/policies.js";
58
- export * from "./core/middleware.js";
59
- export * from "./core/events.js";
60
- // ============================================================================
61
- // Interfaces
62
- // ============================================================================
63
-
64
- export * from "./interfaces/collection.js";
65
- export * from "./interfaces/list.js";
66
- export * from "./interfaces/map.js";
67
- export * from "./interfaces/set.js";
68
-
69
- // ============================================================================
70
- // Storage
71
- // ============================================================================
72
-
51
+ // The storage, the overlay and the undo log stay in this package.
73
52
  export * from "./storage/index.js";
74
-
75
- // The overlay: a logical document through a stack of layers, and the stacks from rules
76
53
  export * from "./overlay/index.js";
77
-
78
- // The order of a list as data: a rank between two neighbors, and the index of a drop
79
- export * from "./order/index.js";
80
-
81
- // The undo of the changes of items: the inverse of a patch, and an undo log
82
54
  export * from "./undo/index.js";
83
55
 
84
- // Export queue interfaces with disambiguation for PriorityQueue
85
- export type {
86
- ReadonlyQueue,
87
- Queue,
88
- Deque,
89
- BlockingQueue,
90
- PriorityQueue as IPriorityQueue,
91
- AsyncQueue as IAsyncQueue,
92
- TransferQueue,
93
- DelayQueue,
94
- } from "./interfaces/queue.js";
95
-
96
- // ============================================================================
97
- // Implementations
98
- // ============================================================================
99
-
100
- export * from "./impl/array-list.js";
101
- export * from "./impl/array-deque.js";
102
- export * from "./impl/hash-map.js";
103
- export * from "./impl/linked-hash-map.js";
104
- export * from "./impl/tree-map.js";
105
- export * from "./impl/tree-set.js";
106
- export * from "./impl/linked-list.js";
107
- export * from "./impl/hash-set.js";
108
- export * from "./impl/priority-queue.js";
109
- export { SummaryTree, summaryTree, type SummaryLocation, type SummaryMonoid, type SummarySearch, type SummarySpec } from "./impl/summary-tree.js";
110
-
111
- // ============================================================================
112
- // Behaviors
113
- // ============================================================================
114
-
115
- // Export bounded behaviors (excluding duplicate BoundedCollection interface)
56
+ // The lists, sets, maps, queues, behaviors, channels and lazy operations are in the general package.
116
57
  export {
58
+ type ArrayConvertible,
59
+ ArrayDeque,
60
+ type ArrayDequeOptions,
61
+ ArrayList,
62
+ type ArrayListOptions,
63
+ type Async,
64
+ AsyncEmitter,
65
+ type AsyncOption,
66
+ AsyncQueue,
67
+ type AsyncQueueOptions,
68
+ type AsyncResult,
69
+ type Asyncify,
70
+ type BiMap,
71
+ type BlockingQueue,
72
+ type Bounded,
73
+ type BoundedCollection,
117
74
  type BoundedOptions,
118
- boundedList,
119
- boundedQueue,
75
+ Channel,
76
+ type CircularList,
77
+ type Clearable,
78
+ type Cloneable,
79
+ type Collection,
80
+ CollectionBuilder,
81
+ type CollectionEvents,
82
+ type Collector,
83
+ type CompactionPolicy,
84
+ type Compare,
85
+ type ComparisonProvider,
86
+ type ConflictResolutionPolicy,
87
+ DEFAULT_CONFLICT_POLICY,
88
+ DEFAULT_EVICTION_POLICY,
89
+ DEFAULT_GROWTH_POLICY,
90
+ DEFAULT_OVERFLOW_POLICY,
91
+ DEFAULT_RETRY_POLICY,
92
+ DEFAULT_UNDERFLOW_POLICY,
93
+ DEFAULT_VALIDATION_POLICY,
94
+ type DelayQueue,
95
+ type Deque,
96
+ type DequeEvents,
97
+ type Disposable,
98
+ type ElementOf,
99
+ type ElementType,
100
+ Emitter,
101
+ type Emptiable,
102
+ type Entry,
103
+ type Eq,
104
+ type EqualityProvider,
105
+ Err,
106
+ EventBatcher,
107
+ type EventMap,
108
+ type Evented,
109
+ type EvictionCandidate,
110
+ type EvictionMetadata,
111
+ type EvictionPolicy,
112
+ type EvictionSelector,
113
+ type Freezable,
114
+ type GrowthPolicy,
115
+ type Hash,
116
+ HashMap,
117
+ type HashMapOptions,
118
+ type HashProvider,
119
+ HashSet,
120
+ type HashSetOptions,
121
+ type IAsyncQueue,
122
+ type IPriorityQueue,
123
+ type IsReadonly,
124
+ KEY_DIGITS,
125
+ type KeyCheckOptions,
126
+ type KeyedItem,
127
+ LRUCache,
128
+ type LRUOptions,
129
+ LinkedHashMap,
130
+ type LinkedHashMapOptions,
131
+ LinkedList,
132
+ type LinkedListOptions,
133
+ type List,
134
+ type ListEvents,
135
+ type Listener,
136
+ type MapEvents,
137
+ type MapLike,
138
+ type MergeFunction,
139
+ type Middleware,
140
+ type MultiMap,
141
+ type MutableCollectionBase,
142
+ type NavigableMap,
143
+ type NavigableSet,
144
+ None,
145
+ Ok,
146
+ type Option,
147
+ type OverflowContext,
148
+ type OverflowHandler,
149
+ type OverflowPolicy,
150
+ type Point,
151
+ PriorityQueue,
152
+ type PriorityQueueOptions,
153
+ type Queue,
154
+ type QueueEvents,
155
+ type RandomAccess,
156
+ type Readonly,
157
+ type ReadonlyCollection,
158
+ type ReadonlyCollectionBase,
159
+ type ReadonlyList,
160
+ type ReadonlyMapLike,
161
+ type ReadonlyOptions,
162
+ type ReadonlyQueue,
163
+ type ReadonlySet,
164
+ type Result,
165
+ type RetryContext,
166
+ type RetryPolicy,
167
+ type RetryPredicate,
168
+ type SafeCollection,
169
+ type SafeDequeOperations,
170
+ type SafeListOperations,
171
+ type SafeMapOperations,
172
+ type SafeQueueOperations,
173
+ type SelectCase,
174
+ type Set,
175
+ type Settled,
176
+ type Sized,
177
+ Some,
178
+ type SortedMap,
179
+ type SortedSet,
180
+ type Stack,
181
+ type SummaryLocation,
182
+ type SummaryMonoid,
183
+ type SummarySearch,
184
+ type SummarySpec,
185
+ type SummaryStatistics,
186
+ SummaryTree,
187
+ TTLCache,
188
+ type TTLOptions,
189
+ type TransferQueue,
190
+ TreeMap,
191
+ type TreeMapOptions,
192
+ TreeSet,
193
+ type TreeSetOptions,
194
+ type UnderflowContext,
195
+ type UnderflowHandler,
196
+ type UnderflowPolicy,
197
+ type Unsubscribe,
198
+ type ValidationContext,
199
+ type ValidationHandler,
200
+ type ValidationPolicy,
201
+ type Vector,
202
+ type WeakMapLike,
203
+ type WithCapability,
204
+ arrayContains,
205
+ arrayDeque,
206
+ arrayIterator,
207
+ arrayList,
208
+ arrayRemove,
209
+ arrayRemoveAll,
210
+ asSettled,
211
+ asyncQueue,
212
+ average,
213
+ averagingNumber,
214
+ blockMethods,
215
+ booleanCompare,
216
+ bounded,
120
217
  boundedDeque,
218
+ boundedList,
121
219
  boundedMap,
122
- bounded,
123
- } from "./behaviors/bounded.js";
124
-
125
- export * from "./behaviors/readonly.js";
126
- export * from "./behaviors/safe.js";
127
- export * from "./behaviors/evented.js";
128
- export * from "./behaviors/synchronized.js";
129
- export * from "./behaviors/lru.js";
130
- export * from "./behaviors/ttl.js";
131
-
132
- // ============================================================================
133
- // Async/Concurrent
134
- // ============================================================================
135
-
136
- export * from "./async/async-queue.js";
137
- export * from "./async/channels.js";
138
- export * from "./async/settled.js";
139
-
140
- // ============================================================================
141
- // Functional Operations
142
- // ============================================================================
143
-
144
- export * from "./fx/iter.js";
145
- export * from "./fx/collectors.js";
146
-
147
- // ============================================================================
148
- // Utilities
149
- // ============================================================================
150
-
151
- export * from "./utils/defaults.js";
152
- export * from "./utils/factories.js";
153
- export * from "./utils/helpers.js";
154
-
155
- // ============================================================================
156
- // Re-exports for convenience
157
- // ============================================================================
158
-
159
- // Most commonly used exports
160
- export { compose, bundle } from "./core/middleware.js";
161
- export { arrayList } from "./impl/array-list.js";
162
- export { arrayDeque } from "./impl/array-deque.js";
163
- export { hashMap } from "./impl/hash-map.js";
164
- export { linkedHashMap } from "./impl/linked-hash-map.js";
165
- export { treeMap } from "./impl/tree-map.js";
166
- export { treeSet } from "./impl/tree-set.js";
167
- export { linkedList } from "./impl/linked-list.js";
168
- export { hashSet } from "./impl/hash-set.js";
169
- export { priorityQueue } from "./impl/priority-queue.js";
170
- // Common behaviors
171
- export { readonly, readonlyList, readonlyMap } from "./behaviors/readonly.js";
172
- export { safeList, safeQueue, safeMap } from "./behaviors/safe.js";
173
- export { eventedList, eventedQueue, eventedMap } from "./behaviors/evented.js";
174
- export { synchronized } from "./behaviors/synchronized.js";
175
- export { lruMap, lruCache, LRUCache } from "./behaviors/lru.js";
176
- export { ttlMap, ttlCache, TTLCache, ttlCollection } from "./behaviors/ttl.js";
177
-
178
- // Async/Concurrent
179
- export { asyncQueue, AsyncQueue } from "./async/async-queue.js";
180
- export { asSettled, type Settled } from "./async/settled.js";
181
- export {
220
+ boundedQueue,
221
+ buffered,
222
+ buildList,
223
+ buildMap,
224
+ bundle,
182
225
  channel,
183
- Channel,
184
- select,
185
- timeout,
186
- ticker,
187
- pipeline,
188
- fanOut,
189
- fanIn,
190
- merge,
191
- workerPool,
192
- } from "./async/channels.js";
193
-
194
- // Functional operations
195
- export {
196
- map,
197
- filter,
198
- flatMap,
199
- flatten,
200
- take,
201
- skip,
202
- takeWhile,
203
- skipWhile,
204
- concat,
205
- zip,
206
- enumerate,
226
+ checkBounds,
227
+ checkInsertBounds,
228
+ checkRangeBounds,
207
229
  chunk,
208
- window,
209
- partition,
210
- reduce,
211
- scan,
212
- sort,
213
- reverse,
230
+ clamp,
231
+ collect,
232
+ collectToArray,
233
+ collectToList,
234
+ collectToMap,
235
+ collectToSet,
236
+ combineHashes,
237
+ compareKeys,
238
+ comparing,
239
+ comparingKey,
240
+ compose,
241
+ concat,
242
+ count,
243
+ counting,
244
+ createEmitter,
245
+ dateCompare,
246
+ deepEq,
247
+ defaultCompare,
248
+ defaultEq,
249
+ defaultHash,
250
+ delegate,
214
251
  distinct,
215
252
  distinctConsecutive,
216
- tap,
217
- some,
253
+ dropIndex,
254
+ emptyList,
255
+ emptyMap,
256
+ emptyQueue,
257
+ enhanceMethod,
258
+ enumerate,
259
+ eqBy,
260
+ evented,
261
+ eventedDeque,
262
+ eventedList,
263
+ eventedMap,
264
+ eventedQueue,
218
265
  every,
219
- none,
266
+ fanIn,
267
+ fanOut,
268
+ filter,
269
+ filtering,
220
270
  find,
221
- count,
222
- min,
223
- max,
224
- sum,
225
- average,
226
- toArray,
227
- toSet,
228
- toMap as iterToMap,
229
- pipe,
230
- } from "./fx/iter.js";
231
-
232
- export {
233
- collect,
234
- toList as collectToList,
235
- toArray as collectToArray,
236
- toSet as collectToSet,
237
- toMap as collectToMap,
271
+ findIndex,
272
+ findLastIndex,
273
+ first,
274
+ flatMap,
275
+ flatMapOption,
276
+ flatMapResult,
277
+ flatMapping,
278
+ flatten,
279
+ forwardEvent,
280
+ fromNullable,
281
+ getOrElse,
282
+ getOrElseResult,
283
+ groupBy,
238
284
  groupingBy,
239
285
  groupingByWith,
240
- partitioningBy,
241
- counting,
242
- summingNumber,
243
- averagingNumber,
244
- minBy,
245
- maxBy,
286
+ hasCapability,
287
+ hashBy,
288
+ hashMap,
289
+ hashNumber,
290
+ hashSet,
291
+ hashString,
292
+ immutableListOf,
293
+ immutableMapOf,
294
+ interceptMethods,
295
+ isErr,
296
+ isNone,
297
+ isOk,
298
+ isSome,
299
+ isValidKey,
300
+ iterToMap,
246
301
  joining,
247
- mapping,
248
- filtering,
249
- flatMapping,
250
- reducing,
251
- reducingWith,
252
- teeing,
253
- first,
302
+ keyBetween,
303
+ keysBetween,
304
+ keysForDrop,
254
305
  last,
255
- summarizingNumber,
256
- } from "./fx/collectors.js";
257
-
258
- // Common factories
259
- export {
260
- emptyList,
261
- emptyMap,
262
- emptyQueue,
263
- singletonList,
264
- singletonMap,
265
- nCopies,
306
+ linkedHashMap,
307
+ linkedList,
266
308
  listOf,
309
+ lruCache,
310
+ lruMap,
311
+ map,
312
+ mapAsyncOption,
313
+ mapAsyncResult,
314
+ mapError,
267
315
  mapOf,
316
+ mapOption,
317
+ mapResult,
318
+ mapping,
319
+ max,
320
+ maxBy,
321
+ merge,
322
+ min,
323
+ minBy,
324
+ mutableListOf,
325
+ mutableMapOf,
326
+ nCopies,
327
+ none,
328
+ nullsFirst,
329
+ nullsLast,
330
+ numberCompare,
331
+ onWhen,
332
+ optionToResult,
333
+ partition,
334
+ partitioningBy,
335
+ pipe,
336
+ pipeline,
337
+ priorityQueue,
338
+ queueOf,
268
339
  range,
269
340
  rangeTo,
341
+ readWriteLock,
342
+ readonly,
343
+ readonlyCollection,
344
+ readonlyList,
345
+ readonlyMap,
346
+ readonlyQueue,
347
+ reduce,
348
+ reducing,
349
+ reducingWith,
350
+ reentrantSynchronized,
351
+ requireNonEmpty,
352
+ requireNonNull,
353
+ resultToOption,
354
+ reverse,
355
+ reverseArrayIterator,
356
+ reversed,
357
+ safe,
358
+ safeDeque,
359
+ safeList,
360
+ safeMap,
361
+ safeQueue,
362
+ scan,
363
+ select,
364
+ sequence,
365
+ sequenceResults,
366
+ shallowEq,
367
+ singletonList,
368
+ singletonMap,
369
+ skip,
370
+ skipWhile,
371
+ some,
372
+ sort,
373
+ stringCompare,
374
+ stringCompareIgnoreCase,
375
+ stringHashCode,
376
+ sum,
377
+ summarizingNumber,
378
+ summaryTree,
379
+ summingNumber,
380
+ synchronized,
381
+ synchronizedCollection,
382
+ synchronizedList,
383
+ synchronizedMap,
384
+ synchronizedSet,
385
+ take,
386
+ takeWhile,
387
+ tap,
388
+ teeing,
389
+ thenComparing,
390
+ ticker,
391
+ timeout,
392
+ toArray,
270
393
  toList,
271
394
  toMap,
272
- groupBy,
273
- } from "./utils/factories.js";
274
-
275
- // Effects
276
- export {
277
- None,
278
- Some,
279
- type Option,
280
- Ok,
281
- Err,
282
- type Result,
283
- isSome,
284
- isNone,
285
- isOk,
286
- isErr,
287
- getOrElse,
395
+ toNullable,
396
+ toSet,
397
+ treeMap,
398
+ treeSet,
399
+ tryCatch,
400
+ tryCatchAsync,
401
+ ttlCache,
402
+ ttlCollection,
403
+ ttlMap,
404
+ unbuffered,
405
+ unmodifiableCollection,
406
+ unmodifiableList,
407
+ unmodifiableMap,
288
408
  unwrap,
289
- } from "./core/effects.js";
409
+ unwrapResult,
410
+ window,
411
+ workerPool,
412
+ zip,
413
+ } from "@mark1russell7/collections";
@@ -74,8 +74,8 @@ export {
74
74
  export type { CurrentItem, VersionConflict, VersionOf } from "@procedures/client/query";
75
75
 
76
76
  // The listeners of the events of a storage
77
- export { StorageListeners, reportListenerError } from "./listeners.js";
78
- export type { ListenerErrorHandler } from "./listeners.js";
77
+ export { StorageListeners, reportListenerError } from "@mark1russell7/collections";
78
+ export type { ListenerErrorHandler } from "@mark1russell7/collections";
79
79
 
80
80
  export { InMemoryStorage } from "./memory.js";
81
81
  export type { InMemoryStorageOptions } from "./memory.js";
@@ -16,7 +16,7 @@ import type {
16
16
  StorageObserver,
17
17
  StorageWriteOptions,
18
18
  } from "./interface.js";
19
- import { StorageListeners, type ListenerErrorHandler } from "./listeners.js";
19
+ import { StorageListeners, type ListenerErrorHandler } from "@mark1russell7/collections";
20
20
  import {
21
21
  VersionConflictError,
22
22
  applyPatch,
@@ -17,4 +17,4 @@ export {
17
17
  type ContractTestApi,
18
18
  type ContractTestContext,
19
19
  } from "./storage-contract.js";
20
- export { ContractViolation, deepEqual } from "./check.js";
20
+ export { ContractViolation, deepEqual } from "@mark1russell7/collections/testing";
@@ -42,7 +42,7 @@ import {
42
42
  type StorageSelector,
43
43
  type VersionConflict,
44
44
  } from "@procedures/client/query";
45
- import { holds, rejects, same, show } from "./check.js";
45
+ import { holds, rejects, same, show } from "@mark1russell7/collections/testing";
46
46
 
47
47
  /** The item of the suite. Its `id` is its key, so a `HybridStorage` can sync it. */
48
48
  export interface ContractItem {
package/src/undo/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The undo of the changes of items (Graph's split, wave 2, W10). `inversePatch` gives the patch
2
+ * The undo of the changes of items. `inversePatch` gives the patch
3
3
  * that undoes a patch, and `UndoLog` keeps the undo of each change in a storage.
4
4
  */
5
5
  export { inversePatch } from "./inverse.js";
@@ -110,7 +110,7 @@ function newestFirst(a: UndoEntry, b: UndoEntry): number {
110
110
  }
111
111
 
112
112
  /**
113
- * An undo log of the changes of items in collection storages (Graph's split, wave 2, W10). Each
113
+ * An undo log of the changes of items in collection storages. Each
114
114
  * entry keeps the patch that undoes one change (`inversePatch`), or the whole item before the
115
115
  * change when no patch can undo it, and the fingerprint of the item after the change.
116
116
  *