@flurryx/store 0.8.3 → 1.0.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/dist/index.d.ts CHANGED
@@ -1,10 +1,197 @@
1
1
  import { Signal, InjectionToken } from '@angular/core';
2
- import { ResourceState, KeyedResourceKey } from '@flurryx/core';
2
+ import { ResourceState, KeyedResourceData, KeyedResourceKey } from '@flurryx/core';
3
3
 
4
+ /** Message produced by `store.update(key, partial)` — merges partial state into a slot. */
5
+ type UpdateStoreMessage<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = {
6
+ readonly [K in TKey]: {
7
+ readonly type: "update";
8
+ readonly key: K;
9
+ readonly state: Partial<TData[K]>;
10
+ };
11
+ }[TKey];
12
+ /** Message produced by `store.clear(key)` — resets a single slot to its initial state. */
13
+ type ClearStoreMessage<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = {
14
+ readonly [K in TKey]: {
15
+ readonly type: "clear";
16
+ readonly key: K;
17
+ };
18
+ }[TKey];
19
+ /** Message produced by `store.clearAll()` — resets every slot in the store. */
20
+ interface ClearAllStoreMessage<TData extends StoreDataShape<TData>> {
21
+ readonly type: "clearAll";
22
+ }
23
+ /** Message produced by `store.startLoading(key)` — sets `isLoading: true` and clears `status`/`errors`. */
24
+ type StartLoadingStoreMessage<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = {
25
+ readonly [K in TKey]: {
26
+ readonly type: "startLoading";
27
+ readonly key: K;
28
+ };
29
+ }[TKey];
30
+ /** Message produced by `store.stopLoading(key)` — sets `isLoading: false`. */
31
+ type StopLoadingStoreMessage<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = {
32
+ readonly [K in TKey]: {
33
+ readonly type: "stopLoading";
34
+ readonly key: K;
35
+ };
36
+ }[TKey];
37
+ /** Message produced by `store.updateKeyedOne(key, resourceKey, entity)` — merges a single entity into a keyed slot. */
38
+ type UpdateKeyedOneStoreMessage<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = {
39
+ readonly [K in KeyedStoreKey<TData, TKey>]: {
40
+ readonly type: "updateKeyedOne";
41
+ readonly key: K;
42
+ readonly resourceKey: KeyedResourceEntryKey<TData, K>;
43
+ readonly entity: KeyedResourceEntryValue<TData, K>;
44
+ };
45
+ }[KeyedStoreKey<TData, TKey>];
46
+ /** Message produced by `store.clearKeyedOne(key, resourceKey)` — removes a single entity from a keyed slot. */
47
+ type ClearKeyedOneStoreMessage<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = {
48
+ readonly [K in KeyedStoreKey<TData, TKey>]: {
49
+ readonly type: "clearKeyedOne";
50
+ readonly key: K;
51
+ readonly resourceKey: KeyedResourceEntryKey<TData, K>;
52
+ };
53
+ }[KeyedStoreKey<TData, TKey>];
54
+ /** Message produced by `store.startKeyedLoading(key, resourceKey)` — marks a single entity as loading. */
55
+ type StartKeyedLoadingStoreMessage<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = {
56
+ readonly [K in KeyedStoreKey<TData, TKey>]: {
57
+ readonly type: "startKeyedLoading";
58
+ readonly key: K;
59
+ readonly resourceKey: KeyedResourceEntryKey<TData, K>;
60
+ };
61
+ }[KeyedStoreKey<TData, TKey>];
62
+ /** Discriminated union of all typed store messages published to the broker channel. */
63
+ type StoreMessage<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = UpdateStoreMessage<TData, TKey> | ClearStoreMessage<TData, TKey> | ClearAllStoreMessage<TData> | StartLoadingStoreMessage<TData, TKey> | StopLoadingStoreMessage<TData, TKey> | UpdateKeyedOneStoreMessage<TData, TKey> | ClearKeyedOneStoreMessage<TData, TKey> | StartKeyedLoadingStoreMessage<TData, TKey>;
64
+ /** Full store state captured at a point in time, keyed by slot name. Used by history and time travel. */
65
+ type StoreSnapshot<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = Partial<{
66
+ readonly [K in TKey]: TData[K];
67
+ }>;
68
+ /** Delivery status of a broker message: `"pending"` → `"acknowledged"` or `"dead-letter"`. */
69
+ type StoreMessageStatus = "pending" | "acknowledged" | "dead-letter";
70
+
71
+ /**
72
+ * Persisted broker message record stored in the active message channel.
73
+ *
74
+ * Message ids are allocated when the message is first published and remain stable
75
+ * across acknowledgement, replay, and dead-letter transitions.
76
+ */
77
+ interface StoreMessageRecord<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
78
+ /** Stable message id used by `replay(...)` and dead-letter recovery APIs. */
79
+ readonly id: number;
80
+ /** Published store message payload. */
81
+ readonly message: StoreMessage<TData, TKey>;
82
+ /** Latest delivery status stored by the broker channel. */
83
+ readonly status: StoreMessageStatus;
84
+ /** Number of delivery attempts made for this message. */
85
+ readonly attempts: number;
86
+ /** Timestamp when the message was first published to the channel. */
87
+ readonly createdAt: number;
88
+ /** Timestamp of the most recent delivery attempt. */
89
+ readonly lastAttemptedAt: number | null;
90
+ /** Timestamp of the most recent successful acknowledgement, if any. */
91
+ readonly acknowledgedAt: number | null;
92
+ /** Last recorded delivery error, or `null` when the latest attempt succeeded. */
93
+ readonly error: string | null;
94
+ }
95
+ /** Minimal string-based storage adapter used by storage-backed message channels. */
96
+ interface StoreMessageChannelStorage {
97
+ getItem(key: string): string | null;
98
+ setItem(key: string, value: string): void;
99
+ removeItem(key: string): void;
100
+ }
101
+ /**
102
+ * Pluggable persistence channel used by the broker to store published messages.
103
+ *
104
+ * The default channel is in-memory, but storage-backed or custom providers can be
105
+ * supplied to keep messages available across refreshes or offline sessions.
106
+ */
107
+ interface StoreMessageChannel<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
108
+ /** Stores a newly published message and allocates its stable message id. */
109
+ publish(message: StoreMessage<TData, TKey>): StoreMessageRecord<TData, TKey>;
110
+ /** Reads a single persisted message record by id. */
111
+ getMessage(id: number): StoreMessageRecord<TData, TKey> | undefined;
112
+ /** Reads every persisted message record from the channel. */
113
+ getMessages(): readonly StoreMessageRecord<TData, TKey>[];
114
+ /** Persists a new state for an existing message record. */
115
+ saveMessage(entry: StoreMessageRecord<TData, TKey>): void;
116
+ }
117
+ /** Optional store configuration used to override the default in-memory message channel. */
118
+ interface StoreMessageChannelOptions<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
119
+ readonly channel?: StoreMessageChannel<TData, TKey>;
120
+ }
121
+ /** Options for {@link createCompositeStoreMessageChannel}. The first channel is the primary (reads + id allocation); replicas receive all writes. */
122
+ interface CompositeStoreMessageChannelOptions<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
123
+ readonly channels: readonly StoreMessageChannel<TData, TKey>[];
124
+ }
125
+ /** Options for {@link createStorageStoreMessageChannel}. Provide a custom storage adapter, key, and optional serialize/deserialize hooks. */
126
+ interface StorageStoreMessageChannelOptions<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
127
+ readonly storage: StoreMessageChannelStorage;
128
+ readonly storageKey: string;
129
+ readonly serialize?: (state: PersistedStoreMessageChannelState<TData, TKey>) => string;
130
+ readonly deserialize?: (value: string) => PersistedStoreMessageChannelState<TData, TKey>;
131
+ }
132
+ /** Options for {@link createLocalStorageStoreMessageChannel} and {@link createSessionStorageStoreMessageChannel}. Storage defaults to the browser global. */
133
+ interface BrowserStorageStoreMessageChannelOptions<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> extends Omit<StorageStoreMessageChannelOptions<TData, TKey>, "storage"> {
134
+ readonly storage?: StoreMessageChannelStorage;
135
+ }
136
+ interface PersistedStoreMessageChannelState<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
137
+ readonly nextId: number;
138
+ readonly messages: readonly StoreMessageRecord<TData, TKey>[];
139
+ }
140
+ /**
141
+ * Creates an in-memory message channel. Messages are stored in a JavaScript array
142
+ * and lost on page refresh. This is the default channel when no `channel` option is provided.
143
+ */
144
+ declare function createInMemoryStoreMessageChannel<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>>(): StoreMessageChannel<TData, TKey>;
145
+ /**
146
+ * Creates a message channel backed by a custom storage adapter.
147
+ * Messages are serialized and persisted via the provided `storage` object.
148
+ * When the storage quota is exceeded, the oldest messages are evicted automatically.
149
+ *
150
+ * @param options - Storage adapter, key, and optional serialize/deserialize hooks.
151
+ */
152
+ declare function createStorageStoreMessageChannel<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>>(options: StorageStoreMessageChannelOptions<TData, TKey>): StoreMessageChannel<TData, TKey>;
153
+ /**
154
+ * Creates a message channel backed by `localStorage`.
155
+ * Messages survive page refreshes and browser restarts (same-origin only).
156
+ *
157
+ * @param options - Storage key and optional serialize/deserialize hooks.
158
+ */
159
+ declare function createLocalStorageStoreMessageChannel<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>>(options: BrowserStorageStoreMessageChannelOptions<TData, TKey>): StoreMessageChannel<TData, TKey>;
160
+ /**
161
+ * Creates a message channel backed by `sessionStorage`.
162
+ * Messages survive page refreshes but are lost when the browser tab closes.
163
+ *
164
+ * @param options - Storage key and optional serialize/deserialize hooks.
165
+ */
166
+ declare function createSessionStorageStoreMessageChannel<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>>(options: BrowserStorageStoreMessageChannelOptions<TData, TKey>): StoreMessageChannel<TData, TKey>;
167
+ /**
168
+ * Creates a composite message channel that fans out writes to multiple channels.
169
+ * The first channel is the primary (handles reads and id allocation); all channels receive writes.
170
+ *
171
+ * @param options - Array of channels. Must contain at least one.
172
+ */
173
+ declare function createCompositeStoreMessageChannel<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>>(options: CompositeStoreMessageChannelOptions<TData, TKey>): StoreMessageChannel<TData, TKey>;
174
+
175
+ /**
176
+ * Constraint type ensuring every key in a store data map holds a {@link ResourceState}.
177
+ */
4
178
  type StoreDataShape<TData> = {
5
179
  [K in keyof TData]: ResourceState<unknown>;
6
180
  };
