@procedures/store 0.17.3 → 0.18.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.
@@ -1993,6 +1993,20 @@ export class HybridStorage<T> implements CollectionStorage<T> {
1993
1993
  return this.syncToRemote();
1994
1994
  }
1995
1995
 
1996
+ /**
1997
+ * This method resolves when the queue store holds the operations that the queue has at the call
1998
+ * (roadmap CLI-25): the loaded queue, the captured changes and the queued writes. It sends
1999
+ * nothing to the remote. A failed write of the store resolves it too, and the status keeps the
2000
+ * failure. A `TabCoordinator` acknowledges the batches of another tab after it.
2001
+ *
2002
+ * @throws The error of the load, when the storage could not load its queue
2003
+ */
2004
+ async whenQueued(): Promise<void> {
2005
+ await this.loaded;
2006
+ if (this.loadError) throw this.loadError;
2007
+ await this.storeChain;
2008
+ }
2009
+
1996
2010
  /**
1997
2011
  * Force a full sync (both directions).
1998
2012
  */
@@ -48,6 +48,16 @@ export {
48
48
  SyncStateError,
49
49
  } from "./hybrid.js";
50
50
  export type { HybridStorageOptions, HybridMode, LocalCopyStorage } from "./hybrid.js";
51
+ // One leader tab runs the sync, and the other tabs copy its changes (roadmap CLI-25)
52
+ export { TabCoordinator } from "./tab-coordinator.js";
53
+ export type {
54
+ TabAbortSignalLike,
55
+ TabChannelFactory,
56
+ TabChannelLike,
57
+ TabCoordinatorOptions,
58
+ TabLockManagerLike,
59
+ TabRole,
60
+ } from "./tab-coordinator.js";
51
61
  // The push feed of the remote changes (roadmap CLI-21, CLI-15)
52
62
  export { EventsChangeFeed } from "./feed.js";
53
63
  export type {