@y/y 14.0.0-rc.2 → 14.0.0-rc.21
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/README.md +36 -12
- package/dist/src/index.d.ts +24 -1
- package/dist/src/index.d.ts.map +1 -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/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 +2 -5
- package/dist/src/utils/RelativePosition.d.ts.map +1 -1
- package/dist/src/utils/Renderer.d.ts +144 -0
- package/dist/src/utils/Renderer.d.ts.map +1 -0
- 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 +11 -21
- package/dist/src/utils/Transaction.d.ts.map +1 -1
- package/dist/src/utils/UndoManager.d.ts +13 -14
- 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 +22 -26
- package/dist/src/utils/YEvent.d.ts.map +1 -1
- 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 +2 -3
- 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 +331 -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 +15 -64
- package/dist/src/utils/meta.d.ts.map +1 -1
- package/dist/src/utils/renderer-helpers.d.ts +99 -0
- package/dist/src/utils/renderer-helpers.d.ts.map +1 -0
- 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 +18 -0
- package/dist/src/utils/transaction-helpers.d.ts.map +1 -0
- package/dist/src/utils/updates.d.ts +19 -25
- package/dist/src/utils/updates.d.ts.map +1 -1
- package/dist/src/ytype.d.ts +144 -41
- package/dist/src/ytype.d.ts.map +1 -1
- package/global.d.ts +53 -0
- package/package.json +12 -16
- package/src/index.js +32 -124
- package/src/structs/AbstractStruct.js +21 -16
- package/src/structs/GC.js +15 -20
- package/src/structs/Item.js +992 -318
- package/src/structs/Skip.js +16 -19
- package/src/utils/BlockSet.js +20 -20
- package/src/utils/Doc.js +18 -29
- package/src/utils/ID.js +0 -2
- package/src/utils/RelativePosition.js +15 -25
- package/src/utils/{AttributionManager.js → Renderer.js} +42 -197
- package/src/utils/Snapshot.js +15 -37
- package/src/utils/StructStore.js +89 -227
- package/src/utils/Transaction.js +89 -321
- package/src/utils/UndoManager.js +157 -19
- package/src/utils/UpdateDecoder.js +2 -3
- package/src/utils/UpdateEncoder.js +0 -4
- package/src/utils/YEvent.js +20 -26
- package/src/utils/content-helper.js +0 -0
- package/src/utils/delta-helpers.js +21 -42
- package/src/utils/encoding-helpers.js +110 -0
- package/src/utils/encoding.js +197 -122
- package/src/utils/ids.js +1527 -0
- package/src/utils/isParentOf.js +2 -4
- package/src/utils/logging.js +0 -4
- package/src/utils/meta.js +57 -46
- package/src/utils/renderer-helpers.js +110 -0
- package/src/utils/schemas.js +3 -0
- package/src/utils/transaction-helpers.js +413 -0
- package/src/utils/updates.js +24 -146
- package/src/ytype.js +626 -255
- 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/AttributionManager.d.ts +0 -238
- package/dist/src/utils/AttributionManager.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/dist/tests/IdMap.tests.d.ts +0 -9
- package/dist/tests/IdMap.tests.d.ts.map +0 -1
- package/dist/tests/IdSet.tests.d.ts +0 -9
- package/dist/tests/IdSet.tests.d.ts.map +0 -1
- package/dist/tests/attribution.tests.d.ts +0 -9
- package/dist/tests/attribution.tests.d.ts.map +0 -1
- package/dist/tests/compatibility.tests.d.ts +0 -5
- package/dist/tests/compatibility.tests.d.ts.map +0 -1
- package/dist/tests/delta.tests.d.ts +0 -7
- package/dist/tests/delta.tests.d.ts.map +0 -1
- package/dist/tests/doc.tests.d.ts +0 -13
- package/dist/tests/doc.tests.d.ts.map +0 -1
- package/dist/tests/encoding.tests.d.ts +0 -5
- package/dist/tests/encoding.tests.d.ts.map +0 -1
- package/dist/tests/index.d.ts +0 -2
- package/dist/tests/index.d.ts.map +0 -1
- package/dist/tests/relativePositions.tests.d.ts +0 -11
- package/dist/tests/relativePositions.tests.d.ts.map +0 -1
- package/dist/tests/snapshot.tests.d.ts +0 -14
- package/dist/tests/snapshot.tests.d.ts.map +0 -1
- package/dist/tests/testHelper.d.ts +0 -171
- package/dist/tests/testHelper.d.ts.map +0 -1
- package/dist/tests/undo-redo.tests.d.ts +0 -27
- package/dist/tests/undo-redo.tests.d.ts.map +0 -1
- package/dist/tests/updates.tests.d.ts +0 -26
- package/dist/tests/updates.tests.d.ts.map +0 -1
- package/dist/tests/y-array.tests.d.ts +0 -43
- package/dist/tests/y-array.tests.d.ts.map +0 -1
- package/dist/tests/y-map.tests.d.ts +0 -42
- package/dist/tests/y-map.tests.d.ts.map +0 -1
- package/dist/tests/y-text.tests.d.ts +0 -49
- package/dist/tests/y-text.tests.d.ts.map +0 -1
- package/dist/tests/y-xml.tests.d.ts +0 -14
- package/dist/tests/y-xml.tests.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/src/utils/IdSet.js +0 -825
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @template {
|
|
2
|
+
* @template {DeltaConf} DConf
|
|
3
3
|
* YEvent describes the changes on a YType.
|
|
4
4
|
*/
|
|
5
|
-
export class YEvent<DConf extends
|
|
5
|
+
export class YEvent<DConf extends DeltaConf> {
|
|
6
6
|
/**
|
|
7
7
|
* @param {YType<DConf>} target The changed type.
|
|
8
|
-
* @param {Transaction} transaction
|
|
8
|
+
* @param {import('./Transaction.js').Transaction} transaction
|
|
9
9
|
* @param {Set<any>?} subs The keys that changed
|
|
10
10
|
*/
|
|
11
|
-
constructor(target: YType<DConf>, transaction: Transaction, subs: Set<any> | null);
|
|
11
|
+
constructor(target: YType<DConf>, transaction: import("./Transaction.js").Transaction, subs: Set<any> | null);
|
|
12
12
|
/**
|
|
13
13
|
* The type on which this event was created on.
|
|
14
|
-
* @type {YType<DConf>}
|
|
14
|
+
* @type {import('../ytype.js').YType<DConf>}
|
|
15
15
|
*/
|
|
16
|
-
target: YType<DConf>;
|
|
16
|
+
target: import("../ytype.js").YType<DConf>;
|
|
17
17
|
/**
|
|
18
18
|
* The current target on which the observe callback is called.
|
|
19
19
|
* @type {YType<any>}
|
|
@@ -21,17 +21,17 @@ export class YEvent<DConf extends delta.DeltaConf> {
|
|
|
21
21
|
currentTarget: YType<any>;
|
|
22
22
|
/**
|
|
23
23
|
* The transaction that triggered this event.
|
|
24
|
-
* @type {Transaction}
|
|
24
|
+
* @type {import('./Transaction.js').Transaction}
|
|
25
25
|
*/
|
|
26
|
-
transaction: Transaction;
|
|
26
|
+
transaction: import("./Transaction.js").Transaction;
|
|
27
27
|
/**
|
|
28
|
-
* @type {
|
|
28
|
+
* @type {Delta<import('../ytype.js').DeltaConfDeltaToYType<DConf>>|null}
|
|
29
29
|
*/
|
|
30
|
-
_delta:
|
|
30
|
+
_delta: Delta<import("../ytype.js").DeltaConfDeltaToYType<DConf>> | null;
|
|
31
31
|
/**
|
|
32
|
-
* @type {
|
|
32
|
+
* @type {Delta<DConf>|null}
|
|
33
33
|
*/
|
|
34
|
-
_deltaDeep:
|
|
34
|
+
_deltaDeep: Delta<DConf> | null;
|
|
35
35
|
/**
|
|
36
36
|
* Whether the children changed.
|
|
37
37
|
* @type {Boolean}
|
|
@@ -63,37 +63,33 @@ export class YEvent<DConf extends delta.DeltaConf> {
|
|
|
63
63
|
adds(struct: AbstractStruct): boolean;
|
|
64
64
|
/**
|
|
65
65
|
* @template {boolean} [Deep=false]
|
|
66
|
-
* @param {AbstractAttributionManager} am
|
|
67
66
|
* @param {object} [opts]
|
|
67
|
+
* @param {AbstractRenderer} [opts.renderer] - renders the content (with attributions); defaults to the target type's active renderer (see {@link YType#useRenderer}), i.e. `baseRenderer` unless changed
|
|
68
68
|
* @param {Deep} [opts.deep]
|
|
69
|
-
* @return {Deep extends true ?
|
|
69
|
+
* @return {Deep extends true ? Delta<DConf> : Delta<import('../ytype.js').DeltaConfDeltaToYType<DConf>>} The Delta representation of this type.
|
|
70
70
|
*
|
|
71
71
|
* @public
|
|
72
72
|
*/
|
|
73
|
-
public getDelta<Deep extends boolean = false>(
|
|
73
|
+
public getDelta<Deep extends boolean = false>({ renderer, deep }?: {
|
|
74
|
+
renderer?: import("./renderer-helpers.js").AbstractRenderer | undefined;
|
|
74
75
|
deep?: Deep | undefined;
|
|
75
|
-
}): Deep extends true ?
|
|
76
|
+
}): Deep extends true ? Delta<DConf> : Delta<import("../ytype.js").DeltaConfDeltaToYType<DConf>>;
|
|
76
77
|
/**
|
|
77
78
|
* Compute the changes in the delta format.
|
|
78
79
|
* A {@link https://quilljs.com/docs/delta/|Quill Delta}) that represents the changes on the document.
|
|
79
80
|
*
|
|
80
|
-
* @type {
|
|
81
|
+
* @type {Delta<import('../ytype.js').DeltaConfDeltaToYType<DConf>>} The Delta representation of this type.
|
|
81
82
|
* @public
|
|
82
83
|
*/
|
|
83
|
-
public get delta():
|
|
84
|
+
public get delta(): Delta<import("../ytype.js").DeltaConfDeltaToYType<DConf>>;
|
|
84
85
|
/**
|
|
85
86
|
* Compute the changes in the delta format.
|
|
86
87
|
* A {@link https://quilljs.com/docs/delta/|Quill Delta}) that represents the changes on the document.
|
|
87
88
|
*
|
|
88
|
-
* @type {
|
|
89
|
+
* @type {Delta<DConf>} The Delta representation of this type.
|
|
89
90
|
* @public
|
|
90
91
|
*/
|
|
91
|
-
public get deltaDeep():
|
|
92
|
+
public get deltaDeep(): Delta<DConf>;
|
|
92
93
|
}
|
|
93
|
-
export function getPathTo(parent: YType, child: YType,
|
|
94
|
-
import * as delta from 'lib0/delta';
|
|
95
|
-
import { YType } from '../internals.js';
|
|
96
|
-
import { Transaction } from '../internals.js';
|
|
97
|
-
import { AbstractStruct } from '../internals.js';
|
|
98
|
-
import { AbstractAttributionManager } from '../internals.js';
|
|
94
|
+
export function getPathTo(parent: YType, child: YType, renderer?: AbstractRenderer): Array<string | number>;
|
|
99
95
|
//# sourceMappingURL=YEvent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/YEvent.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"YEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/YEvent.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,oBAHyB,KAAK,SAAhB,SAAU;IAItB;;;;OAIG;IACH,oBAJW,KAAK,CAAC,KAAK,CAAC,eACZ,OAAO,kBAAkB,EAAE,WAAW,QACtC,GAAG,CAAC,GAAG,CAAC,OAAC,EA4CnB;IAzCC;;;OAGG;IACH,QAFU,OAAO,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAExB;IACpB;;;OAGG;IACH,eAFU,KAAK,CAAC,GAAG,CAAC,CAEO;IAC3B;;;OAGG;IACH,aAFU,OAAO,kBAAkB,EAAE,WAAW,CAElB;IAC9B;;OAEG;IACH,QAFU,KAAK,CAAC,OAAO,aAAa,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAAC,IAAI,CAEtD;IAClB;;OAEG;IACH,YAFU,KAAK,CAAC,KAAK,CAAC,GAAC,IAAI,CAEL;IACtB;;;;OAIG;IACH,yBAA6B;IAC7B;;;OAGG;IACH,aAFU,GAAG,CAAC,MAAM,CAAC,CAEO;IAU9B;;;;;;;OAOG;IACH,gBAHW,cAAc,GACb,OAAO,CAIlB;IAED;;;;;;;OAOG;IACH,aAHW,cAAc,GACb,OAAO,CAIlB;IAED;;;;;;;;OAQG;IACH,gBARwB,IAAI,SAAf,OAAS,+BAEnB;QAAgC,QAAQ;QACpB,IAAI;KACxB,GAAS,IAAI,SAAS,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,aAAa,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAiCvG;IAED;;;;;;OAMG;IACH,oBAHU,KAAK,CAAC,OAAO,aAAa,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAKlE;IAED;;;;;;OAMG;IACH,wBAHU,KAAK,CAAC,KAAK,CAAC,CAKrB;CACF;AAoBM,kCARI,KAAK,SACL,KAAK,aACL,gBAAgB,GACf,KAAK,CAAC,MAAM,GAAC,MAAM,CAAC,CAqB/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-helper.d.ts","sourceRoot":"","sources":["../../../src/utils/content-helper.js"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export function diffDocsToDelta(v1: Doc, v2: Doc, {
|
|
2
|
-
|
|
1
|
+
export function diffDocsToDelta(v1: Doc, v2: Doc, { renderer }?: {
|
|
2
|
+
renderer?: import("./Renderer.js").DiffRenderer | undefined;
|
|
3
3
|
}): delta.DeltaBuilderAny;
|
|
4
|
-
import { Doc } from '../internals.js';
|
|
5
4
|
import * as delta from 'lib0/delta';
|
|
6
5
|
//# sourceMappingURL=delta-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delta-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/delta-helpers.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delta-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/delta-helpers.js"],"names":[],"mappings":"AAUO,oCAJI,GAAG,MACH,GAAG;;IACF,KAAK,CAAC,eAAe,CAwBhC;uBAhCsB,YAAY"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function writeStructs(encoder: UpdateEncoderV1 | UpdateEncoderV2, structs: Array<GC | Item | Skip>, client: number, idranges: Array<IdRange>): void;
|
|
2
|
+
export function writeStructsFromIdSet(encoder: UpdateEncoderV1 | UpdateEncoderV2, store: StructStore, idset: IdSet): void;
|
|
3
|
+
export function writeStructsFromTransaction(encoder: UpdateEncoderV1 | UpdateEncoderV2, transaction: Transaction): void;
|
|
4
|
+
export function writeUpdateMessageFromTransaction(encoder: UpdateEncoderV1 | UpdateEncoderV2, transaction: Transaction): boolean;
|
|
5
|
+
import { Skip } from '../structs/Skip.js';
|
|
6
|
+
//# sourceMappingURL=encoding-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoding-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding-helpers.js"],"names":[],"mappings":"AAiBO,sCAPI,eAAe,GAAG,eAAe,WACjC,KAAK,CAAC,EAAE,GAAC,IAAI,GAAC,IAAI,CAAC,UACnB,MAAM,YACN,KAAK,CAAC,OAAO,CAAC,QAmDxB;AAYM,+CATI,eAAe,GAAG,eAAe,SACjC,WAAW,SACX,KAAK,QAiBf;AASM,qDANI,eAAe,GAAG,eAAe,eACjC,WAAW,QAK2H;AAO1I,2DAJI,eAAe,GAAG,eAAe,eACjC,WAAW,GACV,OAAO,CASlB;qBAxGoB,oBAAoB"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export function writeStructs(encoder: UpdateEncoderV1 | UpdateEncoderV2, structs: Array<GC | Item>, client: number, idranges: Array<IdRange>): void;
|
|
2
1
|
export function writeClientsStructs(encoder: UpdateEncoderV1 | UpdateEncoderV2, store: StructStore, _sm: Map<number, number>): void;
|
|
3
|
-
export function writeStructsFromIdSet(encoder: UpdateEncoderV1 | UpdateEncoderV2, store: StructStore, idset: IdSet): void;
|
|
4
|
-
export function writeStructsFromTransaction(encoder: UpdateEncoderV1 | UpdateEncoderV2, transaction: Transaction): void;
|
|
5
2
|
export function readUpdateV2(decoder: decoding.Decoder, ydoc: Doc, transactionOrigin?: any, structDecoder?: UpdateDecoderV1 | UpdateDecoderV2): void;
|
|
6
3
|
export function readUpdate(decoder: decoding.Decoder, ydoc: Doc, transactionOrigin?: any): void;
|
|
7
4
|
export function applyUpdateV2(ydoc: Doc, update: Uint8Array, transactionOrigin?: any, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2): void;
|
|
@@ -10,25 +7,26 @@ export function writeStateAsUpdate(encoder: UpdateEncoderV1 | UpdateEncoderV2, d
|
|
|
10
7
|
export function encodeStateAsUpdateV2(doc: Doc, encodedTargetStateVector?: Uint8Array, encoder?: UpdateEncoderV1 | UpdateEncoderV2): Uint8Array<ArrayBuffer>;
|
|
11
8
|
export function encodeStateAsUpdate(doc: Doc, encodedTargetStateVector?: Uint8Array): Uint8Array<ArrayBuffer>;
|
|
12
9
|
export function readStateVector(decoder: IdSetDecoderV1 | IdSetDecoderV2): Map<number, number>;
|
|
10
|
+
export function mergeUpdatesV2(updates: Array<Uint8Array<ArrayBuffer>>, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2, YEncoder?: typeof UpdateEncoderV1 | typeof UpdateEncoderV2): Uint8Array<ArrayBuffer>;
|
|
11
|
+
export function mergeUpdates(updates: Array<Uint8Array<ArrayBuffer>>): Uint8Array<ArrayBuffer>;
|
|
12
|
+
export function diffUpdateV2(update: Uint8Array, sv: Uint8Array, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2, YEncoder?: typeof UpdateEncoderV1 | typeof UpdateEncoderV2): Uint8Array<ArrayBuffer>;
|
|
13
|
+
export function diffUpdate(update: Uint8Array<ArrayBuffer>, sv: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
13
14
|
export function decodeStateVector(decodedState: Uint8Array): Map<number, number>;
|
|
14
15
|
export function writeStateVector(encoder: IdSetEncoderV1 | IdSetEncoderV2, sv: Map<number, number>): IdSetEncoderV1 | IdSetEncoderV2;
|
|
15
16
|
export function writeDocumentStateVector(encoder: IdSetEncoderV1 | IdSetEncoderV2, doc: Doc): IdSetEncoderV1 | IdSetEncoderV2;
|
|
16
17
|
export function encodeStateVectorV2(doc: Doc | Map<number, number>, encoder?: IdSetEncoderV1 | IdSetEncoderV2): Uint8Array<ArrayBuffer>;
|
|
17
18
|
export function encodeStateVector(doc: Doc | Map<number, number>): Uint8Array<ArrayBuffer>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { StructStore } from '
|
|
24
|
-
import { IdSet } from '../internals.js';
|
|
25
|
-
import { Transaction } from '../internals.js';
|
|
19
|
+
export function createDocFromUpdate(update: Uint8Array, opts?: import("./Doc.js").DocOpts): Doc;
|
|
20
|
+
export function createDocFromUpdateV2(update: Uint8Array, opts?: import("./Doc.js").DocOpts): Doc;
|
|
21
|
+
export function cloneDoc(ydoc: Doc, opts?: import("./Doc.js").DocOpts): Doc;
|
|
22
|
+
import { UpdateEncoderV1 } from './UpdateEncoder.js';
|
|
23
|
+
import { UpdateEncoderV2 } from './UpdateEncoder.js';
|
|
24
|
+
import { StructStore } from './StructStore.js';
|
|
26
25
|
import * as decoding from 'lib0/decoding';
|
|
27
|
-
import { Doc } from '
|
|
28
|
-
import { UpdateDecoderV1 } from '
|
|
29
|
-
import { UpdateDecoderV2 } from '
|
|
30
|
-
import { IdSetDecoderV1 } from '
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import { IdSetEncoderV2 } from '../internals.js';
|
|
26
|
+
import { Doc } from './Doc.js';
|
|
27
|
+
import { UpdateDecoderV1 } from './UpdateDecoder.js';
|
|
28
|
+
import { UpdateDecoderV2 } from './UpdateDecoder.js';
|
|
29
|
+
import { IdSetDecoderV1 } from './UpdateDecoder.js';
|
|
30
|
+
import { IdSetEncoderV1 } from './UpdateEncoder.js';
|
|
31
|
+
import { IdSetEncoderV2 } from './UpdateEncoder.js';
|
|
34
32
|
//# sourceMappingURL=encoding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding.js"],"names":[],"mappings":"AA4CO,6CAPI,eAAe,GAAG,eAAe,SACjC,WAAW,OACX,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,QA4B5B;AAkLM,sCAPI,QAAQ,CAAC,OAAO,QAChB,GAAG,sBACH,GAAG,kBACH,eAAe,GAAG,eAAe,QAqFd;AAavB,oCANI,QAAQ,CAAC,OAAO,QAChB,GAAG,sBACH,GAAG,QAI8H;AAcrI,oCAPI,GAAG,UACH,UAAU,sBACV,GAAG,aACH,OAAO,eAAe,GAAG,OAAO,eAAe,QAOzD;AAaM,kCANI,GAAG,UACH,UAAU,sBACV,GAAG,QAIiH;AAYxH,4CANI,eAAe,GAAG,eAAe,OACjC,GAAG,sBACH,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,QAO5B;AAeM,2CAPI,GAAG,6BACH,UAAU,YACV,e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AAO,OAMpC;gCA7pBgF,oBAAoB;gCAApB,oBAAoB;4BALzD,kBAAkB;0BALpC,eAAe;oBAgBrB,UAAU;gCAPmC,oBAAoB;gCAApB,oBAAoB;+BAApB,oBAAoB;+BACJ,oBAAoB;+BAApB,oBAAoB"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {{ inserts: IdSet, deletes: IdSet }} ContentIds
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {{ inserts: IdMap<any>, deletes: IdMap<any> }} ContentMap
|
|
6
|
+
*/
|
|
7
|
+
export class IdRange {
|
|
8
|
+
/**
|
|
9
|
+
* @param {number} clock
|
|
10
|
+
* @param {number} len
|
|
11
|
+
*/
|
|
12
|
+
constructor(clock: number, len: number);
|
|
13
|
+
/**
|
|
14
|
+
* @type {number}
|
|
15
|
+
*/
|
|
16
|
+
clock: number;
|
|
17
|
+
/**
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
len: number;
|
|
21
|
+
/**
|
|
22
|
+
* @param {number} clock
|
|
23
|
+
* @param {number} len
|
|
24
|
+
*/
|
|
25
|
+
copyWith(clock: number, len: number): IdRange;
|
|
26
|
+
/**
|
|
27
|
+
* Helper method making this compatible with IdMap.
|
|
28
|
+
*
|
|
29
|
+
* @return {Array<ContentAttribute<any>>}
|
|
30
|
+
*/
|
|
31
|
+
get attrs(): Array<ContentAttribute<any>>;
|
|
32
|
+
}
|
|
33
|
+
export class MaybeIdRange {
|
|
34
|
+
/**
|
|
35
|
+
* @param {number} clock
|
|
36
|
+
* @param {number} len
|
|
37
|
+
* @param {boolean} exists
|
|
38
|
+
*/
|
|
39
|
+
constructor(clock: number, len: number, exists: boolean);
|
|
40
|
+
/**
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
clock: number;
|
|
44
|
+
/**
|
|
45
|
+
* @type {number}
|
|
46
|
+
*/
|
|
47
|
+
len: number;
|
|
48
|
+
/**
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
*/
|
|
51
|
+
exists: boolean;
|
|
52
|
+
}
|
|
53
|
+
export function createMaybeIdRange(clock: number, len: number, exists: boolean): MaybeIdRange;
|
|
54
|
+
export class IdRanges {
|
|
55
|
+
/**
|
|
56
|
+
* @param {Array<IdRange>} ids
|
|
57
|
+
*/
|
|
58
|
+
constructor(ids: Array<IdRange>);
|
|
59
|
+
sorted: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* A typical use-case for IdSet is to append data. We heavily optimize this case by allowing the
|
|
62
|
+
* last item to be mutated if it isn't used currently.
|
|
63
|
+
* This flag is true if the last item was exposed to the outside.
|
|
64
|
+
*/
|
|
65
|
+
_lastIsUsed: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
69
|
+
private _ids;
|
|
70
|
+
copy(): IdRanges;
|
|
71
|
+
/**
|
|
72
|
+
* @param {number} clock
|
|
73
|
+
* @param {number} length
|
|
74
|
+
*/
|
|
75
|
+
add(clock: number, length: number): void;
|
|
76
|
+
/**
|
|
77
|
+
* Return the list of immutable id ranges, sorted and merged.
|
|
78
|
+
*/
|
|
79
|
+
getIds(): IdRange[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @implements {traits.EqualityTrait}
|
|
83
|
+
*/
|
|
84
|
+
export class IdSet implements traits.EqualityTrait {
|
|
85
|
+
/**
|
|
86
|
+
* @type {Map<number,IdRanges>}
|
|
87
|
+
*/
|
|
88
|
+
clients: Map<number, IdRanges>;
|
|
89
|
+
isEmpty(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @param {(idrange:IdRange, client:number) => void} f
|
|
92
|
+
*/
|
|
93
|
+
forEach(f: (idrange: IdRange, client: number) => void): void;
|
|
94
|
+
/**
|
|
95
|
+
* @param {ID} id
|
|
96
|
+
* @return {boolean}
|
|
97
|
+
*/
|
|
98
|
+
hasId(id: ID): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* @param {number} client
|
|
101
|
+
* @param {number} clock
|
|
102
|
+
*/
|
|
103
|
+
has(client: number, clock: number): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Return slices of ids that exist in this idset.
|
|
106
|
+
*
|
|
107
|
+
* @param {number} client
|
|
108
|
+
* @param {number} clock
|
|
109
|
+
* @param {number} len
|
|
110
|
+
* @return {Array<MaybeIdRange>}
|
|
111
|
+
*/
|
|
112
|
+
slice(client: number, clock: number, len: number): Array<MaybeIdRange>;
|
|
113
|
+
/**
|
|
114
|
+
* @param {number} client
|
|
115
|
+
* @param {number} clock
|
|
116
|
+
* @param {number} len
|
|
117
|
+
*/
|
|
118
|
+
add(client: number, clock: number, len: number): void;
|
|
119
|
+
/**
|
|
120
|
+
* @param {number} client
|
|
121
|
+
* @param {number} clock
|
|
122
|
+
* @param {number} len
|
|
123
|
+
*/
|
|
124
|
+
delete(client: number, clock: number, len: number): void;
|
|
125
|
+
/**
|
|
126
|
+
* @param {any} other
|
|
127
|
+
*/
|
|
128
|
+
[traits.EqualityTraitSymbol](other: any): boolean;
|
|
129
|
+
}
|
|
130
|
+
export function equalIdSets(ds1: IdSet, ds2: IdSet): boolean;
|
|
131
|
+
export function _deleteRangeFromIdSet(set: IdSet | IdMap<any>, client: number, clock: number, len: number): void;
|
|
132
|
+
export function iterateStructsByIdSet(transaction: Transaction, ds: IdSet, f: (arg0: GC | Item) => void): void;
|
|
133
|
+
export function gcIdSet(doc: Doc, ids: IdSet, gcFilter?: (arg0: Item) => boolean): void;
|
|
134
|
+
export function iterateStructsByIdSetWithoutSplits(store: StructStore, ds: IdSet, f: (struct: GC | Item | Skip, offset: number, len: number) => void): void;
|
|
135
|
+
export function findIndexInIdRanges(dis: Array<IdRange>, clock: number): number | null;
|
|
136
|
+
export function findRangeStartInIdRanges(dis: Array<IdRange>, clock: number): number | null;
|
|
137
|
+
export function mergeIdSets(idSets: Array<IdSet>): IdSet;
|
|
138
|
+
/**
|
|
139
|
+
* @template {IdSet | IdMap<any>} S
|
|
140
|
+
* @param {S} dest
|
|
141
|
+
* @param {S} src
|
|
142
|
+
*/
|
|
143
|
+
export function insertIntoIdSet<S extends IdSet | IdMap<any>>(dest: S, src: S): void;
|
|
144
|
+
/**
|
|
145
|
+
* @template {IdSet | IdMap<any>} S
|
|
146
|
+
* @param {S} dest
|
|
147
|
+
* @param {S} src
|
|
148
|
+
*/
|
|
149
|
+
export function insertIntoIdMap<S extends IdSet | IdMap<any>>(dest: S, src: S): void;
|
|
150
|
+
export function _diffSet<Set extends IdSet | IdMap<any>>(set: Set, exclude: IdSet | IdMap<any>): Set;
|
|
151
|
+
/**
|
|
152
|
+
* Remove all ranges from `exclude` from `idSet`. The result is a fresh IdSet containing all ranges from `idSet` that are not
|
|
153
|
+
* in `exclude`.
|
|
154
|
+
*
|
|
155
|
+
* @type {(idSet: IdSet, exclude: IdSet|IdMap<any>) => IdSet}
|
|
156
|
+
*/
|
|
157
|
+
export const diffIdSet: (idSet: IdSet, exclude: IdSet | IdMap<any>) => IdSet;
|
|
158
|
+
export function _intersectSets<SetA extends IdSet | IdMap<any>, SetB extends IdSet | IdMap<any>>(setA: SetA, setB: SetB): SetA extends IdMap<infer A> ? (SetB extends IdMap<infer B> ? IdMap<A | B> : IdMap<A>) : IdSet;
|
|
159
|
+
export function intersectSets<SetA extends IdSet | IdMap<any>, SetB extends IdSet | IdMap<any>>(setA: SetA, setB: SetB): SetA extends IdMap<infer A> ? (SetB extends IdMap<infer B> ? IdMap<A | B> : IdMap<A>) : IdSet;
|
|
160
|
+
export function createIdSet(): IdSet;
|
|
161
|
+
export function createDeleteSetFromStructStore(ss: StructStore): IdSet;
|
|
162
|
+
export function _createInsertSliceFromStructs(structs: Array<GC | Item | Skip>, filterDeleted: boolean): IdRange[];
|
|
163
|
+
export function createInsertSetFromStructStore(ss: StructStore, filterDeleted: boolean): IdSet;
|
|
164
|
+
export function writeIdSet(encoder: IdSetEncoderV1 | IdSetEncoderV2, idSet: IdSet): void;
|
|
165
|
+
export function readIdSet(decoder: IdSetDecoderV1 | IdSetDecoderV2): IdSet;
|
|
166
|
+
export function encodeIdSet(idSet: IdSet): Uint8Array<ArrayBuffer>;
|
|
167
|
+
export function decodeIdSet(data: Uint8Array): IdSet;
|
|
168
|
+
export function readAndApplyDeleteSet(decoder: IdSetDecoderV1 | IdSetDecoderV2, transaction: Transaction, store: StructStore): Uint8Array<ArrayBuffer> | null;
|
|
169
|
+
/**
|
|
170
|
+
* @template Attrs
|
|
171
|
+
*/
|
|
172
|
+
export class AttrRange<Attrs> {
|
|
173
|
+
/**
|
|
174
|
+
* @param {number} clock
|
|
175
|
+
* @param {number} len
|
|
176
|
+
* @param {Array<ContentAttribute<Attrs>>} attrs
|
|
177
|
+
*/
|
|
178
|
+
constructor(clock: number, len: number, attrs: Array<ContentAttribute<Attrs>>);
|
|
179
|
+
/**
|
|
180
|
+
* @readonly
|
|
181
|
+
*/
|
|
182
|
+
readonly clock: number;
|
|
183
|
+
/**
|
|
184
|
+
* @readonly
|
|
185
|
+
*/
|
|
186
|
+
readonly len: number;
|
|
187
|
+
/**
|
|
188
|
+
* @readonly
|
|
189
|
+
*/
|
|
190
|
+
readonly attrs: ContentAttribute<Attrs>[];
|
|
191
|
+
/**
|
|
192
|
+
* @param {number} clock
|
|
193
|
+
* @param {number} len
|
|
194
|
+
*/
|
|
195
|
+
copyWith(clock: number, len: number): AttrRange<Attrs>;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* @todo rename this to `Attribute`
|
|
199
|
+
* @template V
|
|
200
|
+
*/
|
|
201
|
+
export class ContentAttribute<V> {
|
|
202
|
+
/**
|
|
203
|
+
* @param {string} name
|
|
204
|
+
* @param {V} val
|
|
205
|
+
*/
|
|
206
|
+
constructor(name: string, val: V);
|
|
207
|
+
name: string;
|
|
208
|
+
val: V;
|
|
209
|
+
hash(): string;
|
|
210
|
+
}
|
|
211
|
+
export function createContentAttribute<V>(name: string, val: V): ContentAttribute<V>;
|
|
212
|
+
export function createMaybeAttrRange<Attrs>(clock: number, len: number, attrs: Array<ContentAttribute<Attrs>> | null): MaybeAttrRange<Attrs>;
|
|
213
|
+
/**
|
|
214
|
+
* Whenever this is instantiated, it must receive a fresh array of ops, not something copied.
|
|
215
|
+
*
|
|
216
|
+
* @template Attrs
|
|
217
|
+
*/
|
|
218
|
+
export class AttrRanges<Attrs> {
|
|
219
|
+
/**
|
|
220
|
+
* @param {Array<AttrRange<Attrs>>} ids
|
|
221
|
+
*/
|
|
222
|
+
constructor(ids: Array<AttrRange<Attrs>>);
|
|
223
|
+
sorted: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* @private
|
|
226
|
+
*/
|
|
227
|
+
private _ids;
|
|
228
|
+
copy(): AttrRanges<Attrs>;
|
|
229
|
+
/**
|
|
230
|
+
* @param {number} clock
|
|
231
|
+
* @param {number} length
|
|
232
|
+
* @param {Array<ContentAttribute<Attrs>>} attrs
|
|
233
|
+
*/
|
|
234
|
+
add(clock: number, length: number, attrs: Array<ContentAttribute<Attrs>>): void;
|
|
235
|
+
/**
|
|
236
|
+
* Return the list of id ranges, sorted and merged.
|
|
237
|
+
*/
|
|
238
|
+
getIds(): AttrRange<Attrs>[];
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* @template Attrs
|
|
242
|
+
*/
|
|
243
|
+
export class IdMap<Attrs> {
|
|
244
|
+
/**
|
|
245
|
+
* @type {Map<number,AttrRanges<Attrs>>}
|
|
246
|
+
*/
|
|
247
|
+
clients: Map<number, AttrRanges<Attrs>>;
|
|
248
|
+
/**
|
|
249
|
+
* @type {Map<string, ContentAttribute<Attrs>>}
|
|
250
|
+
*/
|
|
251
|
+
attrsH: Map<string, ContentAttribute<Attrs>>;
|
|
252
|
+
/**
|
|
253
|
+
* @type {Set<ContentAttribute<Attrs>>}
|
|
254
|
+
*/
|
|
255
|
+
attrs: Set<ContentAttribute<Attrs>>;
|
|
256
|
+
/**
|
|
257
|
+
* @param {(attrRange:AttrRange<Attrs>, client:number) => void} f
|
|
258
|
+
*/
|
|
259
|
+
forEach(f: (attrRange: AttrRange<Attrs>, client: number) => void): void;
|
|
260
|
+
isEmpty(): boolean;
|
|
261
|
+
/**
|
|
262
|
+
* @param {ID} id
|
|
263
|
+
* @return {boolean}
|
|
264
|
+
*/
|
|
265
|
+
hasId(id: ID): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* @param {number} client
|
|
268
|
+
* @param {number} clock
|
|
269
|
+
* @return {boolean}
|
|
270
|
+
*/
|
|
271
|
+
has(client: number, clock: number): boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Return attributions for a slice of ids.
|
|
274
|
+
*
|
|
275
|
+
* @param {ID} id
|
|
276
|
+
* @param {number} len
|
|
277
|
+
* @return {Array<MaybeAttrRange<Attrs>>}
|
|
278
|
+
*/
|
|
279
|
+
sliceId(id: ID, len: number): Array<MaybeAttrRange<Attrs>>;
|
|
280
|
+
/**
|
|
281
|
+
* Return attributions for a slice of ids.
|
|
282
|
+
*
|
|
283
|
+
* @param {number} client
|
|
284
|
+
* @param {number} clock
|
|
285
|
+
* @param {number} len
|
|
286
|
+
* @return {Array<MaybeAttrRange<Attrs>>}
|
|
287
|
+
*/
|
|
288
|
+
slice(client: number, clock: number, len: number): Array<MaybeAttrRange<Attrs>>;
|
|
289
|
+
/**
|
|
290
|
+
* @param {number} client
|
|
291
|
+
* @param {number} clock
|
|
292
|
+
* @param {number} len
|
|
293
|
+
* @param {Array<ContentAttribute<Attrs>>} attrs
|
|
294
|
+
*/
|
|
295
|
+
add(client: number, clock: number, len: number, attrs: Array<ContentAttribute<Attrs>>): void;
|
|
296
|
+
/**
|
|
297
|
+
* @param {number} client
|
|
298
|
+
* @param {number} clock
|
|
299
|
+
* @param {number} len
|
|
300
|
+
*/
|
|
301
|
+
delete(client: number, clock: number, len: number): void;
|
|
302
|
+
}
|
|
303
|
+
export function idmapAttrsEqual<T>(a: Array<T>, b: Array<T>): boolean;
|
|
304
|
+
export function mergeIdMaps<T>(ams: Array<IdMap<T>>): IdMap<T>;
|
|
305
|
+
export function createIdMapFromIdSet(idset: IdSet, attrs: Array<ContentAttribute<any>>): IdMap<any>;
|
|
306
|
+
export function createIdSetFromIdMap(idmap: IdMap<any>): IdSet;
|
|
307
|
+
export function writeIdMap<Attr>(encoder: IdSetEncoderV1 | IdSetEncoderV2, idmap: IdMap<Attr>): void;
|
|
308
|
+
export function encodeIdMap(idmap: IdMap<any>): Uint8Array<ArrayBuffer>;
|
|
309
|
+
export function readIdMap(decoder: IdSetDecoderV1 | IdSetDecoderV2): IdMap<any>;
|
|
310
|
+
export function decodeIdMap(data: Uint8Array): IdMap<any>;
|
|
311
|
+
export function createIdMap(): IdMap<any>;
|
|
312
|
+
export function diffIdMap<ISet extends IdMap<any>>(set: ISet, exclude: IdSet | IdMap<any>): ISet;
|
|
313
|
+
export function intersectMaps<SetA extends IdSet | IdMap<any>, SetB extends IdSet | IdMap<any>>(setA: SetA, setB: SetB): SetA extends IdMap<infer A> ? (SetB extends IdMap<infer B> ? IdMap<A | B> : IdMap<A>) : IdSet;
|
|
314
|
+
export function filterIdMap<Attrs>(idmap: IdMap<Attrs>, predicate: (attr: Array<ContentAttribute<Attrs>>) => boolean): IdMap<Attrs>;
|
|
315
|
+
export type ContentIds = {
|
|
316
|
+
inserts: IdSet;
|
|
317
|
+
deletes: IdSet;
|
|
318
|
+
};
|
|
319
|
+
export type ContentMap = {
|
|
320
|
+
inserts: IdMap<any>;
|
|
321
|
+
deletes: IdMap<any>;
|
|
322
|
+
};
|
|
323
|
+
export type MaybeAttrRange<Attrs> = {
|
|
324
|
+
clock: number;
|
|
325
|
+
len: number;
|
|
326
|
+
attrs: Array<ContentAttribute<Attrs>> | null;
|
|
327
|
+
};
|
|
328
|
+
import * as traits from 'lib0/traits';
|
|
329
|
+
import { IdSetEncoderV2 } from './UpdateEncoder.js';
|
|
330
|
+
import { IdSetDecoderV2 } from './UpdateDecoder.js';
|
|
331
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/utils/ids.js"],"names":[],"mappings":"AAaA;;GAEG;AAEH;;GAEG;AAEH;IACE;;;OAGG;IACH,mBAHW,MAAM,OACN,MAAM,EAWhB;IARC;;OAEG;IACH,OAFU,MAAM,CAEE;IAClB;;OAEG;IACH,KAFU,MAAM,CAEF;IAGhB;;;OAGG;IACH,gBAHW,MAAM,OACN,MAAM,WAIhB;IAED;;;;OAIG;IACH,aAFY,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAIvC;CACF;AAED;IACE;;;;OAIG;IACH,mBAJW,MAAM,OACN,MAAM,UACN,OAAO,EAejB;IAZC;;OAEG;IACH,OAFU,MAAM,CAEE;IAClB;;OAEG;IACH,KAFU,MAAM,CAEF;IACd;;OAEG;IACH,QAFU,OAAO,CAEG;CAEvB;AAQM,0CALI,MAAM,OACN,MAAM,UACN,OAAO,GACN,YAAY,CAEsE;AAE9F;IACE;;OAEG;IACH,iBAFW,KAAK,CAAC,OAAO,CAAC,EAcxB;IAXC,gBAAmB;IACnB;;;;OAIG;IACH,qBAAwB;IACxB;;OAEG;IACH,aAAe;IAGjB,iBAKC;IAED;;;OAGG;IACH,WAHW,MAAM,UACN,MAAM,QAehB;IAED;;OAEG;IACH,oBA+BC;CACF;AAED;;GAEG;AACH,8BAFgB,MAAM,CAAC,aAAa;IAIhC;;OAEG;IACH,SAFU,GAAG,CAAC,MAAM,EAAC,QAAQ,CAAC,CAEN;IAG1B,mBAEC;IAED;;OAEG;IACH,WAFW,CAAC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,KAAK,IAAI,QAQlD;IAED;;;OAGG;IACH,UAHW,EAAE,GACD,OAAO,CAIlB;IAED;;;OAGG;IACH,YAHW,MAAM,SACN,MAAM,WAQhB;IAED;;;;;;;OAOG;IACH,cALW,MAAM,SACN,MAAM,OACN,MAAM,GACL,K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ACJ,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GACjB,IAAI,CAOf;AA92BM,8BAN2B,IAAI,SAAxB,KAAK,GAAG,KAAK,CAAC,GAAG,CAAE,EACC,IAAI,SAAxB,KAAK,GAAG,KAAK,CAAC,GAAG,CAAE,QACtB,IAAI,QACJ,IAAI,GACH,IAAI,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAwCxG;AAq1BM,4BALM,KAAK,SACP,KAAK,CAAC,KAAK,CAAC,aACZ,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,OAAO,GAChD,KAAK,CAAC,KAAK,CAAC,CAwBvB;yBAx+CY;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE;yBAIlC;IAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CAAE;2BA05B5C,KAAK,IACL;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAC,CAAA;CAAE;wBA56B3D,aAAa;+BASW,oBAAoB;+BACrC,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isParentOf.d.ts","sourceRoot":"","sources":["../../../src/utils/isParentOf.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isParentOf.d.ts","sourceRoot":"","sources":["../../../src/utils/isParentOf.js"],"names":[],"mappings":"AAUO,mCAPI,KAAK,SACL,IAAI,GAAC,IAAI,WAcnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/utils/logging.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/utils/logging.js"],"names":[],"mappings":"AAOO,8BAFI,KAAK,CAAC,GAAG,CAAC,QAWpB"}
|