181
+ /**
182
+ * Extracts the string-typed keys from a store data map.
183
+ */
7
184
  type StoreKey<TData> = keyof TData & string;
185
+ /** Extracts the value stored inside a store slot's `ResourceState<T>`. */
186
+ type StoreResourceValue<TData extends StoreDataShape<TData>, K extends StoreKey<TData>> = TData[K] extends ResourceState<infer TValue> ? TValue : never;
187
+ /** Narrows store keys whose `data` payload is a keyed resource map. */
188
+ type KeyedStoreKey<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> = {
189
+ [K in TKey]: StoreResourceValue<TData, K> extends KeyedResourceData<infer _TResourceKey, infer _TValue> ? K : never;
190
+ }[TKey];
191
+ /** Extracts the resource key type for a keyed store slot. */
192
+ type KeyedResourceEntryKey<TData extends StoreDataShape<TData>, K extends KeyedStoreKey<TData>> = StoreResourceValue<TData, K> extends KeyedResourceData<infer TResourceKey, unknown> ? TResourceKey : never;
193
+ /** Extracts the entity value type for a keyed store slot. */
194
+ type KeyedResourceEntryValue<TData extends StoreDataShape<TData>, K extends KeyedStoreKey<TData>> = StoreResourceValue<TData, K> extends KeyedResourceData<KeyedResourceKey, infer TValue> ? TValue : never;
8
195
  /**
9
196
  * Phantom-typed marker for a store resource slot.
10
197
  * Carries type information at compile time with zero runtime cost.
@@ -38,38 +225,349 @@ type InferData<TConfig extends StoreConfig> = {
38
225
  type ConfigToData<TConfig extends object> = {
39
226
  [K in keyof TConfig & string]: ResourceState<TConfig[K]>;
40
227
  };
228
+ /**
229
+ * Optional runtime configuration for a store instance.
230
+ *
231
+ * The default channel is in-memory. Supply `channel` to persist broker messages
232
+ * elsewhere, such as local storage, session storage, a composite channel, or a
233
+ * custom provider.
234
+ */
235
+ interface StoreOptions<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> extends StoreMessageChannelOptions<TData, TKey> {
236
+ }
41
237
  /**
42
238
  * Shared store interface implemented by both BaseStore and LazyStore.
239
+ *
240
+ * All store instances expose these methods regardless of how they were created
241
+ * (interface-based, fluent, or enum-constrained builder).
43
242
  */
