@univerjs-pro/collaboration 0.2.3 → 0.2.4
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/types/command/create-unit.mutation.d.ts +9 -0
- package/lib/types/command/revert-revision.mutation.d.ts +7 -0
- package/lib/types/controllers/rev/rev.controller.d.ts +9 -0
- package/lib/types/controllers/sheet-transform/algorithms/revert-revision/revert-revision.algo.d.ts +5 -0
- package/lib/types/controllers/sheet-transform/algorithms/utils.d.ts +2 -0
- package/lib/types/index.d.ts +4 -1
- package/lib/types/services/history/type.d.ts +7 -0
- package/lib/types/services/rev/rev.service.d.ts +2 -0
- package/lib/umd/index.js +1 -1
- package/package.json +27 -27
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IMutation } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
export interface ICreateUnitMutationParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* This mutation will not create a unit but only be a signal
|
|
8
|
+
*/
|
|
9
|
+
export declare const CreateUnitMutation: IMutation<ICreateUnitMutationParams>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This controller register sheet transform algorithms to the transform service.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RevisionController extends Disposable {
|
|
7
|
+
private _commandService;
|
|
8
|
+
constructor(_commandService: ICommandService);
|
|
9
|
+
}
|
package/lib/types/controllers/sheet-transform/algorithms/revert-revision/revert-revision.algo.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
|
|
2
|
+
import { IRevertRevisionMutationParams } from '../../../../command/revert-revision.mutation';
|
|
3
|
+
|
|
4
|
+
export declare const RevertRevisionMutationWithOthers: IMutationTransformAlgorithm<IRevertRevisionMutationParams, any>;
|
|
5
|
+
export declare const OthersWithRevertRevision: IMutationTransformAlgorithm<any, IRevertRevisionMutationParams>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,8 +5,11 @@ export { CollaborationEvent, type IAcknowledgedChangeset, type IAcknowledgementE
|
|
|
5
5
|
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';
|
|
6
6
|
export { UniverCollaborationPlugin } from './plugin';
|
|
7
7
|
export { CompressMutationService } from './services/compress-mutation/compress-mutation-service';
|
|
8
|
-
export { RevisionService, SINGLE_SNAPSHOT_MUTATIONS } from './services/rev/rev.service';
|
|
8
|
+
export { RevisionService, SINGLE_SNAPSHOT_MUTATIONS, SINGLE_HISTORY_MUTATIONS } from './services/rev/rev.service';
|
|
9
9
|
export { SnapshotService } from './services/snapshot/snapshot.service';
|
|
10
10
|
export { type IMutationTransformAlgorithm, ITransformService, TransformService, makeArray, } from './services/transform/transform.service';
|
|
11
11
|
export { type IFailureTransformChangesetsResult, type IFailureTransformMutationResult, type IFailureTransformMutationsResult, type IFailureTransformMutationsWithChangesetResult, isTransformChangesetsFailure, isTransformChangesetsSuccess, isTransformMutationFailure, isTransformMutationsFailure, isTransformMutationsSuccess, isTransformMutationSuccess, isTransformMutationsWithChangesetFailure, isTransformMutationsWithChangesetSuccess, type ISuccessTransformChangesetsResult, type ISuccessTransformMutationResult, type ISuccessTransformMutationsResult, type ISuccessTransformMutationsWithChangesetResult, type ITransformChangesetsResult, type ITransformMutationResult, type ITransformMutationsResult, type ITransformMutationsWithChangesetResult, } from './services/transform/types';
|
|
12
12
|
export { mapDocumentTypeToUniverType } from './utils';
|
|
13
|
+
export { IHistoryIoService } from './services/history/type';
|
|
14
|
+
export { RevertRevisionMutation, type IRevertRevisionMutationParams } from './command/revert-revision.mutation';
|
|
15
|
+
export { CreateUnitMutation, type ICreateUnitMutationParams } from './command/create-unit.mutation';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ILogContext } from '@univerjs/core';
|
|
2
|
+
import { ICreateHistoryRequest, ICreateHistoryResponse } from '@univerjs/protocol';
|
|
3
|
+
|
|
4
|
+
export interface IHistoryIoService {
|
|
5
|
+
createHistory(config: ICreateHistoryRequest, context?: ILogContext): Promise<ICreateHistoryResponse>;
|
|
6
|
+
}
|
|
7
|
+
export declare const IHistoryIoService: import('@wendellhu/redi').IdentifierDecorator<IHistoryIoService>;
|
|
@@ -2,6 +2,7 @@ import { IUniverInstanceService } from '@univerjs/core';
|
|
|
2
2
|
|
|
3
3
|
/** Some special mutations. It a changeset contains the following mutations it should create a snapshot immediately. */
|
|
4
4
|
export declare const SINGLE_SNAPSHOT_MUTATIONS: Set<string>;
|
|
5
|
+
export declare const SINGLE_HISTORY_MUTATIONS: Set<string>;
|
|
5
6
|
/**
|
|
6
7
|
* This service provide util functions to get revision number of a document or increment the revision number.
|
|
7
8
|
*/
|
|
@@ -19,4 +20,5 @@ export declare class RevisionService {
|
|
|
19
20
|
* @returns The revision number after increment.
|
|
20
21
|
*/
|
|
21
22
|
incrementRevForDocument(unitID: string): number;
|
|
23
|
+
setRevForDocument(unitID: string, rev: number): void;
|
|
22
24
|
}
|