@y/y 14.0.0-18 → 14.0.0-20

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.
Files changed (129) hide show
  1. package/README.md +7 -5
  2. package/dist/src/index.d.ts +2 -1
  3. package/dist/src/internals.d.ts +2 -9
  4. package/dist/src/structs/ContentType.d.ts +6 -12
  5. package/dist/src/structs/ContentType.d.ts.map +1 -1
  6. package/dist/src/structs/Item.d.ts +5 -6
  7. package/dist/src/structs/Item.d.ts.map +1 -1
  8. package/dist/src/utils/AttributionManager.d.ts +20 -6
  9. package/dist/src/utils/AttributionManager.d.ts.map +1 -1
  10. package/dist/src/utils/Doc.d.ts +7 -70
  11. package/dist/src/utils/Doc.d.ts.map +1 -1
  12. package/dist/src/utils/ID.d.ts +2 -2
  13. package/dist/src/utils/ID.d.ts.map +1 -1
  14. package/dist/src/utils/IdMap.d.ts +19 -16
  15. package/dist/src/utils/IdMap.d.ts.map +1 -1
  16. package/dist/src/utils/IdSet.d.ts +2 -2
  17. package/dist/src/utils/IdSet.d.ts.map +1 -1
  18. package/dist/src/utils/RelativePosition.d.ts +8 -8
  19. package/dist/src/utils/RelativePosition.d.ts.map +1 -1
  20. package/dist/src/utils/Transaction.d.ts +9 -5
  21. package/dist/src/utils/Transaction.d.ts.map +1 -1
  22. package/dist/src/utils/UndoManager.d.ts +14 -12
  23. package/dist/src/utils/UndoManager.d.ts.map +1 -1
  24. package/dist/src/utils/UpdateEncoder.d.ts +2 -0
  25. package/dist/src/utils/UpdateEncoder.d.ts.map +1 -1
  26. package/dist/src/utils/YEvent.d.ts +21 -42
  27. package/dist/src/utils/YEvent.d.ts.map +1 -1
  28. package/dist/src/utils/isParentOf.d.ts +1 -1
  29. package/dist/src/utils/isParentOf.d.ts.map +1 -1
  30. package/dist/src/utils/logging.d.ts +2 -2
  31. package/dist/src/utils/logging.d.ts.map +1 -1
  32. package/dist/src/utils/meta.d.ts +43 -0
  33. package/dist/src/utils/meta.d.ts.map +1 -0
  34. package/dist/src/utils/ts.d.ts +4 -0
  35. package/dist/src/utils/ts.d.ts.map +1 -0
  36. package/dist/src/utils/updates.d.ts +3 -9
  37. package/dist/src/utils/updates.d.ts.map +1 -1
  38. package/dist/src/ytype.d.ts +498 -0
  39. package/dist/src/ytype.d.ts.map +1 -0
  40. package/dist/tests/IdMap.tests.d.ts.map +1 -1
  41. package/dist/tests/attribution.tests.d.ts +1 -0
  42. package/dist/tests/attribution.tests.d.ts.map +1 -1
  43. package/dist/tests/compatibility.tests.d.ts.map +1 -1
  44. package/dist/tests/doc.tests.d.ts.map +1 -1
  45. package/dist/tests/relativePositions.tests.d.ts +9 -9
  46. package/dist/tests/relativePositions.tests.d.ts.map +1 -1
  47. package/dist/tests/snapshot.tests.d.ts.map +1 -1
  48. package/dist/tests/testHelper.d.ts +28 -27
  49. package/dist/tests/testHelper.d.ts.map +1 -1
  50. package/dist/tests/undo-redo.tests.d.ts.map +1 -1
  51. package/dist/tests/updates.tests.d.ts +1 -1
  52. package/dist/tests/updates.tests.d.ts.map +1 -1
  53. package/dist/tests/y-array.tests.d.ts +0 -2
  54. package/dist/tests/y-array.tests.d.ts.map +1 -1
  55. package/dist/tests/y-map.tests.d.ts +0 -3
  56. package/dist/tests/y-map.tests.d.ts.map +1 -1
  57. package/dist/tests/y-text.tests.d.ts +1 -1
  58. package/dist/tests/y-text.tests.d.ts.map +1 -1
  59. package/dist/tests/y-xml.tests.d.ts +0 -1
  60. package/dist/tests/y-xml.tests.d.ts.map +1 -1
  61. package/package.json +16 -16
  62. package/src/index.js +152 -0
  63. package/src/internals.js +35 -0
  64. package/src/structs/AbstractStruct.js +59 -0
  65. package/src/structs/ContentAny.js +115 -0
  66. package/src/structs/ContentBinary.js +93 -0
  67. package/src/structs/ContentDeleted.js +101 -0
  68. package/src/structs/ContentDoc.js +141 -0
  69. package/src/structs/ContentEmbed.js +98 -0
  70. package/src/structs/ContentFormat.js +105 -0
  71. package/src/structs/ContentJSON.js +119 -0
  72. package/src/structs/ContentString.js +113 -0
  73. package/src/structs/ContentType.js +152 -0
  74. package/src/structs/GC.js +80 -0
  75. package/src/structs/Item.js +841 -0
  76. package/src/structs/Skip.js +75 -0
  77. package/src/utils/AttributionManager.js +653 -0
  78. package/src/utils/Doc.js +266 -0
  79. package/src/utils/EventHandler.js +87 -0
  80. package/src/utils/ID.js +89 -0
  81. package/src/utils/IdMap.js +673 -0
  82. package/src/utils/IdSet.js +825 -0
  83. package/src/utils/RelativePosition.js +352 -0
  84. package/src/utils/Snapshot.js +220 -0
  85. package/src/utils/StructSet.js +137 -0
  86. package/src/utils/StructStore.js +289 -0
  87. package/src/utils/Transaction.js +671 -0
  88. package/src/utils/UndoManager.js +406 -0
  89. package/src/utils/UpdateDecoder.js +281 -0
  90. package/src/utils/UpdateEncoder.js +327 -0
  91. package/src/utils/YEvent.js +189 -0
  92. package/src/utils/delta-helpers.js +54 -0
  93. package/src/utils/encoding.js +623 -0
  94. package/src/utils/isParentOf.js +21 -0
  95. package/src/utils/logging.js +21 -0
  96. package/src/utils/meta.js +97 -0
  97. package/src/utils/ts.js +3 -0
  98. package/src/utils/updates.js +711 -0
  99. package/src/ytype.js +1962 -0
  100. package/dist/Skip-wRT7BKFP.js +0 -11877
  101. package/dist/Skip-wRT7BKFP.js.map +0 -1
  102. package/dist/index-BV-j5wdP.js +0 -163
  103. package/dist/index-BV-j5wdP.js.map +0 -1
  104. package/dist/internals.js +0 -25
  105. package/dist/internals.js.map +0 -1
  106. package/dist/src/types/AbstractType.d.ts +0 -239
  107. package/dist/src/types/AbstractType.d.ts.map +0 -1
  108. package/dist/src/types/YArray.d.ts +0 -128
  109. package/dist/src/types/YArray.d.ts.map +0 -1
  110. package/dist/src/types/YMap.d.ts +0 -112
  111. package/dist/src/types/YMap.d.ts.map +0 -1
  112. package/dist/src/types/YText.d.ts +0 -216
  113. package/dist/src/types/YText.d.ts.map +0 -1
  114. package/dist/src/types/YXmlElement.d.ts +0 -106
  115. package/dist/src/types/YXmlElement.d.ts.map +0 -1
  116. package/dist/src/types/YXmlFragment.d.ts +0 -143
  117. package/dist/src/types/YXmlFragment.d.ts.map +0 -1
  118. package/dist/src/types/YXmlHook.d.ts +0 -32
  119. package/dist/src/types/YXmlHook.d.ts.map +0 -1
  120. package/dist/src/types/YXmlText.d.ts +0 -34
  121. package/dist/src/types/YXmlText.d.ts.map +0 -1
  122. package/dist/src/utils/AbstractConnector.d.ts +0 -20
  123. package/dist/src/utils/AbstractConnector.d.ts.map +0 -1
  124. package/dist/src/utils/types.d.ts +0 -7
  125. package/dist/src/utils/types.d.ts.map +0 -1
  126. package/dist/testHelper.js +0 -617
  127. package/dist/testHelper.js.map +0 -1
  128. package/dist/yjs.js +0 -26
  129. package/dist/yjs.js.map +0 -1