44
243
  interface IStore<TData extends StoreDataShape<TData>> {
244
+ /** Returns a read-only `Signal` for the given slot. */
45
245
  get<K extends StoreKey<TData>>(key: K): Signal<TData[K]>;
246
+ /** Merges a partial state into the given slot (immutable spread). */
46
247
  update<K extends StoreKey<TData>>(key: K, newState: Partial<TData[K]>): void;
248
+ /** Resets a slot to its initial idle state (`{ data: undefined, isLoading: false, … }`). */
47
249
  clear<K extends StoreKey<TData>>(key: K): void;
250
+ /** Resets every slot in this store. */
48
251
  clearAll(): void;
252
+ /** Marks a slot as loading: sets `isLoading: true` and clears `status`/`errors`. */
49
253
  startLoading<K extends StoreKey<TData>>(key: K): void;
254
+ /** Marks a slot as no longer loading: sets `isLoading: false`. */
50
255
  stopLoading<K extends StoreKey<TData>>(key: K): void;
256
+ /**
257
+ * Re-executes previously published channel message id(s).
258
+ *
259
+ * Unlike `travelTo(...)`, replay goes back through the broker/consumer path,
260
+ * so it can mutate the store again, truncate future history after time
261
+ * travel, and record new acknowledged history entries.
262
+ */
263
+ replay: StoreHistory<TData>["replay"];
264
+ /**
265
+ * Restores the store to a previously recorded history index.
266
+ *
267
+ * This navigates snapshots only and does not re-run any message.
268
+ */
269
+ travelTo: StoreHistory<TData>["travelTo"];
270
+ /** Moves one step backward in the recorded snapshot history when possible. */
271
+ undo: StoreHistory<TData>["undo"];
272
+ /** Moves one step forward in the recorded snapshot history when possible. */
273
+ redo: StoreHistory<TData>["redo"];
274
+ /**
275
+ * Returns a defensive copy of the recorded history.
276
+ *
277
+ * The first entry is always the initial snapshot captured when the store was created.
278
+ */
279
+ getHistory: StoreHistory<TData>["getHistory"];
280
+ /**
281
+ * Returns persisted broker message records from the configured channel.
282
+ *
283
+ * Use `getMessages(key)` to inspect only the messages that affected one store key.
284
+ */
285
+ getMessages: StoreHistory<TData>["getMessages"];
286
+ /**
287
+ * Returns messages that failed broker acknowledgement.
288
+ *
289
+ * These entries can be inspected for diagnostics and retried later.
290
+ */
291
+ getDeadLetters: StoreHistory<TData>["getDeadLetters"];
292
+ /** Replays a single dead-letter message by dead-letter id. */
293
+ replayDeadLetter: StoreHistory<TData>["replayDeadLetter"];
294
+ /** Attempts to replay all current dead-letter messages once. */
295
+ replayDeadLetters: StoreHistory<TData>["replayDeadLetters"];
296
+ /** Returns the currently restored snapshot index used by `travelTo`, `undo`, and `redo`. */
297
+ getCurrentIndex: StoreHistory<TData>["getCurrentIndex"];
298
+ /** Merges a single entity into a keyed slot and sets its status to `'Success'`. */
51
299
  updateKeyedOne<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey, entity: unknown): void;
300
+ /** Removes a single entity (and its loading/status/errors) from a keyed slot. */
52
301
  clearKeyedOne<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey): void;
302
+ /** Marks a single entity within a keyed slot as loading. */
53
303
  startKeyedLoading<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey): void;
304
+ /**
305
+ * Registers a callback invoked whenever the given slot is updated.
306
+ * @returns A cleanup function that removes the listener.
307
+ */
54
308
  onUpdate<K extends StoreKey<TData>>(key: K, callback: (state: TData[K], previousState: TData[K]) => void): () => void;
55
309
  }
56
310
 
