@y/y 14.0.0-16
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/LICENSE +23 -0
- package/README.md +1406 -0
- package/dist/Skip-j0kX7pdq.js +12173 -0
- package/dist/Skip-j0kX7pdq.js.map +1 -0
- package/dist/Skip-wRT7BKFP.js +11877 -0
- package/dist/Skip-wRT7BKFP.js.map +1 -0
- package/dist/index-DyTeTfmj.js +163 -0
- package/dist/index-DyTeTfmj.js.map +1 -0
- package/dist/index-R7GxO-36.js +165 -0
- package/dist/index-R7GxO-36.js.map +1 -0
- package/dist/internals.cjs +286 -0
- package/dist/internals.cjs.map +1 -0
- package/dist/internals.mjs +25 -0
- package/dist/internals.mjs.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/internals.d.ts +43 -0
- package/dist/src/internals.d.ts.map +1 -0
- package/dist/src/structs/AbstractStruct.d.ts +42 -0
- package/dist/src/structs/AbstractStruct.d.ts.map +1 -0
- package/dist/src/structs/ContentAny.d.ts +67 -0
- package/dist/src/structs/ContentAny.d.ts.map +1 -0
- package/dist/src/structs/ContentBinary.d.ts +64 -0
- package/dist/src/structs/ContentBinary.d.ts.map +1 -0
- package/dist/src/structs/ContentDeleted.d.ts +64 -0
- package/dist/src/structs/ContentDeleted.d.ts.map +1 -0
- package/dist/src/structs/ContentDoc.d.ts +72 -0
- package/dist/src/structs/ContentDoc.d.ts.map +1 -0
- package/dist/src/structs/ContentEmbed.d.ts +67 -0
- package/dist/src/structs/ContentEmbed.d.ts.map +1 -0
- package/dist/src/structs/ContentFormat.d.ts +69 -0
- package/dist/src/structs/ContentFormat.d.ts.map +1 -0
- package/dist/src/structs/ContentJSON.d.ts +70 -0
- package/dist/src/structs/ContentJSON.d.ts.map +1 -0
- package/dist/src/structs/ContentString.d.ts +70 -0
- package/dist/src/structs/ContentString.d.ts.map +1 -0
- package/dist/src/structs/ContentType.d.ts +83 -0
- package/dist/src/structs/ContentType.d.ts.map +1 -0
- package/dist/src/structs/GC.d.ts +31 -0
- package/dist/src/structs/GC.d.ts.map +1 -0
- package/dist/src/structs/Item.d.ts +212 -0
- package/dist/src/structs/Item.d.ts.map +1 -0
- package/dist/src/structs/Skip.d.ts +33 -0
- package/dist/src/structs/Skip.d.ts.map +1 -0
- package/dist/src/types/AbstractType.d.ts +239 -0
- package/dist/src/types/AbstractType.d.ts.map +1 -0
- package/dist/src/types/YArray.d.ts +128 -0
- package/dist/src/types/YArray.d.ts.map +1 -0
- package/dist/src/types/YMap.d.ts +112 -0
- package/dist/src/types/YMap.d.ts.map +1 -0
- package/dist/src/types/YText.d.ts +216 -0
- package/dist/src/types/YText.d.ts.map +1 -0
- package/dist/src/types/YXmlElement.d.ts +106 -0
- package/dist/src/types/YXmlElement.d.ts.map +1 -0
- package/dist/src/types/YXmlFragment.d.ts +143 -0
- package/dist/src/types/YXmlFragment.d.ts.map +1 -0
- package/dist/src/types/YXmlHook.d.ts +32 -0
- package/dist/src/types/YXmlHook.d.ts.map +1 -0
- package/dist/src/types/YXmlText.d.ts +34 -0
- package/dist/src/types/YXmlText.d.ts.map +1 -0
- package/dist/src/utils/AbstractConnector.d.ts +20 -0
- package/dist/src/utils/AbstractConnector.d.ts.map +1 -0
- package/dist/src/utils/AttributionManager.d.ts +224 -0
- package/dist/src/utils/AttributionManager.d.ts.map +1 -0
- package/dist/src/utils/Doc.d.ts +267 -0
- package/dist/src/utils/Doc.d.ts.map +1 -0
- package/dist/src/utils/EventHandler.d.ts +19 -0
- package/dist/src/utils/EventHandler.d.ts.map +1 -0
- package/dist/src/utils/ID.d.ts +26 -0
- package/dist/src/utils/ID.d.ts.map +1 -0
- package/dist/src/utils/IdMap.d.ts +161 -0
- package/dist/src/utils/IdMap.d.ts.map +1 -0
- package/dist/src/utils/IdSet.d.ts +163 -0
- package/dist/src/utils/IdSet.d.ts.map +1 -0
- package/dist/src/utils/RelativePosition.d.ts +91 -0
- package/dist/src/utils/RelativePosition.d.ts.map +1 -0
- package/dist/src/utils/Snapshot.d.ts +40 -0
- package/dist/src/utils/Snapshot.d.ts.map +1 -0
- package/dist/src/utils/StructSet.d.ts +27 -0
- package/dist/src/utils/StructSet.d.ts.map +1 -0
- package/dist/src/utils/StructStore.d.ts +41 -0
- package/dist/src/utils/StructStore.d.ts.map +1 -0
- package/dist/src/utils/Transaction.d.ts +136 -0
- package/dist/src/utils/Transaction.d.ts.map +1 -0
- package/dist/src/utils/UndoManager.d.ts +188 -0
- package/dist/src/utils/UndoManager.d.ts.map +1 -0
- package/dist/src/utils/UpdateDecoder.d.ts +167 -0
- package/dist/src/utils/UpdateDecoder.d.ts.map +1 -0
- package/dist/src/utils/UpdateEncoder.d.ts +164 -0
- package/dist/src/utils/UpdateEncoder.d.ts.map +1 -0
- package/dist/src/utils/YEvent.d.ts +120 -0
- package/dist/src/utils/YEvent.d.ts.map +1 -0
- package/dist/src/utils/delta-helpers.d.ts +6 -0
- package/dist/src/utils/delta-helpers.d.ts.map +1 -0
- package/dist/src/utils/encoding.d.ts +30 -0
- package/dist/src/utils/encoding.d.ts.map +1 -0
- package/dist/src/utils/isParentOf.d.ts +3 -0
- package/dist/src/utils/isParentOf.d.ts.map +1 -0
- package/dist/src/utils/logging.d.ts +3 -0
- package/dist/src/utils/logging.d.ts.map +1 -0
- package/dist/src/utils/types.d.ts +7 -0
- package/dist/src/utils/types.d.ts.map +1 -0
- package/dist/src/utils/updates.d.ts +89 -0
- package/dist/src/utils/updates.d.ts.map +1 -0
- package/dist/testHelper.cjs +780 -0
- package/dist/testHelper.cjs.map +1 -0
- package/dist/testHelper.mjs +617 -0
- package/dist/testHelper.mjs.map +1 -0
- package/dist/tests/IdMap.tests.d.ts +9 -0
- package/dist/tests/IdMap.tests.d.ts.map +1 -0
- package/dist/tests/IdSet.tests.d.ts +9 -0
- package/dist/tests/IdSet.tests.d.ts.map +1 -0
- package/dist/tests/attribution.tests.d.ts +8 -0
- package/dist/tests/attribution.tests.d.ts.map +1 -0
- package/dist/tests/compatibility.tests.d.ts +5 -0
- package/dist/tests/compatibility.tests.d.ts.map +1 -0
- package/dist/tests/delta.tests.d.ts +7 -0
- package/dist/tests/delta.tests.d.ts.map +1 -0
- package/dist/tests/doc.tests.d.ts +13 -0
- package/dist/tests/doc.tests.d.ts.map +1 -0
- package/dist/tests/encoding.tests.d.ts +5 -0
- package/dist/tests/encoding.tests.d.ts.map +1 -0
- package/dist/tests/index.d.ts +2 -0
- package/dist/tests/index.d.ts.map +1 -0
- package/dist/tests/relativePositions.tests.d.ts +11 -0
- package/dist/tests/relativePositions.tests.d.ts.map +1 -0
- package/dist/tests/snapshot.tests.d.ts +13 -0
- package/dist/tests/snapshot.tests.d.ts.map +1 -0
- package/dist/tests/testHelper.d.ts +167 -0
- package/dist/tests/testHelper.d.ts.map +1 -0
- package/dist/tests/undo-redo.tests.d.ts +27 -0
- package/dist/tests/undo-redo.tests.d.ts.map +1 -0
- package/dist/tests/updates.tests.d.ts +24 -0
- package/dist/tests/updates.tests.d.ts.map +1 -0
- package/dist/tests/y-array.tests.d.ts +45 -0
- package/dist/tests/y-array.tests.d.ts.map +1 -0
- package/dist/tests/y-map.tests.d.ts +45 -0
- package/dist/tests/y-map.tests.d.ts.map +1 -0
- package/dist/tests/y-text.tests.d.ts +49 -0
- package/dist/tests/y-text.tests.d.ts.map +1 -0
- package/dist/tests/y-xml.tests.d.ts +15 -0
- package/dist/tests/y-xml.tests.d.ts.map +1 -0
- package/dist/yjs.cjs +151 -0
- package/dist/yjs.cjs.map +1 -0
- package/dist/yjs.mjs +26 -0
- package/dist/yjs.mjs.map +1 -0
- package/package.json +101 -0
- package/src/index.js +153 -0
- package/src/internals.js +44 -0
- package/src/structs/AbstractStruct.js +59 -0
- package/src/structs/ContentAny.js +115 -0
- package/src/structs/ContentBinary.js +93 -0
- package/src/structs/ContentDeleted.js +101 -0
- package/src/structs/ContentDoc.js +141 -0
- package/src/structs/ContentEmbed.js +98 -0
- package/src/structs/ContentFormat.js +105 -0
- package/src/structs/ContentJSON.js +119 -0
- package/src/structs/ContentString.js +113 -0
- package/src/structs/ContentType.js +176 -0
- package/src/structs/GC.js +80 -0
- package/src/structs/Item.js +845 -0
- package/src/structs/Skip.js +75 -0
- package/src/types/AbstractType.js +1434 -0
- package/src/types/YArray.js +270 -0
- package/src/types/YMap.js +244 -0
- package/src/types/YText.js +934 -0
- package/src/types/YXmlElement.js +227 -0
- package/src/types/YXmlFragment.js +266 -0
- package/src/types/YXmlHook.js +68 -0
- package/src/types/YXmlText.js +66 -0
- package/src/utils/AbstractConnector.js +25 -0
- package/src/utils/AttributionManager.js +619 -0
- package/src/utils/Doc.js +372 -0
- package/src/utils/EventHandler.js +87 -0
- package/src/utils/ID.js +89 -0
- package/src/utils/IdMap.js +629 -0
- package/src/utils/IdSet.js +823 -0
- package/src/utils/RelativePosition.js +352 -0
- package/src/utils/Snapshot.js +220 -0
- package/src/utils/StructSet.js +137 -0
- package/src/utils/StructStore.js +289 -0
- package/src/utils/Transaction.js +489 -0
- package/src/utils/UndoManager.js +391 -0
- package/src/utils/UpdateDecoder.js +281 -0
- package/src/utils/UpdateEncoder.js +320 -0
- package/src/utils/YEvent.js +216 -0
- package/src/utils/delta-helpers.js +54 -0
- package/src/utils/encoding.js +623 -0
- package/src/utils/isParentOf.js +21 -0
- package/src/utils/logging.js +21 -0
- package/src/utils/types.js +28 -0
- package/src/utils/updates.js +715 -0
- package/tests/testHelper.js +600 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @private
|
|
3
|
+
*/
|
|
4
|
+
export class ContentString {
|
|
5
|
+
/**
|
|
6
|
+
* @param {string} str
|
|
7
|
+
*/
|
|
8
|
+
constructor(str: string);
|
|
9
|
+
/**
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
str: string;
|
|
13
|
+
/**
|
|
14
|
+
* @return {number}
|
|
15
|
+
*/
|
|
16
|
+
getLength(): number;
|
|
17
|
+
/**
|
|
18
|
+
* @return {Array<any>}
|
|
19
|
+
*/
|
|
20
|
+
getContent(): Array<any>;
|
|
21
|
+
/**
|
|
22
|
+
* @return {boolean}
|
|
23
|
+
*/
|
|
24
|
+
isCountable(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @return {ContentString}
|
|
27
|
+
*/
|
|
28
|
+
copy(): ContentString;
|
|
29
|
+
/**
|
|
30
|
+
* @param {number} offset
|
|
31
|
+
* @return {ContentString}
|
|
32
|
+
*/
|
|
33
|
+
splice(offset: number): ContentString;
|
|
34
|
+
/**
|
|
35
|
+
* @param {ContentString} right
|
|
36
|
+
* @return {boolean}
|
|
37
|
+
*/
|
|
38
|
+
mergeWith(right: ContentString): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @param {Transaction} transaction
|
|
41
|
+
* @param {Item} item
|
|
42
|
+
*/
|
|
43
|
+
integrate(transaction: Transaction, item: Item): void;
|
|
44
|
+
/**
|
|
45
|
+
* @param {Transaction} transaction
|
|
46
|
+
*/
|
|
47
|
+
delete(transaction: Transaction): void;
|
|
48
|
+
/**
|
|
49
|
+
* @param {Transaction} _tr
|
|
50
|
+
*/
|
|
51
|
+
gc(_tr: Transaction): void;
|
|
52
|
+
/**
|
|
53
|
+
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
|
|
54
|
+
* @param {number} offset
|
|
55
|
+
* @param {number} offsetEnd
|
|
56
|
+
*/
|
|
57
|
+
write(encoder: UpdateEncoderV1 | UpdateEncoderV2, offset: number, offsetEnd: number): void;
|
|
58
|
+
/**
|
|
59
|
+
* @return {number}
|
|
60
|
+
*/
|
|
61
|
+
getRef(): number;
|
|
62
|
+
}
|
|
63
|
+
export function readContentString(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentString;
|
|
64
|
+
import { Transaction } from '../internals.js';
|
|
65
|
+
import { Item } from '../internals.js';
|
|
66
|
+
import { UpdateEncoderV1 } from '../internals.js';
|
|
67
|
+
import { UpdateEncoderV2 } from '../internals.js';
|
|
68
|
+
import { UpdateDecoderV1 } from '../internals.js';
|
|
69
|
+
import { UpdateDecoderV2 } from '../internals.js';
|
|
70
|
+
//# sourceMappingURL=ContentString.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentString.d.ts","sourceRoot":"","sources":["../../../src/structs/ContentString.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IACE;;OAEG;IACH,iBAFW,MAAM,EAOhB;IAJC;;OAEG;IACH,KAFU,MAAM,CAEF;IAGhB;;OAEG;IACH,aAFY,MAAM,CAIjB;IAED;;OAEG;IACH,cAFY,KAAK,CAAC,GAAG,CAAC,CAIrB;IAED;;OAEG;IACH,eAFY,OAAO,CAIlB;IAED;;OAEG;IACH,QAFY,aAAa,CAIxB;IAED;;;OAGG;IACH,eAHW,MAAM,GACL,aAAa,CAiBxB;IAED;;;OAGG;IACH,iBAHW,aAAa,GACZ,OAAO,CAKlB;IAED;;;OAGG;IACH,uBAHW,WAAW,QACX,IAAI,QAEiB;IAChC;;OAEG;IACH,oBAFW,WAAW,QAEC;IACvB;;OAEG;IACH,QAFW,WAAW,QAEX;IACX;;;;OAIG;IACH,eAJW,eAAe,GAAG,eAAe,UACjC,MAAM,aACN,MAAM,QAIhB;IAED;;OAEG;IACH,UAFY,MAAM,CAIjB;CACF;AAQM,2CAHI,eAAe,GAAG,eAAe,GAChC,aAAa,CAE0D;4BA9G5E,iBAAiB;qBAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {Array<(decoder: UpdateDecoderV1 | UpdateDecoderV2)=>(import('../utils/types.js').YType)>}
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
export const typeRefs: Array<(decoder: UpdateDecoderV1 | UpdateDecoderV2) => (import("../utils/types.js").YType)>;
|
|
6
|
+
export const YArrayRefID: 0;
|
|
7
|
+
export const YMapRefID: 1;
|
|
8
|
+
export const YTextRefID: 2;
|
|
9
|
+
export const YXmlElementRefID: 3;
|
|
10
|
+
export const YXmlFragmentRefID: 4;
|
|
11
|
+
export const YXmlHookRefID: 5;
|
|
12
|
+
export const YXmlTextRefID: 6;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
export class ContentType {
|
|
17
|
+
/**
|
|
18
|
+
* @param {YType_CT} type
|
|
19
|
+
*/
|
|
20
|
+
constructor(type: YType_CT);
|
|
21
|
+
/**
|
|
22
|
+
* @type {YType_CT}
|
|
23
|
+
*/
|
|
24
|
+
type: YType_CT;
|
|
25
|
+
/**
|
|
26
|
+
* @return {number}
|
|
27
|
+
*/
|
|
28
|
+
getLength(): number;
|
|
29
|
+
/**
|
|
30
|
+
* @return {Array<any>}
|
|
31
|
+
*/
|
|
32
|
+
getContent(): Array<any>;
|
|
33
|
+
/**
|
|
34
|
+
* @return {boolean}
|
|
35
|
+
*/
|
|
36
|
+
isCountable(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @return {ContentType}
|
|
39
|
+
*/
|
|
40
|
+
copy(): ContentType;
|
|
41
|
+
/**
|
|
42
|
+
* @param {number} _offset
|
|
43
|
+
* @return {ContentType}
|
|
44
|
+
*/
|
|
45
|
+
splice(_offset: number): ContentType;
|
|
46
|
+
/**
|
|
47
|
+
* @param {ContentType} _right
|
|
48
|
+
* @return {boolean}
|
|
49
|
+
*/
|
|
50
|
+
mergeWith(_right: ContentType): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* @param {Transaction} transaction
|
|
53
|
+
* @param {Item} item
|
|
54
|
+
*/
|
|
55
|
+
integrate(transaction: Transaction, item: Item): void;
|
|
56
|
+
/**
|
|
57
|
+
* @param {Transaction} transaction
|
|
58
|
+
*/
|
|
59
|
+
delete(transaction: Transaction): void;
|
|
60
|
+
/**
|
|
61
|
+
* @param {Transaction} tr
|
|
62
|
+
*/
|
|
63
|
+
gc(tr: Transaction): void;
|
|
64
|
+
/**
|
|
65
|
+
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
|
|
66
|
+
* @param {number} _offset
|
|
67
|
+
* @param {number} _offsetEnd
|
|
68
|
+
*/
|
|
69
|
+
write(encoder: UpdateEncoderV1 | UpdateEncoderV2, _offset: number, _offsetEnd: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* @return {number}
|
|
72
|
+
*/
|
|
73
|
+
getRef(): number;
|
|
74
|
+
}
|
|
75
|
+
export function readContentType(decoder: UpdateDecoderV1 | UpdateDecoderV2): ContentType;
|
|
76
|
+
export type YType_CT = import("../utils/types.js").YType;
|
|
77
|
+
import { UpdateDecoderV1 } from '../internals.js';
|
|
78
|
+
import { UpdateDecoderV2 } from '../internals.js';
|
|
79
|
+
import { Transaction } from '../internals.js';
|
|
80
|
+
import { Item } from '../internals.js';
|
|
81
|
+
import { UpdateEncoderV1 } from '../internals.js';
|
|
82
|
+
import { UpdateEncoderV2 } from '../internals.js';
|
|
83
|
+
//# sourceMappingURL=ContentType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentType.d.ts","sourceRoot":"","sources":["../../../src/structs/ContentType.js"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,uBAHU,KAAK,CAAC,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,KAAG,CAAC,OAAO,mBAAmB,EAAE,KAAK,CAAC,CAAC,CAWjG;AAED,0BAA2B,CAAC,CAAA;AAC5B,wBAAyB,CAAC,CAAA;AAC1B,yBAA0B,CAAC,CAAA;AAC3B,+BAAgC,CAAC,CAAA;AACjC,gCAAiC,CAAC,CAAA;AAClC,4BAA6B,CAAC,CAAA;AAC9B,4BAA6B,CAAC,CAAA;AAE9B;;GAEG;AACH;IACE;;OAEG;IACH,kBAFW,QAAQ,EAOlB;IAJC;;OAEG;IACH,MAFU,QAAQ,CAEF;IAGlB;;OAEG;IACH,aAFY,MAAM,CAIjB;IAED;;OAEG;IACH,cAFY,KAAK,CAAC,GAAG,CAAC,CAIrB;IAED;;OAEG;IACH,eAFY,OAAO,CAIlB;IAED;;OAEG;IACH,QAFY,WAAW,CAItB;IAED;;;OAGG;IACH,gBAHW,MAAM,GACL,WAAW,CAItB;IAED;;;OAGG;IACH,kBAHW,WAAW,GACV,OAAO,CAIlB;IAED;;;OAGG;IACH,uBAHW,WAAW,QACX,IAAI,QAId;IAED;;OAEG;IACH,oBAFW,WAAW,QAyBrB;IAED;;OAEG;IACH,OAFW,WAAW,QAgBrB;IAED;;;;OAIG;IACH,eAJW,eAAe,GAAG,eAAe,WACjC,MAAM,cACN,MAAM,QAIhB;IAED;;OAEG;IACH,UAFY,MAAM,CAIjB;CACF;AAQM,yCAHI,eAAe,GAAG,eAAe,GAChC,WAAW,CAE4E;uBAnKtF,OAAO,mBAAmB,EAAE,KAAK;gCAHvC,iBAAiB;gCAAjB,iBAAiB;4BAAjB,iBAAiB;qBAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const structGCRefNumber: 0;
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
export class GC extends AbstractStruct {
|
|
6
|
+
delete(): void;
|
|
7
|
+
/**
|
|
8
|
+
* @param {GC} right
|
|
9
|
+
* @return {boolean}
|
|
10
|
+
*/
|
|
11
|
+
mergeWith(right: GC): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @param {Transaction} _transaction
|
|
14
|
+
* @param {StructStore} _store
|
|
15
|
+
* @return {null | number}
|
|
16
|
+
*/
|
|
17
|
+
getMissing(_transaction: Transaction, _store: StructStore): null | number;
|
|
18
|
+
/**
|
|
19
|
+
* gc structs can't be spliced.
|
|
20
|
+
*
|
|
21
|
+
* If this feature is required in the future, then need to try to merge this struct after
|
|
22
|
+
* transaction.
|
|
23
|
+
*
|
|
24
|
+
* @param {number} diff
|
|
25
|
+
*/
|
|
26
|
+
splice(diff: number): GC;
|
|
27
|
+
}
|
|
28
|
+
import { AbstractStruct } from '../internals.js';
|
|
29
|
+
import { Transaction } from '../internals.js';
|
|
30
|
+
import { StructStore } from '../internals.js';
|
|
31
|
+
//# sourceMappingURL=GC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GC.d.ts","sourceRoot":"","sources":["../../../src/structs/GC.js"],"names":[],"mappings":"AASA,gCAAiC,CAAC,CAAA;AAElC;;GAEG;AACH;IAKE,eAAY;IAEZ;;;OAGG;IACH,iBAHW,EAAE,GACD,OAAO,CAQlB;IA0BD;;;;OAIG;IACH,yBAJW,WAAW,UACX,WAAW,GACV,IAAI,GAAG,MAAM,CAIxB;IAED;;;;;;;OAOG;IACH,aAFW,MAAM,MAMhB;CACF;+BAxEM,iBAAiB;4BAAjB,iBAAiB;4BAAjB,iBAAiB"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
export function followRedone(store: StructStore, id: ID): {
|
|
2
|
+
item: Item;
|
|
3
|
+
diff: number;
|
|
4
|
+
};
|
|
5
|
+
export function keepItem(item: Item | null, keep: boolean): void;
|
|
6
|
+
export function splitItem(transaction: Transaction | null, leftItem: Item, diff: number): Item;
|
|
7
|
+
export function splitStruct(transaction: Transaction | null, leftStruct: AbstractStruct, diff: number): GC | Item;
|
|
8
|
+
export function redoItem(transaction: Transaction, item: Item, redoitems: Set<Item>, itemsToDelete: IdSet, ignoreRemoteMapChanges: boolean, um: import("../utils/UndoManager.js").UndoManager): Item | null;
|
|
9
|
+
/**
|
|
10
|
+
* Abstract class that represents any content.
|
|
11
|
+
*/
|
|
12
|
+
export class Item extends AbstractStruct {
|
|
13
|
+
/**
|
|
14
|
+
* @param {ID} id
|
|
15
|
+
* @param {Item | null} left
|
|
16
|
+
* @param {ID | null} origin
|
|
17
|
+
* @param {Item | null} right
|
|
18
|
+
* @param {ID | null} rightOrigin
|
|
19
|
+
* @param {AbstractType<any,any>|ID|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it.
|
|
20
|
+
* @param {string | null} parentSub
|
|
21
|
+
* @param {AbstractContent} content
|
|
22
|
+
*/
|
|
23
|
+
constructor(id: ID, left: Item | null, origin: ID | null, right: Item | null, rightOrigin: ID | null, parent: AbstractType<any, any> | ID | null, parentSub: string | null, content: AbstractContent);
|
|
24
|
+
/**
|
|
25
|
+
* The item that was originally to the left of this item.
|
|
26
|
+
* @type {ID | null}
|
|
27
|
+
*/
|
|
28
|
+
origin: ID | null;
|
|
29
|
+
/**
|
|
30
|
+
* The item that is currently to the left of this item.
|
|
31
|
+
* @type {Item | null}
|
|
32
|
+
*/
|
|
33
|
+
left: Item | null;
|
|
34
|
+
/**
|
|
35
|
+
* The item that is currently to the right of this item.
|
|
36
|
+
* @type {Item | null}
|
|
37
|
+
*/
|
|
38
|
+
right: Item | null;
|
|
39
|
+
/**
|
|
40
|
+
* The item that was originally to the right of this item.
|
|
41
|
+
* @type {ID | null}
|
|
42
|
+
*/
|
|
43
|
+
rightOrigin: ID | null;
|
|
44
|
+
/**
|
|
45
|
+
* @type {AbstractType<any,any>|ID|null}
|
|
46
|
+
*/
|
|
47
|
+
parent: AbstractType<any, any> | ID | null;
|
|
48
|
+
/**
|
|
49
|
+
* If the parent refers to this item with some kind of key (e.g. YMap, the
|
|
50
|
+
* key is specified here. The key is then used to refer to the list in which
|
|
51
|
+
* to insert this item. If `parentSub = null` type._start is the list in
|
|
52
|
+
* which to insert to. Otherwise it is `parent._map`.
|
|
53
|
+
* @type {String | null}
|
|
54
|
+
*/
|
|
55
|
+
parentSub: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* If this type's effect is redone this type refers to the type that undid
|
|
58
|
+
* this operation.
|
|
59
|
+
* @type {ID | null}
|
|
60
|
+
*/
|
|
61
|
+
redone: ID | null;
|
|
62
|
+
/**
|
|
63
|
+
* @type {AbstractContent}
|
|
64
|
+
*/
|
|
65
|
+
content: AbstractContent;
|
|
66
|
+
/**
|
|
67
|
+
* bit1: keep
|
|
68
|
+
* bit2: countable
|
|
69
|
+
* bit3: deleted
|
|
70
|
+
* bit4: mark - mark node as fast-search-marker
|
|
71
|
+
* @type {number} byte
|
|
72
|
+
*/
|
|
73
|
+
info: number;
|
|
74
|
+
/**
|
|
75
|
+
* This is used to mark the item as an indexed fast-search marker
|
|
76
|
+
*
|
|
77
|
+
* @type {boolean}
|
|
78
|
+
*/
|
|
79
|
+
set marker(isMarked: boolean);
|
|
80
|
+
get marker(): boolean;
|
|
81
|
+
set keep(doKeep: boolean);
|
|
82
|
+
/**
|
|
83
|
+
* If true, do not garbage collect this Item.
|
|
84
|
+
*/
|
|
85
|
+
get keep(): boolean;
|
|
86
|
+
get countable(): boolean;
|
|
87
|
+
set deleted(doDelete: boolean);
|
|
88
|
+
/**
|
|
89
|
+
* Whether this item was deleted or not.
|
|
90
|
+
* @type {Boolean}
|
|
91
|
+
*/
|
|
92
|
+
get deleted(): boolean;
|
|
93
|
+
markDeleted(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Return the creator clientID of the missing op or define missing items and return null.
|
|
96
|
+
*
|
|
97
|
+
* @param {Transaction} transaction
|
|
98
|
+
* @param {StructStore} store
|
|
99
|
+
* @return {null | number}
|
|
100
|
+
*/
|
|
101
|
+
getMissing(transaction: Transaction, store: StructStore): null | number;
|
|
102
|
+
/**
|
|
103
|
+
* Returns the next non-deleted item
|
|
104
|
+
*/
|
|
105
|
+
get next(): Item | null;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the previous non-deleted item
|
|
108
|
+
*/
|
|
109
|
+
get prev(): Item | null;
|
|
110
|
+
/**
|
|
111
|
+
* Computes the last content address of this Item.
|
|
112
|
+
*/
|
|
113
|
+
get lastId(): ID;
|
|
114
|
+
/**
|
|
115
|
+
* Try to merge two items
|
|
116
|
+
*
|
|
117
|
+
* @param {Item} right
|
|
118
|
+
* @return {boolean}
|
|
119
|
+
*/
|
|
120
|
+
mergeWith(right: Item): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Mark this Item as deleted.
|
|
123
|
+
*
|
|
124
|
+
* @param {Transaction} transaction
|
|
125
|
+
*/
|
|
126
|
+
delete(transaction: Transaction): void;
|
|
127
|
+
/**
|
|
128
|
+
* @param {Transaction} tr
|
|
129
|
+
* @param {boolean} parentGCd
|
|
130
|
+
*/
|
|
131
|
+
gc(tr: Transaction, parentGCd: boolean): void;
|
|
132
|
+
}
|
|
133
|
+
export function readItemContent(decoder: UpdateDecoderV1 | UpdateDecoderV2, info: number): AbstractContent;
|
|
134
|
+
/**
|
|
135
|
+
* A lookup map for reading Item content.
|
|
136
|
+
*
|
|
137
|
+
* @type {Array<function(UpdateDecoderV1 | UpdateDecoderV2):AbstractContent>}
|
|
138
|
+
*/
|
|
139
|
+
export const contentRefs: Array<(arg0: UpdateDecoderV1 | UpdateDecoderV2) => AbstractContent>;
|
|
140
|
+
/**
|
|
141
|
+
* Do not implement this class!
|
|
142
|
+
*/
|
|
143
|
+
export class AbstractContent {
|
|
144
|
+
/**
|
|
145
|
+
* @return {number}
|
|
146
|
+
*/
|
|
147
|
+
getLength(): number;
|
|
148
|
+
/**
|
|
149
|
+
* @return {Array<any>}
|
|
150
|
+
*/
|
|
151
|
+
getContent(): Array<any>;
|
|
152
|
+
/**
|
|
153
|
+
* Should return false if this Item is some kind of meta information
|
|
154
|
+
* (e.g. format information).
|
|
155
|
+
*
|
|
156
|
+
* * Whether this Item should be addressable via `yarray.get(i)`
|
|
157
|
+
* * Whether this Item should be counted when computing yarray.length
|
|
158
|
+
*
|
|
159
|
+
* @return {boolean}
|
|
160
|
+
*/
|
|
161
|
+
isCountable(): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* @return {AbstractContent}
|
|
164
|
+
*/
|
|
165
|
+
copy(): AbstractContent;
|
|
166
|
+
/**
|
|
167
|
+
* @param {number} _offset
|
|
168
|
+
* @return {AbstractContent}
|
|
169
|
+
*/
|
|
170
|
+
splice(_offset: number): AbstractContent;
|
|
171
|
+
/**
|
|
172
|
+
* @param {AbstractContent} _right
|
|
173
|
+
* @return {boolean}
|
|
174
|
+
*/
|
|
175
|
+
mergeWith(_right: AbstractContent): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* @param {Transaction} _transaction
|
|
178
|
+
* @param {Item} _item
|
|
179
|
+
*/
|
|
180
|
+
integrate(_transaction: Transaction, _item: Item): void;
|
|
181
|
+
/**
|
|
182
|
+
* @param {Transaction} _transaction
|
|
183
|
+
*/
|
|
184
|
+
delete(_transaction: Transaction): void;
|
|
185
|
+
/**
|
|
186
|
+
* @param {Transaction} _transaction
|
|
187
|
+
*/
|
|
188
|
+
gc(_transaction: Transaction): void;
|
|
189
|
+
/**
|
|
190
|
+
* @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder
|
|
191
|
+
* @param {number} _offset
|
|
192
|
+
* @param {number} _offsetEnd
|
|
193
|
+
*/
|
|
194
|
+
write(_encoder: UpdateEncoderV1 | UpdateEncoderV2, _offset: number, _offsetEnd: number): void;
|
|
195
|
+
/**
|
|
196
|
+
* @return {number}
|
|
197
|
+
*/
|
|
198
|
+
getRef(): number;
|
|
199
|
+
}
|
|
200
|
+
export type YType__ = import("../utils/types.js").YType;
|
|
201
|
+
import { StructStore } from '../internals.js';
|
|
202
|
+
import { ID } from '../internals.js';
|
|
203
|
+
import { Transaction } from '../internals.js';
|
|
204
|
+
import { AbstractStruct } from '../internals.js';
|
|
205
|
+
import { GC } from '../internals.js';
|
|
206
|
+
import { IdSet } from '../internals.js';
|
|
207
|
+
import { AbstractType } from '../internals.js';
|
|
208
|
+
import { UpdateDecoderV1 } from '../internals.js';
|
|
209
|
+
import { UpdateDecoderV2 } from '../internals.js';
|
|
210
|
+
import { UpdateEncoderV1 } from '../internals.js';
|
|
211
|
+
import { UpdateEncoderV2 } from '../internals.js';
|
|
212
|
+
//# sourceMappingURL=Item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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AAiB;mBAAjB,iBAAiB;sBAAjB,iBAAiB;6BAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const structSkipRefNumber: 10;
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
export class Skip extends AbstractStruct {
|
|
6
|
+
delete(): void;
|
|
7
|
+
/**
|
|
8
|
+
* @param {Skip} right
|
|
9
|
+
* @return {boolean}
|
|
10
|
+
*/
|
|
11
|
+
mergeWith(right: Skip): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
|
|
14
|
+
* @param {number} offset
|
|
15
|
+
*/
|
|
16
|
+
write(encoder: UpdateEncoderV1 | UpdateEncoderV2, offset: number): void;
|
|
17
|
+
/**
|
|
18
|
+
* @param {Transaction} _transaction
|
|
19
|
+
* @param {StructStore} _store
|
|
20
|
+
* @return {null | number}
|
|
21
|
+
*/
|
|
22
|
+
getMissing(_transaction: Transaction, _store: StructStore): null | number;
|
|
23
|
+
/**
|
|
24
|
+
* @param {number} diff
|
|
25
|
+
*/
|
|
26
|
+
splice(diff: number): Skip;
|
|
27
|
+
}
|
|
28
|
+
import { AbstractStruct } from '../internals.js';
|
|
29
|
+
import { UpdateEncoderV1 } from '../internals.js';
|
|
30
|
+
import { UpdateEncoderV2 } from '../internals.js';
|
|
31
|
+
import { Transaction } from '../internals.js';
|
|
32
|
+
import { StructStore } from '../internals.js';
|
|
33
|
+
//# sourceMappingURL=Skip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skip.d.ts","sourceRoot":"","sources":["../../../src/structs/Skip.js"],"names":[],"mappings":"AAUA,kCAAmC,EAAE,CAAA;AAErC;;GAEG;AACH;IAKE,eAAY;IAEZ;;;OAGG;IACH,iBAHW,IAAI,GACH,OAAO,CAQlB;IAeD;;;OAGG;IACH,eAHW,eAAe,GAAG,eAAe,UACjC,MAAM,QAMhB;IAED;;;;OAIG;IACH,yBAJW,WAAW,UACX,WAAW,GACV,IAAI,GAAG,MAAM,CAIxB;IAED;;OAEG;IACH,aAFW,MAAM,QAMhB;CACF;+BApEM,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;4BAAjB,iBAAiB;4BAAjB,iBAAiB"}
|