@@ -0,0 +1,498 @@
1
+ export function warnPrematureAccess(): void;
2
+ export class ItemTextListPosition {
3
+ /**
4
+ * @param {Item|null} left
5
+ * @param {Item|null} right
6
+ * @param {number} index
7
+ * @param {Map<string,any>} currentAttributes
8
+ * @param {AbstractAttributionManager} am
9
+ */
10
+ constructor(left: Item | null, right: Item | null, index: number, currentAttributes: Map<string, any>, am: AbstractAttributionManager);
11
+ left: Item | null;
12
+ right: Item | null;
13
+ index: number;
14
+ currentAttributes: Map<string, any>;
15
+ am: AbstractAttributionManager;
16
+ /**
17
+ * Only call this if you know that this.right is defined
18
+ */
19
+ forward(): void;
20
+ /**
21
+ * @param {Transaction} transaction
22
+ * @param {YType} parent
23
+ * @param {number} length
24
+ * @param {Object<string,any>} attributes
25
+ *
26
+ * @function
27
+ */
28
+ formatText(transaction: Transaction, parent: YType, length: number, attributes: {
29
+ [x: string]: any;
30
+ }): void;
31
+ }
32
+ export function insertContent(transaction: Transaction, parent: YType, currPos: ItemTextListPosition, content: import("./structs/Item.js").AbstractContent, attributes: {
33
+ [x: string]: any;
34
+ }): void;
35
+ export function insertContentHelper(transaction: Transaction, parent: YType, currPos: ItemTextListPosition, insert: Array<any> | string, attributes: {
36
+ [x: string]: any;
37
+ }): void;
38
+ export function deleteText(transaction: Transaction, currPos: ItemTextListPosition, length: number): ItemTextListPosition;
39
+ export class ArraySearchMarker {
40
+ /**
41
+ * @param {Item} p
42
+ * @param {number} index
43
+ */
44
+ constructor(p: Item, index: number);
45
+ p: Item;
46
+ index: number;
47
+ timestamp: number;
48
+ }
49
+ export function findMarker(yarray: YType, index: number): ArraySearchMarker | null;
50
+ export function updateMarkerChanges(searchMarker: Array<ArraySearchMarker>, index: number, len: number): void;
51
+ export function getTypeChildren(t: YType): Array<Item>;
52
+ export function callTypeObservers(type: YType, transaction: Transaction, event: YEvent<any>): void;
53
+ /**
54
+ * Abstract Yjs Type class
55
+ * @template {delta.DeltaConf} [DConf=any]
56
+ */
57
+ export class YType<DConf extends delta.DeltaConf = any> {
58
+ /**
59
+ * @template {delta.DeltaConf} DC
60
+ * @param {delta.Delta<DC>} d
61
+ * @return {YType<DC>}
62
+ */
63
+ static from<DC extends delta.DeltaConf>(d: delta.Delta<DC>): YType<DC>;
64
+ /**
65
+ * @param {delta.DeltaConfGetName<DConf>?} name
66
+ */
67
+ constructor(name?: delta.DeltaConfGetName<DConf> | null);
68
+ /**
69
+ * @type {delta.DeltaConfGetName<DConf>}
70
+ */
71
+ name: delta.DeltaConfGetName<DConf>;
72
+ /**
73
+ * @type {Item|null}
74
+ */
75
+ _item: Item | null;
76
+ /**
77
+ * @type {Map<string,Item>}
78
+ */
79
+ _map: Map<string, Item>;
80
+ /**
81
+ * @type {Item|null}
82
+ */
83
+ _start: Item | null;
84
+ /**
85
+ * @type {Doc|null}
86
+ */
87
+ doc: Doc | null;
88
+ _length: number;
89
+ /**
90
+ * Event handlers
91
+ * @type {EventHandler<YEvent<DeltaToYType<DConf>>,Transaction>}
92
+ */
93
+ _eH: EventHandler<YEvent<DeltaToYType<DConf>>, Transaction>;
94
+ /**
95
+ * Deep event handlers
96
+ * @type {EventHandler<YEvent<DConf>,Transaction>}
97
+ */
98
+ _dEH: EventHandler<YEvent<DConf>, Transaction>;
99
+ /**
100
+ * @type {null | Array<ArraySearchMarker>}
101
+ */
102
+ _searchMarker: null | Array<ArraySearchMarker>;
103
+ /**
104
+ * @type {delta.DeltaBuilder<DConf>}
105
+ * @private
106
+ */
107
+ private _content;
108
+ _legacyTypeRef: number;
109
+ /**
110
+ * Whether this YText contains formatting attributes.
111
+ * This flag is updated when a formatting item is integrated (see ContentFormat.integrate)
112
+ */
113
+ _hasFormatting: boolean;
114
+ get length(): number;
115
+ /**
116
+ * Returns a fresh delta that can be used to change this YType.
117
+ * @type {delta.DeltaBuilder<DeltaToYType<DConf>>}
118
+ */
119
+ get change(): delta.DeltaBuilder<DeltaToYType<DConf>>;
120
+ /**
121
+ * @return {YType<any>?}
122
+ */
123
+ get parent(): YType<any> | null;
124
+ /**
125
+ * Integrate this type into the Yjs instance.
126
+ *
127
+ * * Save this struct in the os
128
+ * * This type is sent to other client
129
+ * * Observer functions are fired
130
+ *
131
+ * @param {Doc} y The Yjs instance
132
+ * @param {Item|null} item
133
+ */
134
+ _integrate(y: Doc, item: Item | null): void;
135
+ _prelim: any;
136
+ /**
137
+ * @return {YType<DConf>}
138
+ */
139
+ _copy(): YType<DConf>;
140
+ /**
141
+ * Creates YEvent and calls all type observers.
142
+ * Must be implemented by each type.
143
+ *
144
+ * @param {Transaction} transaction
145
+ * @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified.
146
+ */
147
+ _callObserver(transaction: Transaction, parentSubs: Set<null | string>): void;
148
+ /**
149
+ * Observe all events that are created on this type.
150
+ *
151
+ * @template {(target: YEvent<DeltaToYType<DConf>>, tr: Transaction) => void} F
152
+ * @param {F} f Observer function
153
+ * @return {F}
154
+ */
155
+ observe<F extends (target: YEvent<DeltaToYType<DConf>>, tr: Transaction) => void>(f: F): F;
156
+ /**
157
+ * Observe all events that are created by this type and its children.
158
+ *
159
+ * @template {function(YEvent<DConf>,Transaction):void} F
160
+ * @param {F} f Observer function
161
+ * @return {F}
162
+ */
163
+ observeDeep<F extends (arg0: YEvent<DConf>, arg1: Transaction) => void>(f: F): F;
164
+ /**
165
+ * Unregister an observer function.
166
+ *
167
+ * @param {(type:YEvent<DeltaToYType<DConf>>,tr:Transaction)=>void} f Observer function
168
+ */
169
+ unobserve(f: (type: YEvent<DeltaToYType<DConf>>, tr: Transaction) => void): void;
170
+ /**
171
+ * Unregister an observer function.
172
+ *
173
+ * @param {function(YEvent<DConf>,Transaction):void} f Observer function
174
+ */
175
+ unobserveDeep(f: (arg0: YEvent<DConf>, arg1: Transaction) => void): void;
176
+ /**
177
+ * Render the difference to another ydoc (which can be empty) and highlight the differences with
178
+ * attributions.
179
+ *
180
+ * Note that deleted content that was not deleted in prevYdoc is rendered as an insertion with the
181
+ * attribution `{ isDeleted: true, .. }`.
182
+ *
183
+ * @template {boolean} [Deep=false]
184
+ *
185
+ * @param {AbstractAttributionManager} am
186
+ * @param {Object} [opts]
187
+ * @param {import('./utils/IdSet.js').IdSet?} [opts.itemsToRender]
188
+ * @param {boolean} [opts.retainInserts] - if true, retain rendered inserts with attributions
189
+ * @param {boolean} [opts.retainDeletes] - if true, retain rendered+attributed deletes only
190
+ * @param {import('./utils/IdSet.js').IdSet?} [opts.deletedItems] - used for computing prevItem in attributes
191
+ * @param {Map<YType,Set<string|null>>|null} [opts.modified] - set of types that should be rendered as modified children
192
+ * @param {Deep} [opts.deep] - render child types as delta
193
+ * @return {Deep extends true ? delta.Delta<DConf> : delta.Delta<DeltaConfDeltaToYType<DConf>>} The Delta representation of this type.
194
+ *
195
+ * @public
196
+ */
197
+ public toDelta<Deep extends boolean = false>(am?: AbstractAttributionManager, opts?: {
198
+ itemsToRender?: import("./internals.js").IdSet | null | undefined;
199
+ retainInserts?: boolean | undefined;
200
+ retainDeletes?: boolean | undefined;
201
+ deletedItems?: import("./internals.js").IdSet | null | undefined;
202
+ modified?: Map<YType<any>, Set<string | null>> | null | undefined;
203
+ deep?: Deep | undefined;
204
+ }): Deep extends true ? delta.Delta<DConf> : delta.Delta<DeltaConfDeltaToYType<DConf>>;
205
+ /**
206
+ * Render the difference to another ydoc (which can be empty) and highlight the differences with
207
+ * attributions.
208
+ *
209
+ * @param {AbstractAttributionManager} am
210
+ * @return {delta.Delta<DConf>}
211
+ */
212
+ toDeltaDeep(am?: AbstractAttributionManager): delta.Delta<DConf>;
213
+ /**
214
+ * Apply a {@link Delta} on this shared type.
215
+ *
216
+ * @param {delta.DeltaAny} d The changes to apply on this element.
217
+ * @param {AbstractAttributionManager} am
218
+ *
219
+ * @public
220
+ */
221
+ public applyDelta(d: delta.DeltaAny, am?: AbstractAttributionManager): this;
222
+ /**
223
+ * Makes a copy of this data type that can be included somewhere else.
224
+ *
225
+ * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.
226
+ *
227
+ * @return {YType<DConf>}
228
+ */
229
+ clone(): YType<DConf>;
230
+ /**
231
+ * Removes all elements from this YMap.
232
+ */
233
+ clearAttrs(): void;
234
+ /**
235
+ * Removes an attribute from this YXmlElement.
236
+ *
237
+ * @param {string} attributeName The attribute name that is to be removed.
238
+ *
239
+ * @public
240
+ */
241
+ public deleteAttr(attributeName: string): void;
242
+ /**
243
+ * Sets or updates an attribute.
244
+ *
245
+ * @template {Exclude<keyof delta.DeltaConfGetAttrs<DConf>,symbol>} KEY
246
+ * @template {delta.DeltaConfGetAttrs<DConf>[KEY]} VAL
247
+ *
248
+ * @param {KEY} attributeName The attribute name that is to be set.
249
+ * @param {VAL} attributeValue The attribute value that is to be set.
250
+ * @return {VAL}
251
+ *
252
+ * @public
253
+ */
254
+ public setAttr<KEY extends Exclude<keyof delta.DeltaConfGetAttrs<DConf>, symbol>, VAL extends delta.DeltaConfGetAttrs<DConf>[KEY]>(attributeName: KEY, attributeValue: VAL): VAL;
255
+ /**
256
+ * Returns an attribute value that belongs to the attribute name.
257
+ *
258
+ * @template {Exclude<keyof delta.DeltaConfGetAttrs<DConf>,symbol|number>} KEY
259
+ * @param {KEY} attributeName The attribute name that identifies the queried value.
260
+ * @return {delta.DeltaConfGetAttrs<DConf>[KEY]|undefined} The queried attribute value.
261
+ * @public
262
+ */
263
+ public getAttr<KEY extends Exclude<keyof delta.DeltaConfGetAttrs<DConf>, symbol | number>>(attributeName: KEY): delta.DeltaConfGetAttrs<DConf>[KEY] | undefined;
264
+ /**
265
+ * Returns whether an attribute exists
266
+ *
267
+ * @param {string} attributeName The attribute name to check for existence.
268
+ * @return {boolean} whether the attribute exists.
269
+ *
270
+ * @public
271
+ */
272
+ public hasAttr(attributeName: string): boolean;
273
+ /**
274
+ * Returns all attribute name/value pairs in a JSON Object.
275
+ *
276
+ * @param {Snapshot} [snapshot]
277
+ * @return {{ [Key in Extract<keyof delta.DeltaConfGetAttrs<DConf>,string>]?: delta.DeltaConfGetAttrs<DConf>[Key]}} A JSON Object that describes the attributes.
278
+ *
279
+ * @public
280
+ */
281
+ public getAttrs(snapshot?: Snapshot): { [Key in Extract<keyof delta.DeltaConfGetAttrs<DConf>, string>]?: delta.DeltaConfGetAttrs<DConf>[Key]; };
282
+ /**
283
+ * Inserts new content at an index.
284
+ *
285
+ * Important: This function expects an array of content. Not just a content
286
+ * object. The reason for this "weirdness" is that inserting several elements
287
+ * is very efficient when it is done as a single operation.
288
+ *
289
+ * @example
290
+ * // Insert character 'a' at position 0
291
+ * yarray.insert(0, ['a'])
292
+ * // Insert numbers 1, 2 at position 1
293
+ * yarray.insert(1, [1, 2])
294
+ *
295
+ * @param {number} index The index to insert content at.
296
+ * @param {Array<delta.DeltaConfGetChildren<DConf>>|delta.DeltaConfGetText<DConf>} content Array of content to append.
297
+ * @param {delta.FormattingAttributes} [format]
298
+ */
299
+ insert(index: number, content: Array<delta.DeltaConfGetChildren<DConf>> | delta.DeltaConfGetText<DConf>, format?: delta.FormattingAttributes): void;
300
+ /**
301
+ * Inserts new content at an index.
302
+ *
303
+ * Important: This function expects an array of content. Not just a content
304
+ * object. The reason for this "weirdness" is that inserting several elements
305
+ * is very efficient when it is done as a single operation.
306
+ *
307
+ * @example
308
+ * // Insert character 'a' at position 0
309
+ * yarray.insert(0, ['a'])
310
+ * // Insert numbers 1, 2 at position 1
311
+ * yarray.insert(1, [1, 2])
312
+ *
313
+ * @param {number} index The index to insert content at.
314
+ * @param {number} length The index to insert content at.
315
+ * @param {delta.FormattingAttributes} formats
316
+ *
317
+ */
318
+ format(index: number, length: number, formats: delta.FormattingAttributes): void;
319
+ /**
320
+ * Appends content to this YArray.
321
+ *
322
+ * @param {Array<delta.DeltaConfGetChildren<DConf>>|delta.DeltaConfGetText<DConf>} content Array of content to append.
323
+ *
324
+ * @todo Use the following implementation in all types.
325
+ */
326
+ push(content: Array<delta.DeltaConfGetChildren<DConf>> | delta.DeltaConfGetText<DConf>): void;
327
+ /**
328
+ * Prepends content to this YArray.
329
+ *
330
+ * @param {delta.DeltaConfGetText<DConf>} content Array of content to prepend.
331
+ */
332
+ unshift(content: delta.DeltaConfGetText<DConf>): void;
333
+ /**
334
+ * Deletes elements starting from an index.
335
+ *
336
+ * @param {number} index Index at which to start deleting elements
337
+ * @param {number} length The number of elements to remove. Defaults to 1.
338
+ */
339
+ delete(index: number, length?: number): void;
340
+ /**
341
+ * Returns the i-th element from a YArray.
342
+ *
343
+ * @param {number} index The index of the element to return from the YArray
344
+ * @return {delta.DeltaConfGetChildren<DConf>}
345
+ */
346
+ get(index: number): delta.DeltaConfGetChildren<DConf>;
347
+ /**
348
+ * Returns a portion of this YXmlFragment into a JavaScript Array selected
349
+ * from start to end (end not included).
350
+ *
351
+ * @param {number} [start]
352
+ * @param {number} [end]
353
+ * @return {Array<delta.DeltaConfGetChildren<DConf>>}
354
+ */
355
+ slice(start?: number, end?: number): Array<delta.DeltaConfGetChildren<DConf>>;
356
+ /**
357
+ * @todo refactor this, this should use getContent only!
358
+ *
359
+ * Transforms this YArray to a JavaScript Array.
360
+ *
361
+ * @return {Array<delta.DeltaConfGetChildren<DConf> | delta.DeltaConfGetText<DConf>>}
362
+ */
363
+ toArray(): Array<delta.DeltaConfGetChildren<DConf> | delta.DeltaConfGetText<DConf>>;
364
+ /**
365
+ * Transforms this Shared Type to a JSON object.
366
+ * @return {{ name?: string, attrs?: { [K:string|number]: any }, children?: Array<any> }}
367
+ */
368
+ toJSON(): {
369
+ name?: string;
370
+ attrs?: {
371
+ [K: string | number]: any;
372
+ };
373
+ children?: Array<any>;
374
+ };
375
+ /**
376
+ * @param {object} opts
377
+ * @param {boolean} [opts.forceTag] enforce creating a surrouning <name /> tag, even if it is null.
378
+ */
379
+ toString({ forceTag }?: {
380
+ forceTag?: boolean | undefined;
381
+ }): string;
382
+ /**
383
+ * Returns an Array with the result of calling a provided function on every
384
+ * child-element.
385
+ *
386
+ * @template M
387
+ * @param {(child:delta.DeltaConfGetChildren<DConf>|delta.DeltaConfGetText<DConf>,index:number)=>M} f Function that produces an element of the new Array
388
+ * @return {Array<M>} A new array with each element being the result of the
389
+ * callback function
390
+ */
391
+ map<M>(f: (child: delta.DeltaConfGetChildren<DConf> | delta.DeltaConfGetText<DConf>, index: number) => M): Array<M>;
392
+ /**
393
+ * Executes a provided function once on every element of this YArray.
394
+ *
395
+ * @param {(child:delta.DeltaConfGetChildren<DConf>|delta.DeltaConfGetText<DConf>,index:number)=>any} f Function that produces an element of the new Array
396
+ */
397
+ forEach(f: (child: delta.DeltaConfGetChildren<DConf> | delta.DeltaConfGetText<DConf>, index: number) => any): void;
398
+ /**
399
+ * Executes a provided function on once on every key-value pair.
400
+ *
401
+ * @param {(val:delta.DeltaConfGetAttrs<DConf>[any],key:Exclude<keyof delta.DeltaConfGetAttrs<DConf>,symbol>,ytype:this)=>any} f
402
+ */
403
+ forEachAttr(f: (val: delta.DeltaConfGetAttrs<DConf>[any], key: Exclude<keyof delta.DeltaConfGetAttrs<DConf>, symbol>, ytype: this) => any): void;
404
+ /**
405
+ * Returns the keys for each element in the YMap Type.
406
+ *
407
+ * @return {IterableIterator<import('lib0/ts').KeyOf<delta.DeltaConfGetAttrs<DConf>>>}
408
+ */
409
+ attrKeys(): IterableIterator<import("lib0/ts").KeyOf<delta.DeltaConfGetAttrs<DConf>>>;
410
+ /**
411
+ * Returns the values for each element in the YMap Type.
412
+ *
413
+ * @return {IterableIterator<delta.DeltaConfGetAttrs<DConf>[any]>}
414
+ */
415
+ attrValues(): IterableIterator<delta.DeltaConfGetAttrs<DConf>[any]>;
416
+ /**
417
+ * Returns an Iterator of [key, value] pairs
418
+ *
419
+ * @return {IterableIterator<{ [K in keyof delta.DeltaConfGetAttrs<DConf>]: [K,delta.DeltaConfGetAttrs<DConf>[K]] }[any]>}
420
+ */
421
+ attrEntries(): IterableIterator<{ [K in keyof delta.DeltaConfGetAttrs<DConf>]: [K, delta.DeltaConfGetAttrs<DConf>[K]]; }[any]>;
422
+ /**
423
+ * Returns the number of stored attributes (count of key/value pairs)
424
+ *
425
+ * @return {number}
426
+ */
427
+ get attrSize(): number;
428
+ /**
429
+ * @todo this doesn't need to live in a method.
430
+ *
431
+ * Transform the properties of this type to binary and write it to an
432
+ * BinaryEncoder.
433
+ *
434
+ * This is called when this Item is sent to a remote peer.
435
+ *
436
+ * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.
437
+ */
438
+ _write(encoder: UpdateEncoderV1 | UpdateEncoderV2): void;
439
+ /**
440
+ * @param {this} other
441
+ */
442
+ [traits.EqualityTraitSymbol](other: this): boolean;
443
+ }
444
+ export function readYType(decoder: import("./utils/UpdateDecoder.js").UpdateDecoderV1 | import("./utils/UpdateDecoder.js").UpdateDecoderV2): YType;
445
+ export function equalAttrs(a: any, b: any): boolean;
446
+ export function typeListSlice(type: YType<any>, start: number, end: number): Array<any>;
447
+ export function typeListGet(type: YType, index: number): any;
448
+ export function typeListInsertGenericsAfter(transaction: Transaction, parent: YType, referenceItem: Item | null, content: Array<YValue>): void;
449
+ export function typeListInsertGenerics(transaction: Transaction, parent: YType, index: number, content: Array<{
450
+ [x: string]: any;
451
+ } | Array<any> | number | null | string | Uint8Array>): void;
452
+ export function typeListPushGenerics(transaction: Transaction, parent: YType, content: Array<{
453
+ [x: string]: any;
454
+ } | Array<any> | number | null | string | Uint8Array>): void;
455
+ export function typeListDelete(transaction: Transaction, parent: YType, index: number, length: number): void;
456
+ export function typeMapDelete(transaction: Transaction, parent: YType, key: string): void;
457
+ export function typeMapSet(transaction: Transaction, parent: YType, key: string, value: YValue): void;
458
+ export function typeMapGet(parent: YType<any>, key: string): {
459
+ [x: string]: any;
460
+ } | number | null | Array<any> | string | Uint8Array | YType<any> | undefined;
461
+ export function typeMapGetAll(parent: YType<any>): {
462
+ [x: string]: string | number | any[] | Uint8Array<ArrayBufferLike> | YType<any> | {
463
+ [x: string]: any;
464
+ } | null | undefined;
465
+ };
466
+ export function typeMapGetDelta<TypeDelta extends delta.DeltaBuilderAny>(d: TypeDelta, parent: YType, attrsToRender: Set<string | null> | null, am: import("./internals.js").AbstractAttributionManager, deep: boolean, modified?: Set<YType> | Map<YType, any> | null, deletedItems?: import("./utils/IdSet.js").IdSet | null, itemsToRender?: import("./utils/IdSet.js").IdSet | null, opts?: any, optsAll?: any): void;
467
+ export function typeMapHas(parent: YType<any>, key: string): boolean;
468
+ export function typeMapGetSnapshot(parent: YType<any>, key: string, snapshot: Snapshot): {
469
+ [x: string]: any;
470
+ } | number | null | Array<any> | string | Uint8Array | YType<any> | undefined;
471
+ export function typeMapGetAllSnapshot(parent: YType<any>, snapshot: Snapshot): {
472
+ [x: string]: string | number | any[] | Uint8Array<ArrayBufferLike> | YType<any> | {
473
+ [x: string]: any;
474
+ } | null | undefined;
475
+ };
476
+ export function createMapIterator(type: YType<any> & {
477
+ _map: Map<string, Item>;
478
+ }): IterableIterator<Array<any>>;
479
+ export type YValue = {
480
+ [x: string]: any;
481
+ } | Array<any> | number | null | string | Uint8Array | bigint | YType<any>;
482
+ export type DeltaConfDeltaToYType<DConf extends delta.DeltaConf> = delta.DeltaConfOverwrite<DConf, {
483
+ attrs: { [K in keyof delta.DeltaConfGetAttrs<DConf>]: DeltaToYType<delta.DeltaConfGetAttrs<DConf>[K]>; };
484
+ children: DeltaToYType<delta.DeltaConfGetChildren<DConf>>;
485
+ }>;
486
+ export type DeltaToYType<Data extends unknown> = Exclude<Data, delta.DeltaAny> | (Extract<Data, delta.DeltaAny> extends delta.Delta<infer DConf> ? (unknown extends DConf ? YType<DConf> : never) : never);
487
+ import { Item } from './internals.js';
488
+ import { AbstractAttributionManager } from './internals.js';
489
+ import { Transaction } from './internals.js';
490
+ import { YEvent } from './internals.js';
491
+ import * as delta from 'lib0/delta';
492
+ import { Doc } from './internals.js';
493
+ import { EventHandler } from './internals.js';
494
+ import { Snapshot } from './internals.js';
495
+ import { UpdateEncoderV1 } from './internals.js';
496
+ import { UpdateEncoderV2 } from './internals.js';
497
+ import * as traits from 'lib0/traits';
498
+ //# sourceMappingURL=ytype.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ytype.d.ts","sourceRoot":"","sources":["../../src/ytype.js"],"names":[],"mappings":"AA4CO,4CAAiH;AAaxH;IACE;;;;;;OAMG;IACH,kBANW,IAAI,GAAC,IAAI,SACT,IAAI,GAAC,IAAI,SACT,MAAM,qBACN,GAAG,CAAC,MAAM,EAAC,GAAG,CAAC,MACf,0BAA0B,EAQpC;IALC,kBAAgB;IAChB,mBAAkB;IAClB,cAAkB;IAClB,oCAA0C;IAC1C,+BAAY;IAGd;;OAEG;IACH,gBAgBC;IAED;;;;;;;OAOG;IACH,wBAPW,WAAW,UACX,KAAK,UACL,MAAM;;aA4EhB;CACF;AAqHM,2CATI,WAAW,UACX,KAAK,WACL,oBAAoB,WACpB,OAAO,mBAAmB,EAAE,eAAe;;SA0BrD;AASM,iDANI,WAAW,UACX,KAAK,WACL,oBAAoB,UACpB,KAAK,CAAC,GAAG,CAAC,GAAC,MAAM;;SA0B3B;AAWM,wCARI,WAAW,WACX,oBAAoB,UACpB,MAAM,GACL,oBAAoB,CAkD/B;AAED;IACE;;;OAGG;IACH,eAHW,IAAI,SACJ,MAAM,EAOhB;IAHC,QAAU;IACV,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B,gBAAgB;uBAAhB,gBAAgB;uBAKA,YAAY;oBAL5B,gBAAgB;6BAAhB,gBAAgB;yBAAhB,gBAAgB;gCAAhB,gBAAgB;gCAAhB,gBAAgB;wBAIC,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"IdMap.tests.d.ts","sourceRoot":"","sources":["../../tests/IdMap.tests.js"],"names":[],"mappings":"AAuBO,iCAFI,CAAC,CAAC,QAAQ,QAoDpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QA8BpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAcpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAiBpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAiBpB;AAKM,+CAFI,CAAC,CAAC,QAAQ,QA8BpB;AAKM,yDAFI,CAAC,CAAC,QAAQ,QAqCpB;mBA5OkB,cAAc"}
1
+ {"version":3,"file":"IdMap.tests.d.ts","sourceRoot":"","sources":["../../tests/IdMap.tests.js"],"names":[],"mappings":"AAuBO,iCAFI,CAAC,CAAC,QAAQ,QAoDpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QA8BpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAcpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAiBpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAiBpB;AAKM,+CAFI,CAAC,CAAC,QAAQ,QA8BpB;AAKM,yDAFI,CAAC,CAAC,QAAQ,QAoCpB;mBA3OkB,cAAc"}
@@ -4,5 +4,6 @@ export function testInsertionsMindingAttributedContent(_tc: t.TestCase): void;
4
4
  export function testInsertionsIntoAttributedContent(_tc: t.TestCase): void;