57
- declare abstract class BaseStore<TEnum extends Record<string, string | number>, TData extends {
311
+ /**
312
+ * Creates a deep clone of the given value.
313
+ *
314
+ * **Warning:** Class instances with constructor logic, private fields, or
315
+ * non-enumerable state will not clone correctly. The clone preserves the
316
+ * prototype chain via `Object.create(Object.getPrototypeOf(...))` but does
317
+ * **not** invoke the constructor, so any side-effects or hidden state set
318
+ * during construction will be missing from the clone.
319
+ */
320
+ declare function cloneValue<T>(value: T): T;
321
+ /**
322
+ * Creates a minimal patch object that, when spread onto `currentState`, produces `snapshotState`.
323
+ * Properties present in the snapshot are cloned; properties absent from the snapshot are set to `undefined`.
324
+ *
325
+ * @param currentState - The current slot state.
326
+ * @param snapshotState - The target snapshot state to restore.
327
+ * @returns A partial state object suitable for `Signal.update()`.
328
+ */
329
+ declare function createSnapshotRestorePatch<TState extends ResourceState<unknown>>(currentState: TState, snapshotState: TState): Partial<TState>;
330
+
331
+ /**
332
+ * Single acknowledged point in store history.
333
+ *
334
+ * Entry `0` is always the initial snapshot captured when the history driver is
335
+ * created, so its `id`, `message`, and `acknowledgedAt` are `null`.
336
+ */
337
+ interface StoreHistoryEntry<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
338
+ /** Stable message id used by `replay(...)`; `null` for the initial snapshot entry. */
339
+ readonly id: number | null;
340
+ /** Snapshot position used by `travelTo(index)`, `undo()`, and `redo()`. */
341
+ readonly index: number;
342
+ /** Acknowledged message that produced this snapshot; `null` for the initial entry. */
343
+ readonly message: StoreMessage<TData, TKey> | null;
344
+ /** Full store snapshot captured immediately after the message was acknowledged. */
345
+ readonly snapshot: StoreSnapshot<TData, TKey>;
346
+ /** Acknowledgement timestamp for the message; `null` for the initial snapshot entry. */
347
+ readonly acknowledgedAt: number | null;
348
+ }
349
+ /**
350
+ * Failed message tracked by the internal broker when the store consumer does not
351
+ * acknowledge a published message.
352
+ */
353
+ interface StoreDeadLetterEntry<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
354
+ /** Stable dead-letter id used by `replayDeadLetter(id)`. */
355
+ readonly id: number;
356
+ /** Original message that failed acknowledgement. */
357
+ readonly message: StoreMessage<TData, TKey>;
358
+ /** Number of failed acknowledgement attempts for this dead letter. */
359
+ readonly attempts: number;
360
+ /** Last acknowledgement error captured for this dead letter. */
361
+ readonly error: string;
362
+ /** Timestamp of the most recent failure. */
363
+ readonly failedAt: number;
364
+ }
365
+ /**
366
+ * Public history and recovery API exposed on every store instance.
367
+ *
368
+ * `travelTo(...)` navigates snapshots by history index, while `replay(...)`
369
+ * re-executes previously published channel messages by their stable message ids.
370
+ */
371
+ interface StoreHistory<TData extends StoreDataShape<TData>, TKey extends StoreKey<TData> = StoreKey<TData>> {
372
+ /**
373
+ * Re-executes one previously published message by id.
374
+ *
375
+ * The message does not need to have been acknowledged before. Replay resolves it
376
+ * from the configured message channel, sends it back through the broker/consumer
377
+ * flow, and may create a fresh acknowledged history entry if the replay succeeds.
378
+ *
379
+ * @throws {Error} When the id does not point to a persisted channel message.
380
+ * @returns Number of successfully acknowledged replayed messages.
381
+ */
382
+ replay(id: number): number;
383
+ /**
384
+ * Re-executes multiple previously published messages in the provided order.
385
+ *
386
+ * Every id must resolve to a persisted channel message. Replay stops with an error
387
+ * if any supplied id is invalid.
388
+ *
389
+ * @throws {Error} When any id does not point to a persisted channel message.
390
+ * @returns Number of successfully acknowledged replayed messages.
391
+ */
392
+ replay(ids: readonly number[]): number;
393
+ /**
394
+ * Restores the store to the snapshot recorded at a specific history index.
395
+ *
396
+ * This is snapshot navigation only. It does not publish or acknowledge any
397
+ * message and does not create a new history entry.
398
+ *
399
+ * @throws {Error} When the index is outside the recorded history range.
400
+ */
401
+ travelTo(index: number): void;
402
+ /**
403
+ * Moves to the previous recorded snapshot.
404
+ *
405
+ * Equivalent to `travelTo(getCurrentIndex() - 1)` when possible.
406
+ *
407
+ * @returns `true` when the pointer moved, otherwise `false` at the initial snapshot.
408
+ */
409
+ undo(): boolean;
410
+ /**
411
+ * Moves to the next recorded snapshot when history exists ahead of the current pointer.
412
+ *
413
+ * Equivalent to `travelTo(getCurrentIndex() + 1)` when possible.
414
+ *
415
+ * @returns `true` when the pointer moved, otherwise `false` at the latest snapshot.
416
+ */
417
+ redo(): boolean;
418
+ /** Returns a defensive copy of every recorded history entry, including the initial snapshot entry. */
419
+ getHistory(): readonly StoreHistoryEntry<TData, TKey>[];
420
+ /**
421
+ * Returns the history entries that affected a specific store key.
422
+ *
423
+ * The initial snapshot entry is always included as the first item. Messages such
424
+ * as `clearAll` that affect every key are included in every filtered view.
425
+ */
426
+ getHistory<K extends TKey>(key: K): readonly StoreHistoryEntry<TData, K>[];
427
+ /** Returns a defensive copy of the current dead-letter collection. */
428
+ getDeadLetters(): readonly StoreDeadLetterEntry<TData, TKey>[];
429
+ /** Returns every message currently stored in the configured channel. */
430
+ getMessages(): readonly StoreMessageRecord<TData, TKey>[];
431
+ /** Returns channel messages that affected a specific store key. */
432
+ getMessages<K extends TKey>(key: K): readonly StoreMessageRecord<TData, K>[];
433
+ /**
434
+ * Republishes a single dead-letter message by dead-letter id.
435
+ *
436
+ * On success the dead letter is removed and a new acknowledged history entry is recorded.
437
+ *
438
+ * @returns `true` when the dead letter was acknowledged on replay, otherwise `false`.
439
+ */
440
+ replayDeadLetter(id: number): boolean;
441
+ /**
442
+ * Attempts to republish every current dead letter once.
443
+ *
444
+ * Successfully acknowledged dead letters are removed. Failures remain in the
445
+ * dead-letter collection with incremented attempt counts.
446
+ *
447
+ * @returns Number of dead letters successfully acknowledged during the replay attempt.
448
+ */
449
+ replayDeadLetters(): number;
450
+ /** Returns the currently restored history index used by snapshot navigation. */
451
+ getCurrentIndex(): number;
452
+ }
453
+
454
+ /**
455
+ * Abstract base class for flurryx stores.
456
+ *
457
+ * Backed by Angular `signal()` per slot, providing read-only `Signal` access
458
+ * and immutable updates. All writes go through the store's own methods to
459
+ * enforce single-owner encapsulation.
460
+ *
461
+ * Use the {@link Store} builder to create instances — do not subclass directly.
462
+ *
463
+ * @template TEnum - Record mapping slot names to their string/number keys.
464
+ * @template TData - Record mapping slot names to `ResourceState<T>` types.
465
+ */
466
+ declare abstract class BaseStore<TEnum extends Record<string, string | number>, TData extends StoreDataShape<TData> & {
58
467
  [K in keyof TEnum]: ResourceState<unknown>;
59
468
  }> implements IStore<TData> {
60
469
  protected readonly storeEnum: TEnum;
61
470
  private readonly signalsState;
62
- protected constructor(storeEnum: TEnum);
63
- get<K extends keyof TData>(key: K): Signal<TData[K]>;
64
- onUpdate<K extends keyof TData>(key: K, callback: (state: TData[K], previousState: TData[K]) => void): () => void;
65
- update<K extends keyof TData>(key: K, newState: Partial<TData[K]>): void;
471
+ private readonly storeKeys;
472
+ private readonly history;
473
+ /** @inheritDoc */
474
+ readonly travelTo: (index: number) => void;
475
+ /** @inheritDoc */
476
+ readonly undo: () => boolean;
477
+ /** @inheritDoc */
478
+ readonly redo: () => boolean;
479
+ /** @inheritDoc */
480
+ readonly getDeadLetters: () => readonly StoreDeadLetterEntry<TData, StoreKey<TData>>[];
481
+ /** @inheritDoc */
482
+ readonly replayDeadLetter: (id: number) => boolean;
483
+ /** @inheritDoc */
484
+ readonly replayDeadLetters: () => number;
485
+ /** @inheritDoc */
486
+ readonly getCurrentIndex: () => number;
487
+ /** @inheritDoc */
488
+ replay(id: number): number;
489
+ /** @inheritDoc */
490
+ replay(ids: readonly number[]): number;
491
+ /** @inheritDoc */
492
+ getHistory(): readonly StoreHistoryEntry<TData>[];
493
+ /** @inheritDoc */
494
+ getHistory<K extends StoreKey<TData>>(key: K): readonly StoreHistoryEntry<TData, K>[];
495
+ /** @inheritDoc */
496
+ getMessages(): readonly StoreMessageRecord<TData>[];
497
+ /** @inheritDoc */
498
+ getMessages<K extends StoreKey<TData>>(key: K): readonly StoreMessageRecord<TData, K>[];
499
+ protected constructor(storeEnum: TEnum, options?: StoreOptions<TData>);
500
+ /**
501
+ * Returns a **read-only** `Signal` for the given store slot.
502
+ *
503
+ * @param key - The slot name to read.
504
+ * @returns A `Signal` wrapping the slot's current {@link ResourceState}.
505
+ */
506
+ get<K extends StoreKey<TData>>(key: K): Signal<TData[K]>;
507
+ /**
508
+ * Registers a callback fired after every `update` or `clear` on the given slot.
509
+ *
510
+ * @param key - The slot to watch.
511
+ * @param callback - Receives the new state and the previous state.
512
+ * @returns A cleanup function that removes the listener when called.
513
+ */
514
+ onUpdate<K extends StoreKey<TData>>(key: K, callback: (state: TData[K], previousState: TData[K]) => void): () => void;
515
+ /**
516
+ * Partially updates a slot by merging `newState` into the current value (immutable spread).
517
+ *
518
+ * @param key - The slot to update.
519
+ * @param newState - Partial state to merge (e.g. `{ data: newData, status: 'Success' }`).
520
+ */
521
+ update<K extends StoreKey<TData>>(key: K, newState: Partial<TData[K]>): void;
522
+ /** Resets every slot in this store to its initial idle state. */
66
523
  clearAll(): void;
67
- clear<K extends keyof TData>(key: K): void;
68
- startLoading<K extends keyof TData>(key: K): void;
69
- stopLoading<K extends keyof TData>(key: K): void;
70
- updateKeyedOne<K extends keyof TData>(key: K, resourceKey: KeyedResourceKey, entity: unknown): void;
71
- clearKeyedOne<K extends keyof TData>(key: K, resourceKey: KeyedResourceKey): void;
72
- startKeyedLoading<K extends keyof TData>(key: K, resourceKey: KeyedResourceKey): void;
524
+ /**
525
+ * Resets a single slot to `{ data: undefined, isLoading: false, status: undefined, errors: undefined }`.
526
+ *
527
+ * @param key - The slot to clear.
528
+ */
529
+ clear<K extends StoreKey<TData>>(key: K): void;
530
+ /**
531
+ * Marks a slot as loading: sets `isLoading: true` and clears `status` and `errors`.
532
+ *
533
+ * @param key - The slot to mark as loading.
534
+ */
535
+ startLoading<K extends StoreKey<TData>>(key: K): void;
536
+ /**
537
+ * Marks a slot as no longer loading: sets `isLoading: false`.
538
+ * Does **not** clear `status` or `errors`.
539
+ *
540
+ * @param key - The slot to stop loading.
541
+ */
542
+ stopLoading<K extends StoreKey<TData>>(key: K): void;
543
+ /**
544
+ * Merges a single entity into a {@link KeyedResourceData} slot.
545
+ * Sets its status to `'Success'` and clears per-key errors.
546
+ * The top-level `isLoading` is recalculated based on remaining loading keys.
547
+ *
548
+ * @param key - The keyed slot name.
549
+ * @param resourceKey - The entity identifier (e.g. `'inv-123'`).
550
+ * @param entity - The entity value to store.
551
+ */
552
+ updateKeyedOne<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey, entity: unknown): void;
553
+ /**
554
+ * Removes a single entity from a {@link KeyedResourceData} slot,
555
+ * including its loading flag, status, and errors.
556
+ * Recalculates the top-level `isLoading` from the remaining keys.
557
+ *
558
+ * @param key - The keyed slot name.
559
+ * @param resourceKey - The entity identifier to remove.
560
+ */
561
+ clearKeyedOne<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey): void;
562
+ /**
563
+ * Marks a single entity within a keyed slot as loading.
564
+ * Clears its status and errors. If the slot data is not yet a {@link KeyedResourceData},
565
+ * falls back to `startLoading(key)`.
566
+ *
567
+ * @param key - The keyed slot name.
568
+ * @param resourceKey - The entity identifier to mark as loading.
569
+ */
570
+ startKeyedLoading<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey): void;
73
571
  private notifyUpdateHooks;
