@univerjs-pro/exchange-client 0.2.9 → 0.2.10

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.
@@ -1,5 +1,6 @@
1
+ import { ILogContext, ISnapshotServerService } from '@univerjs-pro/collaboration';
1
2
  import { IWorkbookData, Nullable } from '@univerjs/core';
2
- import { IDocumentMeta, ISheetBlock, ISnapshot, IWorkbookMeta, IWorksheetMeta } from '@univerjs/protocol';
3
+ import { IDocumentMeta, IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse, ISheetBlock, ISnapshot, IWorkbookMeta, IWorksheetMeta } from '@univerjs/protocol';
3
4
  export interface IWorksheetMetaJson extends Omit<IWorksheetMeta, 'originalMeta'> {
4
5
  originalMeta: string;
5
6
  }
@@ -50,3 +51,22 @@ export declare function transformSheetBlockMetaToString(sheetBlocks: ISheetBlock
50
51
  * @returns
51
52
  */
52
53
  export declare function transformWorkbookDataToSnapshotJson(workbookData: IWorkbookData): Promise<ISnapshotBlockJson>;
54
+ /**
55
+ * The server needs to fully implement all interfaces, but when used by the client, use saveSheetBlock to cache the sheet block locally, and use getSheetBlock to obtain the sheet block.
56
+ */
57
+ export declare class ClientSnapshotServerService implements ISnapshotServerService {
58
+ private _sheetBlockCache;
59
+ /** Load snapshot from a database. */
60
+ getUnitOnRev(context: ILogContext, params: IGetUnitOnRevRequest): Promise<IGetUnitOnRevResponse>;
61
+ /** Load sheet block from a database. */
62
+ getSheetBlock(context: ILogContext, params: IGetSheetBlockRequest): Promise<IGetSheetBlockResponse>;
63
+ /** Fetch missing changeset */
64
+ fetchMissingChangesets(context: ILogContext, params: IFetchMissingChangesetsRequest): Promise<IFetchMissingChangesetsResponse>;
65
+ getResourcesRequest(context: ILogContext, params: IGetResourcesRequest): Promise<IGetResourcesResponse>;
66
+ /** Save snapshot to a database. */
67
+ saveSnapshot(context: ILogContext, params: ISaveSnapshotRequest): Promise<ISaveSnapshotResponse>;
68
+ /** Save sheet block to a database. */
69
+ saveSheetBlock(context: ILogContext, params: ISaveSheetBlockRequest): Promise<ISaveSheetBlockResponse>;
70
+ /** Save changeset to a database. */
71
+ saveChangeset(context: ILogContext, params: ISaveChangesetRequest): Promise<ISaveChangesetResponse>;
72
+ }