@ckeditor/ckeditor5-operations-compressor 48.2.0 → 48.3.0-alpha.1

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,25 +1,24 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module operations-compressor/operationcompressor/annotationmarkeroperationcompressor
7
- */
8
- import { MarkerOperationCompressor } from './markeroperationcompressor.js';
9
- import type { ProtobufDescriptor } from '../protobuffactory.js';
10
- import type { CompressedOperationsData, CompressionInput, DecompressionInput } from '../compressor.js';
11
- import type { MarkerOperation } from '@ckeditor/ckeditor5-engine';
6
+ * @module operations-compressor/operationcompressor/annotationmarkeroperationcompressor
7
+ */
8
+ import { MarkerOperationCompressor } from "./markeroperationcompressor.js";
9
+ import type { ProtobufDescriptor } from "../protobuffactory.js";
10
+ import type { CompressedOperationsData, CompressionInput, DecompressionInput } from "../compressor.js";
12
11
  export declare class AnnotationMarkerOperationCompressor extends MarkerOperationCompressor {
13
- /**
14
- * @inheritDoc
15
- */
16
- constructor(id: number, name: string, descriptor: ProtobufDescriptor, namespaceToOmit: string);
17
- /**
18
- * @inheritDoc
19
- */
20
- compress(result: CompressedOperationsData, input: CompressionInput): boolean;
21
- /**
22
- * @inheritDoc
23
- */
24
- decompress(result: Array<MarkerOperation>, input: DecompressionInput): void;
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ constructor(id: number, name: string, descriptor: ProtobufDescriptor, namespaceToOmit: string);
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ override compress(result: CompressedOperationsData, input: CompressionInput): boolean;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ override decompress(result: Array<Record<string, unknown>>, input: DecompressionInput): void;
25
24
  }
@@ -1,20 +1,19 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module operations-compressor/operationcompressor/attributeoperationcompressor
7
- */
8
- import { OperationCompressor } from './operationcompressor.js';
9
- import type { CompressedOperationsData, CompressionInput, DecompressionInput } from '../compressor.js';
10
- import type { AttributeOperation } from '@ckeditor/ckeditor5-engine';
6
+ * @module operations-compressor/operationcompressor/attributeoperationcompressor
7
+ */
8
+ import { OperationCompressor } from "./operationcompressor.js";
9
+ import type { CompressedOperationsData, CompressionInput, DecompressionInput } from "../compressor.js";
11
10
  export declare class AttributeOperationCompressor extends OperationCompressor {
12
- /**
13
- * @inheritDoc
14
- */
15
- compress(result: CompressedOperationsData, input: CompressionInput): boolean;
16
- /**
17
- * @inheritDoc
18
- */
19
- decompress(result: Array<AttributeOperation>, input: DecompressionInput): void;
11
+ /**
12
+ * @inheritDoc
13
+ */
14
+ override compress(result: CompressedOperationsData, input: CompressionInput): boolean;
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ override decompress(result: Array<Record<string, unknown>>, input: DecompressionInput): void;
20
19
  }
@@ -1,20 +1,19 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module operations-compressor/operationcompressor/insertoperationcompressor
7
- */
8
- import { OperationCompressor } from './operationcompressor.js';
9
- import type { CompressedOperationsData, CompressionInput, DecompressionInput } from '../compressor.js';
10
- import type { InsertOperation } from '@ckeditor/ckeditor5-engine';
6
+ * @module operations-compressor/operationcompressor/insertoperationcompressor
7
+ */
8
+ import { OperationCompressor } from "./operationcompressor.js";
9
+ import type { CompressedOperationsData, CompressionInput, DecompressionInput } from "../compressor.js";
11
10
  export declare class InsertOperationCompressor extends OperationCompressor {
12
- /**
13
- * @inheritDoc
14
- */
15
- compress(result: CompressedOperationsData, input: CompressionInput): boolean;
16
- /**
17
- * @inheritDoc
18
- */
19
- decompress(result: Array<InsertOperation>, input: DecompressionInput): void;
11
+ /**
12
+ * @inheritDoc
13
+ */
14
+ override compress(result: CompressedOperationsData, input: CompressionInput): boolean;
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ override decompress(result: Array<Record<string, unknown>>, input: DecompressionInput): void;
20
19
  }
@@ -1,16 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module operations-compressor/operationcompressor/markeroperationcompressor
7
- */
8
- import { OperationCompressor } from './operationcompressor.js';
9
- import type { DecompressionInput } from '../compressor.js';
10
- import type { MarkerOperation } from '@ckeditor/ckeditor5-engine';
6
+ * @module operations-compressor/operationcompressor/markeroperationcompressor
7
+ */
8
+ import { OperationCompressor } from "./operationcompressor.js";
9
+ import type { DecompressionInput } from "../compressor.js";
11
10
  export declare class MarkerOperationCompressor extends OperationCompressor {
12
- /**
13
- * @inheritDoc
14
- */
15
- decompress(result: Array<MarkerOperation>, input: DecompressionInput): void;
11
+ /**
12
+ * @inheritDoc
13
+ */
14
+ override decompress(result: Array<Record<string, unknown>>, input: DecompressionInput): void;
16
15
  }