74
572
  private initializeState;
75
573
  }
@@ -82,17 +580,54 @@ declare abstract class BaseStore<TEnum extends Record<string, string | number>,
82
580
  declare class LazyStore<TData extends StoreDataShape<TData>> implements IStore<TData> {
83
581
  private readonly signals;
84
582
  private readonly hooks;
85
- constructor();
583
+ private readonly history;
584
+ /** @inheritDoc */
585
+ readonly travelTo: (index: number) => void;
586
+ /** @inheritDoc */
587
+ readonly undo: () => boolean;
588
+ /** @inheritDoc */
589
+ readonly redo: () => boolean;
590
+ /** @inheritDoc */
591
+ getMessages(): readonly StoreMessageRecord<TData>[];
592
+ /** @inheritDoc */
593
+ getMessages<K extends StoreKey<TData>>(key: K): readonly StoreMessageRecord<TData, K>[];
594
+ /** @inheritDoc */
595
+ readonly getDeadLetters: () => readonly StoreDeadLetterEntry<TData, StoreKey<TData>>[];
596
+ /** @inheritDoc */
597
+ readonly replayDeadLetter: (id: number) => boolean;
598
+ /** @inheritDoc */
599
+ readonly replayDeadLetters: () => number;
600
+ /** @inheritDoc */
601
+ readonly getCurrentIndex: () => number;
602
+ /** @inheritDoc */
603
+ replay(id: number): number;
604
+ /** @inheritDoc */
605
+ replay(ids: readonly number[]): number;
606
+ /** @inheritDoc */
607
+ getHistory(): readonly StoreHistoryEntry<TData>[];
608
+ /** @inheritDoc */
609
+ getHistory<K extends StoreKey<TData>>(key: K): readonly StoreHistoryEntry<TData, K>[];
610
+ constructor(options?: StoreOptions<TData>);
86
611
  private getOrCreate;
612
+ /** @inheritDoc */
87
613
  get<K extends StoreKey<TData>>(key: K): Signal<TData[K]>;
614
+ /** @inheritDoc */
88
615
  update<K extends StoreKey<TData>>(key: K, newState: Partial<TData[K]>): void;
616
+ /** @inheritDoc */
89
617
  clear<K extends StoreKey<TData>>(key: K): void;
618
+ /** @inheritDoc */
90
619
  clearAll(): void;
620
+ /** @inheritDoc */
91
621
  startLoading<K extends StoreKey<TData>>(key: K): void;
622
+ /** @inheritDoc */
92
623
  stopLoading<K extends StoreKey<TData>>(key: K): void;
624
+ /** @inheritDoc */
93
625
  updateKeyedOne<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey, entity: unknown): void;
