@univerjs-pro/collaboration 0.25.0 → 1.0.0-alpha.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.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/controllers/base-transform/algorithms/base-json1.algo.d.ts +4 -0
- package/lib/types/controllers/base-transform/base-transform.controller.d.ts +9 -0
- package/lib/types/controllers/sheet-transform/algorithms/revert-revision/revert-revision.algo.d.ts +1 -1
- package/lib/types/controllers/slide-transform/algorithms/background.algo.d.ts +2 -0
- package/lib/types/controllers/slide-transform/algorithms/chart-resource.algo.d.ts +5 -0
- package/lib/types/controllers/slide-transform/algorithms/drawing-json.algo.d.ts +2 -0
- package/lib/types/controllers/slide-transform/algorithms/element.algo.d.ts +4 -0
- package/lib/types/controllers/slide-transform/algorithms/group.algo.d.ts +4 -0
- package/lib/types/controllers/slide-transform/algorithms/index.d.ts +9 -0
- package/lib/types/controllers/slide-transform/algorithms/order.algo.d.ts +2 -0
- package/lib/types/controllers/slide-transform/algorithms/page.algo.d.ts +4 -0
- package/lib/types/controllers/slide-transform/algorithms/table-resource.algo.d.ts +3 -0
- package/lib/types/controllers/slide-transform/algorithms/types.d.ts +8 -0
- package/lib/types/controllers/slide-transform/slide-transform.controller.d.ts +9 -0
- package/lib/types/index.d.ts +24 -10
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/services/snapshot/snapshot-save.service.d.ts +11 -1
- package/lib/types/services/snapshot/snapshot-transform.d.ts +13 -1
- package/lib/types/services/snapshot/snapshot-utils.d.ts +3 -0
- package/lib/types/services/snapshot/snapshot.service.d.ts +10 -2
- package/lib/types/services/transform/transform.service.d.ts +1 -0
- package/lib/types/services/validation/doc-changeset-validation.d.ts +6 -0
- package/lib/umd/index.js +1 -1
- package/package.json +22 -19
- /package/lib/types/{command → commands}/create-unit.mutation.d.ts +0 -0
- /package/lib/types/{command → commands}/revert-revision.mutation.d.ts +0 -0
- /package/lib/types/{controllers/config.schema.d.ts → config/config.d.ts} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IApplyBaseJson1MutationParams } from '@univerjs-pro/bases';
|
|
2
|
+
import type { IMutationTransformAlgorithm } from '../../../services/transform/transform.service';
|
|
3
|
+
export declare const BaseJson1MutationWithSelf: IMutationTransformAlgorithm<IApplyBaseJson1MutationParams, IApplyBaseJson1MutationParams>;
|
|
4
|
+
export declare const BaseAlgorithms: Array<IMutationTransformAlgorithm<IApplyBaseJson1MutationParams, IApplyBaseJson1MutationParams>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { ITransformService } from '../../services/transform/transform.service';
|
|
3
|
+
/**
|
|
4
|
+
* Registers Base JSON1 transform algorithms to the shared transform service.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BaseTransformController extends Disposable {
|
|
7
|
+
private readonly _transformService;
|
|
8
|
+
constructor(_transformService: ITransformService);
|
|
9
|
+
}
|
package/lib/types/controllers/sheet-transform/algorithms/revert-revision/revert-revision.algo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IRevertRevisionMutationParams } from '../../../../
|
|
1
|
+
import type { IRevertRevisionMutationParams } from '../../../../commands/revert-revision.mutation';
|
|
2
2
|
import type { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
|
|
3
3
|
export declare const RevertRevisionMutationWithOthers: IMutationTransformAlgorithm<IRevertRevisionMutationParams, any>;
|
|
4
4
|
export declare const OthersWithRevertRevision: IMutationTransformAlgorithm<any, IRevertRevisionMutationParams>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IMutationTransformAlgorithm } from '../../../services/transform/transform.service';
|
|
2
|
+
export declare const RemoveSlideChartDataSourceMutationWithResource: IMutationTransformAlgorithm;
|
|
3
|
+
export declare const RemoveSlideChartDataSourceMutationWithSelf: IMutationTransformAlgorithm;
|
|
4
|
+
export declare const RemoveSlideChartSnapshotMutationWithResource: IMutationTransformAlgorithm;
|
|
5
|
+
export declare const RemoveSlideChartSnapshotMutationWithSelf: IMutationTransformAlgorithm;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IMutationTransformAlgorithm } from '../../../services/transform/transform.service';
|
|
2
|
+
export declare const RemoveSlideElementMutationWithOthers: IMutationTransformAlgorithm;
|
|
3
|
+
export declare const AddSlideElementMutationWithSelf: IMutationTransformAlgorithm;
|
|
4
|
+
export declare const UpdateSlideElementMutationWithSelf: IMutationTransformAlgorithm;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IMutationTransformAlgorithm } from '../../../services/transform/transform.service';
|
|
2
|
+
export declare const RemoveSlideElementMutationWithSetGroup: IMutationTransformAlgorithm;
|
|
3
|
+
export declare const RemoveSlideElementMutationWithCancelGroup: IMutationTransformAlgorithm;
|
|
4
|
+
export declare const SetSlideGroupMutationWithSelf: IMutationTransformAlgorithm;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { UpdateSlidePageBackgroundMutationWithSelf } from './background.algo';
|
|
2
|
+
export { RemoveSlideChartDataSourceMutationWithResource, RemoveSlideChartDataSourceMutationWithSelf, RemoveSlideChartSnapshotMutationWithResource, RemoveSlideChartSnapshotMutationWithSelf, } from './chart-resource.algo';
|
|
3
|
+
export { SetSlideDrawingApplyMutationWithSelf } from './drawing-json.algo';
|
|
4
|
+
export { AddSlideElementMutationWithSelf, RemoveSlideElementMutationWithOthers, UpdateSlideElementMutationWithSelf } from './element.algo';
|
|
5
|
+
export { RemoveSlideElementMutationWithCancelGroup, RemoveSlideElementMutationWithSetGroup, SetSlideGroupMutationWithSelf } from './group.algo';
|
|
6
|
+
export { RemoveSlideElementMutationWithOrder } from './order.algo';
|
|
7
|
+
export { AddSlidePageMutationWithSelf, MoveSlidePageMutationWithSelf, RemoveSlidePageMutationWithOthers } from './page.algo';
|
|
8
|
+
export { RemoveSlideTableMutationWithResource, RemoveSlideTableMutationWithSelf } from './table-resource.algo';
|
|
9
|
+
export declare const SLIDE_ALL_ALGORITHMS: import("../../..").IMutationTransformAlgorithm<any, any>[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IMutationTransformAlgorithm } from '../../../services/transform/transform.service';
|
|
2
|
+
export declare const RemoveSlidePageMutationWithOthers: IMutationTransformAlgorithm;
|
|
3
|
+
export declare const AddSlidePageMutationWithSelf: IMutationTransformAlgorithm;
|
|
4
|
+
export declare const MoveSlidePageMutationWithSelf: IMutationTransformAlgorithm;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IMutationInfo } from '@univerjs/core';
|
|
2
|
+
export declare function getSlideUnitId(mutation: IMutationInfo): string | undefined;
|
|
3
|
+
export declare function getSlidePageId(mutation: IMutationInfo): string | undefined;
|
|
4
|
+
export declare function getSlideDrawingId(mutation: IMutationInfo): string | undefined;
|
|
5
|
+
export declare function getSlideDrawingIds(mutation: IMutationInfo): string[];
|
|
6
|
+
export declare function sameSlideUnit(m1: IMutationInfo, m2: IMutationInfo): boolean;
|
|
7
|
+
export declare function sameSlidePage(m1: IMutationInfo, m2: IMutationInfo): boolean;
|
|
8
|
+
export declare function slideDrawingIntersects(m1: IMutationInfo, m2: IMutationInfo): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { ITransformService } from '../../services/transform/transform.service';
|
|
3
|
+
/**
|
|
4
|
+
* This controller registers slide transform algorithms to the transform service.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SlideTransformController extends Disposable {
|
|
7
|
+
private readonly _transformService;
|
|
8
|
+
constructor(_transformService: ITransformService);
|
|
9
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
|
-
export { CreateUnitMutation
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export { CreateUnitMutation } from './commands/create-unit.mutation';
|
|
2
|
+
export type { ICreateUnitMutationParams } from './commands/create-unit.mutation';
|
|
3
|
+
export { RevertRevisionMutation } from './commands/revert-revision.mutation';
|
|
4
|
+
export type { IRevertRevisionMutationParams } from './commands/revert-revision.mutation';
|
|
5
|
+
export type { IUniverCollaborationConfig } from './config/config';
|
|
6
|
+
export { BaseAlgorithms, BaseJson1MutationWithSelf } from './controllers/base-transform/algorithms/base-json1.algo';
|
|
7
|
+
export { BaseTransformController } from './controllers/base-transform/base-transform.controller';
|
|
8
|
+
export { DocAlgorithms, RichTextEditingMutationWithSelf } from './controllers/doc-transform/algorithms/doc-algo';
|
|
4
9
|
export { DocTransformController } from './controllers/doc-transform/doc-transform.controller';
|
|
5
10
|
export { EmptyMutationInfo } from './controllers/empty';
|
|
6
11
|
export { SheetTransformController } from './controllers/sheet-transform/sheet-transform.controller';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
12
|
+
export { SLIDE_ALL_ALGORITHMS } from './controllers/slide-transform/algorithms';
|
|
13
|
+
export { SlideTransformController } from './controllers/slide-transform/slide-transform.controller';
|
|
14
|
+
export { parseChangesetToProtocol, parseMutationToProtocol, parseProtocolChangeset, parseProtocolCommand, parseProtocolMutation, } from './models/changeset';
|
|
15
|
+
export type { IChangeset, IFetchMissingCSResult } from './models/changeset';
|
|
16
|
+
export { CollaborationEvent } from './models/collaboration-events';
|
|
17
|
+
export type { IAcknowledgedChangeset, IAcknowledgementEvent, ICollaborationEvent, ICollaborationUser, IFetchingMissEvent, IFetchOperationsEvent, INewChangesetsEvent, INewHostEvent, IOperationEvent, IPermissionUpdateEvent, IPseudoFetchMissingResultEvent, IRejectedChangeset, IRejectionEvent, IRequestHostEvent, IRetryEvent, IShouldCloseConnEvent, ISubmitChangesetEvent, ITerminateEvent, IUpdateCursorEvent, IUserJoinEvent, IUserLeaveEvent, IUserSelectionEvent, } from './models/collaboration-events';
|
|
9
18
|
export { type ICombRequestEvent, type ICombResponseEvent, type IHeartbeatRequestEvent, type IHeartbeatResponseEvent, type IHelloRequestEvent, type IHelloResponseEvent, type IIngestQuestEvent, type IJoinRequestEvent, type IJoinResponseEvent, type ILeaveRequestEvent, type IRecvResponseEvent, } from './models/socket-events';
|
|
10
19
|
export { UniverCollaborationPlugin } from './plugin';
|
|
11
20
|
export { CompressMutationService } from './services/compress-mutation/compress-mutation.service';
|
|
12
21
|
export { RevisionService, SINGLE_HISTORY_MUTATIONS, SINGLE_SNAPSHOT_MUTATIONS } from './services/rev/rev.service';
|
|
13
22
|
export { SnapshotSaveService } from './services/snapshot/snapshot-save.service';
|
|
14
|
-
export { generateTempDocumentSnapshot, generateTemporarySnap, getSheetBlocksFromSnapshot, transformDocumentDataToSnapshot, transformSnapshotToDocumentData, transformSnapshotToWorkbookData, transformWorkbookDataToSnapshot } from './services/snapshot/snapshot-transform';
|
|
15
|
-
export { textDecoder, textEncoder } from './services/snapshot/snapshot-utils';
|
|
23
|
+
export { generateTempBaseSnapshot, generateTempDocumentSnapshot, generateTemporarySnap, getSheetBlocksFromSnapshot, transformBaseDataToSnapshot, transformDocumentDataToSnapshot, transformSlideDataToSnapshot, transformSnapshotToBaseData, transformSnapshotToDocumentData, transformSnapshotToSlideData, transformSnapshotToWorkbookData, transformWorkbookDataToSnapshot, } from './services/snapshot/snapshot-transform';
|
|
24
|
+
export { decodeSlideOriginalMeta, encodeSlideOriginalMeta, textDecoder, textEncoder, } from './services/snapshot/snapshot-utils';
|
|
16
25
|
export { ISnapshotServerService, SnapshotService } from './services/snapshot/snapshot.service';
|
|
17
|
-
export {
|
|
18
|
-
export
|
|
19
|
-
export {
|
|
26
|
+
export { ITransformService, TransformService } from './services/transform/transform.service';
|
|
27
|
+
export type { IMutationTransformAlgorithm } from './services/transform/transform.service';
|
|
28
|
+
export { isTransformChangesetsFailure, isTransformChangesetsSuccess, isTransformMutationFailure, isTransformMutationsFailure, isTransformMutationsSuccess, isTransformMutationSuccess, isTransformMutationsWithChangesetFailure, isTransformMutationsWithChangesetSuccess, } from './services/transform/types';
|
|
29
|
+
export type { IFailureTransformChangesetsResult, IFailureTransformMutationResult, IFailureTransformMutationsResult, IFailureTransformMutationsWithChangesetResult, ISuccessTransformChangesetsResult, ISuccessTransformMutationResult, ISuccessTransformMutationsResult, ISuccessTransformMutationsWithChangesetResult, ITransformChangesetsResult, ITransformMutationResult, ITransformMutationsResult, ITransformMutationsWithChangesetResult, } from './services/transform/types';
|
|
30
|
+
export { validateDocBodyAfterApply } from './services/validation/doc-changeset-validation';
|
|
31
|
+
export type { IDocBodyValidationResult } from './services/validation/doc-changeset-validation';
|
|
32
|
+
export { b64DecodeUnicode, b64EncodeUnicode, mapDocumentTypeToUniverInstanceType, measureAsyncOperation, measureSyncOperation, uuidv4, } from './utils';
|
|
33
|
+
export type { ILogContext } from './utils';
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IUniverCollaborationConfig } from './
|
|
1
|
+
import type { IUniverCollaborationConfig } from './config/config';
|
|
2
2
|
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
3
3
|
export declare class UniverCollaborationPlugin extends Plugin {
|
|
4
4
|
private readonly _config;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ISlideData } from '@univerjs-pro/slides';
|
|
2
|
+
import type { BaseDataModel, DocumentDataModel, IBaseSnapshot, IDocumentData, IWorkbookData, Workbook } from '@univerjs/core';
|
|
2
3
|
import type { ISheetBlockMeta, ISnapshot } from '@univerjs/protocol';
|
|
3
4
|
import type { ILogContext } from '../../utils';
|
|
4
5
|
import { ILogService } from '@univerjs/core';
|
|
@@ -26,10 +27,19 @@ export declare class SnapshotSaveService {
|
|
|
26
27
|
getSheet(context: ILogContext, unitID: string, rev: number, workbook: Workbook): Promise<{
|
|
27
28
|
snapshot: ISnapshot;
|
|
28
29
|
}>;
|
|
30
|
+
getBase(context: ILogContext, unitID: string, rev: number, base: BaseDataModel): Promise<{
|
|
31
|
+
snapshot: ISnapshot;
|
|
32
|
+
}>;
|
|
29
33
|
getDoc(context: ILogContext, unitId: string, rev: number, document: DocumentDataModel): Promise<{
|
|
30
34
|
snapshot: ISnapshot;
|
|
31
35
|
}>;
|
|
32
36
|
saveDoc(context: ILogContext, unitId: string, rev: number, document: DocumentDataModel, documentData?: IDocumentData): Promise<{
|
|
33
37
|
snapshot: ISnapshot;
|
|
34
38
|
}>;
|
|
39
|
+
saveBase(context: ILogContext, unitId: string, rev: number, base: BaseDataModel, baseData?: IBaseSnapshot): Promise<{
|
|
40
|
+
snapshot: ISnapshot;
|
|
41
|
+
}>;
|
|
42
|
+
saveSlide(unitId: string, slideData: ISlideData, rev: number): Promise<{
|
|
43
|
+
snapshot: ISnapshot;
|
|
44
|
+
}>;
|
|
35
45
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ISlideData } from '@univerjs-pro/slides';
|
|
2
|
+
import type { IBaseSnapshot, IDocumentData, ILogService, IWorkbookData } from '@univerjs/core';
|
|
2
3
|
import type { IDeserializedSheetBlock, ISheetBlock, ISheetBlockMeta, ISnapshot } from '@univerjs/protocol';
|
|
3
4
|
import type { ILogContext } from '../../utils';
|
|
4
5
|
import type { ISnapshotServerService } from './snapshot.service';
|
|
5
6
|
export declare function generateTempDocumentSnapshot(_context: ILogContext, document: IDocumentData, unitID: string, rev: number): Promise<{
|
|
6
7
|
snapshot: ISnapshot;
|
|
7
8
|
}>;
|
|
9
|
+
export declare function generateTempBaseSnapshot(context: ILogContext, base: IBaseSnapshot, unitID: string, rev: number, snapshotService: ISnapshotServerService, logger?: ILogService): Promise<{
|
|
10
|
+
snapshot: ISnapshot;
|
|
11
|
+
}>;
|
|
8
12
|
export declare function generateTemporarySnap(context: ILogContext, workbook: IWorkbookData, unitID: string, rev: number, snapshotService: ISnapshotServerService, logger?: ILogService): Promise<{
|
|
9
13
|
snapshot: ISnapshot;
|
|
10
14
|
}>;
|
|
@@ -14,16 +18,24 @@ export declare function transformWorkbookDataToSnapshotNoSave(context: ILogConte
|
|
|
14
18
|
export declare function transformWorkbookDataToSnapshot(context: ILogContext, workbook: IWorkbookData, unitID: string, rev: number, snapshotService: ISnapshotServerService, logger?: ILogService): Promise<{
|
|
15
19
|
snapshot: ISnapshot;
|
|
16
20
|
}>;
|
|
21
|
+
export declare function transformBaseDataToSnapshot(context: ILogContext, base: IBaseSnapshot, unitID: string, rev: number, snapshotService: ISnapshotServerService, logger?: ILogService): Promise<{
|
|
22
|
+
snapshot: ISnapshot;
|
|
23
|
+
}>;
|
|
17
24
|
/**
|
|
18
25
|
* Assemble a snapshot to a workbook.
|
|
19
26
|
* @param snapshot
|
|
20
27
|
* @param sheetBlocks
|
|
21
28
|
*/
|
|
22
29
|
export declare function transformSnapshotToWorkbookData(snapshot: ISnapshot, sheetBlocks: (IDeserializedSheetBlock | ISheetBlock)[], _context?: ILogContext, logService?: ILogService): Promise<IWorkbookData>;
|
|
30
|
+
export declare function transformSnapshotToBaseData(snapshot: ISnapshot, baseBlocks?: (IDeserializedSheetBlock | ISheetBlock)[], _context?: ILogContext, logService?: ILogService): Promise<IBaseSnapshot>;
|
|
23
31
|
export declare function transformSnapshotToDocumentData(snapshot: ISnapshot): IDocumentData;
|
|
24
32
|
export declare function transformDocumentDataToSnapshot(context: ILogContext, document: IDocumentData, unitID: string, rev: number, snapshotService: ISnapshotServerService): Promise<{
|
|
25
33
|
snapshot: ISnapshot;
|
|
26
34
|
}>;
|
|
35
|
+
export declare function transformSlideDataToSnapshot(_resources: ISlideData['resources'], slideData: ISlideData, unitID: string, rev: number, snapshotService: ISnapshotServerService): Promise<{
|
|
36
|
+
snapshot: ISnapshot;
|
|
37
|
+
}>;
|
|
38
|
+
export declare function transformSnapshotToSlideData(snapshot: ISnapshot): ISlideData;
|
|
27
39
|
/**
|
|
28
40
|
*
|
|
29
41
|
* @param snapshot
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ISlideData } from '@univerjs-pro/slides';
|
|
1
2
|
import type { ICellData, IDocumentData, IObjectMatrixPrimitiveType, IWorkbookData, IWorksheetData } from '@univerjs/core';
|
|
2
3
|
import type { ISheetBlock } from '@univerjs/protocol';
|
|
3
4
|
export declare const textEncoder: TextEncoder;
|
|
@@ -8,10 +9,12 @@ export declare const textDecoder: TextDecoder;
|
|
|
8
9
|
export declare function encodeWorksheetOtherMetas(worksheet: Partial<IWorksheetData>): Uint8Array;
|
|
9
10
|
export declare function encodeWorkbookOtherMetas(workbook: IWorkbookData): Uint8Array;
|
|
10
11
|
export declare function encodeDocOriginalMeta(document: IDocumentData): Uint8Array;
|
|
12
|
+
export declare function encodeSlideOriginalMeta(slide: ISlideData): Uint8Array;
|
|
11
13
|
export declare function decodeWorksheetOtherMetas(buffer: Uint8Array | string): Partial<IWorksheetData>;
|
|
12
14
|
export declare function decodeWorkbookOtherMetas(buffer: Uint8Array | string): Partial<IWorkbookData>;
|
|
13
15
|
export declare function decodePartOfCellData(buffer: Uint8Array | object): IObjectMatrixPrimitiveType<ICellData>;
|
|
14
16
|
export declare function decodeDocOriginalMeta(buffer: Uint8Array | string): Partial<IDocumentData>;
|
|
17
|
+
export declare function decodeSlideOriginalMeta(buffer: Uint8Array | string): ISlideData;
|
|
15
18
|
export declare function splitCellDataToBlocks(cellData: IObjectMatrixPrimitiveType<ICellData>, fragmentCellCount?: number, minBlockSize?: number): {
|
|
16
19
|
blocks: ISheetBlock[];
|
|
17
20
|
totalCells: number;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ISlideData, SlideModel } from '@univerjs-pro/slides';
|
|
2
|
+
import type { BaseDataModel, DocumentDataModel, IBaseSnapshot, IDocumentData, IWorkbookData, Workbook } from '@univerjs/core';
|
|
3
|
+
import type { ICopyFileMetaRequest, ICopyFileMetaResponse, IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetDeserializedSheetBlockResponse, IGetLatestCsReqIdBySidRequest, IGetLatestCsReqIdBySidResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, IReportUnitRoutingStatsRequest, IReportUnitRoutingStatsResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse, ISnapshot } from '@univerjs/protocol';
|
|
3
4
|
import type { ILogContext } from '../../utils';
|
|
4
5
|
import { ICommandService, ILogService, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
5
6
|
import { CompressMutationService } from '../compress-mutation/compress-mutation.service';
|
|
6
7
|
import { RevisionService } from '../rev/rev.service';
|
|
8
|
+
export declare function hasSlideSnapshotMeta(snapshot: ISnapshot | null | undefined): boolean;
|
|
7
9
|
/**
|
|
8
10
|
* It provides implementations for server side controllers to load or save
|
|
9
11
|
* or load snapshots. This service should be implemented by the host environment.
|
|
@@ -45,7 +47,13 @@ export declare class SnapshotService {
|
|
|
45
47
|
private _resourceManagerService;
|
|
46
48
|
constructor(_revisionService: RevisionService, _univerInstanceService: IUniverInstanceService, _snapshotServerService: ISnapshotServerService, _commandService: ICommandService, _logService: ILogService, _compressMutationService: CompressMutationService, _resourceManagerService: IResourceManagerService);
|
|
47
49
|
loadSheet(unitId: string, rev: number, context?: ILogContext): Promise<Workbook>;
|
|
50
|
+
loadBase(unitId: string, rev: number, context?: ILogContext): Promise<BaseDataModel>;
|
|
48
51
|
loadDoc(unitID: string, rev: number, context?: ILogContext): Promise<DocumentDataModel>;
|
|
52
|
+
loadSlide(unitID: string, rev?: number, context?: ILogContext): Promise<SlideModel>;
|
|
49
53
|
saveSheet(_context: ILogContext, workbook: Workbook): IWorkbookData;
|
|
54
|
+
saveBase(_context: ILogContext, base: BaseDataModel): IBaseSnapshot;
|
|
50
55
|
saveDoc(_context: ILogContext, document: DocumentDataModel): IDocumentData;
|
|
56
|
+
saveSlide(unitId: string, slideData: ISlideData, rev: number): Promise<{
|
|
57
|
+
snapshot: ISnapshot;
|
|
58
|
+
}>;
|
|
51
59
|
}
|
|
@@ -44,6 +44,7 @@ export declare class TransformService extends Disposable implements ITransformSe
|
|
|
44
44
|
dispose(): void;
|
|
45
45
|
registerTransformAlgorithm(algorithm: IMutationTransformAlgorithm): void;
|
|
46
46
|
transformMutation(m1: IMutationInfo, m2: IMutationInfo): ITransformMutationResult;
|
|
47
|
+
transformMutation(m1: IMutationInfo, m2: IMutationInfo, onlyLater: false): ITransformMutationResult;
|
|
47
48
|
transformMutation(m1: IMutationInfo, m2: IMutationInfo, onlyLater: true): IFailureTransformMutationResult | Omit<ISuccessTransformMutationResult, 'm1Prime'>;
|
|
48
49
|
transformMutations(m1: IMutationInfo[], m2: IMutationInfo[]): ITransformMutationsResult;
|
|
49
50
|
transformMutations(m1: IMutationInfo[], m2: IMutationInfo[], onlyLater: true): IFailureTransformMutationsResult | Omit<ISuccessTransformMutationsResult, 'm1Prime'>;
|