import type { ILogContext, ISnapshotServerService } from '@univerjs-pro/collaboration'; import type { Nullable } from '@univerjs/core'; import type { IBoardMeta, ICopyFileMetaResponse, IDocumentMeta, IFetchMissingChangesetsResponse, IGetDeserializedSheetBlockResponse, IGetLatestCsReqIdBySidResponse, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevResponse, IPdfMeta, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotResponse, ISheetBlock, ISlideMeta, ISnapshot, IWorkbookMeta, IWorksheetMeta } from '@univerjs/protocol'; export interface IWorksheetMetaJson extends Omit { originalMeta: string; } export interface IWorkbookMetaJson extends Omit { originalMeta: string; sheets: { [key: string]: Partial; }; } export interface IDocumentMetaJson extends Omit { originalMeta: string; } export interface ISlideMetaJson extends Omit { originalMeta: string; } export interface IBoardMetaJson extends Omit { originalMeta: string; } export interface IPdfMetaJson extends Omit { originalMeta: string; } export interface ISnapshotJson extends Omit { workbook: Partial; doc: Partial; slide?: Partial; board?: Partial; pdf?: Partial; } export interface ISheetBlockData extends Omit { data: string; } export interface ISheetBlockJson { [key: string]: Partial; } export interface ISnapshotBlockJson { snapshot: ISnapshotJson; sheetBlocks: ISheetBlockJson; } export interface ISnapshotBlockJsonResponse { snapshot: ISnapshot; sheetBlocks: { [key: string]: ISheetBlock; }; } /** * Convert the Uint8Array in the snapshot to a string for easy transmission to the backend * @param snapshot */ export declare function transformWorkbookSnapshotMetaToString(snapshot: ISnapshot): Nullable; /** * Convert the Uint8Array in the sheet block to a string for easy transmission to the backend * @param sheetBlocks * @returns Encoded sheet blocks keyed by block id. */ export declare function transformSheetBlockMetaToString(sheetBlocks: ISheetBlock[]): ISheetBlockJson; /** * 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. */ export declare class ClientSnapshotServerService implements ISnapshotServerService { private _sheetBlockCache; getUnitOnRev(): Promise; getSheetBlock(_context: ILogContext, params: IGetSheetBlockRequest): Promise; getDeserializedSheetBlock(_context: ILogContext, params: IGetSheetBlockRequest): Promise; fetchMissingChangesets(): Promise; getResourcesRequest(): Promise; saveSnapshot(): Promise; updateSnapshot(): Promise; saveSheetBlock(_context: ILogContext, params: ISaveSheetBlockRequest): Promise; saveChangeset(): Promise; copyFileMeta(): Promise; getLatestCsReqIdBySid(): Promise; }