626
+ /** @inheritDoc */
94
627
  clearKeyedOne<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey): void;
628
+ /** @inheritDoc */
95
629
  startKeyedLoading<K extends StoreKey<TData>>(key: K, resourceKey: KeyedResourceKey): void;
630
+ /** @inheritDoc */
96
631
  onUpdate<K extends StoreKey<TData>>(key: K, callback: (state: TData[K], previousState: TData[K]) => void): () => void;
97
632
  private notifyHooks;
98
633
  }
@@ -101,25 +636,70 @@ declare class LazyStore<TData extends StoreDataShape<TData>> implements IStore<T
101
636
  * Intermediate builder step after .resource('key') — awaits .as<T>().
102
637
  */
103
638
  interface AsStep<TAccum extends StoreConfig, TKey extends string> {
639
+ /**
640
+ * Assign the resource value type for the previously declared key.
641
+ *
642
+ * Returns the main fluent builder so you can define more resources, configure
643
+ * mirrors, or call `.build()`.
644
+ *
645
+ * @example
646
+ * ```ts
647
+ * const CustomersStore = Store
648
+ * .resource('CUSTOMERS').as<Customer[]>()
649
+ * .build();
650
+ * ```
651
+ */
104
652
  as<T>(): StoreBuilder<TAccum & Record<TKey, ResourceDef<T>>>;
105
653
  }
106
654
  /**
107
655
  * Fluent builder for creating stores.
108
- * Accumulates resource definitions then produces an InjectionToken on .build().
656
+ * Accumulates resource definitions then produces an `InjectionToken` on `.build()`.
109
657
  */
110
658
  interface StoreBuilder<TAccum extends StoreConfig> {
659
+ /** Define a new resource slot. Chain `.as<T>()` to set its type. */
111
660
  resource<TKey extends string>(key: TKey): AsStep<TAccum, TKey>;
661
+ /**
662
+ * Mirror a slot from another store. When the source updates, the target is kept in sync.
663
+ *
664
+ * @param source - The source store's `InjectionToken`.
665
+ * @param sourceKey - The key to watch on the source store.
666
+ * @param targetKey - The key on this store to write to. Defaults to `sourceKey`.
667
+ */
112
668
  mirror<TSourceData extends StoreDataShape<TSourceData>>(source: InjectionToken<IStore<TSourceData>>, sourceKey: StoreKey<TSourceData>, targetKey?: StoreKey<TAccum>): StoreBuilder<TAccum>;
669
+ /**
670
+ * Mirror one slot to another **within the same store**.
671
+ * Source and target keys must be different.
672
+ *
673
+ * @param sourceKey - The slot to read from.
674
+ * @param targetKey - The slot to write to.
675
+ */
113
676
  mirrorSelf(sourceKey: StoreKey<TAccum>, targetKey: StoreKey<TAccum>): StoreBuilder<TAccum>;
677
+ /**
678
+ * Accumulate single-entity fetches from a source store into a `KeyedResourceData` slot.
679
+ *
680
+ * @param source - The source store's `InjectionToken`.
681
+ * @param sourceKey - The single-entity key on the source store.
682
+ * @param options - Must include `extractId` to derive the entity's key from its data.
683
+ * @param targetKey - The keyed slot on this store. Defaults to `sourceKey`.
684
+ */
114
685
  mirrorKeyed<TSourceData extends StoreDataShape<TSourceData>, TEntity>(source: InjectionToken<IStore<TSourceData>>, sourceKey: StoreKey<TSourceData>, options: {
115
686
  extractId: (data: TEntity | undefined) => KeyedResourceKey | undefined;
116
687
  }, targetKey?: StoreKey<TAccum>): StoreBuilder<TAccum>;
117
- build(): InjectionToken<BaseStore<InferEnum<TAccum>, InferData<TAccum>>>;
688
+ /**
689
+ * Finalize the builder and create an `InjectionToken` (`providedIn: 'root'`).
690
+ * All mirrors are wired up automatically when Angular creates the store.
691
+ */
692
+ build(options?: StoreOptions<InferData<TAccum>>): InjectionToken<BaseStore<InferEnum<TAccum>, InferData<TAccum>>>;
118
693
  }
