@y/y 14.0.0-rc.6 → 14.0.0-rc.7
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/dist/src/index.d.ts +22 -1
- package/dist/src/structs/AbstractStruct.d.ts +14 -17
- package/dist/src/structs/AbstractStruct.d.ts.map +1 -1
- package/dist/src/structs/GC.d.ts +9 -14
- package/dist/src/structs/GC.d.ts.map +1 -1
- package/dist/src/structs/Item.d.ts +569 -31
- package/dist/src/structs/Item.d.ts.map +1 -1
- package/dist/src/structs/Skip.d.ts +9 -11
- package/dist/src/structs/Skip.d.ts.map +1 -1
- package/dist/src/utils/AttributionManager.d.ts +24 -124
- package/dist/src/utils/AttributionManager.d.ts.map +1 -1
- package/dist/src/utils/BlockSet.d.ts +8 -7
- package/dist/src/utils/BlockSet.d.ts.map +1 -1
- package/dist/src/utils/Doc.d.ts +4 -9
- package/dist/src/utils/Doc.d.ts.map +1 -1
- package/dist/src/utils/ID.d.ts +0 -1
- package/dist/src/utils/ID.d.ts.map +1 -1
- package/dist/src/utils/RelativePosition.d.ts +0 -3
- package/dist/src/utils/RelativePosition.d.ts.map +1 -1
- package/dist/src/utils/Snapshot.d.ts +7 -11
- package/dist/src/utils/Snapshot.d.ts.map +1 -1
- package/dist/src/utils/StructStore.d.ts +45 -23
- package/dist/src/utils/StructStore.d.ts.map +1 -1
- package/dist/src/utils/Transaction.d.ts +6 -16
- package/dist/src/utils/Transaction.d.ts.map +1 -1
- package/dist/src/utils/UndoManager.d.ts +7 -8
- package/dist/src/utils/UndoManager.d.ts.map +1 -1
- package/dist/src/utils/UpdateDecoder.d.ts +1 -1
- package/dist/src/utils/UpdateDecoder.d.ts.map +1 -1
- package/dist/src/utils/UpdateEncoder.d.ts +0 -1
- package/dist/src/utils/UpdateEncoder.d.ts.map +1 -1
- package/dist/src/utils/YEvent.d.ts +12 -17
- package/dist/src/utils/YEvent.d.ts.map +1 -1
- package/dist/src/utils/attribution-manager-helpers.d.ts +99 -0
- package/dist/src/utils/attribution-manager-helpers.d.ts.map +1 -0
- package/dist/src/utils/content-helper.d.ts +2 -0
- package/dist/src/utils/content-helper.d.ts.map +1 -0
- package/dist/src/utils/delta-helpers.d.ts +0 -1
- package/dist/src/utils/delta-helpers.d.ts.map +1 -1
- package/dist/src/utils/encoding-helpers.d.ts +6 -0
- package/dist/src/utils/encoding-helpers.d.ts.map +1 -0
- package/dist/src/utils/encoding.d.ts +16 -18
- package/dist/src/utils/encoding.d.ts.map +1 -1
- package/dist/src/utils/ids.d.ts +313 -0
- package/dist/src/utils/ids.d.ts.map +1 -0
- package/dist/src/utils/isParentOf.d.ts +1 -2
- package/dist/src/utils/isParentOf.d.ts.map +1 -1
- package/dist/src/utils/logging.d.ts +0 -1
- package/dist/src/utils/logging.d.ts.map +1 -1
- package/dist/src/utils/meta.d.ts +35 -36
- package/dist/src/utils/meta.d.ts.map +1 -1
- package/dist/src/utils/schemas.d.ts +3 -0
- package/dist/src/utils/schemas.d.ts.map +1 -0
- package/dist/src/utils/transaction-helpers.d.ts +17 -0
- package/dist/src/utils/transaction-helpers.d.ts.map +1 -0
- package/dist/src/utils/updates.d.ts +15 -21
- package/dist/src/utils/updates.d.ts.map +1 -1
- package/dist/src/ytype.d.ts +38 -18
- package/dist/src/ytype.d.ts.map +1 -1
- package/dist/tests/testHelper.d.ts +1 -1
- package/dist/tests/testHelper.d.ts.map +1 -1
- package/dist/tests/updates.tests.d.ts.map +1 -1
- package/dist/tests/y-map.tests.d.ts.map +1 -1
- package/dist/tests/y-text.tests.d.ts.map +1 -1
- package/package.json +7 -11
- package/src/index.js +24 -127
- package/src/structs/AbstractStruct.js +21 -16
- package/src/structs/GC.js +15 -20
- package/src/structs/Item.js +992 -317
- package/src/structs/Skip.js +16 -19
- package/src/utils/AttributionManager.js +16 -181
- package/src/utils/BlockSet.js +17 -19
- package/src/utils/Doc.js +15 -29
- package/src/utils/ID.js +0 -2
- package/src/utils/RelativePosition.js +8 -18
- package/src/utils/Snapshot.js +12 -34
- package/src/utils/StructStore.js +89 -227
- package/src/utils/Transaction.js +58 -302
- package/src/utils/UndoManager.js +149 -14
- package/src/utils/UpdateDecoder.js +2 -3
- package/src/utils/UpdateEncoder.js +0 -4
- package/src/utils/YEvent.js +10 -16
- package/src/utils/attribution-manager-helpers.js +110 -0
- package/src/utils/content-helper.js +0 -0
- package/src/utils/delta-helpers.js +4 -10
- package/src/utils/encoding-helpers.js +110 -0
- package/src/utils/encoding.js +197 -122
- package/src/utils/{IdSet.js → ids.js} +695 -68
- package/src/utils/isParentOf.js +2 -4
- package/src/utils/logging.js +0 -4
- package/src/utils/meta.js +40 -40
- package/src/utils/schemas.js +3 -0
- package/src/utils/transaction-helpers.js +386 -0
- package/src/utils/updates.js +19 -141
- package/src/ytype.js +233 -76
- package/tests/testHelper.js +10 -12
- package/dist/src/internals.d.ts +0 -36
- package/dist/src/internals.d.ts.map +0 -1
- package/dist/src/structs/ContentAny.d.ts +0 -67
- package/dist/src/structs/ContentAny.d.ts.map +0 -1
- package/dist/src/structs/ContentBinary.d.ts +0 -64
- package/dist/src/structs/ContentBinary.d.ts.map +0 -1
- package/dist/src/structs/ContentDeleted.d.ts +0 -64
- package/dist/src/structs/ContentDeleted.d.ts.map +0 -1
- package/dist/src/structs/ContentDoc.d.ts +0 -72
- package/dist/src/structs/ContentDoc.d.ts.map +0 -1
- package/dist/src/structs/ContentEmbed.d.ts +0 -67
- package/dist/src/structs/ContentEmbed.d.ts.map +0 -1
- package/dist/src/structs/ContentFormat.d.ts +0 -69
- package/dist/src/structs/ContentFormat.d.ts.map +0 -1
- package/dist/src/structs/ContentJSON.d.ts +0 -70
- package/dist/src/structs/ContentJSON.d.ts.map +0 -1
- package/dist/src/structs/ContentString.d.ts +0 -70
- package/dist/src/structs/ContentString.d.ts.map +0 -1
- package/dist/src/structs/ContentType.d.ts +0 -77
- package/dist/src/structs/ContentType.d.ts.map +0 -1
- package/dist/src/utils/IdMap.d.ts +0 -164
- package/dist/src/utils/IdMap.d.ts.map +0 -1
- package/dist/src/utils/IdSet.d.ts +0 -163
- package/dist/src/utils/IdSet.d.ts.map +0 -1
- package/src/internals.js +0 -35
- package/src/structs/ContentAny.js +0 -115
- package/src/structs/ContentBinary.js +0 -93
- package/src/structs/ContentDeleted.js +0 -101
- package/src/structs/ContentDoc.js +0 -141
- package/src/structs/ContentEmbed.js +0 -98
- package/src/structs/ContentFormat.js +0 -105
- package/src/structs/ContentJSON.js +0 -119
- package/src/structs/ContentString.js +0 -113
- package/src/structs/ContentType.js +0 -152
- package/src/utils/IdMap.js +0 -673
package/dist/src/index.d.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
export { Doc } from "./utils/Doc.js";
|
|
2
|
+
export { isParentOf } from "./utils/isParentOf.js";
|
|
3
|
+
export { logType } from "./utils/logging.js";
|
|
4
|
+
export { diffDocsToDelta } from "./utils/delta-helpers.js";
|
|
5
|
+
export { AbstractStruct } from "./structs/AbstractStruct.js";
|
|
6
|
+
export { GC } from "./structs/GC.js";
|
|
7
|
+
export { Skip } from "./structs/Skip.js";
|
|
1
8
|
export * from "./utils/meta.js";
|
|
2
|
-
export {
|
|
9
|
+
export { IdSet, equalIdSets, createDeleteSetFromStructStore, createInsertSetFromStructStore, diffIdSet, createIdSet, mergeIdSets, insertIntoIdSet, iterateStructsByIdSet, readIdSet, IdMap, createIdMap, createContentAttribute, ContentAttribute, diffIdMap, encodeIdMap, createIdMapFromIdSet, insertIntoIdMap, mergeIdMaps, readIdMap, decodeIdMap, filterIdMap } from "./utils/ids.js";
|
|
10
|
+
export { UpdateDecoderV1, UpdateDecoderV2 } from "./utils/UpdateDecoder.js";
|
|
11
|
+
export { UpdateEncoderV1, UpdateEncoderV2 } from "./utils/UpdateEncoder.js";
|
|
12
|
+
export { applyUpdate, applyUpdateV2, readUpdate, readUpdateV2, encodeStateAsUpdate, encodeStateAsUpdateV2, encodeStateVector, decodeStateVector, diffUpdate, diffUpdateV2, mergeUpdates, mergeUpdatesV2, createDocFromUpdate, createDocFromUpdateV2, cloneDoc } from "./utils/encoding.js";
|
|
13
|
+
export { ID, createID, compareIDs, findRootTypeKey } from "./utils/ID.js";
|
|
14
|
+
export { createRelativePositionFromTypeIndex, createRelativePositionFromJSON, createAbsolutePositionFromRelativePosition, compareRelativePositions, AbsolutePosition, RelativePosition, relativePositionToJSON, encodeRelativePosition, decodeRelativePosition } from "./utils/RelativePosition.js";
|
|
15
|
+
export { Snapshot, createSnapshot, snapshot, emptySnapshot, createDocFromSnapshot, decodeSnapshot, encodeSnapshot, decodeSnapshotV2, encodeSnapshotV2, equalSnapshots, snapshotContainsUpdate } from "./utils/Snapshot.js";
|
|
16
|
+
export { findIndexSS, getItemCleanStart, getItemCleanEnd, tryGc } from "./utils/transaction-helpers.js";
|
|
17
|
+
export { Transaction, transact, cleanupYTextFormatting } from "./utils/Transaction.js";
|
|
18
|
+
export { UndoManager, undoContentIds } from "./utils/UndoManager.js";
|
|
19
|
+
export { logUpdate, logUpdateV2, decodeUpdate, decodeUpdateV2, encodeStateVectorFromUpdate, encodeStateVectorFromUpdateV2, convertUpdateFormatV1ToV2, convertUpdateFormatV2ToV1, obfuscateUpdate, obfuscateUpdateV2, createContentIdsFromUpdate, createContentIdsFromUpdateV2, intersectUpdateWithContentIds, intersectUpdateWithContentIdsV2 } from "./utils/updates.js";
|
|
20
|
+
export { YEvent, getPathTo } from "./utils/YEvent.js";
|
|
21
|
+
export { TwosetAttributionManager, noAttributionsManager, AbstractAttributionManager, createAttributionManagerFromDiff, DiffAttributionManager, createAttributionManagerFromSnapshots, SnapshotAttributionManager, Attributions, $attributionManager } from "./utils/AttributionManager.js";
|
|
22
|
+
export { YType as Type, getTypeChildren, typeMapGetSnapshot, typeMapGetAllSnapshot, $ytype, $ytypeAny } from "./ytype.js";
|
|
23
|
+
export { Item, ContentBinary, ContentDeleted, ContentDoc, ContentEmbed, ContentFormat, ContentJSON, ContentAny, ContentString, ContentType } from "./structs/Item.js";
|
|
3
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,7 +4,7 @@ export class AbstractStruct {
|
|
|
4
4
|
* @param {number} length
|
|
5
5
|
*/
|
|
6
6
|
constructor(id: ID, length: number);
|
|
7
|
-
id: ID;
|
|
7
|
+
id: import("../index.js").ID;
|
|
8
8
|
length: number;
|
|
9
9
|
/**
|
|
10
10
|
* @type {boolean}
|
|
@@ -14,29 +14,26 @@ export class AbstractStruct {
|
|
|
14
14
|
* Merge this struct with the item to the right.
|
|
15
15
|
* This method is already assuming that `this.id.clock + this.length === this.id.clock`.
|
|
16
16
|
* Also this method does *not* remove right from StructStore!
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {GC|Item|Skip} _right
|
|
18
18
|
* @return {boolean} whether this merged with right
|
|
19
19
|
*/
|
|
20
|
-
mergeWith(
|
|
20
|
+
mergeWith(_right: GC | Item | Skip): boolean;
|
|
21
21
|
/**
|
|
22
|
-
* @param {UpdateEncoderV1 | UpdateEncoderV2}
|
|
23
|
-
* @param {number}
|
|
24
|
-
* @param {number}
|
|
22
|
+
* @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder The encoder to write data to.
|
|
23
|
+
* @param {number} _offset
|
|
24
|
+
* @param {number} _encodingRef
|
|
25
25
|
*/
|
|
26
|
-
write(
|
|
26
|
+
write(_encoder: UpdateEncoderV1 | UpdateEncoderV2, _offset: number, _encodingRef: number): void;
|
|
27
27
|
/**
|
|
28
|
-
* @param {Transaction}
|
|
29
|
-
* @param {number}
|
|
28
|
+
* @param {Transaction} _transaction
|
|
29
|
+
* @param {number} _offset
|
|
30
30
|
*/
|
|
31
|
-
integrate(
|
|
31
|
+
integrate(_transaction: Transaction, _offset: number): void;
|
|
32
32
|
/**
|
|
33
|
-
* @param {number}
|
|
34
|
-
* @return {
|
|
33
|
+
* @param {number} _diff
|
|
34
|
+
* @return {GC|Item|Skip}
|
|
35
35
|
*/
|
|
36
|
-
splice(
|
|
36
|
+
splice(_diff: number): GC | Item | Skip;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
import { UpdateEncoderV1 } from '../internals.js';
|
|
40
|
-
import { UpdateEncoderV2 } from '../internals.js';
|
|
41
|
-
import { Transaction } from '../internals.js';
|
|
38
|
+
export function addStructToIdSet(idSet: IdSet, struct: AbstractStruct): void;
|
|
42
39
|
//# sourceMappingURL=AbstractStruct.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractStruct.d.ts","sourceRoot":"","sources":["../../../src/structs/AbstractStruct.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AbstractStruct.d.ts","sourceRoot":"","sources":["../../../src/structs/AbstractStruct.js"],"names":[],"mappings":"AAEA;IACE;;;OAGG;IACH,gBAHW,EAAE,UACF,MAAM,EAKhB;IAFC,6BAAY;IACZ,eAAoB;IAGtB;;OAEG;IACH,eAFU,OAAO,CAIhB;IAED;;;;;;OAMG;IACH,kBAHW,EAAE,GAAC,IAAI,GAAC,IAAI,GACX,OAAO,CAIlB;IAED;;;;OAIG;IACH,gBAJW,eAAe,GAAG,eAAe,WACjC,MAAM,gBACN,MAAM,QAIhB;IAED;;;OAGG;IACH,wBAHW,WAAW,WACX,MAAM,QAIhB;IAED;;;OAGG;IACH,cAHW,MAAM,GACL,EAAE,GAAC,IAAI,GAAC,IAAI,CAIvB;CACF;AASM,wCANI,KAAK,UACL,cAAc,QAKqF"}
|
package/dist/src/structs/GC.d.ts
CHANGED
|
@@ -4,17 +4,6 @@ export const structGCRefNumber: 0;
|
|
|
4
4
|
*/
|
|
5
5
|
export class GC extends AbstractStruct {
|
|
6
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
7
|
/**
|
|
19
8
|
* gc structs can't be spliced.
|
|
20
9
|
*
|
|
@@ -24,8 +13,14 @@ export class GC extends AbstractStruct {
|
|
|
24
13
|
* @param {number} diff
|
|
25
14
|
*/
|
|
26
15
|
splice(diff: number): GC;
|
|
16
|
+
/**
|
|
17
|
+
* @type {0}
|
|
18
|
+
*/
|
|
19
|
+
ref: 0;
|
|
20
|
+
/**
|
|
21
|
+
* @type {false}
|
|
22
|
+
*/
|
|
23
|
+
isItem: false;
|
|
27
24
|
}
|
|
28
|
-
import { AbstractStruct } from '
|
|
29
|
-
import { Transaction } from '../internals.js';
|
|
30
|
-
import { StructStore } from '../internals.js';
|
|
25
|
+
import { AbstractStruct } from './AbstractStruct.js';
|
|
31
26
|
//# sourceMappingURL=GC.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GC.d.ts","sourceRoot":"","sources":["../../../src/structs/GC.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GC.d.ts","sourceRoot":"","sources":["../../../src/structs/GC.js"],"names":[],"mappings":"AAGA,gCAAiC,CAAC,CAAA;AAElC;;GAEG;AACH;IAKE,eAAY;IAsCZ;;;;;;;OAOG;IACH,aAFW,MAAM,MAMhB;IAGH;;OAEG;IACH,KAFU,CAAC,CAEK;IAEhB;;OAEG;IACH,QAFU,KAAK,CAEI;CAVlB;+BAhEgD,qBAAqB"}
|