5
5
  export function testYdocDiff(): void;
6
6
  export function testChildListContent(): void;
7
+ export function testAttributionSession1(tc: t.TestCase): void;
7
8
  import * as t from 'lib0/testing';
8
9
  //# sourceMappingURL=attribution.tests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attribution.tests.d.ts","sourceRoot":"","sources":["../../tests/attribution.tests.js"],"names":[],"mappings":"AAcO,2CAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAqBpB;AAKM,4DAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,yDAFI,CAAC,CAAC,QAAQ,QAepB;AAEM,qCAmBN;AAEM,6CAsBN;mBA5HkB,cAAc"}
1
+ {"version":3,"file":"attribution.tests.d.ts","sourceRoot":"","sources":["../../tests/attribution.tests.js"],"names":[],"mappings":"AAeO,2CAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAqBpB;AAKM,4DAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,yDAFI,CAAC,CAAC,QAAQ,QAepB;AAEM,qCAmBN;AAEM,6CAqBN;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAqCpB;mBApKkB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"compatibility.tests.d.ts","sourceRoot":"","sources":["../../tests/compatibility.tests.js"],"names":[],"mappings":"AAcO,8CAFI,CAAC,CAAC,QAAQ,QAQpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,qDAFI,CAAC,CAAC,QAAQ,QASpB;mBApCkB,cAAc"}
1
+ {"version":3,"file":"compatibility.tests.d.ts","sourceRoot":"","sources":["../../tests/compatibility.tests.js"],"names":[],"mappings":"AAsBO,8CAFI,CAAC,CAAC,QAAQ,QAQpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,qDAFI,CAAC,CAAC,QAAQ,QAyBpB;mBA5DkB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"doc.tests.d.ts","sourceRoot":"","sources":["../../tests/doc.tests.js"],"names":[],"mappings":"AAMO,mDAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QA6CpB;AAOM,iDAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,wCAFI,CAAC,CAAC,QAAQ,QAUpB;AAKM,gCAFI,CAAC,CAAC,QAAQ,QAwBpB;AAKM,gCAFI,CAAC,CAAC,QAAQ,QAgEpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QA4CpB;AAKM,qDAFI,CAAC,CAAC,QAAQ,QAuCpB;AAKM,qCAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,uCAFI,CAAC,CAAC,QAAQ,iBAapB;AAKM,uCAFI,CAAC,CAAC,QAAQ,iBAsCpB;mBA9VkB,cAAc"}
1
+ {"version":3,"file":"doc.tests.d.ts","sourceRoot":"","sources":["../../tests/doc.tests.js"],"names":[],"mappings":"AAMO,mDAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QA4CpB;AAOM,iDAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,wCAFI,CAAC,CAAC,QAAQ,QAUpB;AAKM,gCAFI,CAAC,CAAC,QAAQ,QA2BpB;AAKM,gCAFI,CAAC,CAAC,QAAQ,QAgEpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QA4CpB;AAKM,qDAFI,CAAC,CAAC,QAAQ,QAuCpB;AAKM,qCAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,uCAFI,CAAC,CAAC,QAAQ,iBAapB;AAKM,uCAFI,CAAC,CAAC,QAAQ,iBAsCpB;mBAhWkB,cAAc"}
@@ -1,11 +1,11 @@
1
- export function testRelativePositionCase1(tc: t.TestCase): void;
2
- export function testRelativePositionCase2(tc: t.TestCase): void;
3
- export function testRelativePositionCase3(tc: t.TestCase): void;
4
- export function testRelativePositionCase4(tc: t.TestCase): void;
5
- export function testRelativePositionCase5(tc: t.TestCase): void;
6
- export function testRelativePositionCase6(tc: t.TestCase): void;
7
- export function testRelativePositionCase7(tc: t.TestCase): void;
8
- export function testRelativePositionAssociationDifference(tc: t.TestCase): void;
9
- export function testRelativePositionWithUndo(tc: t.TestCase): void;
1
+ export function testRelativePositionCase1(_tc: t.TestCase): void;
2
+ export function testRelativePositionCase2(_tc: t.TestCase): void;
3
+ export function testRelativePositionCase3(_tc: t.TestCase): void;
4
+ export function testRelativePositionCase4(_tc: t.TestCase): void;
5
+ export function testRelativePositionCase5(_tc: t.TestCase): void;
6
+ export function testRelativePositionCase6(_tc: t.TestCase): void;
7
+ export function testRelativePositionCase7(_tc: t.TestCase): void;
8
+ export function testRelativePositionAssociationDifference(_tc: t.TestCase): void;
9
+ export function testRelativePositionWithUndo(_tc: t.TestCase): void;
10
10
  import * as t from 'lib0/testing';
11
11
  //# sourceMappingURL=relativePositions.tests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relativePositions.tests.d.ts","sourceRoot":"","sources":["../../tests/relativePositions.tests.js"],"names":[],"mappings":"AAwBO,8CAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAOpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAOpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAQpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAMpB;AAOM,8CAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,8DAFI,CAAC,CAAC,QAAQ,QAcpB;AAKM,iDAFI,CAAC,CAAC,QAAQ,QAmBpB;mBA/IkB,cAAc"}
1
+ {"version":3,"file":"relativePositions.tests.d.ts","sourceRoot":"","sources":["../../tests/relativePositions.tests.js"],"names":[],"mappings":"AAwBO,+CAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,+CAFI,CAAC,CAAC,QAAQ,QAOpB;AAKM,+CAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,+CAFI,CAAC,CAAC,QAAQ,QAOpB;AAKM,+CAFI,CAAC,CAAC,QAAQ,QAQpB;AAKM,+CAFI,CAAC,CAAC,QAAQ,QAMpB;AAOM,+CAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,+DAFI,CAAC,CAAC,QAAQ,QAcpB;AAKM,kDAFI,CAAC,CAAC,QAAQ,QAmBpB;mBA/IkB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.tests.d.ts","sourceRoot":"","sources":["../../tests/snapshot.tests.js"],"names":[],"mappings":"AAOO,+BAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAiBpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAoBpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,uCAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAyCpB;AAKM,wCAFI,CAAC,CAAC,QAAQ,QAsBpB;mBA7NkB,cAAc"}
1
+ {"version":3,"file":"snapshot.tests.d.ts","sourceRoot":"","sources":["../../tests/snapshot.tests.js"],"names":[],"mappings":"AAQO,+BAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,QAiBpB;AAKM,oDAFI,CAAC,CAAC,QAAQ,QAwBpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAepB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,uCAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QAyCpB;AAKM,wCAFI,CAAC,CAAC,QAAQ,QAsBpB;mBAlOkB,cAAc"}
@@ -119,22 +119,22 @@ export function init<T>(tc: t.TestCase, { users }?: {
119
119
  testObjects: Array<any>;
120
120
  testConnector: TestConnector;
121
121
  users: Array<TestYInstance>;
122
- array0: Y.Array<any>;
123
- array1: Y.Array<any>;
124
- array2: Y.Array<any>;
125
- map0: Y.Map<any>;
126
- map1: Y.Map<any>;
127
- map2: Y.Map<any>;
128
- map3: Y.Map<any>;
129
- text0: Y.Text;
130
- text1: Y.Text;
131
- text2: Y.Text;
132
- xml0: Y.XmlElement;
133
- xml1: Y.XmlElement;
134
- xml2: Y.XmlElement;
122
+ array0: Y.Type<any>;
123
+ array1: Y.Type<any>;
124
+ array2: Y.Type<any>;
125
+ map0: Y.Type<any>;
126
+ map1: Y.Type<any>;
127
+ map2: Y.Type<any>;
128
+ map3: Y.Type<any>;
129
+ text0: Y.Type;
130
+ text1: Y.Type;
131
+ text2: Y.Type;
132
+ xml0: Y.Type;
133
+ xml1: Y.Type;
134
+ xml2: Y.Type;
135
135
  };
136
136
  export function compareIdSets(idSet1: Y.IdSet, idSet2: Y.IdSet): boolean;
137
- export function _idmapAttrsEqual<T>(a: Array<Y.Attribution<T>>, b: Array<Y.Attribution<T>>): boolean;
137
+ export function _idmapAttrsEqual<T>(a: Array<Y.ContentAttribute<T>>, b: Array<Y.ContentAttribute<T>>): boolean;
138
138
  export function validateIdMap<T>(idmap: Y.IdMap<T>): void;
139
139
  export function compareIdmaps<T>(idmap1: Y.IdMap<T>, idmap2: Y.IdMap<T>): void;
140
140
  export function createRandomIdSet(gen: prng.PRNG, clients: number, clockRange: number): Y.IdSet;
@@ -146,21 +146,22 @@ export function applyRandomTests<T>(tc: t.TestCase, mods: Array<(arg0: Y.Doc, ar
146
146
  testObjects: Array<any>;
147
147
  testConnector: TestConnector;
148
148
  users: Array<TestYInstance>;
149
- array0: Y.Array<any>;
150
- array1: Y.Array<any>;
151
- array2: Y.Array<any>;
152
- map0: Y.Map<any>;
153
- map1: Y.Map<any>;
154
- map2: Y.Map<any>;
155
- map3: Y.Map<any>;
156
- text0: Y.Text;
157
- text1: Y.Text;
158
- text2: Y.Text;
159
- xml0: Y.XmlElement;
160
- xml1: Y.XmlElement;
161
- xml2: Y.XmlElement;
149
+ array0: Y.Type<any>;
150
+ array1: Y.Type<any>;
151
+ array2: Y.Type<any>;
152
+ map0: Y.Type<any>;
153
+ map1: Y.Type<any>;
154
+ map2: Y.Type<any>;
155
+ map3: Y.Type<any>;
156
+ text0: Y.Type;
157
+ text1: Y.Type;
158
+ text2: Y.Type;
159
+ xml0: Y.Type;
160
+ xml1: Y.Type;
161
+ xml2: Y.Type;
162
162
  };
163
163
  export type InitTestObjectCallback<T> = (y: TestYInstance) => T;
164
+ export type ApplyRandomTestsResult = ReturnType<typeof applyRandomTests>;
164
165
  import * as Y from '../src/index.js';
165
166
  import * as prng from 'lib0/prng';
166
167
  import * as t from 'lib0/testing';