119
694
  /** Keys from the enum that have NOT yet been defined. */
120
695
  type Remaining<TEnum extends Record<string, string>, TAccum extends StoreConfig> = Exclude<keyof TEnum & string, keyof TAccum>;
121
696
  /** Intermediate .as<T>() step for the constrained builder. */
122
697
  interface ConstrainedAsStep<TEnum extends Record<string, string>, TAccum extends StoreConfig, TKey extends string> {
698
+ /**
699
+ * Assign the resource value type for the selected enum key.
700
+ *
701
+ * Returns the constrained builder for the remaining enum keys.
702
+ */
123
703
  as<T>(): ConstrainedBuilder<TEnum, TAccum & Record<TKey, ResourceDef<T>>>;
124
704
  }
125
705
  /**
@@ -127,22 +707,94 @@ interface ConstrainedAsStep<TEnum extends Record<string, string>, TAccum extends
127
707
  * defined yet. `.build()` is only available when all keys are accounted for.
128
708
  */
129
709
  type ConstrainedBuilder<TEnum extends Record<string, string>, TAccum extends StoreConfig> = [Remaining<TEnum, TAccum>] extends [never] ? {
710
+ /**
711
+ * Mirror a slot from another store. When the source updates, the target is kept in sync.
712
+ *
713
+ * @param source - The source store's `InjectionToken`.
714
+ * @param sourceKey - The key to watch on the source store.
715
+ * @param targetKey - The key on this store to write to. Defaults to `sourceKey`.
716
+ */
130
717
  mirror<TSourceData extends StoreDataShape<TSourceData>>(source: InjectionToken<IStore<TSourceData>>, sourceKey: StoreKey<TSourceData>, targetKey?: StoreKey<TAccum>): ConstrainedBuilder<TEnum, TAccum>;
718
+ /**
719
+ * Mirror one slot to another within the same store.
720
+ * Source and target keys must be different.
721
+ *
722
+ * @param sourceKey - The slot to read from.
723
+ * @param targetKey - The slot to write to.
724
+ */
131
725
  mirrorSelf(sourceKey: StoreKey<TAccum>, targetKey: StoreKey<TAccum>): ConstrainedBuilder<TEnum, TAccum>;
726
+ /**
727
+ * Accumulate single-entity fetches from a source store into a keyed slot.
728
+ *
729
+ * @param source - The source store's `InjectionToken`.
730
+ * @param sourceKey - The single-entity key on the source store.
731
+ * @param options - Must include `extractId` to derive the entity's key from its data.
732
+ * @param targetKey - The keyed slot on this store. Defaults to `sourceKey`.
733
+ */
132
734
  mirrorKeyed<TSourceData extends StoreDataShape<TSourceData>, TEntity>(source: InjectionToken<IStore<TSourceData>>, sourceKey: StoreKey<TSourceData>, options: {
133
735
  extractId: (data: TEntity | undefined) => KeyedResourceKey | undefined;
134
736
  }, targetKey?: StoreKey<TAccum>): ConstrainedBuilder<TEnum, TAccum>;
135
- build(): InjectionToken<BaseStore<InferEnum<TAccum>, InferData<TAccum>>>;
737
+ /**
738
+ * Finalize the builder and create an `InjectionToken` (`providedIn: 'root'`).
739
+ * Available only after all enum keys have been defined.
740
+ */
741
+ build(options?: StoreOptions<InferData<TAccum>>): InjectionToken<BaseStore<InferEnum<TAccum>, InferData<TAccum>>>;
136
742
  } : {
743
+ /** Define the next resource slot from the remaining enum keys. */
137
744
  resource<TKey extends Remaining<TEnum, TAccum>>(key: TKey): ConstrainedAsStep<TEnum, TAccum, TKey>;
138
745
  };
746
+ /**
747
+ * Interface-based builder for `Store.for<Config>()`.
748
+ *
749
+ * Uses a config interface for compile-time shape only, so no runtime enum is required.
750
+ */
139
751
  interface InterfaceBuilder<TConfig extends object> {
752
+ /**
753
+ * Mirror a slot from another store. When the source updates, the target is kept in sync.
754
+ *
755
+ * @param source - The source store's `InjectionToken`.
756
+ * @param sourceKey - The key to watch on the source store.
757
+ * @param targetKey - The key on this store to write to. Defaults to `sourceKey`.
758
+ */
140
759
  mirror<TSourceData extends StoreDataShape<TSourceData>>(source: InjectionToken<IStore<TSourceData>>, sourceKey: StoreKey<TSourceData>, targetKey?: StoreKey<ConfigToData<TConfig>>): InterfaceBuilder<TConfig>;
760
+ /**
761
+ * Mirror one slot to another within the same store.
762
+ * Source and target keys must be different.
763
+ *
764
+ * @param sourceKey - The slot to read from.
765
+ * @param targetKey - The slot to write to.
766
+ */
141
767
  mirrorSelf(sourceKey: StoreKey<ConfigToData<TConfig>>, targetKey: StoreKey<ConfigToData<TConfig>>): InterfaceBuilder<TConfig>;
768
+ /**
769
+ * Accumulate single-entity fetches from a source store into a keyed slot.
770
+ *
771
+ * @param source - The source store's `InjectionToken`.
772
+ * @param sourceKey - The single-entity key on the source store.
773
+ * @param options - Must include `extractId` to derive the entity's key from its data.
774
+ * @param targetKey - The keyed slot on this store. Defaults to `sourceKey`.
775
+ */
142
776
  mirrorKeyed<TSourceData extends StoreDataShape<TSourceData>, TEntity>(source: InjectionToken<IStore<TSourceData>>, sourceKey: StoreKey<TSourceData>, options: {
143
777
  extractId: (data: TEntity | undefined) => KeyedResourceKey | undefined;
144
778
  }, targetKey?: StoreKey<ConfigToData<TConfig>>): InterfaceBuilder<TConfig>;
145
- build(): InjectionToken<IStore<ConfigToData<TConfig>>>;
779
+ /**
780
+ * Finalize the interface-based builder and create a store `InjectionToken`.
781
+ *
782
+ * The resulting token is registered with `providedIn: 'root'` and resolves to
783
+ * a `LazyStore` implementing `IStore<ConfigToData<TConfig>>`.
784
+ *
785
+ * @returns An Angular `InjectionToken` for the configured store.
786
+ *
787
+ * @example
788
+ * ```ts
789
+ * interface ChatStoreConfig {
790
+ * SESSIONS: ChatSession[];
791
+ * MESSAGES: ChatMessage[];
792
+ * }
793
+ *
794
+ * export const ChatStore = Store.for<ChatStoreConfig>().build();
795
+ * ```
796
+ */
797
+ build(options?: StoreOptions<ConfigToData<TConfig>>): InjectionToken<IStore<ConfigToData<TConfig>>>;
146
798
  }