@@ -1,22 +1,22 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module operations-compressor/operationcompressor/nooperationcompressor
7
- */
8
- import { OperationCompressor } from './operationcompressor.js';
9
- import type { CompressedOperationsData, CompressionInput, DecompressionInput } from '../compressor.js';
6
+ * @module operations-compressor/operationcompressor/nooperationcompressor
7
+ */
8
+ import { OperationCompressor } from "./operationcompressor.js";
9
+ import type { CompressedOperationsData, CompressionInput, DecompressionInput } from "../compressor.js";
10
10
  /**
11
- * @extends OperationCompressor
12
- */
11
+ * @extends OperationCompressor
12
+ */
13
13
  export declare class NoOperationCompressor extends OperationCompressor {
14
- /**
15
- * @inheritDoc
16
- */
17
- compress(result: CompressedOperationsData, input: CompressionInput): boolean;
18
- /**
19
- * @inheritDoc
20
- */
21
- decompress(result: Array<any>, input: DecompressionInput): void;
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ override compress(result: CompressedOperationsData, input: CompressionInput): boolean;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ override decompress(result: Array<Record<string, unknown>>, input: DecompressionInput): void;
22
22
  }
@@ -1,28 +1,27 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import type { CompressedOperationsData, CompressionInput, DecompressionInput } from '../compressor.js';
6
- import type { ProtobufDescriptor } from '../protobuffactory.js';
7
- import type { Operation } from '@ckeditor/ckeditor5-engine';
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import type { CompressedOperationsData, CompressionInput, DecompressionInput } from "../compressor.js";
6
+ import type { ProtobufDescriptor } from "../protobuffactory.js";
8
7
  /**
9
- * Compresses and decompresses single operation to the binary format.
10
- */
8
+ * Compresses and decompresses single operation to the binary format.
9
+ */
11
10
  export declare class OperationCompressor {
12
- constructor(id: number, operationName: string, protobufDescriptor: ProtobufDescriptor);
13
- /**
14
- * Serializes and consumes the first operation from the list.
15
- *
16
- * @param result Object to which compression result will be added.
17
- * @param input Input data to compress. The operation compressor will compress one operation (at `input.index`) and increment
18
- * `input.index`.
19
- */
20
- compress(result: CompressedOperationsData, input: CompressionInput): boolean;
21
- /**
22
- * Deserializes and consumes buffered operation.
23
- *
24
- * @param result Decompressed operation.
25
- * @param input Input data to decompress.
26
- */
27
- decompress(result: Array<Operation>, input: DecompressionInput): void;
11
+ constructor(id: number, operationName: string, protobufDescriptor: ProtobufDescriptor);
12
+ /**
13
+ * Serializes and consumes the first operation from the list.
14
+ *
15
+ * @param result Object to which compression result will be added.
16
+ * @param input Input data to compress. The operation compressor will compress one operation (at `input.index`) and increment
17
+ * `input.index`.
18
+ */
19
+ compress(result: CompressedOperationsData, input: CompressionInput): boolean;
20
+ /**
21
+ * Deserializes and consumes buffered operation.
22
+ *
23
+ * @param result Decompressed operation.
24
+ * @param input Input data to decompress.
25
+ */
26
+ decompress(result: Array<Record<string, unknown>>, input: DecompressionInput): void;
28
27
  }
@@ -1,5 +1 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
1
  export {};
package/dist/utils.d.ts CHANGED
@@ -1,30 +1,30 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * Return new position in JSON format shifted by given offset.
7
- *
8
- * @param positionJSON Position serialized to JSON.
9
- * @param shift Offset shift. Can be a negative value.
10
- * @returns New position in JSON format.
11
- */
6
+ * Return new position in JSON format shifted by given offset.
7
+ *
8
+ * @param positionJSON Position serialized to JSON.
9
+ * @param shift Offset shift. Can be a negative value.
10
+ * @returns New position in JSON format.
11
+ */
12
12
  export declare function getPositionShiftedBy(positionJSON: any, shift: number): any;
13
13
  /**
14
- * Checks whether one position serialized to JSON is equal to other position serialized to JSON.
15
- */
14
+ * Checks whether one position serialized to JSON is equal to other position serialized to JSON.
15
+ */
16
16
  export declare function arePositionsEqual(positionA: any, positionB: any): boolean;
17
17
  /**
18
- * For the better compression result one of the two common roots (`main` or `$graveyard`)
19
- * is compressed to the `Boolean` format.
20
- *
21
- * Due tu the Protobuf limitation `Position` descriptor has no dedicated compressor
22
- * so we need to find and format all positions in the operation.
23
- */
18
+ * For the better compression result one of the two common roots (`main` or `$graveyard`)
19
+ * is compressed to the `Boolean` format.
20
+ *
21
+ * Due tu the Protobuf limitation `Position` descriptor has no dedicated compressor
22
+ * so we need to find and format all positions in the operation.
23
+ */
24
24
  export declare function parsePositionBeforeCompression(operation: any): void;
25
25
  /**
26
- * Position reformatting after decompression.
27
- *
28
- * @see {parsePositionBeforeCompression}.
29
- */
26
+ * Position reformatting after decompression.
27
+ *
28
+ * @see {parsePositionBeforeCompression}.
29
+ */
30
30
  export declare function parsePositionAfterCompression(operation: any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-operations-compressor",
3
- "version": "48.2.0",
3
+ "version": "48.3.0-alpha.1",
4
4
  "description": "CKEditor 5 operations compressor for real-time collaboration.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -37,8 +37,7 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "dependencies": {
40
- "@ckeditor/ckeditor5-engine": "48.2.0",
41
- "@ckeditor/ckeditor5-utils": "48.2.0",
40
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.1",
42
41
  "es-toolkit": "1.45.1",
43
42
  "protobufjs": "7.5.8"
44
43
  },