@oimdb/core 4.0.1 → 4.2.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.
- package/CHANGELOG.md +201 -32
- package/README.md +452 -560
- package/dist/index.cjs +2421 -2431
- package/dist/index.d.cts +751 -608
- package/dist/index.d.ts +751 -608
- package/dist/index.js +2364 -2380
- package/llms.txt +961 -1040
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,27 +10,47 @@ interface IOIMEffectService {
|
|
|
10
10
|
setPositionInSubscribedSlot(effect: TOIMEffect, edge: number, positionInSlot: number): void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
type
|
|
14
|
-
readonly
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
type TOIMIndexableSlot<TKey = unknown> = TOIMKeyedSlot<TKey> & {
|
|
18
|
-
readonly indexKeys: unknown[] | undefined;
|
|
13
|
+
type TOIMEditable<TSlot> = {
|
|
14
|
+
-readonly [K in keyof TSlot]: TSlot[K];
|
|
19
15
|
};
|
|
20
16
|
|
|
21
17
|
interface IOIMSlotOwner {
|
|
22
18
|
holdSlot(slot: TOIMSlot): void;
|
|
23
19
|
unholdSlot(slot: TOIMSlot): void;
|
|
24
20
|
releaseSlotIfUnheld(slot: TOIMSlot): void;
|
|
21
|
+
unsafeMutateSlot(slot: TOIMSlot, mutateSlot: (editableSlot: TOIMEditable<TOIMSlot>) => void): void;
|
|
25
22
|
subscribeToSlot(slot: TOIMSlot, effect: TOIMEffect, edge: number): number;
|
|
26
23
|
unsubscribeFromSlot(slot: TOIMSlot, positionInSlot: number, effect: TOIMEffect): boolean;
|
|
24
|
+
onSlotFirstSubscribed(slot: TOIMSlot): void;
|
|
25
|
+
onSlotLastUnsubscribed(slot: TOIMSlot): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class OIMSourceTracker {
|
|
29
|
+
private readonly slotSourceList;
|
|
30
|
+
private computedSourceList;
|
|
31
|
+
private committedAllRootSlots;
|
|
32
|
+
private trackedAllRootSlots;
|
|
33
|
+
private isTrackedAllRootSlotsChanged;
|
|
34
|
+
private committedComputedRootSlots;
|
|
35
|
+
private trackedComputedRootSlots;
|
|
36
|
+
readSourceSlot<TSlot extends TOIMSlot>(slot: TSlot): TSlot;
|
|
37
|
+
readSourceComputedValue<TValue>(computedSlot: TOIMComputedContentSlot<TValue, OIMSourceTracker | undefined>): TValue;
|
|
38
|
+
openSourceTracking(): void;
|
|
39
|
+
closeSourceTracking(): boolean;
|
|
40
|
+
isAnyComputedRootSlotsReplaced(): boolean;
|
|
41
|
+
trackReplacedRootSlots(): boolean;
|
|
42
|
+
getTrackedSourceSlots(): readonly TOIMSlot[];
|
|
43
|
+
getTrackedSourceComputeds(): readonly TOIMComputedContentSlot<unknown, OIMSourceTracker | undefined>[];
|
|
44
|
+
getTrackedAllRootSlots(): readonly TOIMSlot[];
|
|
45
|
+
commitTrackedSources(): void;
|
|
46
|
+
private trackAllRootSlots;
|
|
27
47
|
}
|
|
28
48
|
|
|
29
49
|
interface IOIMComputedValueService<TValue = unknown> {
|
|
30
|
-
getValueForSlot(computedSlot:
|
|
50
|
+
getValueForSlot(computedSlot: TOIMComputedContentSlot<TValue, OIMSourceTracker | undefined>): TValue;
|
|
31
51
|
}
|
|
32
52
|
|
|
33
|
-
type
|
|
53
|
+
type TOIMComputedContentSlot<TValue = unknown, TSourceTracker extends OIMSourceTracker | undefined = undefined> = TOIMSlot & Readonly<TOIMComputedDerivation> & {
|
|
34
54
|
readonly owner: IOIMSlotOwner;
|
|
35
55
|
readonly computedValueService: IOIMComputedValueService<TValue>;
|
|
36
56
|
readonly value: TValue;
|
|
@@ -38,14 +58,12 @@ type TOIMComputedSlot<TValue = unknown, TKey = unknown> = TOIMIndexableSlot<TKey
|
|
|
38
58
|
readonly checkedAtEpoch: number;
|
|
39
59
|
readonly isDeriving: boolean;
|
|
40
60
|
readonly allRootSlots: readonly TOIMSlot[] | undefined;
|
|
61
|
+
readonly sourceTracker: TSourceTracker;
|
|
41
62
|
};
|
|
42
63
|
|
|
43
|
-
type
|
|
64
|
+
type TOIMComputedDerivation = {
|
|
44
65
|
readonly sourceSlots: readonly TOIMSlot[];
|
|
45
|
-
readonly sourceComputeds: readonly
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
type TOIMDerivation = TOIMComputedSources & {
|
|
66
|
+
readonly sourceComputeds: readonly TOIMComputedContentSlot<unknown, OIMSourceTracker | undefined>[];
|
|
49
67
|
ranAtRevision: number;
|
|
50
68
|
ranAtEpoch: number;
|
|
51
69
|
};
|
|
@@ -64,9 +82,9 @@ declare class OIMChannelQueue<TEntry> {
|
|
|
64
82
|
keepFirstEntries(keptCount: number): void;
|
|
65
83
|
}
|
|
66
84
|
|
|
67
|
-
interface
|
|
85
|
+
interface IOIMSlotContentChangeListener<TSlot, TPatch = unknown> {
|
|
68
86
|
onContentChanged(slot: TSlot, patch: TPatch | undefined, changedColumns: readonly string[] | undefined): void;
|
|
69
|
-
|
|
87
|
+
onManyContentsChanged(slotChannelQueue: OIMChannelQueue<TSlot>, patchChannelQueue: OIMChannelQueue<TPatch | undefined>, changedColumnsChannelQueue: OIMChannelQueue<readonly string[] | undefined>): void;
|
|
70
88
|
}
|
|
71
89
|
|
|
72
90
|
type TOIMIndexKeysPositions = {
|
|
@@ -84,10 +102,11 @@ type TOIMColumnReaders = {
|
|
|
84
102
|
readonly columnGroups: TOIMColumnGroup[];
|
|
85
103
|
};
|
|
86
104
|
|
|
87
|
-
type TOIMStoreSlot<TStore = unknown, TSlot extends TOIMSlot = TOIMSlot, TPatch = unknown> = {
|
|
105
|
+
type TOIMStoreSlot<TStore = unknown, TSlot extends TOIMSlot = TOIMSlot, TPatch = unknown, TSlotService = unknown> = {
|
|
88
106
|
readonly store: TStore;
|
|
107
|
+
readonly slotService: TSlotService;
|
|
89
108
|
readonly channelSlot: TOIMChannelSlot;
|
|
90
|
-
readonly contentChangeListeners:
|
|
109
|
+
readonly contentChangeListeners: IOIMSlotContentChangeListener<TSlot, TPatch>[] | undefined;
|
|
91
110
|
readonly contentChangeListenerReadColumnNames: (readonly string[] | undefined)[] | undefined;
|
|
92
111
|
readonly indexKeysPositions: TOIMIndexKeysPositions | undefined;
|
|
93
112
|
readonly columnListenerCountsByColumnName: Map<string, number> | undefined;
|
|
@@ -96,10 +115,10 @@ type TOIMStoreSlot<TStore = unknown, TSlot extends TOIMSlot = TOIMSlot, TPatch =
|
|
|
96
115
|
readonly columnGroupSlotCountsByKey: Map<string, number> | undefined;
|
|
97
116
|
readonly columnReadersByColumnName: Map<string, TOIMColumnReaders> | undefined;
|
|
98
117
|
readonly anyColumnSlotCount: number;
|
|
99
|
-
readonly
|
|
100
|
-
readonly
|
|
101
|
-
readonly
|
|
102
|
-
readonly
|
|
118
|
+
readonly batchDepth: number;
|
|
119
|
+
readonly batchSlotChannelQueue: OIMChannelQueue<TSlot> | undefined;
|
|
120
|
+
readonly batchPatchChannelQueue: OIMChannelQueue<TPatch | undefined> | undefined;
|
|
121
|
+
readonly batchChangedColumnsChannelQueue: OIMChannelQueue<readonly string[] | undefined> | undefined;
|
|
103
122
|
readonly arrivedBucketMemberSlotChannelQueues: OIMChannelQueue<TOIMSlot>[] | undefined;
|
|
104
123
|
readonly departedBucketMemberSlotChannelQueues: OIMChannelQueue<TOIMSlot>[] | undefined;
|
|
105
124
|
readonly removedAtChannelQueues: OIMChannelQueue<number>[] | undefined;
|
|
@@ -117,10 +136,6 @@ type TOIMStoreSlot<TStore = unknown, TSlot extends TOIMSlot = TOIMSlot, TPatch =
|
|
|
117
136
|
readonly isDisposed: boolean;
|
|
118
137
|
};
|
|
119
138
|
|
|
120
|
-
interface IOIMSubframeCloseListener {
|
|
121
|
-
onStoreSlotSubframeClosed(storeSlot: TOIMStoreSlot): void;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
139
|
type TOIMUnusedSlotCollectorSlot = {
|
|
125
140
|
readonly unusedSlotChannelQueue: OIMChannelQueue<TOIMSlot>;
|
|
126
141
|
openDepth: number;
|
|
@@ -129,32 +144,84 @@ type TOIMUnusedSlotCollectorSlot = {
|
|
|
129
144
|
|
|
130
145
|
type TOIMTimer = (run: () => void, inMs: number) => TOIMDisposer;
|
|
131
146
|
|
|
147
|
+
interface IOIMErrorPolicy {
|
|
148
|
+
onErrorCaught(error: unknown): void;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
type TOIMSlotWheelOptions = {
|
|
152
|
+
getNowMs: () => number;
|
|
153
|
+
timer: TOIMTimer;
|
|
154
|
+
errorPolicy: IOIMErrorPolicy;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
type TOIMSlotReleaseWheelOptions = TOIMSlotWheelOptions & {
|
|
158
|
+
getReleaseDueMs: (slot: TOIMSlot) => number;
|
|
159
|
+
setReleaseDueMs: (slot: TOIMSlot, releaseDueMs: number) => void;
|
|
160
|
+
releaseScheduledSlotFlag: number;
|
|
161
|
+
};
|
|
162
|
+
|
|
132
163
|
type TOIMFlushSchedulerSlot = {
|
|
133
164
|
readonly timer: TOIMTimer | undefined;
|
|
134
165
|
scheduledCallback: (() => void) | undefined;
|
|
135
166
|
timerDisposer: TOIMDisposer | undefined;
|
|
136
167
|
};
|
|
137
168
|
|
|
138
|
-
interface
|
|
139
|
-
|
|
169
|
+
interface IOIMFlushSchedulerListener<TFlushSchedulerSlot extends TOIMFlushSchedulerSlot> {
|
|
170
|
+
onSchedulerTimerFired(flushSchedulerSlot: TFlushSchedulerSlot): void;
|
|
140
171
|
}
|
|
141
172
|
|
|
142
|
-
|
|
173
|
+
declare abstract class OIMSlotWheel implements TOIMFlushSchedulerSlot, IOIMFlushSchedulerListener<OIMSlotWheel> {
|
|
174
|
+
readonly timer: TOIMTimer;
|
|
175
|
+
scheduledCallback: (() => void) | undefined;
|
|
176
|
+
timerDisposer: TOIMDisposer | undefined;
|
|
143
177
|
readonly getNowMs: () => number;
|
|
144
|
-
readonly errorPolicy
|
|
145
|
-
scheduledUntilMs
|
|
146
|
-
readonly slotsBySliceNumber
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
178
|
+
private readonly errorPolicy;
|
|
179
|
+
private scheduledUntilMs;
|
|
180
|
+
private readonly slotsBySliceNumber;
|
|
181
|
+
private lastFiledSliceNumber;
|
|
182
|
+
private lastFiledSliceSlots;
|
|
183
|
+
private floorSliceNumber;
|
|
184
|
+
private nextSliceNumber;
|
|
185
|
+
private nextSliceNumberNeedsRescan;
|
|
186
|
+
constructor(options: TOIMSlotWheelOptions);
|
|
187
|
+
getNextSliceNumber(): number | undefined;
|
|
188
|
+
sweepUpToSliceNumber(upToSliceNumber: number): void;
|
|
189
|
+
flush(): void;
|
|
190
|
+
cancelAllSlots(): void;
|
|
191
|
+
protected fileSlot(sliceNumber: number, slot: TOIMSlot): void;
|
|
192
|
+
protected scheduleNextSweep(): void;
|
|
193
|
+
private cancelSlotWheelSchedule;
|
|
194
|
+
onSchedulerTimerFired(): void;
|
|
195
|
+
protected getSweptSliceNumberAt(nowMs: number): number;
|
|
196
|
+
protected abstract onSlotDue(slot: TOIMSlot, nowMs: number): void;
|
|
197
|
+
protected onSlotDropped(_slot: TOIMSlot): void;
|
|
198
|
+
protected onSweepFinished(): void;
|
|
199
|
+
private lowerNextSliceNumber;
|
|
200
|
+
private sweepSlice;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare class OIMSlotReleaseWheel extends OIMSlotWheel {
|
|
204
|
+
readonly getReleaseDueMs: (slot: TOIMSlot) => number;
|
|
205
|
+
private readonly setReleaseDueMs;
|
|
206
|
+
private readonly releaseScheduledSlotFlag;
|
|
207
|
+
constructor(options: TOIMSlotReleaseWheelOptions);
|
|
208
|
+
markSlotReleaseDue(slot: TOIMSlot, keepMs: number): number;
|
|
209
|
+
markSlotReleaseDueNow(slot: TOIMSlot): void;
|
|
210
|
+
scheduleSlotRelease(slot: TOIMSlot, nowMs: number): void;
|
|
211
|
+
isSlotReleasable(slot: TOIMSlot): boolean;
|
|
212
|
+
cancelSlotRelease(slot: TOIMSlot): void;
|
|
213
|
+
isSlotReleaseScheduled(slot: TOIMSlot): boolean;
|
|
214
|
+
protected onSlotDue(slot: TOIMSlot, nowMs: number): void;
|
|
215
|
+
protected onSlotDropped(slot: TOIMSlot): void;
|
|
216
|
+
private fileReleaseSlot;
|
|
217
|
+
}
|
|
152
218
|
|
|
153
219
|
type TOIMCollectorSlot = {
|
|
154
220
|
readonly unusedSlotCollectorSlot: TOIMUnusedSlotCollectorSlot;
|
|
155
|
-
readonly
|
|
156
|
-
|
|
157
|
-
|
|
221
|
+
readonly slotWheelOptions: TOIMSlotWheelOptions;
|
|
222
|
+
afterIdleSlotReleaseWheel: OIMSlotReleaseWheel | undefined;
|
|
223
|
+
afterWriteSlotReleaseWheel: OIMSlotReleaseWheel | undefined;
|
|
224
|
+
afterUnholdSlotReleaseWheel: OIMSlotReleaseWheel | undefined;
|
|
158
225
|
};
|
|
159
226
|
|
|
160
227
|
type TOIMChannelClock = {
|
|
@@ -178,21 +245,14 @@ type TOIMChannelSlot = TOIMFlushSchedulerSlot & {
|
|
|
178
245
|
readonly effectChannelQueue: OIMChannelQueue<TOIMEffect>;
|
|
179
246
|
readonly afterEachFlush: Set<() => void>;
|
|
180
247
|
readonly afterEachFrameHandlerChannelQueue: OIMChannelQueue<() => void>;
|
|
181
|
-
readonly subframeStoreSlotChannelQueues: OIMChannelQueue<TOIMStoreSlot>[];
|
|
182
|
-
readonly changedStoreSlotChannelQueue: OIMChannelQueue<TOIMStoreSlot>;
|
|
183
|
-
readonly changedStoreSlotOwnerChannelQueue: OIMChannelQueue<IOIMSubframeCloseListener>;
|
|
184
248
|
commandsStoreSlotChannelQueue: OIMChannelQueue<TOIMStoreSlot> | undefined;
|
|
185
249
|
changedColumnNames: string[] | undefined;
|
|
186
|
-
subframesOpen: number;
|
|
187
|
-
contentSubframeDepth: number;
|
|
188
|
-
subframeDeliveryDepth: number;
|
|
189
|
-
flushRequestedInSubframe: boolean;
|
|
190
250
|
flushRequested: boolean;
|
|
191
251
|
isFlushing: boolean;
|
|
192
252
|
dropped: boolean;
|
|
193
253
|
};
|
|
194
254
|
|
|
195
|
-
type TOIMEffect =
|
|
255
|
+
type TOIMEffect = TOIMComputedDerivation & {
|
|
196
256
|
readonly effectService: IOIMEffectService;
|
|
197
257
|
readonly channelSlot: TOIMChannelSlot;
|
|
198
258
|
readonly allRootSlots: readonly TOIMSlot[];
|
|
@@ -201,6 +261,7 @@ type TOIMEffect = TOIMDerivation & {
|
|
|
201
261
|
effectFlags: number;
|
|
202
262
|
readonly body: TOIMEffectBody;
|
|
203
263
|
cleanup: (() => void) | undefined;
|
|
264
|
+
readonly sourceTracker: OIMSourceTracker | undefined;
|
|
204
265
|
};
|
|
205
266
|
|
|
206
267
|
type TOIMSlot = {
|
|
@@ -214,7 +275,7 @@ type TOIMSlot = {
|
|
|
214
275
|
readonly releaseDueAfterUnholdMs: number;
|
|
215
276
|
readonly slotFlags: number;
|
|
216
277
|
readonly columnSlotStore: unknown;
|
|
217
|
-
readonly storeSlot: TOIMStoreSlot
|
|
278
|
+
readonly storeSlot: TOIMStoreSlot;
|
|
218
279
|
readonly owner: IOIMSlotOwner;
|
|
219
280
|
};
|
|
220
281
|
|
|
@@ -228,36 +289,64 @@ interface IOIMStoreSlotListener {
|
|
|
228
289
|
onStoreSlotCreated<TStore, TSlot extends TOIMSlot, TPatch>(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>): void;
|
|
229
290
|
}
|
|
230
291
|
|
|
231
|
-
declare class
|
|
232
|
-
static readonly INSTANCE:
|
|
292
|
+
declare class OIMNoStoreSlotListener implements IOIMStoreSlotListener {
|
|
293
|
+
static readonly INSTANCE: OIMNoStoreSlotListener;
|
|
233
294
|
onStoreSlotCreated(): void;
|
|
234
295
|
}
|
|
235
296
|
|
|
297
|
+
interface IOIMSlotSubscriptionListener {
|
|
298
|
+
onSlotFirstSubscribed(slot: TOIMSlot): void;
|
|
299
|
+
onSlotLastUnsubscribed(slot: TOIMSlot): void;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare class OIMNoSlotSubscriptionListener implements IOIMSlotSubscriptionListener {
|
|
303
|
+
static readonly INSTANCE: OIMNoSlotSubscriptionListener;
|
|
304
|
+
onSlotFirstSubscribed(): void;
|
|
305
|
+
onSlotLastUnsubscribed(): void;
|
|
306
|
+
}
|
|
307
|
+
|
|
236
308
|
declare function oimIsSlotEmpty(slot: TOIMSlot): boolean;
|
|
237
309
|
|
|
238
310
|
declare function oimIsSlotReleased(slot: TOIMSlot): boolean;
|
|
239
311
|
|
|
240
|
-
type
|
|
312
|
+
type TOIMKeyedSlot<TKey extends NonNullable<unknown> = NonNullable<unknown>> = TOIMSlot & {
|
|
313
|
+
readonly key: TKey;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
type TOIMIndexableSlot<TKey extends NonNullable<unknown> = NonNullable<unknown>> = TOIMKeyedSlot<TKey> & {
|
|
317
|
+
readonly indexKeys: unknown[] | undefined;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
type TOIMEntityContentSlot<TEntity extends object = object> = TOIMSlot & {
|
|
241
321
|
readonly entity: TEntity | undefined;
|
|
242
322
|
readonly data: unknown[] | undefined;
|
|
243
323
|
};
|
|
244
324
|
|
|
325
|
+
type TOIMEntitySlot<TEntity extends object = object, TKey extends NonNullable<unknown> = NonNullable<unknown>> = TOIMEntityContentSlot<TEntity> & TOIMIndexableSlot<TKey>;
|
|
326
|
+
|
|
245
327
|
type TOIMColumnSlot = TOIMSlot & {
|
|
246
328
|
readonly carrierSlot: TOIMSlot;
|
|
247
329
|
readonly key: string;
|
|
248
330
|
};
|
|
249
331
|
|
|
332
|
+
type TOIMComputedSlot<TValue = unknown, TKey extends NonNullable<unknown> = NonNullable<unknown>, TSourceTracker extends OIMSourceTracker | undefined = undefined> = TOIMComputedContentSlot<TValue, TSourceTracker> & TOIMIndexableSlot<TKey>;
|
|
333
|
+
|
|
250
334
|
type TOIMComputedColumnSlot = TOIMComputedSlot<unknown, string>;
|
|
251
335
|
|
|
252
|
-
interface
|
|
336
|
+
interface IOIMSlotFilingService<TSlot extends TOIMSlot = TOIMSlot, TStore = unknown> {
|
|
253
337
|
createStore(): TStore;
|
|
338
|
+
fileSlot(store: TStore, slot: TSlot): void;
|
|
339
|
+
unfileSlot(store: TStore, slot: TSlot): void;
|
|
340
|
+
getSlots(store: TStore): IterableIterator<TSlot>;
|
|
341
|
+
getSlotCount(store: TStore): number;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
interface IOIMSlotStoreService<TKey extends NonNullable<unknown>, TSlot extends TOIMKeyedSlot<TKey> = TOIMKeyedSlot<TKey>, TStore = unknown> extends IOIMSlotFilingService<TSlot, TStore> {
|
|
254
345
|
ownKey<TOwnedKey extends TKey>(key: TOwnedKey): TOwnedKey;
|
|
255
346
|
isSameKey(key: TKey, otherKey: TKey): boolean;
|
|
256
347
|
get(store: TStore, key: TKey): TSlot | undefined;
|
|
257
348
|
set(store: TStore, key: TKey, slot: TSlot): void;
|
|
258
349
|
remove(store: TStore, key: TKey): void;
|
|
259
|
-
getSlots(store: TStore): IterableIterator<TSlot>;
|
|
260
|
-
getSlotCount(store: TStore): number;
|
|
261
350
|
}
|
|
262
351
|
|
|
263
352
|
declare class OIMSlotOwner implements IOIMSlotOwner {
|
|
@@ -266,12 +355,15 @@ declare class OIMSlotOwner implements IOIMSlotOwner {
|
|
|
266
355
|
subscribeToSlot(slot: TOIMSlot, effect: TOIMEffect, edge: number): number;
|
|
267
356
|
unsubscribeFromSlot(slot: TOIMSlot, positionInSlot: number, effect: TOIMEffect): boolean;
|
|
268
357
|
releaseSlotIfUnheld(_slot: TOIMSlot): void;
|
|
358
|
+
unsafeMutateSlot(slot: TOIMSlot, mutateSlot: (editableSlot: TOIMEditable<TOIMSlot>) => void): void;
|
|
359
|
+
onSlotFirstSubscribed(_slot: TOIMSlot): void;
|
|
360
|
+
onSlotLastUnsubscribed(_slot: TOIMSlot): void;
|
|
269
361
|
protected onSlotIdle(_slot: TOIMSlot): void;
|
|
270
362
|
protected onSlotUnheld(_slot: TOIMSlot): void;
|
|
271
363
|
protected assertNotReleased(slot: TOIMSlot): void;
|
|
272
364
|
}
|
|
273
365
|
|
|
274
|
-
declare abstract class
|
|
366
|
+
declare abstract class OIMColumnSlotOwner<TCarrierSlot extends TOIMSlot, TColumnSlot extends TOIMKeyedSlot<string>> extends OIMSlotOwner {
|
|
275
367
|
protected readonly columnSlotStoreService: IOIMSlotStoreService<string, TColumnSlot>;
|
|
276
368
|
protected constructor(columnSlotStoreService: IOIMSlotStoreService<string, TColumnSlot>);
|
|
277
369
|
protected abstract createColumnSlot(carrierSlot: TCarrierSlot, key: string): TColumnSlot;
|
|
@@ -284,6 +376,8 @@ declare abstract class OIMColumnOwner<TCarrierSlot extends TOIMSlot, TColumnSlot
|
|
|
284
376
|
holdColumn(carrierSlot: TCarrierSlot, key: string): TColumnSlot;
|
|
285
377
|
isAnyColumnReferenced(storeSlot: TOIMStoreSlot, changedColumns: readonly string[]): boolean;
|
|
286
378
|
releaseSlotIfUnheld(slot: TOIMSlot): void;
|
|
379
|
+
onSlotFirstSubscribed(slot: TOIMSlot): void;
|
|
380
|
+
onSlotLastUnsubscribed(slot: TOIMSlot): void;
|
|
287
381
|
protected getColumnGroupsByKeyOf(carrierSlot: TCarrierSlot): Map<string, TOIMColumnGroup> | undefined;
|
|
288
382
|
protected getColumnReadersOf(carrierSlot: TCarrierSlot): Map<string, TOIMColumnReaders> | undefined;
|
|
289
383
|
private getColumnIfFiled;
|
|
@@ -292,7 +386,7 @@ declare abstract class OIMColumnOwner<TCarrierSlot extends TOIMSlot, TColumnSlot
|
|
|
292
386
|
private fileColumnSlot;
|
|
293
387
|
}
|
|
294
388
|
|
|
295
|
-
type
|
|
389
|
+
type TOIMColumnSlotOwnerOptions<TColumnSlot extends TOIMKeyedSlot<string>, TColumnName extends string = string> = {
|
|
296
390
|
columnSlotStoreService: IOIMSlotStoreService<string, TColumnSlot>;
|
|
297
391
|
columnNames?: undefined;
|
|
298
392
|
} | {
|
|
@@ -300,8 +394,8 @@ type TOIMColumnOwnerOptions<TColumnSlot extends TOIMKeyedSlot<string>, TColumnNa
|
|
|
300
394
|
columnSlotStoreService?: undefined;
|
|
301
395
|
};
|
|
302
396
|
|
|
303
|
-
declare class
|
|
304
|
-
constructor(options:
|
|
397
|
+
declare class OIMPushColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TOIMColumnSlot> {
|
|
398
|
+
constructor(options: TOIMColumnSlotOwnerOptions<TOIMColumnSlot>);
|
|
305
399
|
protected createColumnSlot(carrierSlot: TOIMSlot, key: string): TOIMColumnSlot;
|
|
306
400
|
protected carrierSlotOf(columnSlot: TOIMColumnSlot): TOIMSlot;
|
|
307
401
|
markColumnsChanged(carrierSlot: TOIMSlot, patch: object | undefined, changedColumns: readonly string[] | undefined, channelSlot: TOIMChannelSlot): void;
|
|
@@ -310,22 +404,18 @@ declare class OIMColumnOwnerPushDriven extends OIMColumnOwner<TOIMSlot, TOIMColu
|
|
|
310
404
|
private markValueColumnsChanged;
|
|
311
405
|
}
|
|
312
406
|
|
|
313
|
-
declare class
|
|
314
|
-
constructor(options:
|
|
407
|
+
declare class OIMPullColumnSlotOwner extends OIMColumnSlotOwner<TOIMComputedContentSlot, TOIMComputedColumnSlot> implements IOIMComputedValueService {
|
|
408
|
+
constructor(options: TOIMColumnSlotOwnerOptions<TOIMComputedColumnSlot>);
|
|
315
409
|
private readonly deriveColumnSlotValue;
|
|
316
|
-
getValueForSlot(computedSlot:
|
|
317
|
-
protected createColumnSlot(carrierSlot:
|
|
318
|
-
protected carrierSlotOf(columnSlot: TOIMComputedColumnSlot):
|
|
410
|
+
getValueForSlot(computedSlot: TOIMComputedContentSlot): unknown;
|
|
411
|
+
protected createColumnSlot(carrierSlot: TOIMComputedContentSlot, key: string): TOIMComputedColumnSlot;
|
|
412
|
+
protected carrierSlotOf(columnSlot: TOIMComputedColumnSlot): TOIMComputedContentSlot;
|
|
319
413
|
private deriveColumnValue;
|
|
320
414
|
private deriveColumnValues;
|
|
321
415
|
}
|
|
322
416
|
|
|
323
|
-
type TOIMSlotEditable<TSlot> = {
|
|
324
|
-
-readonly [K in keyof TSlot]: TSlot[K];
|
|
325
|
-
};
|
|
326
|
-
|
|
327
417
|
interface IOIMSlotStamp<TSlot> {
|
|
328
|
-
stamp(
|
|
418
|
+
stamp(editableSlot: TOIMEditable<TSlot>): void;
|
|
329
419
|
}
|
|
330
420
|
|
|
331
421
|
type TOIMOrderedListCommand = {
|
|
@@ -344,18 +434,18 @@ type TOIMOrderedListCommand = {
|
|
|
344
434
|
slots: readonly TOIMSlot[];
|
|
345
435
|
};
|
|
346
436
|
|
|
347
|
-
type
|
|
437
|
+
type TOIMBucketContentSlot<TSlots = unknown> = TOIMSlot & {
|
|
348
438
|
readonly owner: IOIMSlotOwner;
|
|
349
|
-
readonly storeSlot: TOIMStoreSlot<unknown,
|
|
439
|
+
readonly storeSlot: TOIMStoreSlot<unknown, TOIMBucketContentSlot<TSlots>>;
|
|
350
440
|
readonly bucketSlotsStore: TSlots;
|
|
351
441
|
readonly commands: readonly TOIMOrderedListCommand[] | undefined;
|
|
352
442
|
readonly isWholeListRecorded: boolean;
|
|
353
443
|
readonly commandsStartedAtRevision: number;
|
|
354
444
|
readonly commandsStartedAtEpoch: number;
|
|
355
|
-
readonly wasEmptyBeforeChange: boolean | undefined;
|
|
356
|
-
readonly isChangedAgainInSubframe: boolean;
|
|
357
445
|
};
|
|
358
446
|
|
|
447
|
+
type TOIMBucketSlot<TSlots = unknown, TKey extends NonNullable<unknown> = NonNullable<unknown>> = TOIMBucketContentSlot<TSlots> & TOIMIndexableSlot<TKey>;
|
|
448
|
+
|
|
359
449
|
type TOIMSameValueGuard<TValue = unknown> = (prevValue: TValue, nextValue: TValue) => boolean;
|
|
360
450
|
|
|
361
451
|
declare function oimSameValueZeroGuard(prevValue: unknown, nextValue: unknown): boolean;
|
|
@@ -373,12 +463,12 @@ declare function oimUnholdSlotsIfAlive(slots: readonly TOIMSlot[]): void;
|
|
|
373
463
|
type TOIMChannelScheduler = (flush: () => void) => void;
|
|
374
464
|
|
|
375
465
|
interface IOIMEntityWriter {
|
|
376
|
-
readonly fillEntity: (slot:
|
|
377
|
-
readonly putEntity: (slot:
|
|
378
|
-
readonly patchEntity: (slot:
|
|
379
|
-
readonly patchColumn: (slot:
|
|
380
|
-
readonly deleteColumns: (slot:
|
|
381
|
-
readonly clearEntity: (slot:
|
|
466
|
+
readonly fillEntity: (slot: TOIMEntityContentSlot, entity: object) => void;
|
|
467
|
+
readonly putEntity: (slot: TOIMEntityContentSlot, entity: object, changedColumnNames: string[] | undefined) => boolean;
|
|
468
|
+
readonly patchEntity: (slot: TOIMEntityContentSlot, patch: object, changedColumnNames: string[] | undefined) => boolean;
|
|
469
|
+
readonly patchColumn: (slot: TOIMEntityContentSlot, columnName: string, value: unknown, changedColumnNames: string[] | undefined) => boolean;
|
|
470
|
+
readonly deleteColumns: (slot: TOIMEntityContentSlot, names: readonly string[]) => readonly string[];
|
|
471
|
+
readonly clearEntity: (slot: TOIMEntityContentSlot) => void;
|
|
382
472
|
}
|
|
383
473
|
|
|
384
474
|
type TOIMEntityColumnName<TEntity extends object> = [
|
|
@@ -387,23 +477,11 @@ type TOIMEntityColumnName<TEntity extends object> = [
|
|
|
387
477
|
|
|
388
478
|
type TOIMEntityColumnValue<TEntity extends object, TColumnName> = object extends TEntity ? unknown : TColumnName extends keyof TEntity ? TEntity[TColumnName] : never;
|
|
389
479
|
|
|
390
|
-
declare
|
|
391
|
-
abstract flush(flushSchedulerSlot: TFlushSchedulerSlot): void;
|
|
392
|
-
protected onSchedulerTimerFired(flushSchedulerSlot: TFlushSchedulerSlot): void;
|
|
393
|
-
protected isScheduled(flushSchedulerSlot: TFlushSchedulerSlot): boolean;
|
|
394
|
-
protected schedule(flushSchedulerSlot: TFlushSchedulerSlot, delayMs: number): void;
|
|
395
|
-
protected cancelSchedule(flushSchedulerSlot: TFlushSchedulerSlot): void;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
declare class OIMChannelService extends OIMFlushSchedulerService<TOIMChannelSlot> {
|
|
480
|
+
declare class OIMChannelService implements IOIMFlushSchedulerListener<TOIMChannelSlot> {
|
|
399
481
|
static readonly INSTANCE: OIMChannelService;
|
|
400
482
|
scheduleEffectRun(channelSlot: TOIMChannelSlot, effect: TOIMEffect): void;
|
|
401
483
|
isRefusingWrites(channelSlot: TOIMChannelSlot): boolean;
|
|
402
484
|
assertNotFlushing(channelSlot: TOIMChannelSlot): void;
|
|
403
|
-
isSubframeOpen(channelSlot: TOIMChannelSlot): boolean;
|
|
404
|
-
listChangedStoreSlot(channelSlot: TOIMChannelSlot, storeSlot: TOIMStoreSlot, subframeCloseListener: IOIMSubframeCloseListener): void;
|
|
405
|
-
openSubframe(channelSlot: TOIMChannelSlot): void;
|
|
406
|
-
closeSubframe(channelSlot: TOIMChannelSlot): void;
|
|
407
485
|
subscribeAfterEachFrame(channelSlot: TOIMChannelSlot, handler: () => void): TOIMDisposer;
|
|
408
486
|
subscribeAfterEachFlush(channelSlot: TOIMChannelSlot, handler: () => void): TOIMDisposer;
|
|
409
487
|
subscribeOnceAfterFrame(channelSlot: TOIMChannelSlot, handler: () => void): TOIMDisposer;
|
|
@@ -412,6 +490,7 @@ declare class OIMChannelService extends OIMFlushSchedulerService<TOIMChannelSlot
|
|
|
412
490
|
writeWithoutFlushCheck(channelSlot: TOIMChannelSlot, slot: TOIMSlot): void;
|
|
413
491
|
private requestFlush;
|
|
414
492
|
dropChannelSlot(channelSlot: TOIMChannelSlot): void;
|
|
493
|
+
onSchedulerTimerFired(channelSlot: TOIMChannelSlot): void;
|
|
415
494
|
flush(channelSlot: TOIMChannelSlot): void;
|
|
416
495
|
private runFrame;
|
|
417
496
|
private dispatchAfterEachFrame;
|
|
@@ -432,72 +511,102 @@ interface IOIMChannelMap {
|
|
|
432
511
|
readonly defaultChannelSlot: TOIMChannelSlot;
|
|
433
512
|
}
|
|
434
513
|
|
|
435
|
-
type
|
|
514
|
+
type TOIMLogAndContinueErrorPolicyOptions = {
|
|
436
515
|
onError?: ((error: unknown) => void) | undefined;
|
|
437
516
|
};
|
|
438
517
|
|
|
439
|
-
declare class
|
|
440
|
-
static readonly INSTANCE:
|
|
518
|
+
declare class OIMLogAndContinueErrorPolicy implements IOIMErrorPolicy {
|
|
519
|
+
static readonly INSTANCE: OIMLogAndContinueErrorPolicy;
|
|
441
520
|
private readonly onError;
|
|
442
|
-
constructor(options?:
|
|
521
|
+
constructor(options?: TOIMLogAndContinueErrorPolicyOptions);
|
|
443
522
|
onErrorCaught(error: unknown): void;
|
|
444
523
|
}
|
|
445
524
|
|
|
446
|
-
declare class
|
|
525
|
+
declare class OIMThrowAtOnceErrorPolicy implements IOIMErrorPolicy {
|
|
447
526
|
onErrorCaught(error: unknown): void;
|
|
448
527
|
}
|
|
449
528
|
|
|
450
|
-
|
|
451
|
-
private readonly slotEffectSourceList;
|
|
452
|
-
private computedEffectSourceList;
|
|
453
|
-
private committedAllRootSlots;
|
|
454
|
-
private trackedAllRootSlots;
|
|
455
|
-
private isTrackedAllRootSlotsChanged;
|
|
456
|
-
readSourceSlot<TSlot extends TOIMSlot>(slot: TSlot): TSlot;
|
|
457
|
-
readSourceComputedValue<TValue>(computedSlot: TOIMComputedSlot<TValue, unknown>): TValue;
|
|
458
|
-
openSourceTracking(): void;
|
|
459
|
-
closeSourceTracking(): boolean;
|
|
460
|
-
getTrackedSourceSlots(): readonly TOIMSlot[];
|
|
461
|
-
getTrackedSourceComputeds(): readonly TOIMComputedSlot[];
|
|
462
|
-
getTrackedAllRootSlots(): readonly TOIMSlot[];
|
|
463
|
-
commitTrackedSources(): void;
|
|
464
|
-
private trackAllRootSlots;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
type TOIMEffectBodyWithSourceTracking = (effectSourceTracker: OIMEffectSourceTracker) => (() => void) | void;
|
|
529
|
+
type TOIMSourceTrackingEffectBody = (sourceTracker: OIMSourceTracker) => (() => void) | void;
|
|
468
530
|
|
|
469
531
|
declare class OIMEffectService implements IOIMEffectService {
|
|
470
532
|
static readonly INSTANCE: OIMEffectService;
|
|
471
|
-
createEffect(channelMap: IOIMChannelMap,
|
|
472
|
-
subscribeEffect(channelMap: IOIMChannelMap,
|
|
473
|
-
|
|
474
|
-
|
|
533
|
+
createEffect(channelMap: IOIMChannelMap, body: TOIMEffectBody, sourceSlots?: readonly TOIMSlot[], sourceComputeds?: readonly TOIMComputedContentSlot[], sourceTrackingComputeds?: readonly TOIMComputedContentSlot<unknown, OIMSourceTracker>[]): TOIMEffect;
|
|
534
|
+
subscribeEffect(channelMap: IOIMChannelMap, body: TOIMEffectBody, sourceSlots?: readonly TOIMSlot[], sourceComputeds?: readonly TOIMComputedContentSlot[], sourceTrackingComputeds?: readonly TOIMComputedContentSlot<unknown, OIMSourceTracker>[]): TOIMDisposer;
|
|
535
|
+
createAndRunEffect(channelMap: IOIMChannelMap, body: TOIMEffectBody, sourceSlots?: readonly TOIMSlot[], sourceComputeds?: readonly TOIMComputedContentSlot[], sourceTrackingComputeds?: readonly TOIMComputedContentSlot<unknown, OIMSourceTracker>[]): TOIMEffect;
|
|
536
|
+
createSourceTrackingEffect(channelMap: IOIMChannelMap, sourceTrackingEffectBody: TOIMSourceTrackingEffectBody): TOIMEffect;
|
|
537
|
+
private createEffectOverSourceTrackingComputeds;
|
|
538
|
+
private createEffectOverSourceTracker;
|
|
539
|
+
private scheduleEffectRunIfWrittenSinceFrameOpened;
|
|
475
540
|
markEffectRunScheduled(effect: TOIMEffect, isSourceCheckOwed: boolean): boolean;
|
|
476
541
|
runScheduledEffect(effect: TOIMEffect): void;
|
|
477
542
|
runEffectIfSourcesChanged(effect: TOIMEffect): void;
|
|
478
543
|
runEffect(effect: TOIMEffect): void;
|
|
479
544
|
disposeEffect(effect: TOIMEffect): void;
|
|
480
545
|
setPositionInSubscribedSlot(effect: TOIMEffect, edge: number, positionInSlot: number): void;
|
|
481
|
-
private
|
|
546
|
+
private runSourceTrackingEffectBody;
|
|
482
547
|
private resubscribeToTrackedSources;
|
|
483
548
|
private getSubscribedSlotAtEdge;
|
|
484
549
|
private runCleanup;
|
|
485
550
|
private unsubscribeFrom;
|
|
486
551
|
}
|
|
487
552
|
|
|
488
|
-
type
|
|
489
|
-
|
|
553
|
+
type TOIMComputedSources = {
|
|
554
|
+
readonly sourceSlots: readonly TOIMSlot[];
|
|
555
|
+
readonly sourceComputeds: readonly TOIMComputedContentSlot[];
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
type TOIMComputedValueReleaser<TValue> = (value: TValue) => void;
|
|
559
|
+
|
|
560
|
+
type TOIMComputedValueServiceOptions<TValue, TComputedSlot extends TOIMComputedContentSlot<TValue, OIMSourceTracker | undefined>> = {
|
|
561
|
+
derive?: ((computedSlot: TComputedSlot) => TValue) | undefined;
|
|
490
562
|
sameValueGuard?: TOIMSameValueGuard<TValue> | undefined;
|
|
563
|
+
releaseValue?: TOIMComputedValueReleaser<TValue> | undefined;
|
|
491
564
|
};
|
|
492
565
|
|
|
493
|
-
declare class OIMComputedValueService<
|
|
566
|
+
declare class OIMComputedValueService<TValue, TComputedSlot extends TOIMComputedContentSlot<TValue, OIMSourceTracker | undefined> = TOIMComputedContentSlot<TValue>> implements IOIMComputedValueService<TValue> {
|
|
494
567
|
private readonly derive;
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
568
|
+
protected readonly sameValueGuard: TOIMSameValueGuard<TValue>;
|
|
569
|
+
protected readonly releaseValue: TOIMComputedValueReleaser<TValue>;
|
|
570
|
+
constructor(options: TOIMComputedValueServiceOptions<TValue, TComputedSlot>);
|
|
571
|
+
getValueForSlot(computedSlot: TComputedSlot): TValue;
|
|
572
|
+
releaseSlotValue(computedSlot: TComputedSlot): void;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
interface IOIMSlotContentService<TSlot extends TOIMSlot> {
|
|
576
|
+
isSlotEmpty(slot: TSlot): boolean;
|
|
577
|
+
releaseSlotContent(slot: TSlot): void;
|
|
578
|
+
hasReference(slot: TSlot): boolean;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
interface IOIMKeyedSlotCreator<TKey extends NonNullable<unknown>, TSlot extends TOIMKeyedSlot> {
|
|
582
|
+
createSlot(key: TKey, storeSlot: TOIMStoreSlot, slotOwner: IOIMSlotOwner): TSlot;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
interface IOIMSingleSlotCreator<TSlot extends TOIMSlot> {
|
|
586
|
+
createSingleSlot(storeSlot: TOIMStoreSlot, slotOwner: IOIMSlotOwner): TSlot;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
type TOIMSlotContentComputedServiceOptions<TValue, TComputedSlot extends TOIMComputedContentSlot<TValue, OIMSourceTracker | undefined>> = {
|
|
590
|
+
computedValueService: OIMComputedValueService<TValue, TComputedSlot>;
|
|
591
|
+
createSources?: ((computedSlot: TComputedSlot) => Partial<TOIMComputedSources>) | undefined;
|
|
592
|
+
initialValue?: TValue | undefined;
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
declare class OIMSlotContentComputedService<TValue, TComputedSlot extends TOIMComputedContentSlot<TValue, OIMSourceTracker | undefined> = TOIMComputedContentSlot<TValue>> implements IOIMSlotContentService<TComputedSlot>, IOIMKeyedSlotCreator<NonNullable<unknown>, TComputedSlot & TOIMIndexableSlot>, IOIMSingleSlotCreator<TComputedSlot> {
|
|
596
|
+
private readonly computedValueService;
|
|
597
|
+
private readonly createSources;
|
|
598
|
+
private readonly initialValue;
|
|
599
|
+
constructor(options: TOIMSlotContentComputedServiceOptions<TValue, TComputedSlot>);
|
|
600
|
+
createSlot<TKey extends NonNullable<unknown>>(key: TKey, storeSlot: TOIMStoreSlot, slotOwner: IOIMSlotOwner): TComputedSlot & TOIMIndexableSlot<TKey>;
|
|
601
|
+
createSingleSlot(storeSlot: TOIMStoreSlot, slotOwner: IOIMSlotOwner): TComputedSlot;
|
|
602
|
+
isSlotEmpty(): boolean;
|
|
603
|
+
releaseSlotContent(computedSlot: TComputedSlot): void;
|
|
604
|
+
hasReference(): boolean;
|
|
605
|
+
protected createSourceTracker(): OIMSourceTracker | undefined;
|
|
606
|
+
protected attachSources(computedSlot: TComputedSlot, storeSlot: TOIMStoreSlot): void;
|
|
498
607
|
}
|
|
499
608
|
|
|
500
|
-
declare function oimRefreshSourceComputeds(sourceComputeds: readonly
|
|
609
|
+
declare function oimRefreshSourceComputeds(sourceComputeds: readonly TOIMComputedContentSlot<unknown, OIMSourceTracker | undefined>[]): void;
|
|
501
610
|
|
|
502
611
|
interface IOIMSlotReleasePolicy {
|
|
503
612
|
readonly releasesWrittenSlots: boolean;
|
|
@@ -510,40 +619,27 @@ interface IOIMSlotReleasePolicy {
|
|
|
510
619
|
cancelSlotRelease(slot: TOIMSlot): void;
|
|
511
620
|
}
|
|
512
621
|
|
|
513
|
-
|
|
514
|
-
createSlot(key: TKey, storeSlot: TOIMStoreSlot | undefined, slotOwnerService: TSlotOwnerService): TSlot;
|
|
515
|
-
isSlotEmpty(slot: TSlot): boolean;
|
|
516
|
-
releaseSlotContent(slot: TSlot, slotOwnerService: TSlotOwnerService): void;
|
|
517
|
-
hasReference(slot: TSlot): boolean;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
interface IOIMSlotContentFlushStrategy<TSlot extends TOIMSlot, TSlotOwnerService extends IOIMSlotOwner = IOIMSlotOwner> {
|
|
521
|
-
onSubframeClosed(storeSlot: TOIMStoreSlot<unknown, TSlot>, slotOwnerService: TSlotOwnerService): void;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
type TOIMSlotOwnerServiceOptions<TKey, TSlot extends TOIMKeyedSlot<TKey>, TStore, TColumnName extends string, TColumnSlot extends TOIMKeyedSlot<string>, TColumnOwner extends OIMColumnOwner<TOIMSlot, TColumnSlot>, TPatch> = {
|
|
622
|
+
type TOIMSlotOwnerServiceOptions<TSlot extends TOIMSlot, TStore, TColumnName extends string, TColumnSlot extends TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot>> = {
|
|
525
623
|
slotStamp?: IOIMSlotStamp<TSlot> | undefined;
|
|
526
624
|
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
625
|
+
slotSubscriptionListener?: IOIMSlotSubscriptionListener | undefined;
|
|
626
|
+
slotFilingService: IOIMSlotFilingService<TSlot, TStore>;
|
|
627
|
+
slotContentService: IOIMSlotContentService<TSlot>;
|
|
628
|
+
columnSlotOwnerOptions: TOIMColumnSlotOwnerOptions<TColumnSlot, TColumnName>;
|
|
629
|
+
createColumnSlotOwner: (columnSlotOwnerOptions: TOIMColumnSlotOwnerOptions<TColumnSlot, TColumnName>) => TColumnSlotOwner;
|
|
532
630
|
};
|
|
533
631
|
|
|
534
|
-
declare class OIMSlotOwnerService<
|
|
535
|
-
private readonly
|
|
536
|
-
private readonly
|
|
632
|
+
declare class OIMSlotOwnerService<TSlot extends TOIMSlot, TStore, TColumnName extends string, TColumnSlot extends TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot>, TPatch = unknown> extends OIMSlotOwner {
|
|
633
|
+
private readonly slotContentService;
|
|
634
|
+
private readonly slotFilingService;
|
|
537
635
|
private readonly slotStamp;
|
|
538
636
|
private readonly slotReleasePolicy;
|
|
539
637
|
private readonly releasesWrittenSlots;
|
|
540
638
|
private readonly schedulesReleaseOnWrite;
|
|
541
|
-
readonly
|
|
542
|
-
private readonly
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
onStoreSlotSubframeClosed(storeSlot: TOIMStoreSlot): void;
|
|
546
|
-
createSlot(key: TKey, storeSlot: TOIMStoreSlot | undefined): TSlot;
|
|
639
|
+
readonly settlesWrittenSlots: boolean;
|
|
640
|
+
private readonly slotSubscriptionListener;
|
|
641
|
+
readonly columnSlotOwner: TColumnSlotOwner;
|
|
642
|
+
constructor(options: TOIMSlotOwnerServiceOptions<TSlot, TStore, TColumnName, TColumnSlot, TColumnSlotOwner>);
|
|
547
643
|
isSlotEmpty(slot: TSlot): boolean;
|
|
548
644
|
hasColumnSlots(slot: TOIMSlot): boolean;
|
|
549
645
|
hasContentChangeListeners(slot: TOIMSlot): boolean;
|
|
@@ -554,40 +650,47 @@ declare class OIMSlotOwnerService<TKey, TSlot extends TOIMKeyedSlot<TKey>, TStor
|
|
|
554
650
|
releaseSlotIfUnheldAfterListeners(slot: TSlot): void;
|
|
555
651
|
releaseWrittenSlotIfUnheld(slot: TSlot): void;
|
|
556
652
|
assertWritable(slot: TOIMSlot): void;
|
|
557
|
-
fileSlot(
|
|
653
|
+
fileSlot(slot: TSlot): void;
|
|
558
654
|
writeSlotToChannelAndSettle(slot: TSlot, wasEmpty: boolean): void;
|
|
559
655
|
settleEmptiness(slot: TSlot, isEmpty: boolean): void;
|
|
560
656
|
markEmptiness(slot: TSlot, isEmpty: boolean): void;
|
|
561
657
|
private settleWrite;
|
|
562
658
|
private scheduleSlotRelease;
|
|
563
659
|
protected onSlotIdle(slot: TSlot): void;
|
|
660
|
+
onSlotFirstSubscribed(slot: TOIMSlot): void;
|
|
661
|
+
onSlotLastUnsubscribed(slot: TOIMSlot): void;
|
|
564
662
|
protected onSlotUnheld(slot: TSlot): void;
|
|
565
663
|
releaseSlotIfUnheld(slot: TOIMSlot): void;
|
|
566
664
|
private isReleasable;
|
|
567
665
|
private releaseSlot;
|
|
568
666
|
}
|
|
569
667
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
668
|
+
interface IOIMSlotContentWriter<TSlot extends TOIMSlot, TContent> {
|
|
669
|
+
insertSlotContent(slot: TSlot, content: TContent, changedSlots?: TSlot[]): void;
|
|
670
|
+
writeSlotContent(slot: TSlot, content: TContent): boolean;
|
|
671
|
+
clearSlotContent(slot: TSlot): void;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
declare class OIMSlotContentChangeListenerService {
|
|
675
|
+
static readonly INSTANCE: OIMSlotContentChangeListenerService;
|
|
676
|
+
addContentChangeListener<TSlot extends TOIMSlot, TPatch>(storeSlot: TOIMStoreSlot<unknown, TSlot, TPatch>, listener: IOIMSlotContentChangeListener<TSlot, TPatch>, readColumnNames: readonly string[] | undefined): void;
|
|
677
|
+
removeContentChangeListener<TSlot extends TOIMSlot, TPatch>(storeSlot: TOIMStoreSlot<unknown, TSlot, TPatch>, listener: IOIMSlotContentChangeListener<TSlot, TPatch>): boolean;
|
|
574
678
|
addReadColumn(storeSlot: TOIMStoreSlot, columnName: string): void;
|
|
575
679
|
removeReadColumn(storeSlot: TOIMStoreSlot, columnName: string): void;
|
|
576
680
|
addReadAnyColumn(storeSlot: TOIMStoreSlot): void;
|
|
577
681
|
removeReadAnyColumn(storeSlot: TOIMStoreSlot): void;
|
|
578
682
|
}
|
|
579
683
|
|
|
580
|
-
interface
|
|
684
|
+
interface IOIMSlotEmptinessPolicy<TSlot> {
|
|
581
685
|
isEmpty(slot: TSlot): boolean;
|
|
582
686
|
}
|
|
583
687
|
|
|
584
|
-
type TOIMSlotContentEntityServiceOptions<TEntity extends object
|
|
585
|
-
keyOf: (entity: TEntity) => TKey;
|
|
688
|
+
type TOIMSlotContentEntityServiceOptions<TEntity extends object> = {
|
|
586
689
|
entityWriter: IOIMEntityWriter;
|
|
587
|
-
|
|
690
|
+
slotEmptinessPolicy: IOIMSlotEmptinessPolicy<TOIMEntityContentSlot<TEntity>>;
|
|
588
691
|
};
|
|
589
692
|
|
|
590
|
-
type TOIMEntitySlotOwnerService<TEntity extends object,
|
|
693
|
+
type TOIMEntitySlotOwnerService<TEntity extends object, TEntitySlot extends TOIMEntityContentSlot<TEntity> = TOIMEntitySlot<TEntity>, TStore = unknown, TColumnName extends string = string> = OIMSlotOwnerService<TEntitySlot, TStore, TColumnName, TOIMColumnSlot, OIMPushColumnSlotOwner, Partial<TEntity>>;
|
|
591
694
|
|
|
592
695
|
declare class OIMUnusedSlotCollectorService {
|
|
593
696
|
static readonly INSTANCE: OIMUnusedSlotCollectorService;
|
|
@@ -608,9 +711,9 @@ type TOIMCollectorSlotOptions = {
|
|
|
608
711
|
|
|
609
712
|
declare function createOIMCollectorSlot(options: TOIMCollectorSlotOptions): TOIMCollectorSlot;
|
|
610
713
|
|
|
611
|
-
declare
|
|
612
|
-
|
|
613
|
-
|
|
714
|
+
declare class OIMColumnSlotService<TSlot extends TOIMSlot, TColumnName extends string, TColumnSlot extends TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot>> {
|
|
715
|
+
private readonly columnSlotOwner;
|
|
716
|
+
constructor(columnSlotOwner: TColumnSlotOwner);
|
|
614
717
|
getColumn(slot: TSlot, columnName: TColumnName): TColumnSlot;
|
|
615
718
|
holdColumn(slot: TSlot, columnName: TColumnName): TColumnSlot;
|
|
616
719
|
getAnyColumn(slot: TSlot): TColumnSlot;
|
|
@@ -620,22 +723,24 @@ declare abstract class OIMSlotColumnService<TSlot extends TOIMSlot, TColumnName
|
|
|
620
723
|
unholdColumn(columnSlot: TColumnSlot): void;
|
|
621
724
|
}
|
|
622
725
|
|
|
623
|
-
type TOIMSlotCollectionServiceOptions<TKey
|
|
624
|
-
slotOwnerService: OIMSlotOwnerService<TKey, TSlot, TStore, TColumnName, TColumnSlot, TColumnOwner, TPatch>;
|
|
726
|
+
type TOIMSlotCollectionServiceOptions<TKey extends NonNullable<unknown>, TSlot extends TOIMKeyedSlot<TKey>, TStore, TSlotContentService, TColumnName extends string = string, TColumnSlot extends TOIMKeyedSlot<string> = TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot> = OIMColumnSlotOwner<TOIMSlot, TColumnSlot>> = Omit<TOIMSlotOwnerServiceOptions<TSlot, TStore, TColumnName, TColumnSlot, TColumnSlotOwner>, 'slotFilingService' | 'slotContentService'> & {
|
|
625
727
|
slotStoreService: IOIMSlotStoreService<TKey, TSlot, TStore>;
|
|
626
|
-
slotContentService: TSlotContentService
|
|
728
|
+
slotContentService: TSlotContentService & IOIMSlotContentService<TSlot> & IOIMKeyedSlotCreator<TKey, TSlot>;
|
|
627
729
|
storeSlotListener?: IOIMStoreSlotListener | undefined;
|
|
628
730
|
};
|
|
629
731
|
|
|
630
|
-
declare class OIMSlotCollectionService<TKey
|
|
732
|
+
declare class OIMSlotCollectionService<TKey extends NonNullable<unknown>, TSlot extends TOIMKeyedSlot<TKey>, TStore, TSlotContentService, TColumnName extends string = string, TColumnSlot extends TOIMKeyedSlot<string> = TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot> = OIMColumnSlotOwner<TOIMSlot, TColumnSlot>, TPatch = unknown> {
|
|
631
733
|
readonly slotContentService: TSlotContentService;
|
|
632
|
-
|
|
633
|
-
|
|
734
|
+
readonly columnSlotService: OIMColumnSlotService<TSlot, TColumnName, TColumnSlot, TColumnSlotOwner>;
|
|
735
|
+
protected readonly slotOwnerService: OIMSlotOwnerService<TSlot, TStore, TColumnName, TColumnSlot, TColumnSlotOwner, TPatch>;
|
|
736
|
+
protected readonly slotStoreService: IOIMSlotStoreService<TKey, TSlot, TStore>;
|
|
737
|
+
protected readonly keyedSlotCreator: IOIMKeyedSlotCreator<TKey, TSlot>;
|
|
634
738
|
private readonly storeSlotListener;
|
|
635
|
-
constructor(options: TOIMSlotCollectionServiceOptions<TKey, TSlot, TStore, TSlotContentService, TColumnName, TColumnSlot,
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
739
|
+
constructor(options: TOIMSlotCollectionServiceOptions<TKey, TSlot, TStore, TSlotContentService, TColumnName, TColumnSlot, TColumnSlotOwner>);
|
|
740
|
+
get slotOwner(): IOIMSlotOwner;
|
|
741
|
+
createStoreSlot(channelMap: IOIMChannelMap): TOIMStoreSlot<TStore, TSlot, TPatch, this>;
|
|
742
|
+
createStoreSlotFrom(sourceStoreSlot: TOIMStoreSlot): TOIMStoreSlot<TStore, TSlot, TPatch, this>;
|
|
743
|
+
protected createStoreSlotOverNewStore<TStoreSlot extends TOIMStoreSlot<TStore, TSlot, TPatch>>(createStoreSlotLiteral: (store: TStore) => TStoreSlot): TStoreSlot;
|
|
639
744
|
findSlotByKey(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>, key: TKey): TSlot | undefined;
|
|
640
745
|
hasSlotContentByKey(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>, key: TKey): boolean;
|
|
641
746
|
getSlotByKey(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>, key: TKey): TSlot;
|
|
@@ -643,36 +748,43 @@ declare class OIMSlotCollectionService<TKey, TSlot extends TOIMKeyedSlot<TKey>,
|
|
|
643
748
|
getSlots(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>): IterableIterator<TSlot>;
|
|
644
749
|
getSlotCount(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>): number;
|
|
645
750
|
isSameKey(key: TKey, otherKey: TKey): boolean;
|
|
751
|
+
openBatch(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>): void;
|
|
752
|
+
closeBatch(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>): void;
|
|
753
|
+
writeInBatch<TResult>(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>, write: () => TResult): TResult;
|
|
646
754
|
protected onSlotMinted(_storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>, _slot: TSlot): void;
|
|
647
755
|
private mintSlotByKey;
|
|
648
756
|
}
|
|
649
757
|
|
|
650
|
-
declare class
|
|
651
|
-
|
|
758
|
+
declare class OIMWritableSlotCollectionService<TKey extends NonNullable<unknown>, TSlot extends TOIMKeyedSlot<TKey>, TStore, TContent, TSlotContentService extends IOIMSlotContentWriter<TSlot, TContent> & IOIMSlotContentService<TSlot> & IOIMKeyedSlotCreator<TKey, TSlot>, TColumnName extends string = string, TColumnSlot extends TOIMKeyedSlot<string> = TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot> = OIMColumnSlotOwner<TOIMSlot, TColumnSlot>, TPatch = unknown> extends OIMSlotCollectionService<TKey, TSlot, TStore, TSlotContentService, TColumnName, TColumnSlot, TColumnSlotOwner, TPatch> {
|
|
759
|
+
writeSlotContentByKey(storeSlot: TOIMStoreSlot<TStore, TSlot, TPatch>, key: TKey, content: TContent, changedSlots?: TSlot[]): TSlot;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
declare class OIMSingleSlotStoreService<TSlot extends TOIMSlot> implements IOIMSlotFilingService<TSlot, TOIMSingleSlotStore<TSlot>> {
|
|
763
|
+
static readonly INSTANCE: OIMSingleSlotStoreService<TOIMSlot>;
|
|
652
764
|
createStore(): TOIMSingleSlotStore<TSlot>;
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
set(store: TOIMSingleSlotStore<TSlot>, _key: void, slot: TSlot): void;
|
|
657
|
-
remove(store: TOIMSingleSlotStore<TSlot>): void;
|
|
765
|
+
getSingleSlot(store: TOIMSingleSlotStore<TSlot>): TSlot | undefined;
|
|
766
|
+
fileSlot(store: TOIMSingleSlotStore<TSlot>, slot: TSlot): void;
|
|
767
|
+
unfileSlot(store: TOIMSingleSlotStore<TSlot>): void;
|
|
658
768
|
getSlots(store: TOIMSingleSlotStore<TSlot>): IterableIterator<TSlot>;
|
|
659
769
|
getSlotCount(store: TOIMSingleSlotStore<TSlot>): number;
|
|
660
770
|
}
|
|
661
771
|
|
|
662
|
-
type TOIMSingleSlotServiceOptions<TSlot extends
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
slotContentService: TSlotContentService;
|
|
772
|
+
type TOIMSingleSlotServiceOptions<TSlot extends TOIMSlot, TSlotContentService, TColumnName extends string = string, TColumnSlot extends TOIMKeyedSlot<string> = TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot> = OIMColumnSlotOwner<TOIMSlot, TColumnSlot>> = Omit<TOIMSlotOwnerServiceOptions<TSlot, TOIMSingleSlotStore<TSlot>, TColumnName, TColumnSlot, TColumnSlotOwner>, 'slotFilingService' | 'slotContentService'> & {
|
|
773
|
+
slotStoreService: OIMSingleSlotStoreService<TSlot>;
|
|
774
|
+
slotContentService: TSlotContentService & IOIMSlotContentService<TSlot> & IOIMSingleSlotCreator<TSlot>;
|
|
666
775
|
storeSlotListener?: IOIMStoreSlotListener | undefined;
|
|
667
776
|
};
|
|
668
777
|
|
|
669
|
-
declare class OIMSingleSlotService<TSlot extends
|
|
778
|
+
declare class OIMSingleSlotService<TSlot extends TOIMSlot, TSlotContentService, TColumnName extends string = string, TColumnSlot extends TOIMKeyedSlot<string> = TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot> = OIMColumnSlotOwner<TOIMSlot, TColumnSlot>, TPatch = unknown> {
|
|
670
779
|
readonly slotContentService: TSlotContentService;
|
|
671
|
-
|
|
672
|
-
|
|
780
|
+
readonly columnSlotService: OIMColumnSlotService<TSlot, TColumnName, TColumnSlot, TColumnSlotOwner>;
|
|
781
|
+
protected readonly slotOwnerService: OIMSlotOwnerService<TSlot, TOIMSingleSlotStore<TSlot>, TColumnName, TColumnSlot, TColumnSlotOwner, TPatch>;
|
|
782
|
+
protected readonly slotStoreService: OIMSingleSlotStoreService<TSlot>;
|
|
783
|
+
protected readonly singleSlotCreator: IOIMSingleSlotCreator<TSlot>;
|
|
673
784
|
private readonly storeSlotListener;
|
|
674
|
-
constructor(options: TOIMSingleSlotServiceOptions<TSlot, TSlotContentService, TColumnName, TColumnSlot,
|
|
675
|
-
|
|
785
|
+
constructor(options: TOIMSingleSlotServiceOptions<TSlot, TSlotContentService, TColumnName, TColumnSlot, TColumnSlotOwner>);
|
|
786
|
+
get slotOwner(): IOIMSlotOwner;
|
|
787
|
+
createStoreSlot(channelMap: IOIMChannelMap): TOIMStoreSlot<TOIMSingleSlotStore<TSlot>, TSlot, TPatch, this>;
|
|
676
788
|
findSingleSlot(storeSlot: TOIMStoreSlot<TOIMSingleSlotStore<TSlot>, TSlot, TPatch>): TSlot | undefined;
|
|
677
789
|
hasSingleSlotContent(storeSlot: TOIMStoreSlot<TOIMSingleSlotStore<TSlot>, TSlot, TPatch>): boolean;
|
|
678
790
|
getSingleSlot(storeSlot: TOIMStoreSlot<TOIMSingleSlotStore<TSlot>, TSlot, TPatch>): TSlot;
|
|
@@ -680,64 +792,59 @@ declare class OIMSingleSlotService<TSlot extends TOIMKeyedSlot<void>, TSlotConte
|
|
|
680
792
|
private mintSingleSlot;
|
|
681
793
|
}
|
|
682
794
|
|
|
683
|
-
declare class
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
795
|
+
declare class OIMWritableSingleSlotService<TSlot extends TOIMSlot, TContent, TSlotContentService extends IOIMSlotContentWriter<TSlot, TContent> & IOIMSlotContentService<TSlot> & IOIMSingleSlotCreator<TSlot>, TColumnName extends string = string, TColumnSlot extends TOIMKeyedSlot<string> = TOIMKeyedSlot<string>, TColumnSlotOwner extends OIMColumnSlotOwner<TOIMSlot, TColumnSlot> = OIMColumnSlotOwner<TOIMSlot, TColumnSlot>, TPatch = unknown> extends OIMSingleSlotService<TSlot, TSlotContentService, TColumnName, TColumnSlot, TColumnSlotOwner, TPatch> {
|
|
796
|
+
writeSingleSlotContent(storeSlot: TOIMStoreSlot<TOIMSingleSlotStore<TSlot>, TSlot, TPatch>, content: TContent, changedSlots?: TSlot[]): TSlot;
|
|
797
|
+
clearSingleSlotContent(storeSlot: TOIMStoreSlot<TOIMSingleSlotStore<TSlot>, TSlot, TPatch>): void;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
declare class OIMSlotContentEntityService<TEntity extends object, TKey extends NonNullable<unknown> = TOIMStoreKey, TColumnName extends string = string> implements IOIMSlotContentWriter<TOIMEntityContentSlot<TEntity>, TEntity>, IOIMSlotContentService<TOIMEntityContentSlot<TEntity>>, IOIMKeyedSlotCreator<TKey, TOIMEntitySlot<TEntity, TKey>>, IOIMSingleSlotCreator<TOIMEntityContentSlot<TEntity>> {
|
|
687
801
|
private readonly entityWriter;
|
|
688
|
-
private readonly
|
|
689
|
-
private readonly
|
|
690
|
-
constructor(options: TOIMSlotContentEntityServiceOptions<TEntity
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
private fillEntitiesUnderKeys;
|
|
699
|
-
clearAllEntities(storeSlot: TOIMStoreSlot<TStore, TOIMEntitySlot<TEntity, TKey>>): void;
|
|
700
|
-
private fillEachEntity;
|
|
701
|
-
private refileRepeatedKey;
|
|
802
|
+
private readonly slotEmptinessPolicy;
|
|
803
|
+
private readonly isSlotEmptinessCustom;
|
|
804
|
+
constructor(options: TOIMSlotContentEntityServiceOptions<TEntity>);
|
|
805
|
+
createSlot(key: TKey, storeSlot: TOIMStoreSlot, slotOwner: IOIMSlotOwner): TOIMEntitySlot<TEntity, TKey>;
|
|
806
|
+
createSingleSlot(storeSlot: TOIMStoreSlot, slotOwner: IOIMSlotOwner): TOIMEntityContentSlot<TEntity>;
|
|
807
|
+
isSlotEmpty(entitySlot: TOIMEntityContentSlot<TEntity>): boolean;
|
|
808
|
+
hasReference(): boolean;
|
|
809
|
+
private updatesEmptinessOnColumnWriteOf;
|
|
810
|
+
private slotOwnerServiceOf;
|
|
811
|
+
insertSlotContent(entitySlot: TOIMEntityContentSlot<TEntity>, entity: TEntity, changedEntitySlots?: TOIMEntityContentSlot<TEntity>[]): void;
|
|
702
812
|
private insertEntityOnFastPath;
|
|
703
|
-
private
|
|
704
|
-
|
|
705
|
-
updateEntity(entitySlot:
|
|
706
|
-
updateEntityColumn<TColumn extends keyof TEntity & string
|
|
707
|
-
deleteEntityColumns(entitySlot:
|
|
708
|
-
markEntityChanged(entitySlot:
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
private updateEntityInSubframe;
|
|
813
|
+
private insertEntityOffFastPath;
|
|
814
|
+
writeSlotContent(entitySlot: TOIMEntityContentSlot<TEntity>, entity: TEntity): boolean;
|
|
815
|
+
updateEntity<TEntitySlot extends TOIMEntityContentSlot<TEntity>>(entitySlot: TEntitySlot, patch: Partial<TEntity>): TEntitySlot;
|
|
816
|
+
updateEntityColumn<TColumn extends keyof TEntity & string, TEntitySlot extends TOIMEntityContentSlot<TEntity>>(entitySlot: TEntitySlot, columnName: TColumn, value: TEntity[TColumn]): TEntitySlot;
|
|
817
|
+
deleteEntityColumns<TEntitySlot extends TOIMEntityContentSlot<TEntity>>(entitySlot: TEntitySlot, columnNames: readonly TOIMEntityColumnName<TEntity>[]): TEntitySlot;
|
|
818
|
+
markEntityChanged(entitySlot: TOIMEntityContentSlot<TEntity>, changedColumns?: readonly (keyof TEntity & string)[]): void;
|
|
819
|
+
clearSlotContent(entitySlot: TOIMEntityContentSlot<TEntity>): void;
|
|
820
|
+
private updateEntityOffFastPath;
|
|
712
821
|
private updateEntityColumnOffFastPath;
|
|
713
|
-
private
|
|
822
|
+
private updateEntityColumnAndDispatch;
|
|
714
823
|
private dispatchPatchWritten;
|
|
715
824
|
private writeSlotToChannelAndReleaseIfUnheld;
|
|
716
825
|
private dispatchContentChangeAndReleaseIfUnheld;
|
|
717
|
-
|
|
718
|
-
private
|
|
719
|
-
private withdrawSlotContent;
|
|
720
|
-
private clearSlotContent;
|
|
826
|
+
releaseSlotContent(entitySlot: TOIMEntityContentSlot<TEntity>): void;
|
|
827
|
+
private clearEntityAndMarkColumns;
|
|
721
828
|
private isOnFastPath;
|
|
722
829
|
private hasChangedColumnReaders;
|
|
723
830
|
private updateEntitySlotEmptiness;
|
|
724
|
-
private
|
|
831
|
+
private writeEntityToSlot;
|
|
725
832
|
private dispatchColumnsChanged;
|
|
726
833
|
}
|
|
727
834
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
835
|
+
type TOIMSlotContentServiceKey<TSlotContentService> = TSlotContentService extends {
|
|
836
|
+
createSlot(key: infer TKey, ...rest: never[]): unknown;
|
|
837
|
+
} ? Extract<TKey, NonNullable<unknown>> : never;
|
|
838
|
+
|
|
839
|
+
type TOIMSlotContentServiceSlot<TSlotContentService> = TSlotContentService extends {
|
|
840
|
+
createSlot(...args: never[]): infer TSlot;
|
|
841
|
+
} ? Extract<TSlot, TOIMKeyedSlot<TOIMSlotContentServiceKey<TSlotContentService>>> : never;
|
|
734
842
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}): OIMSingleSlotService<TSlot, TSlotContentService, TColumnName, TOIMColumnSlot, OIMColumnOwnerPushDriven, TPatch>;
|
|
843
|
+
type TOIMSlotContentServiceContent<TSlotContentService> = TSlotContentService extends {
|
|
844
|
+
writeSlotContent(slot: never, content: infer TContent): boolean;
|
|
845
|
+
} ? TContent : never;
|
|
846
|
+
|
|
847
|
+
type TOIMSlotContentServicePatch<TSlotContentService> = TOIMSlotContentServiceContent<TSlotContentService> extends readonly unknown[] ? TOIMSlotContentServiceContent<TSlotContentService> : Partial<TOIMSlotContentServiceContent<TSlotContentService>>;
|
|
741
848
|
|
|
742
849
|
interface IOIMIndexKeysService {
|
|
743
850
|
createPositions(): TOIMIndexKeysPositions;
|
|
@@ -747,309 +854,380 @@ interface IOIMIndexKeysService {
|
|
|
747
854
|
set<TIndexKey>(slot: TOIMIndexableSlot, position: number, indexKey: TIndexKey | undefined): void;
|
|
748
855
|
}
|
|
749
856
|
|
|
750
|
-
type
|
|
751
|
-
channelScheduler?: TOIMChannelScheduler | undefined;
|
|
752
|
-
errorPolicy?: IOIMErrorPolicy | undefined;
|
|
753
|
-
onBeforeFlush?: (() => void) | undefined;
|
|
754
|
-
getNowMs?: (() => number) | undefined;
|
|
755
|
-
releaseTimer?: TOIMTimer | undefined;
|
|
756
|
-
entityWriter?: IOIMEntityWriter | undefined;
|
|
757
|
-
indexKeysService?: IOIMIndexKeysService | undefined;
|
|
857
|
+
type TOIMDefaultsOptions = {
|
|
758
858
|
slotStamp?: IOIMSlotStamp<TOIMSlot> | undefined;
|
|
759
859
|
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
860
|
+
entityWriter?: IOIMEntityWriter | undefined;
|
|
861
|
+
entitySlotEmptinessPolicy?: IOIMSlotEmptinessPolicy<TOIMEntityContentSlot> | undefined;
|
|
862
|
+
indexKeysService?: IOIMIndexKeysService | undefined;
|
|
863
|
+
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMColumnSlot> | undefined;
|
|
864
|
+
computedColumnSlotStoreService?: IOIMSlotStoreService<string, TOIMComputedColumnSlot> | undefined;
|
|
865
|
+
storeSlotListener?: IOIMStoreSlotListener | undefined;
|
|
760
866
|
};
|
|
761
867
|
|
|
762
|
-
declare class
|
|
763
|
-
readonly
|
|
764
|
-
readonly collectorSlot: TOIMCollectorSlot;
|
|
765
|
-
readonly defaultChannelSlot: TOIMChannelSlot;
|
|
766
|
-
readonly entityWriter: IOIMEntityWriter | undefined;
|
|
868
|
+
declare class OIMDefaults {
|
|
869
|
+
static readonly INSTANCE: OIMDefaults;
|
|
767
870
|
readonly slotStamp: IOIMSlotStamp<TOIMSlot> | undefined;
|
|
768
871
|
readonly slotReleasePolicy: IOIMSlotReleasePolicy | undefined;
|
|
872
|
+
readonly entityWriter: IOIMEntityWriter | undefined;
|
|
873
|
+
readonly entitySlotEmptinessPolicy: IOIMSlotEmptinessPolicy<TOIMEntityContentSlot> | undefined;
|
|
769
874
|
readonly indexKeysService: IOIMIndexKeysService | undefined;
|
|
770
|
-
|
|
771
|
-
|
|
875
|
+
readonly columnSlotStoreService: IOIMSlotStoreService<string, TOIMColumnSlot> | undefined;
|
|
876
|
+
readonly computedColumnSlotStoreService: IOIMSlotStoreService<string, TOIMComputedColumnSlot> | undefined;
|
|
877
|
+
readonly storeSlotListener: IOIMStoreSlotListener | undefined;
|
|
878
|
+
constructor(options?: TOIMDefaultsOptions);
|
|
772
879
|
}
|
|
773
880
|
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
881
|
+
declare function createOIMSlotCollectionService<TSlotContentService extends object, TStore = Map<TOIMSlotContentServiceKey<TSlotContentService>, TOIMSlotContentServiceSlot<TSlotContentService>>, TColumnName extends string = string>(options: {
|
|
882
|
+
defaults?: OIMDefaults | undefined;
|
|
883
|
+
slotContentService: TSlotContentService & IOIMKeyedSlotCreator<TOIMSlotContentServiceKey<TSlotContentService>, TOIMSlotContentServiceSlot<TSlotContentService>> & IOIMSlotContentWriter<TOIMSlotContentServiceSlot<TSlotContentService>, TOIMSlotContentServiceContent<TSlotContentService>> & IOIMSlotContentService<TOIMSlotContentServiceSlot<TSlotContentService>>;
|
|
777
884
|
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
885
|
+
slotSubscriptionListener?: IOIMSlotSubscriptionListener | undefined;
|
|
778
886
|
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMColumnSlot> | undefined;
|
|
779
887
|
columnNames?: readonly TColumnName[] | undefined;
|
|
780
|
-
}
|
|
888
|
+
} & (TOIMSlotContentServiceKey<TSlotContentService> extends readonly unknown[] ? {
|
|
889
|
+
slotStoreService: IOIMSlotStoreService<TOIMSlotContentServiceKey<TSlotContentService>, TOIMSlotContentServiceSlot<TSlotContentService>, TStore>;
|
|
890
|
+
} : {
|
|
891
|
+
slotStoreService?: IOIMSlotStoreService<TOIMSlotContentServiceKey<TSlotContentService>, TOIMSlotContentServiceSlot<TSlotContentService>, TStore> | undefined;
|
|
892
|
+
})): OIMWritableSlotCollectionService<TOIMSlotContentServiceKey<TSlotContentService>, TOIMSlotContentServiceSlot<TSlotContentService>, TStore, TOIMSlotContentServiceContent<TSlotContentService>, TSlotContentService & IOIMKeyedSlotCreator<TOIMSlotContentServiceKey<TSlotContentService>, TOIMSlotContentServiceSlot<TSlotContentService>> & IOIMSlotContentWriter<TOIMSlotContentServiceSlot<TSlotContentService>, TOIMSlotContentServiceContent<TSlotContentService>> & IOIMSlotContentService<TOIMSlotContentServiceSlot<TSlotContentService>>, TColumnName, TOIMColumnSlot, OIMPushColumnSlotOwner, TOIMSlotContentServicePatch<TSlotContentService>>;
|
|
781
893
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}): OIMSlotContentEntityService<TEntity, void, TOIMSingleSlotStore<TOIMEntitySlot<TEntity, void>>, TColumnName>;
|
|
786
|
-
declare function createOIMSlotContentEntityService<TEntity extends object, TColumnName extends TOIMEntityColumnName<TEntity> = TOIMEntityColumnName<TEntity>, TKey extends TOIMStoreKey = TOIMStoreKey>(db: OIMDB, options: TOIMSlotContentEntityServiceFactoryOptions<TEntity, TKey, TColumnName> & {
|
|
787
|
-
keyOf: (entity: TEntity) => TKey;
|
|
788
|
-
slotStoreService?: undefined;
|
|
789
|
-
}): OIMSlotContentEntityService<TEntity, TKey, Map<TKey, TOIMEntitySlot<TEntity, TKey>>, TColumnName>;
|
|
790
|
-
declare function createOIMSlotContentEntityService<TEntity extends object, TColumnName extends TOIMEntityColumnName<TEntity> = TOIMEntityColumnName<TEntity>, TKey extends TOIMStoreKey | readonly unknown[] = TOIMStoreKey, TStore = Map<TKey, TOIMEntitySlot<TEntity, TKey>>>(db: OIMDB, options: TOIMSlotContentEntityServiceFactoryOptions<TEntity, TKey, TColumnName> & {
|
|
791
|
-
keyOf: (entity: TEntity) => TKey;
|
|
792
|
-
slotStoreService: IOIMSlotStoreService<TKey, TOIMEntitySlot<TEntity, TKey>, TStore>;
|
|
793
|
-
}): OIMSlotContentEntityService<TEntity, TKey, TStore, TColumnName>;
|
|
894
|
+
type TOIMSlotContentServiceSingleSlot<TSlotContentService> = TSlotContentService extends {
|
|
895
|
+
createSingleSlot(...args: never[]): infer TSlot;
|
|
896
|
+
} ? Extract<TSlot, TOIMSlot> : never;
|
|
794
897
|
|
|
795
|
-
declare function
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}):
|
|
898
|
+
declare function createOIMSingleSlotService<TSlotContentService extends object, TColumnName extends string = string>(options: {
|
|
899
|
+
defaults?: OIMDefaults | undefined;
|
|
900
|
+
slotContentService: TSlotContentService & IOIMSingleSlotCreator<TOIMSlotContentServiceSingleSlot<TSlotContentService>> & IOIMSlotContentWriter<TOIMSlotContentServiceSingleSlot<TSlotContentService>, TOIMSlotContentServiceContent<TSlotContentService>> & IOIMSlotContentService<TOIMSlotContentServiceSingleSlot<TSlotContentService>>;
|
|
901
|
+
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
902
|
+
slotSubscriptionListener?: IOIMSlotSubscriptionListener | undefined;
|
|
903
|
+
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMColumnSlot> | undefined;
|
|
904
|
+
columnNames?: readonly TColumnName[] | undefined;
|
|
905
|
+
}): OIMWritableSingleSlotService<TOIMSlotContentServiceSingleSlot<TSlotContentService>, TOIMSlotContentServiceContent<TSlotContentService>, TSlotContentService & IOIMSingleSlotCreator<TOIMSlotContentServiceSingleSlot<TSlotContentService>> & IOIMSlotContentWriter<TOIMSlotContentServiceSingleSlot<TSlotContentService>, TOIMSlotContentServiceContent<TSlotContentService>> & IOIMSlotContentService<TOIMSlotContentServiceSingleSlot<TSlotContentService>>, TColumnName, TOIMColumnSlot, OIMPushColumnSlotOwner>;
|
|
803
906
|
|
|
804
|
-
declare function
|
|
907
|
+
declare function createOIMSlotContentEntityService<TEntity extends object, TKey extends NonNullable<unknown> = TOIMStoreKey, TColumnName extends TOIMEntityColumnName<TEntity> = TOIMEntityColumnName<TEntity>>(options?: {
|
|
908
|
+
defaults?: OIMDefaults | undefined;
|
|
909
|
+
entityWriter?: IOIMEntityWriter | undefined;
|
|
910
|
+
slotEmptinessPolicy?: IOIMSlotEmptinessPolicy<TOIMEntityContentSlot<TEntity>> | undefined;
|
|
911
|
+
}): OIMSlotContentEntityService<TEntity, TKey, TColumnName>;
|
|
805
912
|
|
|
806
913
|
interface IOIMBucketCommands {
|
|
807
|
-
recordInsert(bucketSlot:
|
|
808
|
-
recordRemove(bucketSlot:
|
|
809
|
-
recordMove(bucketSlot:
|
|
810
|
-
recordWholeList(bucketSlot:
|
|
914
|
+
recordInsert(bucketSlot: TOIMBucketContentSlot<unknown>, index: number, bucketMemberSlot: TOIMSlot, bucketMemberSlotCount: number): void;
|
|
915
|
+
recordRemove(bucketSlot: TOIMBucketContentSlot<unknown>, index: number, count: number, bucketMemberSlotCount: number): void;
|
|
916
|
+
recordMove(bucketSlot: TOIMBucketContentSlot<unknown>, from: number, to: number, bucketMemberSlotCount: number): void;
|
|
917
|
+
recordWholeList(bucketSlot: TOIMBucketContentSlot<unknown>): void;
|
|
811
918
|
}
|
|
812
919
|
|
|
813
|
-
type TOIMBucketSlotOwnerService<TSlots, TBucketMemberSlot extends TOIMSlot = TOIMSlot, TKey = unknown, TStore = unknown> = OIMSlotOwnerService<TKey, TOIMBucketSlot<TSlots, TKey>, TStore, string, TOIMColumnSlot, OIMColumnOwnerPushDriven, readonly TBucketMemberSlot[]>;
|
|
814
|
-
|
|
815
920
|
type TOIMSlotContentBucketServiceOptions = {
|
|
816
921
|
bucketCommands?: IOIMBucketCommands | undefined;
|
|
817
922
|
};
|
|
818
923
|
|
|
819
|
-
declare abstract class OIMSlotContentBucketService<TBucketMemberSlot extends TOIMSlot, TSlots> {
|
|
924
|
+
declare abstract class OIMSlotContentBucketService<TBucketMemberSlot extends TOIMSlot, TSlots, TKey extends NonNullable<unknown> = TOIMStoreKey> implements IOIMSlotContentService<TOIMBucketContentSlot<TSlots>>, IOIMKeyedSlotCreator<TKey, TOIMBucketSlot<TSlots, TKey>>, IOIMSingleSlotCreator<TOIMBucketContentSlot<TSlots>>, IOIMSlotContentWriter<TOIMBucketContentSlot<TSlots>, readonly TBucketMemberSlot[]> {
|
|
820
925
|
protected readonly bucketCommands: IOIMBucketCommands;
|
|
821
|
-
private readonly slotContentStrategy;
|
|
822
926
|
protected constructor(options: TOIMSlotContentBucketServiceOptions);
|
|
823
|
-
createSlotOwnerService<TKey, TStore>(slotOwnerServiceOptions: Omit<TOIMSlotOwnerServiceOptions<TKey, TOIMBucketSlot<TSlots, TKey>, TStore, string, TOIMColumnSlot, OIMColumnOwnerPushDriven, readonly TBucketMemberSlot[]>, 'slotContentStrategy' | 'slotContentFlushStrategy'>): TOIMBucketSlotOwnerService<TSlots, TBucketMemberSlot, TKey, TStore>;
|
|
824
927
|
protected abstract createBucketMemberSlotsStore(): TSlots;
|
|
825
|
-
protected abstract addSlot(bucketSlot:
|
|
826
|
-
protected abstract removeSlot(bucketSlot:
|
|
827
|
-
protected abstract removeSlots(bucketSlot:
|
|
828
|
-
protected abstract reconcileSlots(bucketSlot:
|
|
829
|
-
protected abstract drainSlots(bucketSlot:
|
|
830
|
-
abstract hasBucketMemberSlot(bucketSlot:
|
|
831
|
-
abstract getBucketMemberSlotCount(bucketSlot:
|
|
832
|
-
abstract getBucketMemberSlots(bucketSlot:
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
928
|
+
protected abstract addSlot(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
929
|
+
protected abstract removeSlot(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
930
|
+
protected abstract removeSlots(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlots: readonly TBucketMemberSlot[], removedChannelQueue: OIMChannelQueue<TOIMSlot>, removedAtChannelQueue: OIMChannelQueue<number>): void;
|
|
931
|
+
protected abstract reconcileSlots(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlots: readonly TBucketMemberSlot[], arrivedChannelQueue: OIMChannelQueue<TOIMSlot>, departedChannelQueue: OIMChannelQueue<TOIMSlot>): void;
|
|
932
|
+
protected abstract drainSlots(bucketSlot: TOIMBucketContentSlot<TSlots>, departedChannelQueue: OIMChannelQueue<TOIMSlot>): void;
|
|
933
|
+
abstract hasBucketMemberSlot(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
934
|
+
abstract getBucketMemberSlotCount(bucketSlot: TOIMBucketContentSlot<TSlots>): number;
|
|
935
|
+
abstract getBucketMemberSlots(bucketSlot: TOIMBucketContentSlot<TSlots>): Iterable<TBucketMemberSlot>;
|
|
936
|
+
getBucketMemberSlotsMissingFrom(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlots: readonly TBucketMemberSlot[]): TBucketMemberSlot[];
|
|
937
|
+
createSlot(key: TKey, storeSlot: TOIMStoreSlot, slotOwner: IOIMSlotOwner): TOIMBucketSlot<TSlots, TKey>;
|
|
938
|
+
createSingleSlot(storeSlot: TOIMStoreSlot, slotOwner: IOIMSlotOwner): TOIMBucketContentSlot<TSlots>;
|
|
939
|
+
isSlotEmpty(bucketSlot: TOIMBucketContentSlot<TSlots>): boolean;
|
|
940
|
+
hasReference(): boolean;
|
|
941
|
+
releaseSlotContent(bucketSlot: TOIMBucketContentSlot<TSlots>): void;
|
|
942
|
+
markContentChanged(bucketSlot: TOIMBucketContentSlot<TSlots>): void;
|
|
943
|
+
markBucketColumnsChanged(bucketSlot: TOIMBucketContentSlot<TSlots>, patch: object | undefined, changedColumns: readonly string[] | undefined): void;
|
|
944
|
+
addBucketMemberSlot(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlot: TBucketMemberSlot): void;
|
|
945
|
+
removeBucketMemberSlot(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlot: TBucketMemberSlot): void;
|
|
946
|
+
addBucketMemberSlots(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlots: readonly TBucketMemberSlot[]): void;
|
|
947
|
+
removeBucketMemberSlots(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlots: readonly TBucketMemberSlot[]): void;
|
|
948
|
+
insertSlotContent(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlots: readonly TBucketMemberSlot[], changedBucketSlots?: TOIMBucketContentSlot<TSlots>[]): void;
|
|
949
|
+
writeSlotContent(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlots: readonly TBucketMemberSlot[]): boolean;
|
|
950
|
+
clearSlotContent(bucketSlot: TOIMBucketContentSlot<TSlots>): void;
|
|
951
|
+
fillBucketMemberSlots(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlots: readonly TBucketMemberSlot[]): void;
|
|
952
|
+
protected markBucketSlotChanged(bucketSlot: TOIMBucketContentSlot<TSlots>): void;
|
|
953
|
+
protected letGoOfRemovedBucketMemberSlot(bucketSlot: TOIMBucketContentSlot<TSlots>, bucketMemberSlot: TOIMSlot, at: number): void;
|
|
849
954
|
protected assertBucketMemberSlotNotReleased(bucketMemberSlot: TOIMSlot): void;
|
|
850
955
|
private assertBucketMemberSlotsNotReleased;
|
|
851
|
-
private
|
|
956
|
+
private addBucketMemberSlotUnannounced;
|
|
852
957
|
private reconcileBucketMemberSlots;
|
|
853
958
|
private drainBucketMemberSlots;
|
|
854
959
|
private unholdAllBucketMemberSlots;
|
|
855
|
-
private writeChangedBucketSlot;
|
|
856
|
-
private flushChangedBucketSlot;
|
|
857
960
|
}
|
|
858
961
|
|
|
859
962
|
type TOIMBucketSlotsSetStore<TBucketMemberSlot extends TOIMSlot = TOIMSlot> = Set<TBucketMemberSlot>;
|
|
860
963
|
|
|
861
|
-
declare class
|
|
964
|
+
declare class OIMSlotContentSetBucketService<TBucketMemberSlot extends TOIMSlot = TOIMSlot, TKey extends NonNullable<unknown> = TOIMStoreKey> extends OIMSlotContentBucketService<TBucketMemberSlot, TOIMBucketSlotsSetStore<TBucketMemberSlot>, TKey> {
|
|
862
965
|
constructor(options?: TOIMSlotContentBucketServiceOptions);
|
|
863
966
|
protected createBucketMemberSlotsStore(): TOIMBucketSlotsSetStore<TBucketMemberSlot>;
|
|
864
|
-
protected addSlot(bucketSlot:
|
|
865
|
-
protected removeSlot(bucketSlot:
|
|
866
|
-
protected removeSlots(bucketSlot:
|
|
867
|
-
protected reconcileSlots(bucketSlot:
|
|
868
|
-
protected drainSlots(bucketSlot:
|
|
869
|
-
hasBucketMemberSlot(bucketSlot:
|
|
870
|
-
getBucketMemberSlotCount(bucketSlot:
|
|
871
|
-
getBucketMemberSlots(bucketSlot:
|
|
967
|
+
protected addSlot(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsSetStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
968
|
+
protected removeSlot(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsSetStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
969
|
+
protected removeSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsSetStore<TBucketMemberSlot>>, bucketMemberSlots: readonly TBucketMemberSlot[], removedChannelQueue: OIMChannelQueue<TOIMSlot>, removedAtChannelQueue: OIMChannelQueue<number>): void;
|
|
970
|
+
protected reconcileSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsSetStore<TBucketMemberSlot>>, bucketMemberSlots: readonly TBucketMemberSlot[], arrivedChannelQueue: OIMChannelQueue<TOIMSlot>, departedChannelQueue: OIMChannelQueue<TOIMSlot>): void;
|
|
971
|
+
protected drainSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsSetStore<TBucketMemberSlot>>, departedChannelQueue: OIMChannelQueue<TOIMSlot>): void;
|
|
972
|
+
hasBucketMemberSlot(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsSetStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
973
|
+
getBucketMemberSlotCount(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsSetStore<TBucketMemberSlot>>): number;
|
|
974
|
+
getBucketMemberSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsSetStore<TBucketMemberSlot>>): Iterable<TBucketMemberSlot>;
|
|
872
975
|
}
|
|
873
976
|
|
|
874
977
|
type TOIMBucketSlotsArrayStore<TBucketMemberSlot extends TOIMSlot = TOIMSlot> = {
|
|
875
978
|
bucketMemberSlots: TBucketMemberSlot[];
|
|
979
|
+
uniqueBucketMemberSlots: Set<TBucketMemberSlot> | undefined;
|
|
980
|
+
sortedCount: number;
|
|
876
981
|
};
|
|
877
982
|
|
|
878
|
-
interface
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
hasBucketMemberSlot(bucketSlot: TOIMBucketSlot<TSlots>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
896
|
-
getBucketMemberSlotCount(bucketSlot: TOIMBucketSlot<TSlots>): number;
|
|
897
|
-
getBucketMemberSlots(bucketSlot: TOIMBucketSlot<TSlots>): Iterable<TBucketMemberSlot>;
|
|
898
|
-
getBucketMemberSlotAt(bucketSlot: TOIMBucketSlot<TSlots>, at: number): TBucketMemberSlot | undefined;
|
|
899
|
-
getBucketMemberSlotPosition(bucketSlot: TOIMBucketSlot<TSlots>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
900
|
-
private emptyBucketMemberSlotsStore;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
declare class OIMSlotContentBucketServiceArrayDriven<TBucketMemberSlot extends TOIMSlot = TOIMSlot, TSlots extends TOIMBucketSlotsArrayStore<TBucketMemberSlot> = TOIMBucketSlotsArrayStore<TBucketMemberSlot>> extends OIMSlotContentBucketServiceArrayBased<TBucketMemberSlot, TSlots> {
|
|
904
|
-
protected readonly bucketArrayMembership: IOIMBucketArrayMembership<TBucketMemberSlot, TSlots>;
|
|
905
|
-
constructor(options?: TOIMSlotContentBucketServiceOptions & {
|
|
906
|
-
bucketArrayMembership?: IOIMBucketArrayMembership<TBucketMemberSlot, TSlots> | undefined;
|
|
907
|
-
});
|
|
908
|
-
protected createBucketMemberSlotsStore(): TSlots;
|
|
909
|
-
insertBucketMemberSlotAt(bucketSlot: TOIMBucketSlot<TSlots>, at: number, bucketMemberSlot: TBucketMemberSlot): void;
|
|
910
|
-
removeBucketMemberSlotAt(bucketSlot: TOIMBucketSlot<TSlots>, at: number): TBucketMemberSlot | undefined;
|
|
911
|
-
removeBucketMemberSlotRange(bucketSlot: TOIMBucketSlot<TSlots>, at: number, count: number): readonly TBucketMemberSlot[];
|
|
912
|
-
moveBucketMemberSlotToPosition(bucketSlot: TOIMBucketSlot<TSlots>, from: number, to: number): TBucketMemberSlot | undefined;
|
|
913
|
-
moveBucketMemberSlotRangeToPosition(bucketSlot: TOIMBucketSlot<TSlots>, from: number, count: number, to: number): void;
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
type TOIMBucketSlotsSortedArrayStore<TBucketMemberSlot extends TOIMSlot = TOIMSlot> = TOIMBucketSlotsArrayStore<TBucketMemberSlot> & {
|
|
917
|
-
sortedCount: number;
|
|
983
|
+
interface IOIMBucketMemberSlotsArrayService<TBucketMemberSlot extends TOIMSlot = TOIMSlot> {
|
|
984
|
+
createBucketSlotsArrayStore(): TOIMBucketSlotsArrayStore<TBucketMemberSlot>;
|
|
985
|
+
hasBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
986
|
+
appendBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
987
|
+
insertBucketMemberSlotAt(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number, bucketMemberSlot: TBucketMemberSlot): number;
|
|
988
|
+
removeBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
989
|
+
removeBucketMemberSlotAt(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number): TBucketMemberSlot;
|
|
990
|
+
removeBucketMemberSlotRange(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number, count: number): TBucketMemberSlot[];
|
|
991
|
+
removeBucketMemberSlots(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlots: readonly TBucketMemberSlot[], removedChannelQueue: OIMChannelQueue<TOIMSlot>, removedAtChannelQueue: OIMChannelQueue<number>): void;
|
|
992
|
+
moveBucketMemberSlotRange(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, from: number, count: number, landing: number): boolean;
|
|
993
|
+
sortBucketMemberSlots(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, compareBucketMemberSlots: (left: TBucketMemberSlot, right: TBucketMemberSlot) => number): void;
|
|
994
|
+
isSameBucketMemberSlotSequence(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlots: readonly TBucketMemberSlot[]): boolean;
|
|
995
|
+
clearBucketMemberSlots(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>): void;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
type TOIMSlotContentArrayBucketServiceOptions<TBucketMemberSlot extends TOIMSlot = TOIMSlot> = TOIMSlotContentBucketServiceOptions & {
|
|
999
|
+
bucketMemberSlotsArrayService?: IOIMBucketMemberSlotsArrayService<TBucketMemberSlot> | undefined;
|
|
918
1000
|
};
|
|
919
1001
|
|
|
920
|
-
|
|
1002
|
+
declare abstract class OIMSlotContentArrayBucketService<TBucketMemberSlot extends TOIMSlot, TKey extends NonNullable<unknown> = TOIMStoreKey> extends OIMSlotContentBucketService<TBucketMemberSlot, TOIMBucketSlotsArrayStore<TBucketMemberSlot>, TKey> {
|
|
1003
|
+
protected readonly bucketMemberSlotsArrayService: IOIMBucketMemberSlotsArrayService<TBucketMemberSlot>;
|
|
1004
|
+
protected constructor(options: TOIMSlotContentArrayBucketServiceOptions<TBucketMemberSlot>);
|
|
1005
|
+
protected createBucketMemberSlotsStore(): TOIMBucketSlotsArrayStore<TBucketMemberSlot>;
|
|
1006
|
+
protected addSlot(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1007
|
+
protected removeSlot(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
1008
|
+
protected removeSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, bucketMemberSlots: readonly TBucketMemberSlot[], removedChannelQueue: OIMChannelQueue<TOIMSlot>, removedAtChannelQueue: OIMChannelQueue<number>): void;
|
|
1009
|
+
protected reconcileSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, bucketMemberSlots: readonly TBucketMemberSlot[], arrivedChannelQueue: OIMChannelQueue<TOIMSlot>, departedChannelQueue: OIMChannelQueue<TOIMSlot>): void;
|
|
1010
|
+
protected drainSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, departedChannelQueue: OIMChannelQueue<TOIMSlot>): void;
|
|
1011
|
+
hasBucketMemberSlot(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1012
|
+
getBucketMemberSlotCount(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>): number;
|
|
1013
|
+
getBucketMemberSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>): Iterable<TBucketMemberSlot>;
|
|
1014
|
+
getBucketMemberSlotAt(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, at: number): TBucketMemberSlot | undefined;
|
|
1015
|
+
getBucketMemberSlotPosition(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
declare class OIMSlotContentPositionalArrayBucketService<TBucketMemberSlot extends TOIMSlot = TOIMSlot, TKey extends NonNullable<unknown> = TOIMStoreKey> extends OIMSlotContentArrayBucketService<TBucketMemberSlot, TKey> {
|
|
1019
|
+
constructor(options?: TOIMSlotContentArrayBucketServiceOptions<TBucketMemberSlot>);
|
|
1020
|
+
insertBucketMemberSlotAt(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, at: number, bucketMemberSlot: TBucketMemberSlot): void;
|
|
1021
|
+
removeBucketMemberSlotAt(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, at: number): TBucketMemberSlot | undefined;
|
|
1022
|
+
removeBucketMemberSlotRange(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, at: number, count: number): readonly TBucketMemberSlot[];
|
|
1023
|
+
moveBucketMemberSlotToPosition(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, from: number, to: number): TBucketMemberSlot | undefined;
|
|
1024
|
+
moveBucketMemberSlotRangeToPosition(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, from: number, count: number, to: number): void;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
declare class OIMBucketMemberSlotsArrayService<TBucketMemberSlot extends TOIMSlot = TOIMSlot> implements IOIMBucketMemberSlotsArrayService<TBucketMemberSlot> {
|
|
1028
|
+
static readonly INSTANCE: OIMBucketMemberSlotsArrayService<TOIMSlot>;
|
|
1029
|
+
createBucketSlotsArrayStore(): TOIMBucketSlotsArrayStore<TBucketMemberSlot>;
|
|
1030
|
+
hasBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1031
|
+
appendBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1032
|
+
insertBucketMemberSlotAt(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number, bucketMemberSlot: TBucketMemberSlot): number;
|
|
1033
|
+
removeBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
1034
|
+
removeBucketMemberSlotAt(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number): TBucketMemberSlot;
|
|
1035
|
+
removeBucketMemberSlotRange(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number, count: number): TBucketMemberSlot[];
|
|
1036
|
+
removeBucketMemberSlots(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlots: readonly TBucketMemberSlot[], removedChannelQueue: OIMChannelQueue<TOIMSlot>, removedAtChannelQueue: OIMChannelQueue<number>): void;
|
|
1037
|
+
moveBucketMemberSlotRange(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, from: number, count: number, landing: number): boolean;
|
|
1038
|
+
sortBucketMemberSlots(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, compareBucketMemberSlots: (left: TBucketMemberSlot, right: TBucketMemberSlot) => number): void;
|
|
1039
|
+
isSameBucketMemberSlotSequence(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlots: readonly TBucketMemberSlot[]): boolean;
|
|
1040
|
+
clearBucketMemberSlots(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>): void;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
declare class OIMBucketUniqueMemberSlotsArrayService<TBucketMemberSlot extends TOIMSlot = TOIMSlot> extends OIMBucketMemberSlotsArrayService<TBucketMemberSlot> {
|
|
1044
|
+
static readonly INSTANCE: OIMBucketUniqueMemberSlotsArrayService<TOIMSlot>;
|
|
1045
|
+
createBucketSlotsArrayStore(): TOIMBucketSlotsArrayStore<TBucketMemberSlot>;
|
|
1046
|
+
hasBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1047
|
+
appendBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1048
|
+
insertBucketMemberSlotAt(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number, bucketMemberSlot: TBucketMemberSlot): number;
|
|
1049
|
+
removeBucketMemberSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
1050
|
+
removeBucketMemberSlotAt(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number): TBucketMemberSlot;
|
|
1051
|
+
removeBucketMemberSlotRange(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, at: number, count: number): TBucketMemberSlot[];
|
|
1052
|
+
removeBucketMemberSlots(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlots: readonly TBucketMemberSlot[], removedChannelQueue: OIMChannelQueue<TOIMSlot>, removedAtChannelQueue: OIMChannelQueue<number>): void;
|
|
1053
|
+
isSameBucketMemberSlotSequence(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlots: readonly TBucketMemberSlot[]): boolean;
|
|
1054
|
+
clearBucketMemberSlots(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>): void;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
type TOIMSlotContentSortedArrayBucketServiceOptions<TBucketMemberSlot extends TOIMSlot = TOIMSlot> = TOIMSlotContentArrayBucketServiceOptions<TBucketMemberSlot> & {
|
|
921
1058
|
compareBucketMemberSlots: (left: TBucketMemberSlot, right: TBucketMemberSlot) => number;
|
|
922
1059
|
};
|
|
923
1060
|
|
|
924
|
-
declare class
|
|
1061
|
+
declare class OIMSlotContentSortedArrayBucketService<TBucketMemberSlot extends TOIMSlot = TOIMSlot, TKey extends NonNullable<unknown> = TOIMStoreKey> extends OIMSlotContentArrayBucketService<TBucketMemberSlot, TKey> {
|
|
925
1062
|
private readonly compareBucketMemberSlots;
|
|
926
|
-
constructor(options:
|
|
927
|
-
protected
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
getBucketMemberSlotAt(bucketSlot: TOIMBucketSlot<TOIMBucketSlotsSortedArrayStore<TBucketMemberSlot>>, at: number): TBucketMemberSlot | undefined;
|
|
934
|
-
getBucketMemberSlotPosition(bucketSlot: TOIMBucketSlot<TOIMBucketSlotsSortedArrayStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
935
|
-
repositionBucketMemberSlot(bucketSlot: TOIMBucketSlot<TOIMBucketSlotsSortedArrayStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): void;
|
|
936
|
-
private settle;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
type TOIMBucketCollectionFactoryArguments<TKey, TBucketSlot, TStore, TOptions extends {
|
|
940
|
-
bucketSlotStoreService?: unknown;
|
|
941
|
-
}> = [
|
|
942
|
-
TKey
|
|
943
|
-
] extends [readonly unknown[]] ? [bucketCollectionFactoryOptions: TOptions & Required<Pick<TOptions, 'bucketSlotStoreService'>>] : [TStore] extends [Map<TKey, TBucketSlot>] ? [bucketCollectionFactoryOptions?: TOptions] : [bucketCollectionFactoryOptions: TOptions & Required<Pick<TOptions, 'bucketSlotStoreService'>>];
|
|
944
|
-
|
|
945
|
-
declare function createOIMBucketService<TBucketMemberSlot extends TOIMSlot = TOIMEntitySlot, TKey extends TOIMStoreKey | readonly unknown[] = TOIMStoreKey, TSlots = TOIMBucketSlotsArrayStore<TBucketMemberSlot>, TSlotContentService extends OIMSlotContentBucketService<TBucketMemberSlot, TSlots> = OIMSlotContentBucketServiceArrayDriven<TBucketMemberSlot> & OIMSlotContentBucketService<TBucketMemberSlot, TSlots>, TStore = Map<TKey, TOIMBucketSlot<TSlots, TKey>>>(db: OIMDB, ...[options]: TOIMBucketCollectionFactoryArguments<TKey, TOIMBucketSlot<TSlots, TKey>, TStore, {
|
|
946
|
-
slotContentService?: (TSlotContentService & OIMSlotContentBucketService<TBucketMemberSlot, TSlots>) | undefined;
|
|
947
|
-
bucketSlotStoreService?: IOIMSlotStoreService<TKey, TOIMBucketSlot<TSlots, TKey>, TStore> | undefined;
|
|
948
|
-
maxCommandsPerSlot?: number | undefined;
|
|
949
|
-
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
950
|
-
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMColumnSlot> | undefined;
|
|
951
|
-
columnNames?: readonly string[] | undefined;
|
|
952
|
-
}>): OIMSlotCollectionService<TKey, TOIMBucketSlot<TSlots, TKey>, TStore, TSlotContentService, string, TOIMColumnSlot, OIMColumnOwnerPushDriven, readonly TBucketMemberSlot[]>;
|
|
1063
|
+
constructor(options: TOIMSlotContentSortedArrayBucketServiceOptions<TBucketMemberSlot>);
|
|
1064
|
+
protected drainSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, departedChannelQueue: OIMChannelQueue<TOIMSlot>): void;
|
|
1065
|
+
getBucketMemberSlots(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>): Iterable<TBucketMemberSlot>;
|
|
1066
|
+
getBucketMemberSlotAt(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, at: number): TBucketMemberSlot | undefined;
|
|
1067
|
+
getBucketMemberSlotPosition(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): number;
|
|
1068
|
+
repositionBucketMemberSlot(bucketSlot: TOIMBucketContentSlot<TOIMBucketSlotsArrayStore<TBucketMemberSlot>>, bucketMemberSlot: TBucketMemberSlot): void;
|
|
1069
|
+
}
|
|
953
1070
|
|
|
954
|
-
|
|
955
|
-
slotContentService?: (TSlotContentService & OIMSlotContentBucketService<TBucketMemberSlot, TSlots>) | undefined;
|
|
956
|
-
maxCommandsPerSlot?: number | undefined;
|
|
957
|
-
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
958
|
-
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMColumnSlot> | undefined;
|
|
959
|
-
columnNames?: readonly string[] | undefined;
|
|
960
|
-
}): OIMSingleSlotService<TOIMBucketSlot<TSlots, void>, TSlotContentService, string, TOIMColumnSlot, OIMColumnOwnerPushDriven, readonly TBucketMemberSlot[]>;
|
|
1071
|
+
type TOIMBucketSlotOwnerService<TSlots, TBucketMemberSlot extends TOIMSlot = TOIMSlot, TBucketSlot extends TOIMBucketContentSlot<TSlots> = TOIMBucketContentSlot<TSlots>, TStore = unknown> = OIMSlotOwnerService<TBucketSlot, TStore, string, TOIMColumnSlot, OIMPushColumnSlotOwner, readonly TBucketMemberSlot[]>;
|
|
961
1072
|
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1073
|
+
type TOIMDBOptions = {
|
|
1074
|
+
channelScheduler?: TOIMChannelScheduler | undefined;
|
|
1075
|
+
errorPolicy?: IOIMErrorPolicy | undefined;
|
|
1076
|
+
onBeforeFlush?: (() => void) | undefined;
|
|
1077
|
+
getNowMs?: (() => number) | undefined;
|
|
1078
|
+
releaseTimer?: TOIMTimer | undefined;
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
declare class OIMDB implements IOIMChannelMap {
|
|
1082
|
+
readonly clock: TOIMChannelClock;
|
|
1083
|
+
readonly collectorSlot: TOIMCollectorSlot;
|
|
1084
|
+
readonly defaultChannelSlot: TOIMChannelSlot;
|
|
1085
|
+
constructor(options?: TOIMDBOptions);
|
|
1086
|
+
flush(): void;
|
|
972
1087
|
}
|
|
973
1088
|
|
|
974
1089
|
declare class OIMDefaultValue<TValue> {
|
|
975
|
-
private readonly name;
|
|
976
1090
|
private readonly createValue;
|
|
977
1091
|
private defaultValue;
|
|
978
|
-
|
|
979
|
-
constructor(name: string, createValue: () => TValue);
|
|
1092
|
+
constructor(createValue: () => TValue);
|
|
980
1093
|
getValue(): TValue;
|
|
981
|
-
setValue(value: TValue): void;
|
|
982
|
-
private assertNoLateOverride;
|
|
983
1094
|
}
|
|
984
1095
|
|
|
985
|
-
|
|
986
|
-
readonly
|
|
987
|
-
|
|
1096
|
+
declare class OIMFlushSchedulerService {
|
|
1097
|
+
static readonly INSTANCE: OIMFlushSchedulerService;
|
|
1098
|
+
isScheduled(flushSchedulerSlot: TOIMFlushSchedulerSlot): boolean;
|
|
1099
|
+
schedule<TFlushSchedulerSlot extends TOIMFlushSchedulerSlot>(flushSchedulerSlot: TFlushSchedulerSlot, delayMs: number, flushSchedulerListener: IOIMFlushSchedulerListener<TFlushSchedulerSlot>): void;
|
|
1100
|
+
cancelSchedule(flushSchedulerSlot: TOIMFlushSchedulerSlot): void;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
type TOIMComputedStoreSlot<TStore = unknown, TValue = unknown, TComputedSlot extends TOIMComputedContentSlot<TValue, OIMSourceTracker | undefined> = TOIMComputedContentSlot<TValue>> = TOIMStoreSlot<TStore, TComputedSlot> & {
|
|
1104
|
+
readonly derive: ((computedSlot: TComputedSlot) => TValue) | undefined;
|
|
1105
|
+
readonly createSources: ((computedSlot: TComputedSlot) => Partial<TOIMComputedSources>) | undefined;
|
|
988
1106
|
};
|
|
989
1107
|
|
|
990
|
-
type
|
|
991
|
-
|
|
992
|
-
columnOwnerOptions: TOIMColumnOwnerOptions<TOIMComputedColumnSlot, Extract<keyof TValue, string>>;
|
|
1108
|
+
type TOIMComputedDerivationOptions<TValue, TComputedSlot extends TOIMComputedContentSlot<TValue>> = {
|
|
1109
|
+
columnSlotOwnerOptions: TOIMColumnSlotOwnerOptions<TOIMComputedColumnSlot, Extract<keyof TValue, string>>;
|
|
993
1110
|
slotReleasePolicy: IOIMSlotReleasePolicy;
|
|
994
1111
|
storeSlotListener: IOIMStoreSlotListener;
|
|
995
|
-
createSources?: ((
|
|
996
|
-
derive?: ((computedSlot:
|
|
1112
|
+
createSources?: ((computedSlot: TComputedSlot) => Partial<TOIMComputedSources>) | undefined;
|
|
1113
|
+
derive?: ((computedSlot: TComputedSlot) => TValue) | undefined;
|
|
997
1114
|
sameValueGuard?: TOIMSameValueGuard<TValue> | undefined;
|
|
1115
|
+
releaseValue?: TOIMComputedValueReleaser<TValue> | undefined;
|
|
998
1116
|
initialValue?: TValue | undefined;
|
|
999
1117
|
};
|
|
1000
1118
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1119
|
+
type TOIMComputedServiceOptions<TKey extends NonNullable<unknown>, TValue, TComputedStore> = TOIMComputedDerivationOptions<TValue, TOIMComputedSlot<TValue, TKey>> & {
|
|
1120
|
+
computedSlotStoreService: IOIMSlotStoreService<TKey, TOIMComputedSlot<TValue, TKey>, TComputedStore>;
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
declare class OIMComputedService<TKey extends NonNullable<unknown>, TValue, TComputedStore> {
|
|
1124
|
+
readonly computedCollectionService: OIMSlotCollectionService<TKey, TOIMComputedSlot<TValue, TKey>, TComputedStore, OIMSlotContentComputedService<TValue, TOIMComputedSlot<TValue, TKey>>, Extract<keyof TValue, string>, TOIMComputedColumnSlot, OIMPullColumnSlotOwner>;
|
|
1003
1125
|
private readonly hasDerive;
|
|
1004
1126
|
private readonly hasCreateSources;
|
|
1005
1127
|
constructor(options: TOIMComputedServiceOptions<TKey, TValue, TComputedStore>);
|
|
1006
|
-
createComputedStoreSlot(channelMap: IOIMChannelMap, derive?: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => TValue) | undefined, createSources?: ((
|
|
1007
|
-
private assertDeriveAndCreateSources;
|
|
1128
|
+
createComputedStoreSlot(channelMap: IOIMChannelMap, derive?: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => TValue) | undefined, createSources?: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => Partial<TOIMComputedSources>) | undefined): TOIMComputedStoreSlot<TComputedStore, TValue, TOIMComputedSlot<TValue, TKey>>;
|
|
1008
1129
|
}
|
|
1009
1130
|
|
|
1010
|
-
type
|
|
1011
|
-
|
|
1012
|
-
declare function createOIMComputedService<TKey, TValue, TComputedStore = TOIMDefaultSlotStore<TKey, TOIMComputedSlot<TValue, TKey>>>(options: {
|
|
1013
|
-
createSources?: ((key: TKey, storeSlot: TOIMStoreSlot | undefined) => Partial<TOIMComputedSources>) | undefined;
|
|
1014
|
-
derive?: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => TValue) | undefined;
|
|
1131
|
+
type TOIMComputedServiceFactoryOptions<TValue> = {
|
|
1132
|
+
defaults?: OIMDefaults | undefined;
|
|
1015
1133
|
sameValueGuard?: TOIMSameValueGuard<TValue> | undefined;
|
|
1134
|
+
releaseValue?: TOIMComputedValueReleaser<TValue> | undefined;
|
|
1016
1135
|
initialValue?: TValue | undefined;
|
|
1017
1136
|
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
1018
1137
|
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMComputedColumnSlot> | undefined;
|
|
1019
1138
|
columnNames?: readonly Extract<keyof TValue, string>[] | undefined;
|
|
1020
|
-
}
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
declare function createOIMComputedService<TKey extends NonNullable<unknown>, TValue, TComputedStore = Map<TKey, TOIMComputedSlot<TValue, TKey>>>(options: TOIMComputedServiceFactoryOptions<TValue> & {
|
|
1142
|
+
createSources?: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => Partial<TOIMComputedSources>) | undefined;
|
|
1143
|
+
derive?: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => TValue) | undefined;
|
|
1021
1144
|
computedSlotStoreService?: IOIMSlotStoreService<TKey, TOIMComputedSlot<TValue, TKey>, TComputedStore> | undefined;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1145
|
+
}): OIMComputedService<TKey, TValue, TComputedStore>;
|
|
1146
|
+
|
|
1147
|
+
declare class OIMSingleComputedService<TValue> {
|
|
1148
|
+
readonly computedSingleSlotService: OIMSingleSlotService<TOIMComputedContentSlot<TValue>, OIMSlotContentComputedService<TValue>, Extract<keyof TValue, string>, TOIMComputedColumnSlot, OIMPullColumnSlotOwner>;
|
|
1149
|
+
private readonly hasDerive;
|
|
1150
|
+
private readonly hasCreateSources;
|
|
1151
|
+
constructor(options: TOIMComputedDerivationOptions<TValue, TOIMComputedContentSlot<TValue>>);
|
|
1152
|
+
createComputedStoreSlot(channelMap: IOIMChannelMap, derive?: ((computedSlot: TOIMComputedContentSlot<TValue>) => TValue) | undefined, createSources?: ((computedSlot: TOIMComputedContentSlot<TValue>) => Partial<TOIMComputedSources>) | undefined): TOIMComputedStoreSlot<TOIMSingleSlotStore<TOIMComputedContentSlot<TValue>>, TValue>;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
declare function createOIMSingleComputedService<TValue>(options?: TOIMComputedServiceFactoryOptions<TValue> & {
|
|
1156
|
+
createSources?: ((computedSlot: TOIMComputedContentSlot<TValue>) => Partial<TOIMComputedSources>) | undefined;
|
|
1157
|
+
derive?: ((computedSlot: TOIMComputedContentSlot<TValue>) => TValue) | undefined;
|
|
1158
|
+
}): OIMSingleComputedService<TValue>;
|
|
1159
|
+
|
|
1160
|
+
type TOIMSourceTrackingComputedSlot<TValue = unknown, TKey extends NonNullable<unknown> = NonNullable<unknown>> = TOIMComputedSlot<TValue, TKey, OIMSourceTracker>;
|
|
1025
1161
|
|
|
1026
|
-
type
|
|
1162
|
+
type TOIMSourceTrackingComputedDerive<TValue, TComputedSlot> = (computedSlot: TComputedSlot, sourceTracker: OIMSourceTracker) => TValue;
|
|
1163
|
+
|
|
1164
|
+
type TOIMSourceTrackingComputedDerivationOptions<TValue, TComputedSlot> = {
|
|
1165
|
+
columnSlotOwnerOptions: TOIMColumnSlotOwnerOptions<TOIMComputedColumnSlot, Extract<keyof TValue, string>>;
|
|
1166
|
+
slotReleasePolicy: IOIMSlotReleasePolicy;
|
|
1167
|
+
storeSlotListener: IOIMStoreSlotListener;
|
|
1168
|
+
derive: TOIMSourceTrackingComputedDerive<TValue, TComputedSlot>;
|
|
1169
|
+
sameValueGuard?: TOIMSameValueGuard<TValue> | undefined;
|
|
1170
|
+
releaseValue?: TOIMComputedValueReleaser<TValue> | undefined;
|
|
1171
|
+
initialValue?: TValue | undefined;
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
type TOIMSourceTrackingComputedContentSlot<TValue = unknown> = TOIMComputedContentSlot<TValue, OIMSourceTracker>;
|
|
1175
|
+
|
|
1176
|
+
declare class OIMSlotContentSourceTrackingComputedService<TValue, TComputedSlot extends TOIMSourceTrackingComputedContentSlot<TValue> = TOIMSourceTrackingComputedContentSlot<TValue>> extends OIMSlotContentComputedService<TValue, TComputedSlot> {
|
|
1177
|
+
protected createSourceTracker(): OIMSourceTracker;
|
|
1178
|
+
protected attachSources(): void;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
declare class OIMSourceTrackingComputedService<TKey extends NonNullable<unknown>, TValue, TComputedStore> {
|
|
1182
|
+
readonly computedCollectionService: OIMSlotCollectionService<TKey, TOIMSourceTrackingComputedSlot<TValue, TKey>, TComputedStore, OIMSlotContentSourceTrackingComputedService<TValue, TOIMSourceTrackingComputedSlot<TValue, TKey>>, Extract<keyof TValue, string>, TOIMComputedColumnSlot, OIMPullColumnSlotOwner>;
|
|
1183
|
+
constructor(options: TOIMSourceTrackingComputedDerivationOptions<TValue, TOIMSourceTrackingComputedSlot<TValue, TKey>> & {
|
|
1184
|
+
computedSlotStoreService: IOIMSlotStoreService<TKey, TOIMSourceTrackingComputedSlot<TValue, TKey>, TComputedStore>;
|
|
1185
|
+
});
|
|
1186
|
+
createComputedStoreSlot(channelMap: IOIMChannelMap): TOIMStoreSlot<TComputedStore, TOIMSourceTrackingComputedSlot<TValue, TKey>>;
|
|
1187
|
+
}
|
|
1027
1188
|
|
|
1028
|
-
|
|
1189
|
+
declare class OIMSingleSourceTrackingComputedService<TValue> {
|
|
1190
|
+
readonly computedSingleSlotService: OIMSingleSlotService<TOIMSourceTrackingComputedContentSlot<TValue>, OIMSlotContentSourceTrackingComputedService<TValue>, Extract<keyof TValue, string>, TOIMComputedColumnSlot, OIMPullColumnSlotOwner>;
|
|
1191
|
+
constructor(options: TOIMSourceTrackingComputedDerivationOptions<TValue, TOIMSourceTrackingComputedContentSlot<TValue>>);
|
|
1192
|
+
createComputedStoreSlot(channelMap: IOIMChannelMap): TOIMStoreSlot<TOIMSingleSlotStore<TOIMSourceTrackingComputedContentSlot<TValue>>, TOIMSourceTrackingComputedContentSlot<TValue>>;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
declare function createOIMSourceTrackingComputedService<TKey extends NonNullable<unknown>, TValue, TComputedStore = Map<TKey, TOIMSourceTrackingComputedSlot<TValue, TKey>>>(options: TOIMComputedServiceFactoryOptions<TValue> & {
|
|
1196
|
+
derive: TOIMSourceTrackingComputedDerive<TValue, TOIMSourceTrackingComputedSlot<TValue, TKey>>;
|
|
1197
|
+
computedSlotStoreService?: IOIMSlotStoreService<TKey, TOIMSourceTrackingComputedSlot<TValue, TKey>, TComputedStore> | undefined;
|
|
1198
|
+
}): OIMSourceTrackingComputedService<TKey, TValue, TComputedStore>;
|
|
1199
|
+
|
|
1200
|
+
declare function createOIMSingleSourceTrackingComputedService<TValue>(options: TOIMComputedServiceFactoryOptions<TValue> & {
|
|
1201
|
+
derive: TOIMSourceTrackingComputedDerive<TValue, TOIMSourceTrackingComputedContentSlot<TValue>>;
|
|
1202
|
+
}): OIMSingleSourceTrackingComputedService<TValue>;
|
|
1203
|
+
|
|
1204
|
+
type TOIMSortedComputedSlot<TEntity extends object, TKey extends NonNullable<unknown>> = TOIMComputedSlot<readonly TOIMEntitySlot<TEntity>[], TKey>;
|
|
1205
|
+
|
|
1206
|
+
type TOIMIndexStoreSlot<TStore = unknown, TBucketSlot extends TOIMSlot = TOIMSlot, TBucketPatch = unknown, TSourceSlot extends TOIMSlot = TOIMSlot, TSourcePatch = unknown, TKey = unknown, TSourceStore = unknown, TSlotService = unknown> = TOIMStoreSlot<TStore, TBucketSlot, TBucketPatch, TSlotService> & {
|
|
1029
1207
|
readonly sourceStoreSlot: TOIMStoreSlot<TSourceStore, TSourceSlot, TSourcePatch>;
|
|
1030
1208
|
readonly indexKeysPosition: number;
|
|
1031
|
-
readonly contentChangeListener:
|
|
1209
|
+
readonly contentChangeListener: IOIMSlotContentChangeListener<TSourceSlot, TSourcePatch>;
|
|
1032
1210
|
readonly requestedKeys: readonly TKey[] | undefined;
|
|
1033
1211
|
readonly bucketColumnNames: Set<string>;
|
|
1034
1212
|
readonly isAnyBucketColumnRead: boolean;
|
|
1035
1213
|
readonly isDisposed: boolean;
|
|
1036
1214
|
};
|
|
1037
1215
|
|
|
1038
|
-
type
|
|
1216
|
+
type TOIMSlotCollectionIndexServiceOptions<TKey extends NonNullable<unknown>, TEntity extends object, TBucketSlot extends TOIMKeyedSlot<TKey>, TStore, TSlotContentService, TSourceKey extends NonNullable<unknown>, TSourceStore> = TOIMSlotCollectionServiceOptions<TKey, TBucketSlot, TStore, TSlotContentService, string, TOIMColumnSlot, OIMPushColumnSlotOwner> & {
|
|
1039
1217
|
keyOf: (entity: TEntity) => TKey;
|
|
1040
1218
|
columns?: readonly string[] | undefined;
|
|
1041
1219
|
sourceSlotCollectionService: Pick<OIMSlotCollectionService<TSourceKey, TOIMEntitySlot<TEntity, TSourceKey>, TSourceStore, unknown>, 'getSlots'>;
|
|
1042
1220
|
indexKeysService: IOIMIndexKeysService;
|
|
1043
1221
|
};
|
|
1044
1222
|
|
|
1045
|
-
declare class
|
|
1223
|
+
declare class OIMSlotCollectionIndexService<TKey extends NonNullable<unknown>, TEntity extends object, TSlots, TSourceKey extends NonNullable<unknown> = NonNullable<unknown>, TSourceStore = unknown, TSlotContentService extends OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots, TKey> = OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots, TKey>, TBucketSlot extends TOIMBucketSlot<TSlots, TKey> = TOIMBucketSlot<TSlots, TKey>, TStore = Map<TKey, TBucketSlot>> extends OIMSlotCollectionService<TKey, TBucketSlot, TStore, Pick<TSlotContentService, Extract<keyof TSlotContentService, 'getBucketMemberSlots' | 'getBucketMemberSlotCount' | 'hasBucketMemberSlot' | 'getBucketMemberSlotAt' | 'getBucketMemberSlotPosition'>>, string, TOIMColumnSlot, OIMPushColumnSlotOwner, readonly TOIMEntitySlot<TEntity>[]> {
|
|
1046
1224
|
protected readonly slotContentBucketService: TSlotContentService;
|
|
1047
1225
|
private readonly keyOf;
|
|
1048
1226
|
private readonly keyColumns;
|
|
1049
1227
|
private readonly sourceSlotCollectionService;
|
|
1050
1228
|
private readonly indexKeysService;
|
|
1051
|
-
constructor(options:
|
|
1052
|
-
createIndexStoreSlot(sourceStoreSlot: TOIMStoreSlot<TSourceStore, TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>>): TOIMIndexStoreSlot<TStore, TBucketSlot, readonly TOIMEntitySlot<TEntity>[], TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>, TKey, TSourceStore>;
|
|
1229
|
+
constructor(options: TOIMSlotCollectionIndexServiceOptions<TKey, TEntity, TBucketSlot, TStore, TSlotContentService, TSourceKey, TSourceStore>);
|
|
1230
|
+
createIndexStoreSlot(sourceStoreSlot: TOIMStoreSlot<TSourceStore, TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>>): TOIMIndexStoreSlot<TStore, TBucketSlot, readonly TOIMEntitySlot<TEntity>[], TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>, TKey, TSourceStore, this>;
|
|
1053
1231
|
disposeIndexStoreSlot(indexStoreSlot: TOIMIndexStoreSlot<TStore, TBucketSlot, readonly TOIMEntitySlot<TEntity>[], TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>, TKey, TSourceStore>): void;
|
|
1054
1232
|
getSlotByKey(storeSlot: TOIMStoreSlot<TStore, TBucketSlot, readonly TOIMEntitySlot<TEntity>[]>, key: TKey): TBucketSlot;
|
|
1055
1233
|
holdSlotByKey(storeSlot: TOIMStoreSlot<TStore, TBucketSlot, readonly TOIMEntitySlot<TEntity>[]>, key: TKey): TBucketSlot;
|
|
@@ -1075,22 +1253,22 @@ declare class OIMIndexService<TKey, TEntity extends object, TSlots, TSourceKey =
|
|
|
1075
1253
|
private groupUnderMintedBucketKey;
|
|
1076
1254
|
private decideIndexKeyForSlot;
|
|
1077
1255
|
private collectSourceSlotsForKey;
|
|
1078
|
-
private
|
|
1256
|
+
private fillBucketSlotWithSourceSlots;
|
|
1079
1257
|
}
|
|
1080
1258
|
|
|
1081
|
-
type
|
|
1259
|
+
type TOIMSlotCollectionIndexServiceStoreSlot<TKey extends NonNullable<unknown>, TEntity extends object, TSlots, TSourceKey extends NonNullable<unknown>, TSourceStore> = Parameters<OIMSlotCollectionIndexService<TKey, TEntity, TSlots, TSourceKey, TSourceStore>['getBucketColumnByKey']>[0];
|
|
1082
1260
|
|
|
1083
1261
|
type TOIMSortableColumnName<TEntity extends object> = {
|
|
1084
1262
|
[TColumn in keyof TEntity]-?: NonNullable<TEntity[TColumn]> extends string | number | bigint ? TColumn : never;
|
|
1085
1263
|
}[keyof TEntity] & string;
|
|
1086
1264
|
|
|
1087
1265
|
type TOIMSortColumn<TEntity extends object> = {
|
|
1088
|
-
|
|
1266
|
+
columnName: TOIMSortableColumnName<TEntity>;
|
|
1089
1267
|
direction: 'asc' | 'desc';
|
|
1090
1268
|
};
|
|
1091
1269
|
|
|
1092
|
-
type
|
|
1093
|
-
indexService:
|
|
1270
|
+
type TOIMSortedComputedServiceOptions<TKey extends NonNullable<unknown>, TEntity extends object, TSlots, TSourceKey extends NonNullable<unknown>, TSourceStore, TComputedStore> = {
|
|
1271
|
+
indexService: OIMSlotCollectionIndexService<TKey, TEntity, TSlots, TSourceKey, TSourceStore>;
|
|
1094
1272
|
computedSlotStoreService: IOIMSlotStoreService<TKey, TOIMComputedSlot<readonly TOIMEntitySlot<TEntity>[], TKey>, TComputedStore>;
|
|
1095
1273
|
columnSlotStoreService: IOIMSlotStoreService<string, TOIMComputedColumnSlot>;
|
|
1096
1274
|
sortColumns?: readonly TOIMSortColumn<TEntity>[] | undefined;
|
|
@@ -1099,49 +1277,47 @@ type TOIMComputedServiceSortedOptions<TKey, TEntity extends object, TSlots, TSou
|
|
|
1099
1277
|
storeSlotListener: IOIMStoreSlotListener;
|
|
1100
1278
|
};
|
|
1101
1279
|
|
|
1102
|
-
declare class
|
|
1103
|
-
readonly computedCollectionService: OIMSlotCollectionService<TKey, TOIMSortedComputedSlot<TEntity, TKey>, TComputedStore,
|
|
1104
|
-
constructor(options:
|
|
1105
|
-
createSortedStoreSlot(indexStoreSlot:
|
|
1280
|
+
declare class OIMSortedComputedService<TKey extends NonNullable<unknown>, TEntity extends object, TSlots, TSourceKey extends NonNullable<unknown>, TSourceStore, TComputedStore> {
|
|
1281
|
+
readonly computedCollectionService: OIMSlotCollectionService<TKey, TOIMSortedComputedSlot<TEntity, TKey>, TComputedStore, OIMSlotContentComputedService<readonly TOIMEntitySlot<TEntity>[], TOIMSortedComputedSlot<TEntity, TKey>>, string, TOIMComputedColumnSlot, OIMPullColumnSlotOwner>;
|
|
1282
|
+
constructor(options: TOIMSortedComputedServiceOptions<TKey, TEntity, TSlots, TSourceKey, TSourceStore, TComputedStore>);
|
|
1283
|
+
createSortedStoreSlot(indexStoreSlot: TOIMSlotCollectionIndexServiceStoreSlot<TKey, TEntity, TSlots, TSourceKey, TSourceStore>): TOIMStoreSlot<TComputedStore, TOIMSortedComputedSlot<TEntity, TKey>>;
|
|
1106
1284
|
}
|
|
1107
1285
|
|
|
1108
|
-
|
|
1109
|
-
|
|
1286
|
+
type TOIMDefaultSlotStore<TKey, TSlot> = Map<TKey, TSlot>;
|
|
1287
|
+
|
|
1288
|
+
declare function createOIMSortedComputedService<TKey extends NonNullable<unknown>, TEntity extends object, TSlots, TSourceKey extends NonNullable<unknown>, TSourceStore, TComputedStore = TOIMDefaultSlotStore<TKey, TOIMComputedSlot<readonly TOIMEntitySlot<TEntity>[], TKey>>>(options: {
|
|
1289
|
+
defaults?: OIMDefaults | undefined;
|
|
1290
|
+
indexService: OIMSlotCollectionIndexService<TKey, TEntity, TSlots, TSourceKey, TSourceStore>;
|
|
1110
1291
|
sortColumns?: readonly TOIMSortColumn<TEntity>[] | undefined;
|
|
1111
1292
|
comparator?: ((left: TEntity, right: TEntity) => number) | undefined;
|
|
1112
1293
|
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
1113
1294
|
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMComputedColumnSlot> | undefined;
|
|
1114
|
-
} & ([TComputedStore] extends [Map<TKey, TOIMComputedSlot<readonly TOIMEntitySlot<TEntity>[], TKey>>] ? {
|
|
1115
1295
|
computedSlotStoreService?: IOIMSlotStoreService<TKey, TOIMComputedSlot<readonly TOIMEntitySlot<TEntity>[], TKey>, TComputedStore> | undefined;
|
|
1116
|
-
}
|
|
1117
|
-
computedSlotStoreService: IOIMSlotStoreService<TKey, TOIMComputedSlot<readonly TOIMEntitySlot<TEntity>[], TKey>, TComputedStore>;
|
|
1118
|
-
})): OIMComputedServiceSorted<TKey, TEntity, TSlots, TSourceKey, TSourceStore, TComputedStore>;
|
|
1296
|
+
}): OIMSortedComputedService<TKey, TEntity, TSlots, TSourceKey, TSourceStore, TComputedStore>;
|
|
1119
1297
|
|
|
1120
|
-
type
|
|
1121
|
-
bucketCollectionService: OIMSlotCollectionService<TKey, TOIMBucketSlot<TSlots, TKey>, TBucketStore, OIMSlotContentBucketService<TBucketMemberSlot, TSlots>, string, TOIMColumnSlot,
|
|
1298
|
+
type TOIMBucketMemoComputedServiceOptions<TKey extends NonNullable<unknown>, TBucketMemberSlot extends TOIMSlot, TSlots, TBucketStore, TComputedStore> = {
|
|
1299
|
+
bucketCollectionService: OIMSlotCollectionService<TKey, TOIMBucketSlot<TSlots, TKey>, TBucketStore, OIMSlotContentBucketService<TBucketMemberSlot, TSlots>, string, TOIMColumnSlot, OIMPushColumnSlotOwner, readonly TBucketMemberSlot[]>;
|
|
1122
1300
|
computedSlotStoreService: IOIMSlotStoreService<TKey, TOIMComputedSlot<readonly TBucketMemberSlot[], TKey>, TComputedStore>;
|
|
1123
1301
|
columnSlotStoreService: IOIMSlotStoreService<string, TOIMComputedColumnSlot>;
|
|
1124
1302
|
slotReleasePolicy: IOIMSlotReleasePolicy;
|
|
1125
1303
|
storeSlotListener: IOIMStoreSlotListener;
|
|
1126
1304
|
};
|
|
1127
1305
|
|
|
1128
|
-
type TOIMBucketMemoComputedSlot<TBucketMemberSlot extends TOIMSlot, TKey
|
|
1306
|
+
type TOIMBucketMemoComputedSlot<TBucketMemberSlot extends TOIMSlot, TKey extends NonNullable<unknown>> = TOIMComputedSlot<readonly TBucketMemberSlot[], TKey>;
|
|
1129
1307
|
|
|
1130
|
-
declare class
|
|
1131
|
-
readonly computedCollectionService: OIMSlotCollectionService<TKey, TOIMBucketMemoComputedSlot<TBucketMemberSlot, TKey>, TComputedStore,
|
|
1132
|
-
constructor(options:
|
|
1308
|
+
declare class OIMBucketMemoComputedService<TKey extends NonNullable<unknown>, TBucketMemberSlot extends TOIMSlot, TSlots, TBucketStore, TComputedStore> {
|
|
1309
|
+
readonly computedCollectionService: OIMSlotCollectionService<TKey, TOIMBucketMemoComputedSlot<TBucketMemberSlot, TKey>, TComputedStore, OIMSlotContentComputedService<readonly TBucketMemberSlot[], TOIMBucketMemoComputedSlot<TBucketMemberSlot, TKey>>, string, TOIMComputedColumnSlot, OIMPullColumnSlotOwner>;
|
|
1310
|
+
constructor(options: TOIMBucketMemoComputedServiceOptions<TKey, TBucketMemberSlot, TSlots, TBucketStore, TComputedStore>);
|
|
1133
1311
|
createBucketMemoStoreSlot(bucketStoreSlot: TOIMStoreSlot<TBucketStore, TOIMBucketSlot<TSlots, TKey>, readonly TBucketMemberSlot[]>): TOIMStoreSlot<TComputedStore, TOIMBucketMemoComputedSlot<TBucketMemberSlot, TKey>>;
|
|
1134
1312
|
}
|
|
1135
1313
|
|
|
1136
|
-
declare function
|
|
1137
|
-
|
|
1314
|
+
declare function createOIMBucketMemoComputedService<TKey extends NonNullable<unknown>, TBucketMemberSlot extends TOIMSlot, TSlots, TBucketStore, TComputedStore = TOIMDefaultSlotStore<TKey, TOIMComputedSlot<readonly TBucketMemberSlot[], TKey>>>(options: {
|
|
1315
|
+
defaults?: OIMDefaults | undefined;
|
|
1316
|
+
bucketCollectionService: OIMSlotCollectionService<TKey, TOIMBucketSlot<TSlots, TKey>, TBucketStore, OIMSlotContentBucketService<TBucketMemberSlot, TSlots>, string, TOIMColumnSlot, OIMPushColumnSlotOwner, readonly TBucketMemberSlot[]>;
|
|
1138
1317
|
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
1139
1318
|
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMComputedColumnSlot> | undefined;
|
|
1140
|
-
} & ([TComputedStore] extends [Map<TKey, TOIMComputedSlot<readonly TBucketMemberSlot[], TKey>>] ? {
|
|
1141
1319
|
computedSlotStoreService?: IOIMSlotStoreService<TKey, TOIMComputedSlot<readonly TBucketMemberSlot[], TKey>, TComputedStore> | undefined;
|
|
1142
|
-
}
|
|
1143
|
-
computedSlotStoreService: IOIMSlotStoreService<TKey, TOIMComputedSlot<readonly TBucketMemberSlot[], TKey>, TComputedStore>;
|
|
1144
|
-
})): OIMComputedServiceBucketMemo<TKey, TBucketMemberSlot, TSlots, TBucketStore, TComputedStore>;
|
|
1320
|
+
}): OIMBucketMemoComputedService<TKey, TBucketMemberSlot, TSlots, TBucketStore, TComputedStore>;
|
|
1145
1321
|
|
|
1146
1322
|
type TOIMBucketCommandsOptions = {
|
|
1147
1323
|
maxCommandsPerSlot?: number | undefined;
|
|
@@ -1150,26 +1326,28 @@ type TOIMBucketCommandsOptions = {
|
|
|
1150
1326
|
declare class OIMBucketCommands implements IOIMBucketCommands {
|
|
1151
1327
|
private readonly maxCommandsPerSlot;
|
|
1152
1328
|
constructor(options: TOIMBucketCommandsOptions);
|
|
1153
|
-
recordInsert(bucketSlot:
|
|
1154
|
-
recordRemove(bucketSlot:
|
|
1155
|
-
recordMove(bucketSlot:
|
|
1156
|
-
recordWholeList(bucketSlot:
|
|
1329
|
+
recordInsert(bucketSlot: TOIMBucketContentSlot<unknown>, index: number, bucketMemberSlot: TOIMSlot, bucketMemberSlotCount: number): void;
|
|
1330
|
+
recordRemove(bucketSlot: TOIMBucketContentSlot<unknown>, index: number, count: number, bucketMemberSlotCount: number): void;
|
|
1331
|
+
recordMove(bucketSlot: TOIMBucketContentSlot<unknown>, from: number, to: number, bucketMemberSlotCount: number): void;
|
|
1332
|
+
recordWholeList(bucketSlot: TOIMBucketContentSlot<unknown>): void;
|
|
1157
1333
|
private recordCommand;
|
|
1158
1334
|
}
|
|
1159
1335
|
|
|
1160
|
-
declare class
|
|
1336
|
+
declare class OIMSlotCollectionSortedArrayIndexService<TKey extends NonNullable<unknown>, TEntity extends object, TSourceKey extends NonNullable<unknown> = NonNullable<unknown>, TSourceStore = unknown, TBucketSlot extends TOIMBucketSlot<TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TKey> = TOIMBucketSlot<TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TKey>, TStore = Map<TKey, TBucketSlot>> extends OIMSlotCollectionIndexService<TKey, TEntity, TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TSourceKey, TSourceStore, OIMSlotContentSortedArrayBucketService<TOIMEntitySlot<TEntity>, TKey>, TBucketSlot, TStore> {
|
|
1161
1337
|
private readonly sortColumnNames;
|
|
1162
|
-
constructor(options:
|
|
1338
|
+
constructor(options: TOIMSlotCollectionIndexServiceOptions<TKey, TEntity, TBucketSlot, TStore, OIMSlotContentSortedArrayBucketService<TOIMEntitySlot<TEntity>, TKey>, TSourceKey, TSourceStore> & {
|
|
1163
1339
|
sortColumns: readonly TOIMSortColumn<TEntity>[];
|
|
1164
1340
|
});
|
|
1165
|
-
createIndexStoreSlot(sourceStoreSlot: TOIMStoreSlot<TSourceStore, TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>>): TOIMIndexStoreSlot<TStore, TBucketSlot, readonly TOIMEntitySlot<TEntity>[], TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>, TKey, TSourceStore>;
|
|
1341
|
+
createIndexStoreSlot(sourceStoreSlot: TOIMStoreSlot<TSourceStore, TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>>): TOIMIndexStoreSlot<TStore, TBucketSlot, readonly TOIMEntitySlot<TEntity>[], TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>, TKey, TSourceStore, this>;
|
|
1166
1342
|
protected onBucketColumnsChanged(_indexStoreSlot: TOIMIndexStoreSlot<TStore, TBucketSlot, readonly TOIMEntitySlot<TEntity>[], TOIMEntitySlot<TEntity, TSourceKey>, Partial<TEntity>, TKey, TSourceStore>, bucketSlot: TBucketSlot, entitySlot: TOIMEntitySlot<TEntity, TSourceKey>, changedColumns: readonly string[] | undefined): void;
|
|
1167
1343
|
private isSortColumnChanged;
|
|
1168
1344
|
}
|
|
1169
1345
|
|
|
1170
|
-
type
|
|
1346
|
+
type TOIMSlotCollectionIndexServiceFactoryOptions<TEntity extends object, TSourceKey extends NonNullable<unknown>, TSourceStore> = {
|
|
1171
1347
|
entityService: Pick<OIMSlotCollectionService<TSourceKey, TOIMEntitySlot<TEntity, TSourceKey>, TSourceStore, unknown>, 'getSlots'>;
|
|
1348
|
+
defaults?: OIMDefaults | undefined;
|
|
1172
1349
|
slotReleasePolicy?: IOIMSlotReleasePolicy | undefined;
|
|
1350
|
+
slotSubscriptionListener?: IOIMSlotSubscriptionListener | undefined;
|
|
1173
1351
|
columnSlotStoreService?: IOIMSlotStoreService<string, TOIMColumnSlot> | undefined;
|
|
1174
1352
|
columnNames?: readonly string[] | undefined;
|
|
1175
1353
|
};
|
|
@@ -1186,34 +1364,19 @@ type TOIMIndexKeyOptions<TKey, TEntity extends object, TColumns extends readonly
|
|
|
1186
1364
|
columns: [TKey] extends [never] ? never : [TKey] extends [TOIMIndexKey<TEntity, TColumns>] ? TColumns : never;
|
|
1187
1365
|
};
|
|
1188
1366
|
|
|
1189
|
-
declare function
|
|
1190
|
-
slotContentService?: (TSlotContentService & OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>) | undefined;
|
|
1367
|
+
declare function createOIMSlotCollectionIndexService<TEntity extends object, TSourceKey extends NonNullable<unknown>, const TColumns extends readonly TOIMEntityColumnName<TEntity>[] = readonly TOIMEntityColumnName<TEntity>[], TKey extends TOIMStoreKey = [TOIMIndexKey<TEntity, TColumns>] extends [TOIMStoreKey] ? Extract<TOIMIndexKey<TEntity, TColumns>, TOIMStoreKey> : never, TSourceStore = unknown, TSlots = TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TSlotContentService extends OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots, TKey> = OIMSlotContentPositionalArrayBucketService<TOIMEntitySlot<TEntity>, TKey> & OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots, TKey>>(options: TOIMSlotCollectionIndexServiceFactoryOptions<TEntity, TSourceKey, TSourceStore> & {
|
|
1368
|
+
slotContentService?: (TSlotContentService & OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots, TKey>) | undefined;
|
|
1191
1369
|
bucketSlotStoreService?: undefined;
|
|
1192
|
-
} & TOIMIndexKeyOptions<TKey, TEntity, TColumns>):
|
|
1193
|
-
declare function
|
|
1194
|
-
slotContentService?: (TSlotContentService & OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>) | undefined;
|
|
1370
|
+
} & TOIMIndexKeyOptions<TKey, TEntity, TColumns>): OIMSlotCollectionIndexService<TKey, TEntity, TSlots, TSourceKey, TSourceStore, TSlotContentService, TOIMBucketSlot<TSlots, TKey>, Map<TKey, TOIMBucketSlot<TSlots, TKey>>>;
|
|
1371
|
+
declare function createOIMSlotCollectionIndexService<TEntity extends object, TSourceKey extends NonNullable<unknown>, const TColumns extends readonly TOIMEntityColumnName<TEntity>[] = readonly TOIMEntityColumnName<TEntity>[], TKey extends TOIMStoreKey | readonly TOIMStoreKey[] = TOIMStoreKey, TSourceStore = unknown, TSlots = TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TSlotContentService extends OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots, TKey> = OIMSlotContentPositionalArrayBucketService<TOIMEntitySlot<TEntity>, TKey> & OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots, TKey>, TStore = Map<TKey, TOIMBucketSlot<TSlots, TKey>>>(options: TOIMSlotCollectionIndexServiceFactoryOptions<TEntity, TSourceKey, TSourceStore> & {
|
|
1372
|
+
slotContentService?: (TSlotContentService & OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots, TKey>) | undefined;
|
|
1195
1373
|
bucketSlotStoreService: IOIMSlotStoreService<TKey, TOIMBucketSlot<TSlots, TKey>, TStore>;
|
|
1196
|
-
} & TOIMIndexKeyOptions<TKey, TEntity, TColumns>):
|
|
1197
|
-
|
|
1198
|
-
type TOIMCompositeKeyNode<TAtKey = unknown, TCompositeKeyPart = TOIMEntitySlot> = {
|
|
1199
|
-
childNodes: Map<TCompositeKeyPart, TOIMCompositeKeyNode<TAtKey, TCompositeKeyPart>> | undefined;
|
|
1200
|
-
atThisKey: TAtKey | undefined;
|
|
1201
|
-
};
|
|
1374
|
+
} & TOIMIndexKeyOptions<TKey, TEntity, TColumns>): OIMSlotCollectionIndexService<TKey, TEntity, TSlots, TSourceKey, TSourceStore, TSlotContentService, TOIMBucketSlot<TSlots, TKey>, TStore>;
|
|
1202
1375
|
|
|
1203
|
-
|
|
1204
|
-
readonly root: TOIMCompositeKeyNode<TSlot, TCompositeKeyPart>;
|
|
1205
|
-
readonly slots: Set<TSlot>;
|
|
1206
|
-
};
|
|
1207
|
-
|
|
1208
|
-
declare function createOIMIndexServiceByCompositeKey<TEntity extends object, TSourceKey, const TColumns extends readonly TOIMEntityColumnName<TEntity>[] = readonly TOIMEntityColumnName<TEntity>[], TKey extends readonly TOIMStoreKey[] = Extract<TOIMIndexKey<TEntity, TColumns>, readonly TOIMStoreKey[]>, TSourceStore = unknown, TSlots = TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TSlotContentService extends OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots> = OIMSlotContentBucketServiceArrayDriven<TOIMEntitySlot<TEntity>> & OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>>(db: OIMDB, options: TOIMIndexServiceFactoryOptions<TEntity, TSourceKey, TSourceStore> & {
|
|
1209
|
-
columns: [TKey] extends [never] ? never : TColumns;
|
|
1210
|
-
slotContentService?: (TSlotContentService & OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>) | undefined;
|
|
1211
|
-
}): OIMIndexService<TKey, TEntity, TSlots, TSourceKey, TSourceStore, TSlotContentService, TOIMBucketSlot<TSlots, TKey>, TOIMSlotStoreTree<TOIMBucketSlot<TSlots, TKey>, TOIMStoreKey>>;
|
|
1212
|
-
|
|
1213
|
-
declare function createOIMIndexServiceSortedArrayDriven<TEntity extends object, TSourceKey, const TColumns extends readonly TOIMEntityColumnName<TEntity>[] = readonly TOIMEntityColumnName<TEntity>[], TKey extends TOIMStoreKey = [TOIMIndexKey<TEntity, TColumns>] extends [TOIMStoreKey] ? Extract<TOIMIndexKey<TEntity, TColumns>, TOIMStoreKey> : never, TSourceStore = unknown, TStore = Map<TKey, TOIMBucketSlot<TOIMBucketSlotsSortedArrayStore<TOIMEntitySlot<TEntity>>, TKey>>>(db: OIMDB, options: TOIMIndexServiceFactoryOptions<TEntity, TSourceKey, TSourceStore> & {
|
|
1376
|
+
declare function createOIMSlotCollectionSortedArrayIndexService<TEntity extends object, TSourceKey extends NonNullable<unknown>, const TColumns extends readonly TOIMEntityColumnName<TEntity>[] = readonly TOIMEntityColumnName<TEntity>[], TKey extends TOIMStoreKey = [TOIMIndexKey<TEntity, TColumns>] extends [TOIMStoreKey] ? Extract<TOIMIndexKey<TEntity, TColumns>, TOIMStoreKey> : never, TSourceStore = unknown, TStore = Map<TKey, TOIMBucketSlot<TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TKey>>>(options: TOIMSlotCollectionIndexServiceFactoryOptions<TEntity, TSourceKey, TSourceStore> & {
|
|
1214
1377
|
sortColumns: readonly TOIMSortColumn<TEntity>[];
|
|
1215
|
-
bucketSlotStoreService?: IOIMSlotStoreService<TKey, TOIMBucketSlot<
|
|
1216
|
-
} & TOIMIndexKeyOptions<TKey, TEntity, TColumns>):
|
|
1378
|
+
bucketSlotStoreService?: IOIMSlotStoreService<TKey, TOIMBucketSlot<TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TKey>, TStore> | undefined;
|
|
1379
|
+
} & TOIMIndexKeyOptions<TKey, TEntity, TColumns>): OIMSlotCollectionSortedArrayIndexService<TKey, TEntity, TSourceKey, TSourceStore, TOIMBucketSlot<TOIMBucketSlotsArrayStore<TOIMEntitySlot<TEntity>>, TKey>, TStore>;
|
|
1217
1380
|
|
|
1218
1381
|
type TOIMFactoryOptions<TClassOptions, TFilledByDb extends PropertyKey, TDefaulted extends PropertyKey> = Omit<TClassOptions, TFilledByDb | TDefaulted> & {
|
|
1219
1382
|
[TName in TDefaulted & keyof TClassOptions]?: TClassOptions[TName] | undefined;
|
|
@@ -1229,105 +1392,88 @@ declare abstract class OIMIndexKeysService implements IOIMIndexKeysService {
|
|
|
1229
1392
|
set<TIndexKey>(slot: TOIMIndexableSlot, position: number, indexKey: TIndexKey | undefined): void;
|
|
1230
1393
|
}
|
|
1231
1394
|
|
|
1232
|
-
declare class
|
|
1233
|
-
static readonly INSTANCE:
|
|
1395
|
+
declare class OIMAppendingIndexKeysService extends OIMIndexKeysService {
|
|
1396
|
+
static readonly INSTANCE: OIMAppendingIndexKeysService;
|
|
1234
1397
|
allocatePosition(positions: TOIMIndexKeysPositions): number;
|
|
1235
1398
|
releasePosition(): void;
|
|
1236
1399
|
}
|
|
1237
1400
|
|
|
1238
|
-
declare class
|
|
1401
|
+
declare class OIMReclaimingIndexKeysService extends OIMIndexKeysService {
|
|
1239
1402
|
allocatePosition(positions: TOIMIndexKeysPositions): number;
|
|
1240
1403
|
releasePosition(positions: TOIMIndexKeysPositions, position: number, slots: Iterable<TOIMIndexableSlot>): void;
|
|
1241
1404
|
}
|
|
1242
1405
|
|
|
1243
|
-
type
|
|
1406
|
+
type TOIMEntityInserter = <TEntity extends object>(slot: TOIMEntityContentSlot<TEntity>, entity: TEntity) => void;
|
|
1244
1407
|
|
|
1245
|
-
declare function oimPutEntityColumns(slot:
|
|
1408
|
+
declare function oimPutEntityColumns(slot: TOIMEntityContentSlot, entity: object, sameValueGuard: TOIMSameValueGuard, changedColumnNames: string[] | undefined, targetOf: (entity: Record<string, unknown>) => Record<string, unknown>): Record<string, unknown> | undefined;
|
|
1246
1409
|
|
|
1247
|
-
declare function oimPatchEntityColumns(slot:
|
|
1410
|
+
declare function oimPatchEntityColumns(slot: TOIMEntityContentSlot, patch: object, sameValueGuard: TOIMSameValueGuard, changedColumnNames: string[] | undefined, targetOf: (entity: Record<string, unknown>) => Record<string, unknown>): Record<string, unknown> | undefined;
|
|
1248
1411
|
|
|
1249
|
-
declare function oimPatchEntityColumn(slot:
|
|
1412
|
+
declare function oimPatchEntityColumn(slot: TOIMEntityContentSlot, columnName: string, value: unknown, sameValueGuard: TOIMSameValueGuard, changedColumnNames: string[] | undefined, targetOf: (entity: Record<string, unknown>) => Record<string, unknown>): Record<string, unknown> | undefined;
|
|
1250
1413
|
|
|
1251
1414
|
type TOIMEntityWriterOptions = {
|
|
1252
1415
|
sameValueGuard?: TOIMSameValueGuard | undefined;
|
|
1253
|
-
|
|
1416
|
+
entityInserter?: TOIMEntityInserter | undefined;
|
|
1254
1417
|
putEntityColumns?: typeof oimPutEntityColumns | undefined;
|
|
1255
1418
|
patchEntityColumns?: typeof oimPatchEntityColumns | undefined;
|
|
1256
1419
|
patchEntityColumn?: typeof oimPatchEntityColumn | undefined;
|
|
1257
1420
|
};
|
|
1258
1421
|
|
|
1259
|
-
declare function
|
|
1422
|
+
declare function createOIMInPlaceEntityWriter(options?: TOIMEntityWriterOptions): IOIMEntityWriter;
|
|
1260
1423
|
|
|
1261
|
-
declare function
|
|
1424
|
+
declare function createOIMReplacingEntityWriter(options?: TOIMEntityWriterOptions): IOIMEntityWriter;
|
|
1262
1425
|
|
|
1263
|
-
declare function oimInsertEntityWithoutCopy<TEntity extends object>(slot:
|
|
1426
|
+
declare function oimInsertEntityWithoutCopy<TEntity extends object>(slot: TOIMEntityContentSlot<TEntity>, entity: TEntity): void;
|
|
1264
1427
|
|
|
1265
|
-
declare function oimInsertEntityWithCopy<TEntity extends object>(slot:
|
|
1428
|
+
declare function oimInsertEntityWithCopy<TEntity extends object>(slot: TOIMEntityContentSlot<TEntity>, entity: TEntity): void;
|
|
1266
1429
|
|
|
1267
|
-
declare function oimInsertEntityWithSanitizedCopy<TEntity extends object>(slot:
|
|
1430
|
+
declare function oimInsertEntityWithSanitizedCopy<TEntity extends object>(slot: TOIMEntityContentSlot<TEntity>, entity: TEntity): void;
|
|
1268
1431
|
|
|
1269
|
-
declare const
|
|
1432
|
+
declare const oimGuardedPatchEntityColumns: typeof oimPatchEntityColumns;
|
|
1270
1433
|
|
|
1271
|
-
declare const
|
|
1434
|
+
declare const oimGuardedPatchEntityColumn: typeof oimPatchEntityColumn;
|
|
1272
1435
|
|
|
1273
|
-
declare const
|
|
1436
|
+
declare const oimGuardedPutEntityColumns: typeof oimPutEntityColumns;
|
|
1274
1437
|
|
|
1275
|
-
declare
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
abstract getReleaseSlotCollectorSlot(collectorSlot: TOIMCollectorSlot): TOIMReleaseSlotCollectorSlot;
|
|
1279
|
-
getReleaseSlotCollectorSlotOf(slot: TOIMSlot): TOIMReleaseSlotCollectorSlot;
|
|
1280
|
-
markSlotReleaseDue(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot, slot: TOIMSlot, keepMs: number): number;
|
|
1281
|
-
scheduleSlotRelease(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot, slot: TOIMSlot, nowMs: number): void;
|
|
1282
|
-
isSlotReleasable(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot, slot: TOIMSlot): boolean;
|
|
1283
|
-
cancelSlotRelease(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot, slot: TOIMSlot): void;
|
|
1284
|
-
scheduleNextRelease(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot): void;
|
|
1285
|
-
protected cancelSchedule(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot): void;
|
|
1286
|
-
flush(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot): void;
|
|
1287
|
-
protected onSchedulerTimerFired(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot): void;
|
|
1288
|
-
cancelAllSlotReleases(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot): void;
|
|
1289
|
-
}
|
|
1438
|
+
declare function oimMintAfterWriteSlotReleaseWheel(collectorSlot: TOIMCollectorSlot): OIMSlotReleaseWheel;
|
|
1439
|
+
|
|
1440
|
+
declare function oimMintAfterIdleSlotReleaseWheel(collectorSlot: TOIMCollectorSlot): OIMSlotReleaseWheel;
|
|
1290
1441
|
|
|
1291
|
-
declare function
|
|
1442
|
+
declare function oimMintAfterUnholdSlotReleaseWheel(collectorSlot: TOIMCollectorSlot): OIMSlotReleaseWheel;
|
|
1292
1443
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
scheduleSlotRelease(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot, releaseSlotCollectorService: OIMReleaseSlotCollectorService, slot: TOIMSlot, nowMs: number): void;
|
|
1296
|
-
cancelSlotRelease(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot, slot: TOIMSlot): void;
|
|
1297
|
-
getNextReleaseSliceNumber(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot): number | undefined;
|
|
1298
|
-
cancelAllSlotReleases(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot): void;
|
|
1299
|
-
isSlotReleaseScheduled(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot, slot: TOIMSlot): boolean;
|
|
1300
|
-
releaseDueUpToSliceNumber(releaseSlotCollectorSlot: TOIMReleaseSlotCollectorSlot, releaseSlotCollectorService: OIMReleaseSlotCollectorService, upToSliceNumber: number): void;
|
|
1301
|
-
private releaseSlice;
|
|
1302
|
-
private removeFromSliceNumber;
|
|
1303
|
-
private updateNextSliceNumber;
|
|
1304
|
-
private invalidateNextSliceNumber;
|
|
1305
|
-
private addToSliceNumber;
|
|
1444
|
+
interface IOIMSlotRefetchListener {
|
|
1445
|
+
onSlotsRefetchDue(slots: readonly TOIMSlot[]): void;
|
|
1306
1446
|
}
|
|
1307
1447
|
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1448
|
+
type TOIMSlotRefetchWheelOptions = Partial<TOIMSlotWheelOptions> & {
|
|
1449
|
+
slotRefetchListener: IOIMSlotRefetchListener;
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
declare class OIMSlotRefetchWheel extends OIMSlotWheel {
|
|
1453
|
+
private readonly slotRefetchListener;
|
|
1454
|
+
private readonly refetchDueSlots;
|
|
1455
|
+
constructor(options: TOIMSlotRefetchWheelOptions);
|
|
1456
|
+
scheduleSlotRefetchAt(slot: TOIMSlot, atMs: number): void;
|
|
1457
|
+
protected getSweptSliceNumberAt(nowMs: number): number;
|
|
1458
|
+
protected onSlotDue(slot: TOIMSlot): void;
|
|
1459
|
+
protected onSweepFinished(): void;
|
|
1313
1460
|
}
|
|
1314
1461
|
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
readonly getReleaseDueMs: (slot: TOIMSlot) => number;
|
|
1318
|
-
protected readonly setReleaseDueMs: (slot: TOIMSlot, releaseDueMs: number) => void;
|
|
1319
|
-
getReleaseSlotCollectorSlot(collectorSlot: TOIMCollectorSlot): TOIMReleaseSlotCollectorSlot;
|
|
1462
|
+
interface IOIMSlotReleaseDueFramePolicy {
|
|
1463
|
+
isSlotReleaseDueFrameOpen(): boolean;
|
|
1320
1464
|
}
|
|
1321
1465
|
|
|
1322
|
-
type
|
|
1466
|
+
type TOIMSlotAfterWriteReleasePolicyOptions = {
|
|
1323
1467
|
keepAfterWriteMs: number;
|
|
1468
|
+
slotReleaseDueFramePolicy?: IOIMSlotReleaseDueFramePolicy;
|
|
1324
1469
|
};
|
|
1325
1470
|
|
|
1326
|
-
declare class
|
|
1471
|
+
declare class OIMSlotAfterWriteReleasePolicy implements IOIMSlotReleasePolicy {
|
|
1327
1472
|
readonly releasesWrittenSlots = true;
|
|
1328
1473
|
readonly schedulesReleaseOnWrite = true;
|
|
1329
1474
|
private readonly keepAfterWriteMs;
|
|
1330
|
-
|
|
1475
|
+
private readonly slotReleaseDueFramePolicy;
|
|
1476
|
+
constructor(options: TOIMSlotAfterWriteReleasePolicyOptions);
|
|
1331
1477
|
onSlotWritten(slot: TOIMSlot): void;
|
|
1332
1478
|
onSlotIdle(slot: TOIMSlot): boolean;
|
|
1333
1479
|
onSlotUnheld(): void;
|
|
@@ -1336,15 +1482,28 @@ declare class OIMSlotReleasePolicyAfterWrite implements IOIMSlotReleasePolicy {
|
|
|
1336
1482
|
cancelSlotRelease(slot: TOIMSlot): void;
|
|
1337
1483
|
}
|
|
1338
1484
|
|
|
1339
|
-
|
|
1485
|
+
declare class OIMSlotReleaseAutoDueFramePolicy implements IOIMSlotReleaseDueFramePolicy {
|
|
1486
|
+
static readonly INSTANCE: OIMSlotReleaseAutoDueFramePolicy;
|
|
1487
|
+
isSlotReleaseDueFrameOpen(): boolean;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
declare class OIMSlotReleaseManualDueFramePolicy implements IOIMSlotReleaseDueFramePolicy {
|
|
1491
|
+
private slotReleaseDueFrameDepth;
|
|
1492
|
+
isSlotReleaseDueFrameOpen(): boolean;
|
|
1493
|
+
openSlotReleaseDueFrame(): void;
|
|
1494
|
+
closeSlotReleaseDueFrame(): void;
|
|
1495
|
+
writeInSlotReleaseDueFrame(write: () => void): void;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
type TOIMSlotAfterIdleReleasePolicyOptions = {
|
|
1340
1499
|
keepAfterIdleMs: number;
|
|
1341
1500
|
};
|
|
1342
1501
|
|
|
1343
|
-
declare class
|
|
1502
|
+
declare class OIMSlotAfterIdleReleasePolicy implements IOIMSlotReleasePolicy {
|
|
1344
1503
|
readonly releasesWrittenSlots = true;
|
|
1345
1504
|
readonly schedulesReleaseOnWrite = true;
|
|
1346
1505
|
private readonly keepAfterIdleMs;
|
|
1347
|
-
constructor(options:
|
|
1506
|
+
constructor(options: TOIMSlotAfterIdleReleasePolicyOptions);
|
|
1348
1507
|
onSlotWritten(): void;
|
|
1349
1508
|
onSlotIdle(slot: TOIMSlot): boolean;
|
|
1350
1509
|
onSlotUnheld(): void;
|
|
@@ -1353,8 +1512,8 @@ declare class OIMSlotReleasePolicyAfterIdle implements IOIMSlotReleasePolicy {
|
|
|
1353
1512
|
cancelSlotRelease(slot: TOIMSlot): void;
|
|
1354
1513
|
}
|
|
1355
1514
|
|
|
1356
|
-
declare class
|
|
1357
|
-
static readonly INSTANCE:
|
|
1515
|
+
declare class OIMSlotAtUnholdReleasePolicy implements IOIMSlotReleasePolicy {
|
|
1516
|
+
static readonly INSTANCE: OIMSlotAtUnholdReleasePolicy;
|
|
1358
1517
|
readonly releasesWrittenSlots = true;
|
|
1359
1518
|
readonly schedulesReleaseOnWrite = false;
|
|
1360
1519
|
onSlotWritten(): void;
|
|
@@ -1365,8 +1524,8 @@ declare class OIMSlotReleasePolicyAtUnhold implements IOIMSlotReleasePolicy {
|
|
|
1365
1524
|
cancelSlotRelease(): void;
|
|
1366
1525
|
}
|
|
1367
1526
|
|
|
1368
|
-
declare class
|
|
1369
|
-
static readonly INSTANCE:
|
|
1527
|
+
declare class OIMSlotAtEmptyReleasePolicy implements IOIMSlotReleasePolicy {
|
|
1528
|
+
static readonly INSTANCE: OIMSlotAtEmptyReleasePolicy;
|
|
1370
1529
|
readonly releasesWrittenSlots = false;
|
|
1371
1530
|
readonly schedulesReleaseOnWrite = false;
|
|
1372
1531
|
onSlotWritten(): void;
|
|
@@ -1377,8 +1536,8 @@ declare class OIMSlotReleasePolicyAtEmpty implements IOIMSlotReleasePolicy {
|
|
|
1377
1536
|
cancelSlotRelease(): void;
|
|
1378
1537
|
}
|
|
1379
1538
|
|
|
1380
|
-
declare class
|
|
1381
|
-
static readonly INSTANCE:
|
|
1539
|
+
declare class OIMSlotNeverReleasePolicy implements IOIMSlotReleasePolicy {
|
|
1540
|
+
static readonly INSTANCE: OIMSlotNeverReleasePolicy;
|
|
1382
1541
|
readonly releasesWrittenSlots = false;
|
|
1383
1542
|
readonly schedulesReleaseOnWrite = false;
|
|
1384
1543
|
onSlotWritten(): void;
|
|
@@ -1389,15 +1548,15 @@ declare class OIMSlotReleasePolicyNever implements IOIMSlotReleasePolicy {
|
|
|
1389
1548
|
cancelSlotRelease(): void;
|
|
1390
1549
|
}
|
|
1391
1550
|
|
|
1392
|
-
type
|
|
1551
|
+
type TOIMSlotAfterUnholdReleasePolicyOptions = {
|
|
1393
1552
|
keepAfterUnholdMs: number;
|
|
1394
1553
|
};
|
|
1395
1554
|
|
|
1396
|
-
declare class
|
|
1555
|
+
declare class OIMSlotAfterUnholdReleasePolicy implements IOIMSlotReleasePolicy {
|
|
1397
1556
|
readonly releasesWrittenSlots = true;
|
|
1398
1557
|
readonly schedulesReleaseOnWrite = false;
|
|
1399
1558
|
private readonly keepAfterUnholdMs;
|
|
1400
|
-
constructor(options:
|
|
1559
|
+
constructor(options: TOIMSlotAfterUnholdReleasePolicyOptions);
|
|
1401
1560
|
onSlotWritten(): void;
|
|
1402
1561
|
onSlotIdle(): boolean;
|
|
1403
1562
|
onSlotUnheld(slot: TOIMSlot): void;
|
|
@@ -1406,14 +1565,7 @@ declare class OIMSlotReleasePolicyAfterUnhold implements IOIMSlotReleasePolicy {
|
|
|
1406
1565
|
cancelSlotRelease(slot: TOIMSlot): void;
|
|
1407
1566
|
}
|
|
1408
1567
|
|
|
1409
|
-
declare class
|
|
1410
|
-
static readonly INSTANCE: OIMReleaseSlotCollectorServiceAfterUnhold;
|
|
1411
|
-
readonly getReleaseDueMs: (slot: TOIMSlot) => number;
|
|
1412
|
-
protected readonly setReleaseDueMs: (slot: TOIMSlot, releaseDueMs: number) => void;
|
|
1413
|
-
getReleaseSlotCollectorSlot(collectorSlot: TOIMCollectorSlot): TOIMReleaseSlotCollectorSlot;
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
declare class OIMSlotReleasePolicyEarliest implements IOIMSlotReleasePolicy {
|
|
1568
|
+
declare class OIMSlotEarliestReleasePolicy implements IOIMSlotReleasePolicy {
|
|
1417
1569
|
readonly releasesWrittenSlots: boolean;
|
|
1418
1570
|
readonly schedulesReleaseOnWrite: boolean;
|
|
1419
1571
|
private readonly slotReleasePolicies;
|
|
@@ -1431,25 +1583,37 @@ declare const oimSliceOfMs: (ms: number) => number;
|
|
|
1431
1583
|
|
|
1432
1584
|
declare const OIM_SLICE_LENGTH_MS = 1024;
|
|
1433
1585
|
|
|
1434
|
-
declare class
|
|
1435
|
-
static readonly INSTANCE:
|
|
1586
|
+
declare class OIMSlotMapStoreService<TSlot extends TOIMKeyedSlot<TKey>, TKey extends NonNullable<unknown> = TSlot extends TOIMKeyedSlot<infer TSlotKey> ? TSlotKey : TOIMStoreKey> implements IOIMSlotStoreService<TKey, TSlot, Map<TKey, TSlot>> {
|
|
1587
|
+
static readonly INSTANCE: OIMSlotMapStoreService<TOIMKeyedSlot, {}>;
|
|
1436
1588
|
createStore(): Map<TKey, TSlot>;
|
|
1437
1589
|
ownKey<TOwnedKey extends TKey>(key: TOwnedKey): TOwnedKey;
|
|
1438
1590
|
isSameKey(key: TKey, otherKey: TKey): boolean;
|
|
1439
1591
|
get(store: Map<TKey, TSlot>, key: TKey): TSlot | undefined;
|
|
1440
1592
|
set(store: Map<TKey, TSlot>, key: TKey, slot: TSlot): void;
|
|
1441
1593
|
remove(store: Map<TKey, TSlot>, key: TKey): void;
|
|
1594
|
+
fileSlot(store: Map<TKey, TSlot>, slot: TSlot): void;
|
|
1595
|
+
unfileSlot(store: Map<TKey, TSlot>, slot: TSlot): void;
|
|
1442
1596
|
getSlots(store: Map<TKey, TSlot>): IterableIterator<TSlot>;
|
|
1443
1597
|
getSlotCount(store: Map<TKey, TSlot>): number;
|
|
1444
1598
|
}
|
|
1445
1599
|
|
|
1600
|
+
type TOIMCompositeKeyNode<TAtKey = unknown, TCompositeKeyPart = TOIMEntitySlot> = {
|
|
1601
|
+
childNodes: Map<TCompositeKeyPart, TOIMCompositeKeyNode<TAtKey, TCompositeKeyPart>> | undefined;
|
|
1602
|
+
atThisKey: TAtKey | undefined;
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1446
1605
|
interface IOIMKeyTreeWalk<TCompositeKeyPart> {
|
|
1447
1606
|
mintNodeAt<TAtKey>(rootCompositeKeyNode: TOIMCompositeKeyNode<TAtKey, TCompositeKeyPart>, compositeKey: readonly TCompositeKeyPart[]): TOIMCompositeKeyNode<TAtKey, TCompositeKeyPart>;
|
|
1448
1607
|
nodeAt<TAtKey>(rootCompositeKeyNode: TOIMCompositeKeyNode<TAtKey, TCompositeKeyPart>, compositeKey: readonly TCompositeKeyPart[]): TOIMCompositeKeyNode<TAtKey, TCompositeKeyPart> | undefined;
|
|
1449
1608
|
deleteKey<TAtKey>(rootCompositeKeyNode: TOIMCompositeKeyNode<TAtKey, TCompositeKeyPart>, compositeKey: readonly TCompositeKeyPart[]): TAtKey | undefined;
|
|
1450
1609
|
}
|
|
1451
1610
|
|
|
1452
|
-
|
|
1611
|
+
type TOIMSlotStoreTree<TSlot, TCompositeKeyPart> = {
|
|
1612
|
+
readonly rootCompositeKeyNode: TOIMCompositeKeyNode<TSlot, TCompositeKeyPart>;
|
|
1613
|
+
readonly slots: Set<TSlot>;
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1616
|
+
declare class OIMSlotTreeStoreService<TCompositeKeyPart, TSlot extends TOIMKeyedSlot<readonly TCompositeKeyPart[]>> implements IOIMSlotStoreService<readonly TCompositeKeyPart[], TSlot, TOIMSlotStoreTree<TSlot, TCompositeKeyPart>> {
|
|
1453
1617
|
private readonly keyTreeWalk;
|
|
1454
1618
|
constructor(keyTreeWalk: IOIMKeyTreeWalk<TCompositeKeyPart>);
|
|
1455
1619
|
createStore(): TOIMSlotStoreTree<TSlot, TCompositeKeyPart>;
|
|
@@ -1458,6 +1622,8 @@ declare class OIMSlotStoreServiceTreeDriven<TCompositeKeyPart, TSlot extends TOI
|
|
|
1458
1622
|
get(slotStoreTree: TOIMSlotStoreTree<TSlot, TCompositeKeyPart>, compositeKey: readonly TCompositeKeyPart[]): TSlot | undefined;
|
|
1459
1623
|
set(slotStoreTree: TOIMSlotStoreTree<TSlot, TCompositeKeyPart>, compositeKey: readonly TCompositeKeyPart[], slot: TSlot): void;
|
|
1460
1624
|
remove(slotStoreTree: TOIMSlotStoreTree<TSlot, TCompositeKeyPart>, compositeKey: readonly TCompositeKeyPart[]): void;
|
|
1625
|
+
fileSlot(slotStoreTree: TOIMSlotStoreTree<TSlot, TCompositeKeyPart>, slot: TSlot): void;
|
|
1626
|
+
unfileSlot(slotStoreTree: TOIMSlotStoreTree<TSlot, TCompositeKeyPart>, slot: TSlot): void;
|
|
1461
1627
|
getSlots(slotStoreTree: TOIMSlotStoreTree<TSlot, TCompositeKeyPart>): IterableIterator<TSlot>;
|
|
1462
1628
|
getSlotCount(slotStoreTree: TOIMSlotStoreTree<TSlot, TCompositeKeyPart>): number;
|
|
1463
1629
|
}
|
|
@@ -1470,41 +1636,18 @@ declare abstract class OIMKeyTreeWalk<TCompositeKeyPart> implements IOIMKeyTreeW
|
|
|
1470
1636
|
deleteKey<TAtKey>(rootCompositeKeyNode: TOIMCompositeKeyNode<TAtKey, TCompositeKeyPart>, compositeKey: readonly TCompositeKeyPart[]): TAtKey | undefined;
|
|
1471
1637
|
}
|
|
1472
1638
|
|
|
1473
|
-
declare class
|
|
1474
|
-
static readonly INSTANCE:
|
|
1639
|
+
declare class OIMCompositeKeyTreeWalk extends OIMKeyTreeWalk<TOIMEntitySlot> {
|
|
1640
|
+
static readonly INSTANCE: OIMCompositeKeyTreeWalk;
|
|
1475
1641
|
protected holdCompositeKeyPart(entitySlot: TOIMEntitySlot): void;
|
|
1476
1642
|
protected unholdCompositeKeyPart(entitySlot: TOIMEntitySlot): void;
|
|
1477
1643
|
}
|
|
1478
1644
|
|
|
1479
|
-
declare class
|
|
1480
|
-
static readonly INSTANCE:
|
|
1645
|
+
declare class OIMScalarKeyTreeWalk extends OIMKeyTreeWalk<TOIMStoreKey> {
|
|
1646
|
+
static readonly INSTANCE: OIMScalarKeyTreeWalk;
|
|
1481
1647
|
protected holdCompositeKeyPart(): void;
|
|
1482
1648
|
protected unholdCompositeKeyPart(): void;
|
|
1483
1649
|
}
|
|
1484
1650
|
|
|
1485
|
-
type TOIMBucketSlotsArrayUniqueStore<TBucketMemberSlot extends TOIMSlot = TOIMSlot> = TOIMBucketSlotsArrayStore<TBucketMemberSlot> & {
|
|
1486
|
-
uniqueBucketMemberSlots: Set<TBucketMemberSlot>;
|
|
1487
|
-
};
|
|
1488
|
-
|
|
1489
|
-
declare class OIMBucketArrayMembershipNonUnique<TBucketMemberSlot extends TOIMSlot = TOIMSlot> implements IOIMBucketArrayMembership<TBucketMemberSlot, TOIMBucketSlotsArrayStore<TBucketMemberSlot>> {
|
|
1490
|
-
static readonly INSTANCE: OIMBucketArrayMembershipNonUnique<TOIMSlot>;
|
|
1491
|
-
createStore(): TOIMBucketSlotsArrayStore<TBucketMemberSlot>;
|
|
1492
|
-
addSlot(): boolean;
|
|
1493
|
-
removeSlot(): boolean;
|
|
1494
|
-
hasSlot(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1495
|
-
clearSlots(): void;
|
|
1496
|
-
containsTheSameSequence(bucketSlotsArrayStore: TOIMBucketSlotsArrayStore<TBucketMemberSlot>, bucketMemberSlots: readonly TBucketMemberSlot[]): boolean;
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
declare class OIMBucketArrayMembershipUnique<TBucketMemberSlot extends TOIMSlot = TOIMSlot> implements IOIMBucketArrayMembership<TBucketMemberSlot, TOIMBucketSlotsArrayUniqueStore<TBucketMemberSlot>> {
|
|
1500
|
-
createStore(): TOIMBucketSlotsArrayUniqueStore<TBucketMemberSlot>;
|
|
1501
|
-
addSlot(bucketSlotsArrayUniqueStore: TOIMBucketSlotsArrayUniqueStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1502
|
-
removeSlot(bucketSlotsArrayUniqueStore: TOIMBucketSlotsArrayUniqueStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1503
|
-
hasSlot(bucketSlotsArrayUniqueStore: TOIMBucketSlotsArrayUniqueStore<TBucketMemberSlot>, bucketMemberSlot: TBucketMemberSlot): boolean;
|
|
1504
|
-
clearSlots(bucketSlotsArrayUniqueStore: TOIMBucketSlotsArrayUniqueStore<TBucketMemberSlot>): void;
|
|
1505
|
-
containsTheSameSequence(bucketSlotsArrayUniqueStore: TOIMBucketSlotsArrayUniqueStore<TBucketMemberSlot>, bucketMemberSlots: readonly TBucketMemberSlot[]): boolean;
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
1651
|
declare const OIM_NOTHING_WAS_INSERTED = -1;
|
|
1509
1652
|
|
|
1510
1653
|
declare const OIM_NOTHING_WAS_REMOVED = -1;
|
|
@@ -1515,4 +1658,4 @@ declare const OIM_REMOVED_WITHOUT_A_POSITION = -2;
|
|
|
1515
1658
|
|
|
1516
1659
|
declare function oimOrderedListCommandsOfTransition(prev: readonly TOIMSlot[], next: readonly TOIMSlot[], maxCommandsPerSlot?: number): TOIMOrderedListCommand[];
|
|
1517
1660
|
|
|
1518
|
-
export { type
|
|
1661
|
+
export { type IOIMBucketCommands, type IOIMBucketMemberSlotsArrayService, type IOIMChannelMap, type IOIMComputedValueService, type IOIMEffectService, type IOIMEntityWriter, type IOIMErrorPolicy, type IOIMFlushSchedulerListener, type IOIMIndexKeysService, type IOIMKeyTreeWalk, type IOIMKeyedSlotCreator, type IOIMSingleSlotCreator, type IOIMSlotContentChangeListener, type IOIMSlotContentService, type IOIMSlotContentWriter, type IOIMSlotEmptinessPolicy, type IOIMSlotFilingService, type IOIMSlotOwner, type IOIMSlotRefetchListener, type IOIMSlotReleaseDueFramePolicy, type IOIMSlotReleasePolicy, type IOIMSlotStamp, type IOIMSlotStoreService, type IOIMSlotSubscriptionListener, type IOIMStoreSlotListener, OIMAppendingIndexKeysService, OIMBucketCommands, OIMBucketMemberSlotsArrayService, OIMBucketMemoComputedService, OIMBucketUniqueMemberSlotsArrayService, type OIMChannelQueue, OIMChannelService, OIMColumnSlotOwner, OIMColumnSlotService, OIMCompositeKeyTreeWalk, OIMComputedService, OIMComputedValueService, OIMDB, OIMDefaultValue, OIMDefaults, OIMEffectService, OIMFlushSchedulerService, OIMIndexKeysService, OIMKeyTreeWalk, OIMLogAndContinueErrorPolicy, OIMNoSlotSubscriptionListener, OIMNoStoreSlotListener, OIMPullColumnSlotOwner, type OIMPushColumnSlotOwner, OIMReclaimingIndexKeysService, OIMScalarKeyTreeWalk, OIMSingleComputedService, OIMSingleSlotService, OIMSingleSlotStoreService, OIMSingleSourceTrackingComputedService, OIMSlotAfterIdleReleasePolicy, OIMSlotAfterUnholdReleasePolicy, OIMSlotAfterWriteReleasePolicy, OIMSlotAtEmptyReleasePolicy, OIMSlotAtUnholdReleasePolicy, OIMSlotCollectionIndexService, OIMSlotCollectionService, OIMSlotCollectionSortedArrayIndexService, OIMSlotContentArrayBucketService, OIMSlotContentBucketService, OIMSlotContentChangeListenerService, type OIMSlotContentComputedService, OIMSlotContentEntityService, OIMSlotContentPositionalArrayBucketService, OIMSlotContentSetBucketService, OIMSlotContentSortedArrayBucketService, type OIMSlotContentSourceTrackingComputedService, OIMSlotEarliestReleasePolicy, OIMSlotMapStoreService, OIMSlotNeverReleasePolicy, OIMSlotOwner, type OIMSlotOwnerService, OIMSlotRefetchWheel, OIMSlotReleaseAutoDueFramePolicy, OIMSlotReleaseManualDueFramePolicy, OIMSlotReleaseWheel, OIMSlotTreeStoreService, OIMSlotWheel, OIMSortedComputedService, type OIMSourceTracker, OIMSourceTrackingComputedService, OIMThrowAtOnceErrorPolicy, OIMUnusedSlotCollectorService, OIMWritableSingleSlotService, OIMWritableSlotCollectionService, OIM_FROZEN_EMPTY_SLOTS, OIM_NOTHING_WAS_INSERTED, OIM_NOTHING_WAS_REMOVED, OIM_REMOVED_WITHOUT_A_POSITION, OIM_SLICE_LENGTH_MS, type TOIMBucketCommandsOptions, type TOIMBucketContentSlot, type TOIMBucketMemoComputedServiceOptions, type TOIMBucketMemoComputedSlot, type TOIMBucketSlot, type TOIMBucketSlotOwnerService, type TOIMBucketSlotsArrayStore, type TOIMBucketSlotsSetStore, type TOIMChannelClock, type TOIMChannelFrame, type TOIMChannelScheduler, type TOIMChannelSlot, type TOIMChannelSlotOptions, type TOIMCollectorSlot, type TOIMCollectorSlotOptions, type TOIMColumnGroup, type TOIMColumnReaders, type TOIMColumnSlot, type TOIMColumnSlotOwnerOptions, type TOIMCompositeKeyNode, type TOIMComputedColumnSlot, type TOIMComputedContentSlot, type TOIMComputedDerivation, type TOIMComputedDerivationOptions, type TOIMComputedServiceFactoryOptions, type TOIMComputedServiceOptions, type TOIMComputedSlot, type TOIMComputedSources, type TOIMComputedStoreSlot, type TOIMComputedValueReleaser, type TOIMComputedValueServiceOptions, type TOIMDBOptions, type TOIMDefaultSlotStore, type TOIMDefaultsOptions, type TOIMDisposer, type TOIMEditable, type TOIMEffect, type TOIMEffectBody, type TOIMEntityColumnName, type TOIMEntityColumnValue, type TOIMEntityContentSlot, type TOIMEntityInserter, type TOIMEntitySlot, type TOIMEntitySlotOwnerService, type TOIMEntityWriterOptions, type TOIMFactoryOptions, type TOIMFlushSchedulerSlot, type TOIMIndexKey, type TOIMIndexKeyOptions, type TOIMIndexKeysPositions, type TOIMIndexStoreSlot, type TOIMIndexableSlot, type TOIMKeyedSlot, type TOIMLogAndContinueErrorPolicyOptions, type TOIMOrderedListCommand, type TOIMSameValueGuard, type TOIMSingleSlotServiceOptions, type TOIMSingleSlotStore, type TOIMSingleSlotStoreSlot, type TOIMSlot, type TOIMSlotAfterIdleReleasePolicyOptions, type TOIMSlotAfterUnholdReleasePolicyOptions, type TOIMSlotAfterWriteReleasePolicyOptions, type TOIMSlotCollectionIndexServiceFactoryOptions, type TOIMSlotCollectionIndexServiceOptions, type TOIMSlotCollectionIndexServiceStoreSlot, type TOIMSlotCollectionServiceOptions, type TOIMSlotContentArrayBucketServiceOptions, type TOIMSlotContentBucketServiceOptions, type TOIMSlotContentComputedServiceOptions, type TOIMSlotContentEntityServiceOptions, type TOIMSlotContentServiceContent, type TOIMSlotContentServiceKey, type TOIMSlotContentServicePatch, type TOIMSlotContentServiceSingleSlot, type TOIMSlotContentServiceSlot, type TOIMSlotContentSortedArrayBucketServiceOptions, type TOIMSlotOwnerServiceOptions, type TOIMSlotRefetchWheelOptions, type TOIMSlotReleaseWheelOptions, type TOIMSlotStoreTree, type TOIMSlotWheelOptions, type TOIMSortColumn, type TOIMSortableColumnName, type TOIMSortedComputedServiceOptions, type TOIMSortedComputedSlot, type TOIMSourceTrackingComputedContentSlot, type TOIMSourceTrackingComputedDerivationOptions, type TOIMSourceTrackingComputedDerive, type TOIMSourceTrackingComputedSlot, type TOIMSourceTrackingEffectBody, type TOIMStoreKey, type TOIMStoreSlot, type TOIMTimer, type TOIMUnusedSlotCollectorSlot, createOIMBucketMemoComputedService, createOIMChannelSlot, createOIMCollectorSlot, createOIMComputedService, createOIMInPlaceEntityWriter, createOIMReplacingEntityWriter, createOIMSingleComputedService, createOIMSingleSlotService, createOIMSingleSourceTrackingComputedService, createOIMSlotCollectionIndexService, createOIMSlotCollectionService, createOIMSlotCollectionSortedArrayIndexService, createOIMSlotContentEntityService, createOIMSortedComputedService, createOIMSourceTrackingComputedService, createOIMUnusedSlotCollectorSlot, oimColumnsComparator, oimGuardedPatchEntityColumn, oimGuardedPatchEntityColumns, oimGuardedPutEntityColumns, oimHoldSlots, oimInsertEntityWithCopy, oimInsertEntityWithSanitizedCopy, oimInsertEntityWithoutCopy, oimIsAnySlotChangedAfter, oimIsSlotEmpty, oimIsSlotReleased, oimMintAfterIdleSlotReleaseWheel, oimMintAfterUnholdSlotReleaseWheel, oimMintAfterWriteSlotReleaseWheel, oimOrderedListCommandsOfTransition, oimPatchEntityColumn, oimPatchEntityColumns, oimPutEntityColumns, oimRefreshSourceComputeds, oimSameKeySequence, oimSameSlotSequence, oimSameValueZeroGuard, oimSliceOfMs, oimUnholdSlotsIfAlive };
|