@procedures/collections 0.46.0 → 0.47.2
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.
- package/CHANGELOG.md +42 -8
- package/README.md +30 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +1 -58
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -94
- package/dist/index.js.map +1 -1
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/memory.d.ts +1 -1
- package/dist/storage/memory.d.ts.map +1 -1
- package/dist/storage/memory.js +1 -1
- package/dist/storage/memory.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/storage-contract.js +1 -1
- package/dist/testing/storage-contract.js.map +1 -1
- package/dist/undo/index.d.ts +1 -1
- package/dist/undo/index.js +1 -1
- package/dist/undo/undo-log.d.ts +1 -1
- package/dist/undo/undo-log.js +1 -1
- package/package.json +6 -6
- package/src/index.ts +338 -213
- package/src/storage/index.ts +2 -2
- package/src/storage/memory.ts +1 -1
- package/src/testing/index.ts +1 -1
- package/src/testing/storage-contract.ts +1 -1
- package/src/undo/index.ts +1 -1
- package/src/undo/undo-log.ts +1 -1
- package/dist/async/async-queue.d.ts +0 -170
- package/dist/async/async-queue.d.ts.map +0 -1
- package/dist/async/async-queue.js +0 -404
- package/dist/async/async-queue.js.map +0 -1
- package/dist/async/channels.d.ts +0 -211
- package/dist/async/channels.d.ts.map +0 -1
- package/dist/async/channels.js +0 -393
- package/dist/async/channels.js.map +0 -1
- package/dist/async/settled.d.ts +0 -23
- package/dist/async/settled.d.ts.map +0 -1
- package/dist/async/settled.js +0 -32
- package/dist/async/settled.js.map +0 -1
- package/dist/behaviors/bounded.d.ts +0 -79
- package/dist/behaviors/bounded.d.ts.map +0 -1
- package/dist/behaviors/bounded.js +0 -393
- package/dist/behaviors/bounded.js.map +0 -1
- package/dist/behaviors/composite.d.ts +0 -17
- package/dist/behaviors/composite.d.ts.map +0 -1
- package/dist/behaviors/composite.js +0 -93
- package/dist/behaviors/composite.js.map +0 -1
- package/dist/behaviors/evented.d.ts +0 -154
- package/dist/behaviors/evented.d.ts.map +0 -1
- package/dist/behaviors/evented.js +0 -299
- package/dist/behaviors/evented.js.map +0 -1
- package/dist/behaviors/lru.d.ts +0 -84
- package/dist/behaviors/lru.d.ts.map +0 -1
- package/dist/behaviors/lru.js +0 -376
- package/dist/behaviors/lru.js.map +0 -1
- package/dist/behaviors/readonly.d.ts +0 -73
- package/dist/behaviors/readonly.d.ts.map +0 -1
- package/dist/behaviors/readonly.js +0 -189
- package/dist/behaviors/readonly.js.map +0 -1
- package/dist/behaviors/safe.d.ts +0 -163
- package/dist/behaviors/safe.d.ts.map +0 -1
- package/dist/behaviors/safe.js +0 -176
- package/dist/behaviors/safe.js.map +0 -1
- package/dist/behaviors/synchronized.d.ts +0 -88
- package/dist/behaviors/synchronized.d.ts.map +0 -1
- package/dist/behaviors/synchronized.js +0 -285
- package/dist/behaviors/synchronized.js.map +0 -1
- package/dist/behaviors/ttl.d.ts +0 -118
- package/dist/behaviors/ttl.d.ts.map +0 -1
- package/dist/behaviors/ttl.js +0 -354
- package/dist/behaviors/ttl.js.map +0 -1
- package/dist/contracts/model.d.ts +0 -29
- package/dist/contracts/model.d.ts.map +0 -1
- package/dist/contracts/model.js +0 -26
- package/dist/contracts/model.js.map +0 -1
- package/dist/core/effects.d.ts +0 -176
- package/dist/core/effects.d.ts.map +0 -1
- package/dist/core/effects.js +0 -180
- package/dist/core/effects.js.map +0 -1
- package/dist/core/events.d.ts +0 -192
- package/dist/core/events.d.ts.map +0 -1
- package/dist/core/events.js +0 -291
- package/dist/core/events.js.map +0 -1
- package/dist/core/middleware.d.ts +0 -231
- package/dist/core/middleware.d.ts.map +0 -1
- package/dist/core/middleware.js +0 -161
- package/dist/core/middleware.js.map +0 -1
- package/dist/core/policies.d.ts +0 -220
- package/dist/core/policies.d.ts.map +0 -1
- package/dist/core/policies.js +0 -48
- package/dist/core/policies.js.map +0 -1
- package/dist/core/traits.d.ts +0 -142
- package/dist/core/traits.d.ts.map +0 -1
- package/dist/core/traits.js +0 -8
- package/dist/core/traits.js.map +0 -1
- package/dist/fx/collectors.d.ts +0 -193
- package/dist/fx/collectors.d.ts.map +0 -1
- package/dist/fx/collectors.js +0 -375
- package/dist/fx/collectors.js.map +0 -1
- package/dist/fx/iter.d.ts +0 -166
- package/dist/fx/iter.d.ts.map +0 -1
- package/dist/fx/iter.js +0 -421
- package/dist/fx/iter.js.map +0 -1
- package/dist/impl/array-deque.d.ts +0 -112
- package/dist/impl/array-deque.d.ts.map +0 -1
- package/dist/impl/array-deque.js +0 -380
- package/dist/impl/array-deque.js.map +0 -1
- package/dist/impl/array-list.d.ts +0 -101
- package/dist/impl/array-list.d.ts.map +0 -1
- package/dist/impl/array-list.js +0 -387
- package/dist/impl/array-list.js.map +0 -1
- package/dist/impl/hash-map.d.ts +0 -149
- package/dist/impl/hash-map.d.ts.map +0 -1
- package/dist/impl/hash-map.js +0 -473
- package/dist/impl/hash-map.js.map +0 -1
- package/dist/impl/hash-set.d.ts +0 -125
- package/dist/impl/hash-set.d.ts.map +0 -1
- package/dist/impl/hash-set.js +0 -264
- package/dist/impl/hash-set.js.map +0 -1
- package/dist/impl/linked-hash-map.d.ts +0 -141
- package/dist/impl/linked-hash-map.d.ts.map +0 -1
- package/dist/impl/linked-hash-map.js +0 -442
- package/dist/impl/linked-hash-map.js.map +0 -1
- package/dist/impl/linked-list.d.ts +0 -109
- package/dist/impl/linked-list.d.ts.map +0 -1
- package/dist/impl/linked-list.js +0 -494
- package/dist/impl/linked-list.js.map +0 -1
- package/dist/impl/priority-queue.d.ts +0 -139
- package/dist/impl/priority-queue.d.ts.map +0 -1
- package/dist/impl/priority-queue.js +0 -343
- package/dist/impl/priority-queue.js.map +0 -1
- package/dist/impl/tree-map.d.ts +0 -153
- package/dist/impl/tree-map.d.ts.map +0 -1
- package/dist/impl/tree-map.js +0 -788
- package/dist/impl/tree-map.js.map +0 -1
- package/dist/impl/tree-set.d.ts +0 -112
- package/dist/impl/tree-set.d.ts.map +0 -1
- package/dist/impl/tree-set.js +0 -374
- package/dist/impl/tree-set.js.map +0 -1
- package/dist/interfaces/collection.d.ts +0 -119
- package/dist/interfaces/collection.d.ts.map +0 -1
- package/dist/interfaces/collection.js +0 -8
- package/dist/interfaces/collection.js.map +0 -1
- package/dist/interfaces/list.d.ts +0 -247
- package/dist/interfaces/list.d.ts.map +0 -1
- package/dist/interfaces/list.js +0 -8
- package/dist/interfaces/list.js.map +0 -1
- package/dist/interfaces/map.d.ts +0 -344
- package/dist/interfaces/map.d.ts.map +0 -1
- package/dist/interfaces/map.js +0 -8
- package/dist/interfaces/map.js.map +0 -1
- package/dist/interfaces/queue.d.ts +0 -304
- package/dist/interfaces/queue.d.ts.map +0 -1
- package/dist/interfaces/queue.js +0 -8
- package/dist/interfaces/queue.js.map +0 -1
- package/dist/interfaces/set.d.ts +0 -137
- package/dist/interfaces/set.d.ts.map +0 -1
- package/dist/interfaces/set.js +0 -8
- package/dist/interfaces/set.js.map +0 -1
- package/dist/order/index.d.ts +0 -7
- package/dist/order/index.d.ts.map +0 -1
- package/dist/order/index.js +0 -7
- package/dist/order/index.js.map +0 -1
- package/dist/order/rank.d.ts +0 -100
- package/dist/order/rank.d.ts.map +0 -1
- package/dist/order/rank.js +0 -286
- package/dist/order/rank.js.map +0 -1
- package/dist/storage/listeners.d.ts +0 -39
- package/dist/storage/listeners.d.ts.map +0 -1
- package/dist/storage/listeners.js +0 -65
- package/dist/storage/listeners.js.map +0 -1
- package/dist/testing/check.d.ts +0 -25
- package/dist/testing/check.d.ts.map +0 -1
- package/dist/testing/check.js +0 -85
- package/dist/testing/check.js.map +0 -1
- package/dist/utils/defaults.d.ts +0 -135
- package/dist/utils/defaults.d.ts.map +0 -1
- package/dist/utils/defaults.js +0 -322
- package/dist/utils/defaults.js.map +0 -1
- package/dist/utils/factories.d.ts +0 -144
- package/dist/utils/factories.d.ts.map +0 -1
- package/dist/utils/factories.js +0 -293
- package/dist/utils/factories.js.map +0 -1
- package/dist/utils/helpers.d.ts +0 -137
- package/dist/utils/helpers.d.ts.map +0 -1
- package/dist/utils/helpers.js +0 -221
- package/dist/utils/helpers.js.map +0 -1
- package/src/async/async-queue.ts +0 -481
- package/src/async/channels.ts +0 -450
- package/src/async/settled.ts +0 -41
- package/src/behaviors/bounded.ts +0 -485
- package/src/behaviors/composite.ts +0 -99
- package/src/behaviors/evented.ts +0 -464
- package/src/behaviors/lru.ts +0 -447
- package/src/behaviors/readonly.ts +0 -236
- package/src/behaviors/safe.ts +0 -372
- package/src/behaviors/synchronized.ts +0 -316
- package/src/behaviors/ttl.ts +0 -462
- package/src/contracts/model.ts +0 -44
- package/src/core/effects.ts +0 -323
- package/src/core/events.ts +0 -356
- package/src/core/middleware.ts +0 -415
- package/src/core/policies.ts +0 -316
- package/src/core/traits.ts +0 -164
- package/src/fx/collectors.ts +0 -500
- package/src/fx/iter.ts +0 -536
- package/src/impl/array-deque.ts +0 -463
- package/src/impl/array-list.ts +0 -490
- package/src/impl/hash-map.ts +0 -623
- package/src/impl/hash-set.ts +0 -342
- package/src/impl/linked-hash-map.ts +0 -572
- package/src/impl/linked-list.ts +0 -606
- package/src/impl/priority-queue.ts +0 -448
- package/src/impl/tree-map.ts +0 -912
- package/src/impl/tree-set.ts +0 -469
- package/src/interfaces/collection.ts +0 -141
- package/src/interfaces/list.ts +0 -281
- package/src/interfaces/map.ts +0 -405
- package/src/interfaces/queue.ts +0 -353
- package/src/interfaces/set.ts +0 -158
- package/src/order/index.ts +0 -6
- package/src/order/rank.ts +0 -271
- package/src/storage/listeners.ts +0 -72
- package/src/testing/check.ts +0 -81
- package/src/utils/defaults.ts +0 -345
- package/src/utils/factories.ts +0 -357
- package/src/utils/helpers.ts +0 -248
package/src/index.ts
CHANGED
|
@@ -48,241 +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
|
-
//
|
|
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
|
-
|
|
110
|
-
// ============================================================================
|
|
111
|
-
// Behaviors
|
|
112
|
-
// ============================================================================
|
|
113
|
-
|
|
114
|
-
// Export bounded behaviors (excluding duplicate BoundedCollection interface)
|
|
56
|
+
// The lists, sets, maps, queues, behaviors, channels and lazy operations are in the general package.
|
|
115
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,
|
|
116
74
|
type BoundedOptions,
|
|
117
|
-
|
|
118
|
-
|
|
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,
|
|
119
217
|
boundedDeque,
|
|
218
|
+
boundedList,
|
|
120
219
|
boundedMap,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
export * from "./behaviors/evented.js";
|
|
127
|
-
export * from "./behaviors/synchronized.js";
|
|
128
|
-
export * from "./behaviors/lru.js";
|
|
129
|
-
export * from "./behaviors/ttl.js";
|
|
130
|
-
|
|
131
|
-
// ============================================================================
|
|
132
|
-
// Async/Concurrent
|
|
133
|
-
// ============================================================================
|
|
134
|
-
|
|
135
|
-
export * from "./async/async-queue.js";
|
|
136
|
-
export * from "./async/channels.js";
|
|
137
|
-
export * from "./async/settled.js";
|
|
138
|
-
|
|
139
|
-
// ============================================================================
|
|
140
|
-
// Functional Operations
|
|
141
|
-
// ============================================================================
|
|
142
|
-
|
|
143
|
-
export * from "./fx/iter.js";
|
|
144
|
-
export * from "./fx/collectors.js";
|
|
145
|
-
|
|
146
|
-
// ============================================================================
|
|
147
|
-
// Utilities
|
|
148
|
-
// ============================================================================
|
|
149
|
-
|
|
150
|
-
export * from "./utils/defaults.js";
|
|
151
|
-
export * from "./utils/factories.js";
|
|
152
|
-
export * from "./utils/helpers.js";
|
|
153
|
-
|
|
154
|
-
// ============================================================================
|
|
155
|
-
// Re-exports for convenience
|
|
156
|
-
// ============================================================================
|
|
157
|
-
|
|
158
|
-
// Most commonly used exports
|
|
159
|
-
export { compose, bundle } from "./core/middleware.js";
|
|
160
|
-
export { arrayList } from "./impl/array-list.js";
|
|
161
|
-
export { arrayDeque } from "./impl/array-deque.js";
|
|
162
|
-
export { hashMap } from "./impl/hash-map.js";
|
|
163
|
-
export { linkedHashMap } from "./impl/linked-hash-map.js";
|
|
164
|
-
export { treeMap } from "./impl/tree-map.js";
|
|
165
|
-
export { treeSet } from "./impl/tree-set.js";
|
|
166
|
-
export { linkedList } from "./impl/linked-list.js";
|
|
167
|
-
export { hashSet } from "./impl/hash-set.js";
|
|
168
|
-
export { priorityQueue } from "./impl/priority-queue.js";
|
|
169
|
-
// Common behaviors
|
|
170
|
-
export { readonly, readonlyList, readonlyMap } from "./behaviors/readonly.js";
|
|
171
|
-
export { safeList, safeQueue, safeMap } from "./behaviors/safe.js";
|
|
172
|
-
export { eventedList, eventedQueue, eventedMap } from "./behaviors/evented.js";
|
|
173
|
-
export { synchronized } from "./behaviors/synchronized.js";
|
|
174
|
-
export { lruMap, lruCache, LRUCache } from "./behaviors/lru.js";
|
|
175
|
-
export { ttlMap, ttlCache, TTLCache, ttlCollection } from "./behaviors/ttl.js";
|
|
176
|
-
|
|
177
|
-
// Async/Concurrent
|
|
178
|
-
export { asyncQueue, AsyncQueue } from "./async/async-queue.js";
|
|
179
|
-
export { asSettled, type Settled } from "./async/settled.js";
|
|
180
|
-
export {
|
|
220
|
+
boundedQueue,
|
|
221
|
+
buffered,
|
|
222
|
+
buildList,
|
|
223
|
+
buildMap,
|
|
224
|
+
bundle,
|
|
181
225
|
channel,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
ticker,
|
|
186
|
-
pipeline,
|
|
187
|
-
fanOut,
|
|
188
|
-
fanIn,
|
|
189
|
-
merge,
|
|
190
|
-
workerPool,
|
|
191
|
-
} from "./async/channels.js";
|
|
192
|
-
|
|
193
|
-
// Functional operations
|
|
194
|
-
export {
|
|
195
|
-
map,
|
|
196
|
-
filter,
|
|
197
|
-
flatMap,
|
|
198
|
-
flatten,
|
|
199
|
-
take,
|
|
200
|
-
skip,
|
|
201
|
-
takeWhile,
|
|
202
|
-
skipWhile,
|
|
203
|
-
concat,
|
|
204
|
-
zip,
|
|
205
|
-
enumerate,
|
|
226
|
+
checkBounds,
|
|
227
|
+
checkInsertBounds,
|
|
228
|
+
checkRangeBounds,
|
|
206
229
|
chunk,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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,
|
|
213
251
|
distinct,
|
|
214
252
|
distinctConsecutive,
|
|
215
|
-
|
|
216
|
-
|
|
253
|
+
dropIndex,
|
|
254
|
+
emptyList,
|
|
255
|
+
emptyMap,
|
|
256
|
+
emptyQueue,
|
|
257
|
+
enhanceMethod,
|
|
258
|
+
enumerate,
|
|
259
|
+
eqBy,
|
|
260
|
+
evented,
|
|
261
|
+
eventedDeque,
|
|
262
|
+
eventedList,
|
|
263
|
+
eventedMap,
|
|
264
|
+
eventedQueue,
|
|
217
265
|
every,
|
|
218
|
-
|
|
266
|
+
fanIn,
|
|
267
|
+
fanOut,
|
|
268
|
+
filter,
|
|
269
|
+
filtering,
|
|
219
270
|
find,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
toList as collectToList,
|
|
234
|
-
toArray as collectToArray,
|
|
235
|
-
toSet as collectToSet,
|
|
236
|
-
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,
|
|
237
284
|
groupingBy,
|
|
238
285
|
groupingByWith,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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,
|
|
245
301
|
joining,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
reducing,
|
|
250
|
-
reducingWith,
|
|
251
|
-
teeing,
|
|
252
|
-
first,
|
|
302
|
+
keyBetween,
|
|
303
|
+
keysBetween,
|
|
304
|
+
keysForDrop,
|
|
253
305
|
last,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
// Common factories
|
|
258
|
-
export {
|
|
259
|
-
emptyList,
|
|
260
|
-
emptyMap,
|
|
261
|
-
emptyQueue,
|
|
262
|
-
singletonList,
|
|
263
|
-
singletonMap,
|
|
264
|
-
nCopies,
|
|
306
|
+
linkedHashMap,
|
|
307
|
+
linkedList,
|
|
265
308
|
listOf,
|
|
309
|
+
lruCache,
|
|
310
|
+
lruMap,
|
|
311
|
+
map,
|
|
312
|
+
mapAsyncOption,
|
|
313
|
+
mapAsyncResult,
|
|
314
|
+
mapError,
|
|
266
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,
|
|
267
339
|
range,
|
|
268
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,
|
|
269
393
|
toList,
|
|
270
394
|
toMap,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
isOk,
|
|
285
|
-
isErr,
|
|
286
|
-
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,
|
|
287
408
|
unwrap,
|
|
288
|
-
|
|
409
|
+
unwrapResult,
|
|
410
|
+
window,
|
|
411
|
+
workerPool,
|
|
412
|
+
zip,
|
|
413
|
+
} from "@mark1russell7/collections";
|
package/src/storage/index.ts
CHANGED
|
@@ -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 "
|
|
78
|
-
export type { ListenerErrorHandler } from "
|
|
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";
|
package/src/storage/memory.ts
CHANGED
|
@@ -16,7 +16,7 @@ import type {
|
|
|
16
16
|
StorageObserver,
|
|
17
17
|
StorageWriteOptions,
|
|
18
18
|
} from "./interface.js";
|
|
19
|
-
import { StorageListeners, type ListenerErrorHandler } from "
|
|
19
|
+
import { StorageListeners, type ListenerErrorHandler } from "@mark1russell7/collections";
|
|
20
20
|
import {
|
|
21
21
|
VersionConflictError,
|
|
22
22
|
applyPatch,
|
package/src/testing/index.ts
CHANGED
|
@@ -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 "
|
|
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
|
|
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";
|
package/src/undo/undo-log.ts
CHANGED
|
@@ -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
|
|
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
|
*
|