@fileverse-dev/dsheet 4.0.5-edit-mode-6 → 4.0.5-edit-mode-7

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.
@@ -102,6 +102,7 @@ interface EditorProviderProps {
102
102
  onDataBlockEvent?: (event: DataBlockEvent) => void;
103
103
  smartContracts?: SmartContractConfig;
104
104
  onContentSyncStatusChange?: (status: 'initializing' | 'syncing' | 'synced' | 'error') => void;
105
+ onCollaborationInitializationComplete?: (result: 'ready' | 'error') => void;
105
106
  onIndexedDbError?: (error: Error) => void;
106
107
  }
107
108
  export declare const EditorProvider: React.FC<EditorProviderProps>;
@@ -7,6 +7,11 @@ export declare const isQualifyingCollaborationEdit: (origin: unknown, indexeddbO
7
7
  export declare const shouldRenderBootstrappedWorkbook: (collabEnabled: boolean, sheetCount: number) => boolean;
8
8
  export declare const shouldInitializeDefaultWorkbook: (syncStatus: string | undefined, collabEnabled: boolean, collabStatus: string | undefined) => boolean;
9
9
  export declare const getWorkbookHydrationReason: (status: string | undefined, previousStatus: string | undefined, hasHydratedReadyState: boolean) => "initial" | "reconnect" | null;
10
+ export declare const shouldRehydrateWorkbookOnReady: ({ reason, isOwner, hasUnmergedPeerUpdates, }: {
11
+ reason: "initial" | "reconnect";
12
+ isOwner: boolean;
13
+ hasUnmergedPeerUpdates: boolean;
14
+ }) => boolean;
10
15
  export interface CollaborationConnectionController {
11
16
  onYdocUpdate: (update: Uint8Array, origin: unknown) => void;
12
17
  dispose: () => void;
@@ -111,6 +111,9 @@ export interface DsheetProps {
111
111
  * collab start/resume on 'synced' — starting before local content is fully
112
112
  * synced is what let the RTC layer bind to a stale doc in the past. */
113
113
  onContentSyncStatusChange?: (status: 'initializing' | 'syncing' | 'synced' | 'error') => void;
114
+ /** Fires once the first collaboration sync has been reconciled with the
115
+ * workbook, or when that reconciliation fails. */
116
+ onCollaborationInitializationComplete?: (result: 'ready' | 'error') => void;
114
117
  editorStateRef?: React.MutableRefObject<{
115
118
  refreshIndexedDB: () => Promise<void>;
116
119
  getContentSnapshot: () => DSheetContentSnapshot;