@fileverse-dev/dsheet 4.1.27-stabilise-package-1 → 4.1.27-stabilise-package-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,7 +130,10 @@ export interface DsheetProps {
130
130
  * collaboration continue using the in-memory Y.Doc, matching dDoc. Also
131
131
  * called when the first read of the local store does not finish within 15 s
132
132
  * (the editor then continues without local persistence, and
133
- * `rebuildLocalStore()` can recreate the store). */
133
+ * `rebuildLocalStore()` can recreate the store). That timeout error is a
134
+ * `PersistenceSyncTimeoutError` (`localRowsUnread: true`): the store may hold
135
+ * rows the live doc never loaded, so rebuilding it can drop unpublished
136
+ * edits. Check with `isPersistenceSyncTimeoutError` before rebuilding. */
134
137
  onIndexedDbError?: (error: Error) => void;
135
138
  username?: string;
136
139
  portalContent?: string;
@@ -9,7 +9,14 @@
9
9
  export declare const INDEXEDDB_SYNC_TIMEOUT_MS = 15000;
10
10
  /** How long a rebuild waits for a running bootstrap before it abandons it. */
11
11
  export declare const REBUILD_BOOTSTRAP_WAIT_MS = 3000;
12
+ /**
13
+ * The first read of the local store did not finish in time. The store may
14
+ * still hold rows that were never replayed into the live Y.Doc, so deleting
15
+ * and rebuilding it from the doc can drop them. `localRowsUnread` is true so a
16
+ * host can tell this apart from a real read error and skip the rebuild.
17
+ */
12
18
  export declare class PersistenceSyncTimeoutError extends Error {
19
+ readonly localRowsUnread = true;
13
20
  constructor(ms: number);
14
21
  }
15
22
  export declare class PersistenceSupersededError extends Error {
@@ -33,3 +40,4 @@ export declare function waitForPersistenceSynced(persistence: {
33
40
  * waiting for a provider that may never sync.
34
41
  */
35
42
  export declare function waitForBootstrapOrAbandon(bootstrap: Promise<unknown>, ms?: number): Promise<'settled' | 'stuck'>;
43
+ export declare const isPersistenceSyncTimeoutError: (error: unknown) => error is PersistenceSyncTimeoutError;