147
799
  interface StoreEntry {
148
800
  /**
@@ -151,6 +803,16 @@ interface StoreEntry {
151
803
  * or call .build() when done.
152
804
  */
153
805
  resource<TKey extends string>(key: TKey): {
806
+ /**
807
+ * Set the resource value type and continue the fluent builder chain.
808
+ *
809
+ * @example
810
+ * ```ts
811
+ * const UsersStore = Store
812
+ * .resource('USERS').as<User[]>()
813
+ * .build();
814
+ * ```
815
+ */
154
816
  as<T>(): StoreBuilder<Record<TKey, ResourceDef<T>>>;
155
817
  };
156
818
  /**
@@ -197,9 +859,31 @@ interface StoreEntry {
197
859
  */
198
860
  declare const Store: StoreEntry;
199
861
 
862
+ /**
863
+ * Clears every store instance tracked by flurryx.
864
+ *
865
+ * Calls `clearAll()` on each registered store, resetting all slots to their
866
+ * initial idle state. Useful for logout, tenant switching, or test cleanup.
867
+ *
868
+ * @example
869
+ * ```ts
870
+ * import { clearAllStores } from '@flurryx/store';
871
+ *
872
+ * logout() {
873
+ * clearAllStores();
874
+ * }
875
+ * ```
876
+ */
200
877
  declare function clearAllStores(): void;
201
878
 
879
+ /**
880
+ * Options for {@link mirrorKey}.
881
+ */
202
882
  interface MirrorOptions {
883
+ /**
884
+ * Angular `DestroyRef` (or any object with an `onDestroy` method) for
885
+ * automatic cleanup. When provided, the mirror stops when the ref is destroyed.
886
+ */
203
887
  destroyRef?: {
204
888
  onDestroy: (fn: () => void) => void;
205
889
  };
@@ -217,8 +901,21 @@ interface MirrorOptions {
217
901
  */
218
902
  declare function mirrorKey<TSource extends StoreDataShape<TSource>, TTarget extends StoreDataShape<TTarget>>(source: IStore<TSource>, sourceKey: StoreKey<TSource>, target: IStore<TTarget>, targetKeyOrOptions?: StoreKey<TTarget> | MirrorOptions, options?: MirrorOptions): () => void;
219
903
 
904
+ /**
905
+ * Options for {@link collectKeyed}.
906
+ *
907
+ * @template TEntity - The entity type emitted by the source store.
908
+ */
220
909
  interface CollectKeyedOptions<TEntity> {
910
+ /**
911
+ * Extracts the entity identifier from the source data.
912
+ * Return `undefined` to skip accumulation for that emission.
913
+ */
221
914
  extractId: (data: TEntity | undefined) => KeyedResourceKey | undefined;
915
+ /**
916
+ * Angular `DestroyRef` (or any object with an `onDestroy` method) for
917
+ * automatic cleanup. When provided, collection stops when the ref is destroyed.
918
+ */
222
919
  destroyRef?: {
223
920
  onDestroy: (fn: () => void) => void;
224
921
  };
@@ -241,4 +938,4 @@ interface CollectKeyedOptions<TEntity> {
241
938
  */
242
939
  declare function collectKeyed<TSource extends StoreDataShape<TSource>, TTarget extends StoreDataShape<TTarget>, TEntity = unknown>(source: IStore<TSource>, sourceKey: StoreKey<TSource>, target: IStore<TTarget>, targetKeyOrOptions?: StoreKey<TTarget> | CollectKeyedOptions<TEntity>, options?: CollectKeyedOptions<TEntity>): () => void;
243
940
 
244
- export { BaseStore, type CollectKeyedOptions, type ConfigToData, type IStore, LazyStore, type MirrorOptions, Store, clearAllStores, collectKeyed, mirrorKey };
941
+ export { BaseStore, type BrowserStorageStoreMessageChannelOptions, type ClearAllStoreMessage, type ClearKeyedOneStoreMessage, type ClearStoreMessage, type CollectKeyedOptions, type CompositeStoreMessageChannelOptions, type ConfigToData, type IStore, LazyStore, type MirrorOptions, type StartKeyedLoadingStoreMessage, type StartLoadingStoreMessage, type StopLoadingStoreMessage, type StorageStoreMessageChannelOptions, Store, type StoreDeadLetterEntry, type StoreHistory, type StoreHistoryEntry, type StoreMessage, type StoreMessageChannel, type StoreMessageChannelOptions, type StoreMessageChannelStorage, type StoreMessageRecord, type StoreMessageStatus, type StoreOptions, type StoreSnapshot, type UpdateKeyedOneStoreMessage, type UpdateStoreMessage, clearAllStores, cloneValue, collectKeyed, createCompositeStoreMessageChannel, createInMemoryStoreMessageChannel, createLocalStorageStoreMessageChannel, createSessionStorageStoreMessageChannel, createSnapshotRestorePatch, createStorageStoreMessageChannel, mirrorKey };