@ckeditor/ckeditor5-operations-compressor 38.1.1 → 38.2.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.
- package/package.json +2 -2
- package/src/actioncompressor/actioncompressor.d.ts +56 -56
- package/src/actioncompressor/actioncompressor.js +1 -1
- package/src/actioncompressor/deletingactioncompressor.d.ts +24 -24
- package/src/actioncompressor/deletingactioncompressor.js +1 -1
- package/src/actioncompressor/forwarddeletingactioncompressor.d.ts +24 -24
- package/src/actioncompressor/forwarddeletingactioncompressor.js +1 -1
- package/src/actioncompressor/typingactioncompressor.d.ts +24 -24
- package/src/actioncompressor/typingactioncompressor.js +1 -1
- package/src/actioncompressor/userselectionactioncompressor.d.ts +12 -12
- package/src/actioncompressor/userselectionactioncompressor.js +1 -1
- package/src/compressor.d.ts +41 -41
- package/src/compressor.js +1 -1
- package/src/lib/compiledmessages.js +1 -1
- package/src/operationcompressor/annotationmarkeroperationcompressor.d.ts +18 -18
- package/src/operationcompressor/annotationmarkeroperationcompressor.js +1 -1
- package/src/operationcompressor/attributeoperationcompressor.d.ts +13 -13
- package/src/operationcompressor/attributeoperationcompressor.js +1 -1
- package/src/operationcompressor/insertoperationcompressor.d.ts +13 -13
- package/src/operationcompressor/insertoperationcompressor.js +1 -1
- package/src/operationcompressor/markeroperationcompressor.d.ts +9 -9
- package/src/operationcompressor/markeroperationcompressor.js +1 -1
- package/src/operationcompressor/nooperationcompressor.d.ts +16 -16
- package/src/operationcompressor/nooperationcompressor.js +1 -1
- package/src/operationcompressor/operationcompressor.d.ts +24 -24
- package/src/operationcompressor/operationcompressor.js +1 -1
- package/src/protobufdescriptions.d.ts +12 -12
- package/src/protobufdescriptions.js +1 -1
- package/src/protobuffactory.d.ts +1 -1
- package/src/protobuffactory.js +1 -1
- package/src/utils.d.ts +26 -26
- package/src/utils.js +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import OperationCompressor from './operationcompressor';
|
|
2
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
-
import type { InsertOperation } from 'ckeditor5/src/engine';
|
|
4
|
-
export default class InsertOperationCompressor extends OperationCompressor {
|
|
5
|
-
/**
|
|
6
|
-
* @inheritDoc
|
|
7
|
-
*/
|
|
8
|
-
compress(result: CompressedOperationsData, operations: Array<InsertOperation>): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* @inheritDoc
|
|
11
|
-
*/
|
|
12
|
-
decompress(result: Array<InsertOperation>, data: CompressedOperationsData): void;
|
|
13
|
-
}
|
|
1
|
+
import OperationCompressor from './operationcompressor.js';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
3
|
+
import type { InsertOperation } from 'ckeditor5/src/engine.js';
|
|
4
|
+
export default class InsertOperationCompressor extends OperationCompressor {
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
8
|
+
compress(result: CompressedOperationsData, operations: Array<InsertOperation>): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @inheritDoc
|
|
11
|
+
*/
|
|
12
|
+
decompress(result: Array<InsertOperation>, data: CompressedOperationsData): void;
|
|
13
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x3c55=['compress','parse','stringify','buffers','every','_protobufDescriptor','children','attributes','attributesBoolean','nodes','__className','_deserializeNodesAttributes','boolean','keys','push','_serializeNodesAttributes','_areValuesBoolean','attributesJson','types','_id','decompress','shift','_operationName'];(function(_0xb09f96,_0x3c55d1){const _0x468a27=function(_0x9f60e0){while(--_0x9f60e0){_0xb09f96['push'](_0xb09f96['shift']());}};_0x468a27(++_0x3c55d1);}(_0x3c55,0x92));const _0x468a=function(_0xb09f96,_0x3c55d1){_0xb09f96=_0xb09f96-0x0;let _0x468a27=_0x3c55[_0xb09f96];return _0x468a27;};import _0x4f2f25 from'./operationcompressor.js';import{parsePositionBeforeCompression as _0x582970,parsePositionAfterCompression as _0x40d1ee}from'../utils.js';export default class i extends _0x4f2f25{[_0x468a('0xf')](_0x4f3017,_0x1f552e){const _0x5c50f9=_0x1f552e['shift']();return this[_0x468a('0x7')](_0x5c50f9[_0x468a('0x1')]),_0x582970(_0x5c50f9),_0x4f3017[_0x468a('0x12')][_0x468a('0x6')](this['_protobufDescriptor']['compress'](_0x5c50f9)),_0x4f3017[_0x468a('0xa')][_0x468a('0x6')](this[_0x468a('0xb')]),!0x0;}[_0x468a('0xc')](_0x5344ad,_0x36a26b){const {types:_0x3b5050,buffers:_0x5b8003}=_0x36a26b,_0x561747=this[_0x468a('0x14')]['decompress'](_0x5b8003['shift']());_0x3b5050[_0x468a('0xd')](),_0x561747[_0x468a('0x1')]||(_0x561747[_0x468a('0x1')]=[]),this['_deserializeNodesAttributes'](_0x561747['nodes']),_0x40d1ee(_0x561747),_0x561747[_0x468a('0x2')]=this[_0x468a('0xe')],_0x5344ad[_0x468a('0x6')](_0x561747);}[_0x468a('0x7')](_0x40e6f2){for(const _0x38dec3 of _0x40e6f2){if(_0x38dec3['attributes']){const _0x50453d=_0x38dec3['attributes'];this['_areValuesBoolean'](_0x50453d)?_0x38dec3[_0x468a('0x0')]=_0x50453d:_0x38dec3[_0x468a('0x9')]=JSON[_0x468a('0x11')](_0x50453d);}_0x38dec3[_0x468a('0x15')]&&this[_0x468a('0x7')](_0x38dec3[_0x468a('0x15')]);}}[_0x468a('0x3')](_0x279c7a){for(const _0x3d37e2 of _0x279c7a)(_0x3d37e2[_0x468a('0x0')]||_0x3d37e2[_0x468a('0x9')])&&(_0x3d37e2[_0x468a('0x0')]?(_0x3d37e2[_0x468a('0x16')]=_0x3d37e2[_0x468a('0x0')],delete _0x3d37e2[_0x468a('0x0')]):(_0x3d37e2[_0x468a('0x16')]=JSON[_0x468a('0x10')](_0x3d37e2['attributesJson']),delete _0x3d37e2[_0x468a('0x9')])),_0x3d37e2[_0x468a('0x15')]&&this[_0x468a('0x3')](_0x3d37e2[_0x468a('0x15')]);}[_0x468a('0x8')](_0x54608c){return Object[_0x468a('0x5')](_0x54608c)[_0x468a('0x13')](_0x427147=>_0x468a('0x4')==typeof _0x54608c[_0x427147]);}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import OperationCompressor from './operationcompressor';
|
|
2
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
-
import type { MarkerOperation } from 'ckeditor5/src/engine';
|
|
4
|
-
export default class MarkerOperationCompressor extends OperationCompressor {
|
|
5
|
-
/**
|
|
6
|
-
* @inheritDoc
|
|
7
|
-
*/
|
|
8
|
-
decompress(result: Array<MarkerOperation>, data: CompressedOperationsData): void;
|
|
9
|
-
}
|
|
1
|
+
import OperationCompressor from './operationcompressor.js';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
3
|
+
import type { MarkerOperation } from 'ckeditor5/src/engine.js';
|
|
4
|
+
export default class MarkerOperationCompressor extends OperationCompressor {
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
8
|
+
decompress(result: Array<MarkerOperation>, data: CompressedOperationsData): void;
|
|
9
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x579d=['length','decompress','oldRange','newRange'];(function(_0x2b7873,_0x579db5){const _0x37b2a9=function(_0x58e502){while(--_0x58e502){_0x2b7873['push'](_0x2b7873['shift']());}};_0x37b2a9(++_0x579db5);}(_0x579d,0x11a));const _0x37b2=function(_0x2b7873,_0x579db5){_0x2b7873=_0x2b7873-0x0;let _0x37b2a9=_0x579d[_0x2b7873];return _0x37b2a9;};import _0x5721d6 from'./operationcompressor.js';export default class n extends _0x5721d6{[_0x37b2('0x3')](_0x12a974,_0x1017c8){super[_0x37b2('0x3')](_0x12a974,_0x1017c8);const _0x518404=_0x12a974[_0x12a974[_0x37b2('0x2')]-0x1];_0x518404[_0x37b2('0x0')]||(_0x518404[_0x37b2('0x0')]=null),_0x518404[_0x37b2('0x1')]||(_0x518404[_0x37b2('0x1')]=null);}}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import OperationCompressor from './operationcompressor';
|
|
2
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
3
|
-
import type { Operation } from 'ckeditor5/src/engine';
|
|
4
|
-
/**
|
|
5
|
-
* @extends OperationCompressor
|
|
6
|
-
*/
|
|
7
|
-
export default class NoOperationCompressor extends OperationCompressor {
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
compress(result: CompressedOperationsData, operations: Array<Operation>): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
16
|
-
}
|
|
1
|
+
import OperationCompressor from './operationcompressor.js';
|
|
2
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
3
|
+
import type { Operation } from 'ckeditor5/src/engine.js';
|
|
4
|
+
/**
|
|
5
|
+
* @extends OperationCompressor
|
|
6
|
+
*/
|
|
7
|
+
export default class NoOperationCompressor extends OperationCompressor {
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
compress(result: CompressedOperationsData, operations: Array<Operation>): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
decompress(result: Array<any>, data: CompressedOperationsData): void;
|
|
16
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x34d2=['_id','shift','_operationName','push','compress','types'];(function(_0x2a9bb6,_0x34d244){var _0x577d4b=function(_0x9d5b06){while(--_0x9d5b06){_0x2a9bb6['push'](_0x2a9bb6['shift']());}};_0x577d4b(++_0x34d244);}(_0x34d2,0x117));var _0x577d=function(_0x2a9bb6,_0x34d244){_0x2a9bb6=_0x2a9bb6-0x0;var _0x577d4b=_0x34d2[_0x2a9bb6];return _0x577d4b;};import _0x57446e from'./operationcompressor.js';export default class p extends _0x57446e{[_0x577d('0x1')](_0x1c0e43,_0x17ac72){return _0x17ac72[_0x577d('0x4')](),_0x1c0e43['types']['push'](this[_0x577d('0x3')]),!0x0;}['decompress'](_0xfe446a,_0x1b6387){_0x1b6387[_0x577d('0x2')][_0x577d('0x4')](),_0xfe446a[_0x577d('0x0')]({'__className':this[_0x577d('0x5')]});}}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type { CompressedOperationsData } from '../compressor';
|
|
2
|
-
import type { ProtobufDescriptor } from '../protobuffactory';
|
|
3
|
-
import type { Operation } from 'ckeditor5/src/engine';
|
|
4
|
-
/**
|
|
5
|
-
* Compresses and decompresses single operation to the binary format.
|
|
6
|
-
*/
|
|
7
|
-
export default class OperationCompressor {
|
|
8
|
-
constructor(id: number, operationName: string, protobufDescriptor: ProtobufDescriptor);
|
|
9
|
-
/**
|
|
10
|
-
* Serializes and consumes the first operation from the list.
|
|
11
|
-
*
|
|
12
|
-
* @param result Object to which compression result will be added.
|
|
13
|
-
* @param operations List of operations to compress. The first one will be compressed
|
|
14
|
-
* and removed from the list.
|
|
15
|
-
*/
|
|
16
|
-
compress(result: CompressedOperationsData, operations: Array<Operation>): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Deserializes and consumes buffered operation.
|
|
19
|
-
*
|
|
20
|
-
* @param result Decompressed operation.
|
|
21
|
-
* @param data Data to decompress.
|
|
22
|
-
*/
|
|
23
|
-
decompress(result: Array<Operation>, data: CompressedOperationsData): void;
|
|
24
|
-
}
|
|
1
|
+
import type { CompressedOperationsData } from '../compressor.js';
|
|
2
|
+
import type { ProtobufDescriptor } from '../protobuffactory.js';
|
|
3
|
+
import type { Operation } from 'ckeditor5/src/engine.js';
|
|
4
|
+
/**
|
|
5
|
+
* Compresses and decompresses single operation to the binary format.
|
|
6
|
+
*/
|
|
7
|
+
export default class OperationCompressor {
|
|
8
|
+
constructor(id: number, operationName: string, protobufDescriptor: ProtobufDescriptor);
|
|
9
|
+
/**
|
|
10
|
+
* Serializes and consumes the first operation from the list.
|
|
11
|
+
*
|
|
12
|
+
* @param result Object to which compression result will be added.
|
|
13
|
+
* @param operations List of operations to compress. The first one will be compressed
|
|
14
|
+
* and removed from the list.
|
|
15
|
+
*/
|
|
16
|
+
compress(result: CompressedOperationsData, operations: Array<Operation>): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Deserializes and consumes buffered operation.
|
|
19
|
+
*
|
|
20
|
+
* @param result Decompressed operation.
|
|
21
|
+
* @param data Data to decompress.
|
|
22
|
+
*/
|
|
23
|
+
decompress(result: Array<Operation>, data: CompressedOperationsData): void;
|
|
24
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2535=['__className','decompress','_operationName','push','_id','compress','shift','buffers','types','_protobufDescriptor'];(function(_0x37b82a,_0x2535e0){const _0x3e2a90=function(_0x5d90f0){while(--_0x5d90f0){_0x37b82a['push'](_0x37b82a['shift']());}};_0x3e2a90(++_0x2535e0);}(_0x2535,0x14e));const _0x3e2a=function(_0x37b82a,_0x2535e0){_0x37b82a=_0x37b82a-0x0;let _0x3e2a90=_0x2535[_0x37b82a];return _0x3e2a90;};import{parsePositionBeforeCompression as _0xb7c10f,parsePositionAfterCompression as _0x1e3ce3}from'../utils.js';export default class e{constructor(_0xfe7187,_0x1b90f0,_0x19dc6f){this['_id']=_0xfe7187,this[_0x3e2a('0x8')]=_0x1b90f0,this[_0x3e2a('0x5')]=_0x19dc6f;}[_0x3e2a('0x1')](_0x5621d2,_0x5e04bd){const _0x23c575=_0x5e04bd[_0x3e2a('0x2')]();return _0xb7c10f(_0x23c575),_0x5621d2[_0x3e2a('0x3')]['push'](this[_0x3e2a('0x5')][_0x3e2a('0x1')](_0x23c575)),_0x5621d2[_0x3e2a('0x4')]['push'](this[_0x3e2a('0x0')]),!0x0;}['decompress'](_0xb0847e,_0x13f284){_0x13f284[_0x3e2a('0x4')][_0x3e2a('0x2')]();const _0x5c608a=this['_protobufDescriptor'][_0x3e2a('0x7')](_0x13f284['buffers'][_0x3e2a('0x2')]());_0x1e3ce3(_0x5c608a),_0x5c608a[_0x3e2a('0x6')]=this[_0x3e2a('0x8')],_0xb0847e[_0x3e2a('0x9')](_0x5c608a);}}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Descriptions used by protobuf.
|
|
3
|
-
*
|
|
4
|
-
* If something fails regarding operations serialization, most probably you forgot to update and recompile protobuf descriptions.
|
|
5
|
-
*
|
|
6
|
-
* Change the below descriptions accordingly to changes done to the data that is compressed.
|
|
7
|
-
* Then, rebuild compiled messages. To do that run `node dev/scripts/compilemessages.js` from main directory.
|
|
8
|
-
*
|
|
9
|
-
* If you added a new operation type, add it also in `compressor.ts`.
|
|
10
|
-
*
|
|
11
|
-
* Make sure that the new `compiledmessages.js` is pushed to GH repository.
|
|
12
|
-
*/
|
|
1
|
+
/**
|
|
2
|
+
* Descriptions used by protobuf.
|
|
3
|
+
*
|
|
4
|
+
* If something fails regarding operations serialization, most probably you forgot to update and recompile protobuf descriptions.
|
|
5
|
+
*
|
|
6
|
+
* Change the below descriptions accordingly to changes done to the data that is compressed.
|
|
7
|
+
* Then, rebuild compiled messages. To do that run `node dev/scripts/compilemessages.js` from main directory.
|
|
8
|
+
*
|
|
9
|
+
* If you added a new operation type, add it also in `compressor.ts`.
|
|
10
|
+
*
|
|
11
|
+
* Make sure that the new `compiledmessages.js` is pushed to GH repository.
|
|
12
|
+
*/
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x2c82=['bool','string','repeated','Range','uint32','Position','exports'];(function(_0x5182dd,_0x2c824a){var _0x19ef8d=function(_0x5c3812){while(--_0x5c3812){_0x5182dd['push'](_0x5182dd['shift']());}};_0x19ef8d(++_0x2c824a);}(_0x2c82,0x1ba));var _0x19ef=function(_0x5182dd,_0x2c824a){_0x5182dd=_0x5182dd-0x0;var _0x19ef8d=_0x2c82[_0x5182dd];return _0x19ef8d;};'use strict';module[_0x19ef('0x5')]={'AttributeOperation':{'fields':{'range':{'type':'Range','id':0x1},'key':{'type':_0x19ef('0x0'),'id':0x2},'oldValueBoolean':{'type':_0x19ef('0x6'),'id':0x3},'oldValueJson':{'type':_0x19ef('0x0'),'id':0x4},'newValueBoolean':{'type':_0x19ef('0x6'),'id':0x5},'newValueJson':{'type':_0x19ef('0x0'),'id':0x6},'wasUndone':{'type':_0x19ef('0x6'),'id':0x7}}},'InsertOperation':{'fields':{'position':{'type':_0x19ef('0x4'),'id':0x1},'nodes':{'rule':'repeated','type':'Element','id':0x2},'shouldReceiveAttributes':{'type':'bool','id':0x3},'wasUndone':{'type':_0x19ef('0x6'),'id':0x4}}},'MarkerOperation':{'fields':{'name':{'type':_0x19ef('0x0'),'id':0x1},'oldRange':{'type':'Range','id':0x2},'newRange':{'type':_0x19ef('0x2'),'id':0x3},'affectsData':{'type':_0x19ef('0x6'),'id':0x4},'wasUndone':{'type':_0x19ef('0x6'),'id':0x5}}},'MergeOperation':{'fields':{'sourcePosition':{'type':_0x19ef('0x4'),'id':0x1},'targetPosition':{'type':_0x19ef('0x4'),'id':0x2},'graveyardPosition':{'type':'Position','id':0x3},'howMany':{'type':_0x19ef('0x3'),'id':0x4},'wasUndone':{'type':_0x19ef('0x6'),'id':0x5}}},'MoveOperation':{'fields':{'sourcePosition':{'type':'Position','id':0x1},'howMany':{'type':_0x19ef('0x3'),'id':0x2},'targetPosition':{'type':'Position','id':0x3},'wasUndone':{'type':_0x19ef('0x6'),'id':0x4}}},'RenameOperation':{'fields':{'position':{'type':_0x19ef('0x4'),'id':0x1},'oldName':{'type':_0x19ef('0x0'),'id':0x2},'newName':{'type':_0x19ef('0x0'),'id':0x3},'wasUndone':{'type':_0x19ef('0x6'),'id':0x4}}},'RootAttributeOperation':{'fields':{'root':{'type':_0x19ef('0x0'),'id':0x1},'key':{'type':'string','id':0x2},'oldValueBoolean':{'type':_0x19ef('0x6'),'id':0x3},'oldValueJson':{'type':_0x19ef('0x0'),'id':0x4},'newValueBoolean':{'type':_0x19ef('0x6'),'id':0x5},'newValueJson':{'type':_0x19ef('0x0'),'id':0x6},'wasUndone':{'type':_0x19ef('0x6'),'id':0x7}}},'RootOperation':{'fields':{'rootName':{'type':_0x19ef('0x0'),'id':0x1},'elementName':{'type':'string','id':0x2},'isAdd':{'type':'bool','id':0x3},'wasUndone':{'type':_0x19ef('0x6'),'id':0x4}}},'SplitOperation':{'fields':{'splitPosition':{'type':_0x19ef('0x4'),'id':0x1},'graveyardPosition':{'type':_0x19ef('0x4'),'id':0x2},'howMany':{'type':_0x19ef('0x3'),'id':0x3},'insertionPosition':{'type':_0x19ef('0x4'),'id':0x4},'wasUndone':{'type':'bool','id':0x5}}},'Position':{'fields':{'root':{'type':_0x19ef('0x0'),'id':0x1},'rootMain':{'type':_0x19ef('0x6'),'id':0x2},'rootGraveyard':{'type':_0x19ef('0x6'),'id':0x3},'path':{'rule':_0x19ef('0x1'),'type':_0x19ef('0x3'),'id':0x4},'stickiness':{'type':_0x19ef('0x0'),'id':0x5}}},'Range':{'fields':{'start':{'type':_0x19ef('0x4'),'id':0x1},'end':{'type':_0x19ef('0x4'),'id':0x2}}},'Element':{'fields':{'name':{'type':_0x19ef('0x0'),'id':0x1},'children':{'rule':_0x19ef('0x1'),'type':'Element','id':0x2},'data':{'type':_0x19ef('0x0'),'id':0x3},'attributesBoolean':{'keyType':'string','type':'bool','id':0x4},'attributesJson':{'type':_0x19ef('0x0'),'id':0x5}}}};
|
package/src/protobuffactory.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/src/protobuffactory.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x18de=['toObject','verify','decode','finish','_protobuf','_protobufRoot','getDescriptor','compress','encode'];(function(_0x36cbe6,_0x18decd){const _0x507791=function(_0x227f05){while(--_0x227f05){_0x36cbe6['push'](_0x36cbe6['shift']());}};_0x507791(++_0x18decd);}(_0x18de,0x14a));const _0x5077=function(_0x36cbe6,_0x18decd){_0x36cbe6=_0x36cbe6-0x0;let _0x507791=_0x18de[_0x36cbe6];return _0x507791;};import*as _0x512e8d from'./lib/compiledmessages.js';export default class r{constructor(){this[_0x5077('0x8')]=_0x512e8d;}[_0x5077('0x0')](_0x4c967b){return new ProtobufDescriptor(this[_0x5077('0x8')][_0x4c967b]);}}export class ProtobufDescriptor{constructor(_0x58187b){this[_0x5077('0x7')]=_0x58187b;}[_0x5077('0x1')](_0x5a52fd){const _0x43146b=this[_0x5077('0x7')][_0x5077('0x4')](_0x5a52fd);if(_0x43146b)throw Error(_0x43146b);return this[_0x5077('0x7')][_0x5077('0x2')](this[_0x5077('0x7')]['create'](_0x5a52fd))[_0x5077('0x6')]();}['decompress'](_0x134eb5){return this[_0x5077('0x7')][_0x5077('0x3')](this[_0x5077('0x7')][_0x5077('0x5')](_0x134eb5),{'oneofs':!0x0});}}
|
package/src/utils.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return new position in JSON format shifted by given offset.
|
|
3
|
-
*
|
|
4
|
-
* @param positionJSON Position serialized to JSON.
|
|
5
|
-
* @param shift Offset shift. Can be a negative value.
|
|
6
|
-
* @returns New position in JSON format.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getPositionShiftedBy(positionJSON: any, shift: number): any;
|
|
9
|
-
/**
|
|
10
|
-
* Checks whether one position serialized to JSON is equal to other position serialized to JSON.
|
|
11
|
-
*/
|
|
12
|
-
export declare function arePositionsEqual(positionA: any, positionB: any): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* For the better compression result one of the two common roots (`main` or `$graveyard`)
|
|
15
|
-
* is compressed to the `Boolean` format.
|
|
16
|
-
*
|
|
17
|
-
* Due tu the Protobuf limitation `Position` descriptor has no dedicated compressor
|
|
18
|
-
* so we need to find and format all positions in the operation.
|
|
19
|
-
*/
|
|
20
|
-
export declare function parsePositionBeforeCompression(operation: any): void;
|
|
21
|
-
/**
|
|
22
|
-
* Position reformatting after decompression.
|
|
23
|
-
*
|
|
24
|
-
* @see {parsePositionBeforeCompression}.
|
|
25
|
-
*/
|
|
26
|
-
export declare function parsePositionAfterCompression(operation: any): void;
|
|
1
|
+
/**
|
|
2
|
+
* Return new position in JSON format shifted by given offset.
|
|
3
|
+
*
|
|
4
|
+
* @param positionJSON Position serialized to JSON.
|
|
5
|
+
* @param shift Offset shift. Can be a negative value.
|
|
6
|
+
* @returns New position in JSON format.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPositionShiftedBy(positionJSON: any, shift: number): any;
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether one position serialized to JSON is equal to other position serialized to JSON.
|
|
11
|
+
*/
|
|
12
|
+
export declare function arePositionsEqual(positionA: any, positionB: any): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* For the better compression result one of the two common roots (`main` or `$graveyard`)
|
|
15
|
+
* is compressed to the `Boolean` format.
|
|
16
|
+
*
|
|
17
|
+
* Due tu the Protobuf limitation `Position` descriptor has no dedicated compressor
|
|
18
|
+
* so we need to find and format all positions in the operation.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parsePositionBeforeCompression(operation: any): void;
|
|
21
|
+
/**
|
|
22
|
+
* Position reformatting after decompression.
|
|
23
|
+
*
|
|
24
|
+
* @see {parsePositionBeforeCompression}.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parsePositionAfterCompression(operation: any): void;
|
package/src/utils.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1745=['$graveyard','path','root','rootGraveyard','main','rootMain','nodes','length'];(function(_0x564207,_0x17455f){const _0x42f529=function(_0x2ecd8b){while(--_0x2ecd8b){_0x564207['push'](_0x564207['shift']());}};_0x42f529(++_0x17455f);}(_0x1745,0x1ce));const _0x42f5=function(_0x564207,_0x17455f){_0x564207=_0x564207-0x0;let _0x42f529=_0x1745[_0x564207];return _0x42f529;};import{cloneDeep as _0x52db35,isEqual as _0x27ac1e,isObject as _0x442f9a}from'lodash-es';export function getPositionShiftedBy(_0x4151cb,_0x5052cd){const _0x13fcbd=_0x52db35(_0x4151cb);return _0x13fcbd[_0x42f5('0x3')][_0x13fcbd[_0x42f5('0x3')][_0x42f5('0x1')]-0x1]+=_0x5052cd,_0x13fcbd;}export function arePositionsEqual(_0x1fbdb8,_0x344159){return _0x1fbdb8[_0x42f5('0x4')]===_0x344159[_0x42f5('0x4')]&&_0x27ac1e(_0x1fbdb8['path'],_0x344159[_0x42f5('0x3')]);}export function parsePositionBeforeCompression(_0x33a030){P(_0x33a030,_0x24a02c=>(_0x42f5('0x6')==_0x24a02c[_0x42f5('0x4')]?(_0x24a02c[_0x42f5('0x7')]=!0x0,delete _0x24a02c['root']):_0x42f5('0x2')==_0x24a02c[_0x42f5('0x4')]&&(_0x24a02c[_0x42f5('0x5')]=!0x0,delete _0x24a02c[_0x42f5('0x4')]),_0x24a02c));}export function parsePositionAfterCompression(_0x403377){P(_0x403377,_0x4d133d=>(_0x4d133d['rootMain']?(_0x4d133d[_0x42f5('0x4')]='main',delete _0x4d133d[_0x42f5('0x7')]):_0x4d133d[_0x42f5('0x5')]&&(_0x4d133d['root']=_0x42f5('0x2'),delete _0x4d133d[_0x42f5('0x5')]),_0x4d133d));}function P(_0x386f5b,_0x1360b3){for(const _0x46d655 in _0x386f5b){const _0x12faac=_0x386f5b[_0x46d655];_0x42f5('0x0')!==_0x46d655&&_0x442f9a(_0x12faac)&&(_0x12faac[_0x42f5('0x3')]&&(_0x12faac[_0x42f5('0x4')]||_0x12faac['rootMain']||_0x12faac[_0x42f5('0x5')])?_0x386f5b[_0x46d655]=_0x1360b3(_0x12faac):P(_0x12faac,_0x1360b3));}return _0x386f5b;}
|