@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.
Files changed (166) hide show
  1. package/README.md +36 -12
  2. package/dist/src/index.d.ts +24 -1
  3. package/dist/src/index.d.ts.map +1 -1
  4. package/dist/src/structs/AbstractStruct.d.ts +14 -17
  5. package/dist/src/structs/AbstractStruct.d.ts.map +1 -1
  6. package/dist/src/structs/GC.d.ts +9 -14
  7. package/dist/src/structs/GC.d.ts.map +1 -1
  8. package/dist/src/structs/Item.d.ts +569 -31
  9. package/dist/src/structs/Item.d.ts.map +1 -1
  10. package/dist/src/structs/Skip.d.ts +9 -11
  11. package/dist/src/structs/Skip.d.ts.map +1 -1
  12. package/dist/src/utils/BlockSet.d.ts +8 -7
  13. package/dist/src/utils/BlockSet.d.ts.map +1 -1
  14. package/dist/src/utils/Doc.d.ts +4 -9
  15. package/dist/src/utils/Doc.d.ts.map +1 -1
  16. package/dist/src/utils/ID.d.ts +0 -1
  17. package/dist/src/utils/ID.d.ts.map +1 -1
  18. package/dist/src/utils/RelativePosition.d.ts +2 -5
  19. package/dist/src/utils/RelativePosition.d.ts.map +1 -1
  20. package/dist/src/utils/Renderer.d.ts +144 -0
  21. package/dist/src/utils/Renderer.d.ts.map +1 -0
  22. package/dist/src/utils/Snapshot.d.ts +7 -11
  23. package/dist/src/utils/Snapshot.d.ts.map +1 -1
  24. package/dist/src/utils/StructStore.d.ts +45 -23
  25. package/dist/src/utils/StructStore.d.ts.map +1 -1
  26. package/dist/src/utils/Transaction.d.ts +11 -21
  27. package/dist/src/utils/Transaction.d.ts.map +1 -1
  28. package/dist/src/utils/UndoManager.d.ts +13 -14
  29. package/dist/src/utils/UndoManager.d.ts.map +1 -1
  30. package/dist/src/utils/UpdateDecoder.d.ts +1 -1
  31. package/dist/src/utils/UpdateDecoder.d.ts.map +1 -1
  32. package/dist/src/utils/UpdateEncoder.d.ts +0 -1
  33. package/dist/src/utils/UpdateEncoder.d.ts.map +1 -1
  34. package/dist/src/utils/YEvent.d.ts +22 -26
  35. package/dist/src/utils/YEvent.d.ts.map +1 -1
  36. package/dist/src/utils/content-helper.d.ts +2 -0
  37. package/dist/src/utils/content-helper.d.ts.map +1 -0
  38. package/dist/src/utils/delta-helpers.d.ts +2 -3
  39. package/dist/src/utils/delta-helpers.d.ts.map +1 -1
  40. package/dist/src/utils/encoding-helpers.d.ts +6 -0
  41. package/dist/src/utils/encoding-helpers.d.ts.map +1 -0
  42. package/dist/src/utils/encoding.d.ts +16 -18
  43. package/dist/src/utils/encoding.d.ts.map +1 -1
  44. package/dist/src/utils/ids.d.ts +331 -0
  45. package/dist/src/utils/ids.d.ts.map +1 -0
  46. package/dist/src/utils/isParentOf.d.ts +1 -2
  47. package/dist/src/utils/isParentOf.d.ts.map +1 -1
  48. package/dist/src/utils/logging.d.ts +0 -1
  49. package/dist/src/utils/logging.d.ts.map +1 -1
  50. package/dist/src/utils/meta.d.ts +15 -64
  51. package/dist/src/utils/meta.d.ts.map +1 -1
  52. package/dist/src/utils/renderer-helpers.d.ts +99 -0
  53. package/dist/src/utils/renderer-helpers.d.ts.map +1 -0
  54. package/dist/src/utils/schemas.d.ts +3 -0
  55. package/dist/src/utils/schemas.d.ts.map +1 -0
  56. package/dist/src/utils/transaction-helpers.d.ts +18 -0
  57. package/dist/src/utils/transaction-helpers.d.ts.map +1 -0
  58. package/dist/src/utils/updates.d.ts +19 -25
  59. package/dist/src/utils/updates.d.ts.map +1 -1
  60. package/dist/src/ytype.d.ts +144 -41
  61. package/dist/src/ytype.d.ts.map +1 -1
  62. package/global.d.ts +53 -0
  63. package/package.json +12 -16
  64. package/src/index.js +32 -124
  65. package/src/structs/AbstractStruct.js +21 -16
  66. package/src/structs/GC.js +15 -20
  67. package/src/structs/Item.js +992 -318
  68. package/src/structs/Skip.js +16 -19
  69. package/src/utils/BlockSet.js +20 -20
  70. package/src/utils/Doc.js +18 -29
  71. package/src/utils/ID.js +0 -2
  72. package/src/utils/RelativePosition.js +15 -25
  73. package/src/utils/{AttributionManager.js → Renderer.js} +42 -197
  74. package/src/utils/Snapshot.js +15 -37
  75. package/src/utils/StructStore.js +89 -227
  76. package/src/utils/Transaction.js +89 -321
  77. package/src/utils/UndoManager.js +157 -19
  78. package/src/utils/UpdateDecoder.js +2 -3
  79. package/src/utils/UpdateEncoder.js +0 -4
  80. package/src/utils/YEvent.js +20 -26
  81. package/src/utils/content-helper.js +0 -0
  82. package/src/utils/delta-helpers.js +21 -42
  83. package/src/utils/encoding-helpers.js +110 -0
  84. package/src/utils/encoding.js +197 -122
  85. package/src/utils/ids.js +1527 -0
  86. package/src/utils/isParentOf.js +2 -4
  87. package/src/utils/logging.js +0 -4
  88. package/src/utils/meta.js +57 -46
  89. package/src/utils/renderer-helpers.js +110 -0
  90. package/src/utils/schemas.js +3 -0
  91. package/src/utils/transaction-helpers.js +413 -0
  92. package/src/utils/updates.js +24 -146
  93. package/src/ytype.js +626 -255
  94. package/tests/testHelper.js +10 -12
  95. package/dist/src/internals.d.ts +0 -36
  96. package/dist/src/internals.d.ts.map +0 -1
  97. package/dist/src/structs/ContentAny.d.ts +0 -67
  98. package/dist/src/structs/ContentAny.d.ts.map +0 -1
  99. package/dist/src/structs/ContentBinary.d.ts +0 -64
  100. package/dist/src/structs/ContentBinary.d.ts.map +0 -1
  101. package/dist/src/structs/ContentDeleted.d.ts +0 -64
  102. package/dist/src/structs/ContentDeleted.d.ts.map +0 -1
  103. package/dist/src/structs/ContentDoc.d.ts +0 -72
  104. package/dist/src/structs/ContentDoc.d.ts.map +0 -1
  105. package/dist/src/structs/ContentEmbed.d.ts +0 -67
  106. package/dist/src/structs/ContentEmbed.d.ts.map +0 -1
  107. package/dist/src/structs/ContentFormat.d.ts +0 -69
  108. package/dist/src/structs/ContentFormat.d.ts.map +0 -1
  109. package/dist/src/structs/ContentJSON.d.ts +0 -70
  110. package/dist/src/structs/ContentJSON.d.ts.map +0 -1
  111. package/dist/src/structs/ContentString.d.ts +0 -70
  112. package/dist/src/structs/ContentString.d.ts.map +0 -1
  113. package/dist/src/structs/ContentType.d.ts +0 -77
  114. package/dist/src/structs/ContentType.d.ts.map +0 -1
  115. package/dist/src/utils/AttributionManager.d.ts +0 -238
  116. package/dist/src/utils/AttributionManager.d.ts.map +0 -1
  117. package/dist/src/utils/IdMap.d.ts +0 -164
  118. package/dist/src/utils/IdMap.d.ts.map +0 -1
  119. package/dist/src/utils/IdSet.d.ts +0 -163
  120. package/dist/src/utils/IdSet.d.ts.map +0 -1
  121. package/dist/tests/IdMap.tests.d.ts +0 -9
  122. package/dist/tests/IdMap.tests.d.ts.map +0 -1
  123. package/dist/tests/IdSet.tests.d.ts +0 -9
  124. package/dist/tests/IdSet.tests.d.ts.map +0 -1
  125. package/dist/tests/attribution.tests.d.ts +0 -9
  126. package/dist/tests/attribution.tests.d.ts.map +0 -1
  127. package/dist/tests/compatibility.tests.d.ts +0 -5
  128. package/dist/tests/compatibility.tests.d.ts.map +0 -1
  129. package/dist/tests/delta.tests.d.ts +0 -7
  130. package/dist/tests/delta.tests.d.ts.map +0 -1
  131. package/dist/tests/doc.tests.d.ts +0 -13
  132. package/dist/tests/doc.tests.d.ts.map +0 -1
  133. package/dist/tests/encoding.tests.d.ts +0 -5
  134. package/dist/tests/encoding.tests.d.ts.map +0 -1
  135. package/dist/tests/index.d.ts +0 -2
  136. package/dist/tests/index.d.ts.map +0 -1
  137. package/dist/tests/relativePositions.tests.d.ts +0 -11
  138. package/dist/tests/relativePositions.tests.d.ts.map +0 -1
  139. package/dist/tests/snapshot.tests.d.ts +0 -14
  140. package/dist/tests/snapshot.tests.d.ts.map +0 -1
  141. package/dist/tests/testHelper.d.ts +0 -171
  142. package/dist/tests/testHelper.d.ts.map +0 -1
  143. package/dist/tests/undo-redo.tests.d.ts +0 -27
  144. package/dist/tests/undo-redo.tests.d.ts.map +0 -1
  145. package/dist/tests/updates.tests.d.ts +0 -26
  146. package/dist/tests/updates.tests.d.ts.map +0 -1
  147. package/dist/tests/y-array.tests.d.ts +0 -43
  148. package/dist/tests/y-array.tests.d.ts.map +0 -1
  149. package/dist/tests/y-map.tests.d.ts +0 -42
  150. package/dist/tests/y-map.tests.d.ts.map +0 -1
  151. package/dist/tests/y-text.tests.d.ts +0 -49
  152. package/dist/tests/y-text.tests.d.ts.map +0 -1
  153. package/dist/tests/y-xml.tests.d.ts +0 -14
  154. package/dist/tests/y-xml.tests.d.ts.map +0 -1
  155. package/src/internals.js +0 -35
  156. package/src/structs/ContentAny.js +0 -115
  157. package/src/structs/ContentBinary.js +0 -93
  158. package/src/structs/ContentDeleted.js +0 -101
  159. package/src/structs/ContentDoc.js +0 -141
  160. package/src/structs/ContentEmbed.js +0 -98
  161. package/src/structs/ContentFormat.js +0 -105
  162. package/src/structs/ContentJSON.js +0 -119
  163. package/src/structs/ContentString.js +0 -113
  164. package/src/structs/ContentType.js +0 -152
  165. package/src/utils/IdMap.js +0 -673
  166. package/src/utils/IdSet.js +0 -825
package/README.md CHANGED
@@ -50,7 +50,6 @@ Showcase](https://yjs-diagram.synergy.codes/).
50
50
 
51
51
  * [AFFiNE](https://affine.pro/) A local-first, privacy-first, open source
52
52
  knowledge base. :star2:
53
- * [Huly](https://huly.io/) - Open Source All-in-One Project Management Platform :star2:
54
53
  * [Cargo](https://cargo.site/) Site builder for designers and artists :star2:
55
54
  * [Gitbook](https://gitbook.com) Knowledge management for technical teams :star2:
56
55
  * [Evernote](https://evernote.com) Note-taking app :star2:
@@ -62,6 +61,7 @@ Showcase](https://yjs-diagram.synergy.codes/).
62
61
  * [Dynaboard](https://dynaboard.com/) Build web apps collaboratively. :star:
63
62
  * [Relm](https://www.relm.us/) A collaborative gameworld for teamwork and
64
63
  community. :star:
64
+ * [Huly](https://huly.io/) - Open Source All-in-One Project Management Platform
65
65
  * [Room.sh](https://room.sh/) A meeting application with integrated
66
66
  collaborative drawing, editing, and coding tools. :star:
67
67
  * [Nimbus Note](https://nimbusweb.me/note.php) A note-taking app designed by
@@ -131,6 +131,8 @@ editing for your IDE or custom editor
131
131
  * [ProtonMail | Proton Docs](https://proton.me/drive/docs) - E2E encrypted
132
132
  collaborative documents in Proton Drive.
133
133
  * [Theneo](https://www.theneo.io/) - AI-powered API docs with live team collaboration.
134
+ * [ToolJet](https://tooljet.com/) - Build full-stack enterprise internal apps in
135
+ minutes.
134
136
 
135
137
  ## Table of Contents
136
138
 
@@ -157,8 +159,8 @@ are implemented in separate modules.
157
159
 
158
160
  ### Bindings
159
161
 
160
- | Name | Cursors | Binding | Demo |
161
- |---|:-:|---|---|
162
+ | Name | Cursors | Binding | Demo |
163
+ | --- | :-: | --- | --- |
162
164
  | [ProseMirror](https://prosemirror.net/)                                                   | ✔ | [y-prosemirror](https://github.com/yjs/y-prosemirror) | [demo](https://demos.yjs.dev/prosemirror/prosemirror.html) |
163
165
  | [Quill](https://quilljs.com/) | ✔ | [y-quill](https://github.com/yjs/y-quill) | [demo](https://demos.yjs.dev/quill/quill.html) |
164
166
  | [CodeMirror](https://codemirror.net/) | ✔ | [y-codemirror](https://github.com/yjs/y-codemirror) | [demo](https://demos.yjs.dev/codemirror/codemirror.html) |
@@ -171,12 +173,13 @@ are implemented in separate modules.
171
173
  | [Tiptap](https://tiptap.dev/) | ✔ | [y-prosemirror](https://github.com/yjs/y-prosemirror) | [demo](https://template.tiptap.dev/preview/templates/simple) |
172
174
  | [Milkdown](https://github.com/Milkdown/milkdown) | ✔ | [y-prosemirror](https://github.com/yjs/y-prosemirror) | [demo](https://milkdown.dev/playground) |
173
175
  | [Superdoc](https://superdoc.dev/) | ✔ | (native) | [demo](https://superdoc.dev/) |
174
- | [valtio](https://github.com/pmndrs/valtio) | | [valtio-yjs](https://github.com/dai-shi/valtio-yjs) | [demo](https://codesandbox.io/s/valtio-yjs-demo-ox3iy) |
175
- | [immer](https://github.com/immerjs/immer) | | [immer-yjs](https://github.com/sep2/immer-yjs) | [demo](https://codesandbox.io/s/immer-yjs-demo-6e0znb) |
176
+ | [valtio](https://github.com/pmndrs/valtio) | | [valtio-yjs](https://github.com/dai-shi/valtio-yjs) | [demo](https://codesandbox.io/s/valtio-yjs-demo-ox3iy) |
177
+ | [immer](https://github.com/immerjs/immer) | | [immer-yjs](https://github.com/sep2/immer-yjs) | [demo](https://codesandbox.io/s/immer-yjs-demo-6e0znb) |
178
+ | [mutative](https://github.com/unadlib/mutative) | | [mutative-yjs](https://github.com/mutativejs/mutative-yjs) | [demo](https://codesandbox.io/p/sandbox/fjrwk3) |
176
179
  | React | | [react-yjs](https://github.com/nikgraf/react-yjs) | [demo](https://react-yjs-example.vercel.app/) |
177
180
  | React / Vue / Svelte / MobX | | [SyncedStore](https://syncedstore.org) | [demo](https://syncedstore.org/docs/react) |
178
- | [mobx-keystone](https://mobx-keystone.js.org/) | | [mobx-keystone-yjs](https://github.com/xaviergonz/mobx-keystone/tree/master/packages/mobx-keystone-yjs) | [demo](https://mobx-keystone.js.org/examples/yjs-binding) |
179
- | [PSPDFKit](https://www.nutrient.io/) | | [yjs-pspdfkit](https://github.com/hoangqwe159/yjs-pspdfkit) | [demo](https://github.com/hoangqwe159/yjs-pspdfkit) |
181
+ | [mobx-keystone](https://mobx-keystone.js.org/) | | [mobx-keystone-yjs](https://github.com/xaviergonz/mobx-keystone/tree/master/packages/mobx-keystone-yjs) | [demo](https://mobx-keystone.js.org/examples/yjs-binding) |
182
+ | [PSPDFKit](https://www.nutrient.io/) | | [yjs-pspdfkit](https://github.com/hoangqwe159/yjs-pspdfkit) | [demo](https://github.com/hoangqwe159/yjs-pspdfkit) |
180
183
  | [Rows n'Columns](https://www.rowsncolumns.app/) | ✔ | [@rowsncolumns/y-spreadsheet](https://docs.rowsncolumns.app/collaboration/yjs-collaboration) | |
181
184
 
182
185
  ### Utilities
@@ -190,7 +193,7 @@ Library with <code>YMultiDocUndoManager</code> (undo/redo across Yjs docs) and
190
193
  <code>YKeyValue</code> (optimized key-value store).
191
194
  </dd>
192
195
  <dt>
193
- <a href="https://github.com/Tulip-Writer/yjs-orderedtree"> yjs-orderedtree </a> 🌳
196
+ <a href="https://github.com/Tulip-Writer/yjs-orderedtree">yjs-orderedtree</a> 🌳
194
197
  </dt>
195
198
  <dd>
196
199
  Class for ordered trees via Y.Map. Handles <code>insert</code>,
@@ -304,6 +307,13 @@ Encryption (E2EE).
304
307
  <dd>
305
308
  An ActionCable companion for Yjs clients. There is a fitting
306
309
  <a href="https://github.com/y-crdt/yrb-redis">redis extension</a> as well.
310
+ </dd>
311
+ <dt><a href="https://github.com/uwx/y-atproto">y-atproto</a></dt>
312
+ <dd>
313
+ A Yjs provider that syncs documents over the
314
+ <a href="https://atproto.com/">AT Protocol</a> (the decentralized protocol
315
+ behind Bluesky). Documents are stored as ATProto records and real-time updates
316
+ are delivered via <a href="https://github.com/bluesky-social/jetstream">Jetstream</a>.
307
317
  </dd>
308
318
  <dt><a href="https://github.com/y-crdt/ypy-websocket">ypy-websocket</a></dt>
309
319
  <dd>
@@ -391,13 +401,18 @@ There are several Yjs-compatible ports to other programming languages.
391
401
  * [y-crdt](https://github.com/y-crdt/y-crdt) - Rust implementation with multiple
392
402
  language bindings to other languages
393
403
  * [yrs](https://github.com/y-crdt/y-crdt/tree/main/yrs) - Rust interface
394
- * [ypy](https://github.com/y-crdt/ypy) - Python binding
404
+ * [pycrdt](https://github.com/y-crdt/pycrdt) - Python binding
395
405
  * [yrb](https://github.com/y-crdt/yrb) - Ruby binding
406
+ * [yr](https://github.com/y-crdt/yr) - R binding
407
+ * [ydotnet](https://github.com/y-crdt/ydotnet) - .NET/C# binding
396
408
  * [yswift](https://github.com/y-crdt/yswift) - Swift binding
409
+ * [ykt](https://github.com/y-crdt/ykt) - Kotlin binding
397
410
  * [yffi](https://github.com/y-crdt/y-crdt/tree/main/yffi) - C-FFI
398
411
  * [ywasm](https://github.com/y-crdt/y-crdt/tree/main/ywasm) - WASM binding
399
- * [y_ex](https://github.com/satoren/y_ex) - Elixir bindings
412
+ * [y_ex](https://github.com/satoren/y_ex) - Elixir binding
413
+ * [ypy](https://github.com/y-crdt/ypy) - Python binding (deprecated, use pycrdt)
400
414
  * [ycs](https://github.com/yjs/ycs) - .Net compatible C# implementation.
415
+ * [ygo](https://github.com/reearth/ygo) - Go implementation.
401
416
 
402
417
  ## Getting Started
403
418
 
@@ -559,7 +574,8 @@ to JSON using their <code>toJSON</code> method.
559
574
  </dd>
560
575
  <b><code>[Symbol.Iterator]</code></b>
561
576
  <dd>
562
- Returns an YArray Iterator that contains the values for each index in the array.
577
+ Returns an YArray Iterator that contains the values for each index in
578
+ the array.
563
579
  <pre>for (let value of yarray) { .. }</pre>
564
580
  </dd>
565
581
  <b><code>observe(function(YArrayEvent, Transaction):void)</code></b>
@@ -1189,8 +1205,16 @@ ytext.toString() // => 'abc'
1189
1205
 
1190
1206
  <dl>
1191
1207
  <b><code>constructor(scope:Y.AbstractType|Array&lt;Y.AbstractType&gt;
1192
- [, {captureTimeout:number,trackedOrigins:Set&lt;any&gt;,deleteFilter:function(item):boolean}])</code></b>
1208
+ [, {captureTimeout:number,trackedOrigins:Set&lt;any&gt;,deleteFilter:function(item):boolean,ignoreRemoteAttributeChanges:boolean}])</code></b>
1193
1209
  <dd>Accepts either single type as scope or an array of types.</dd>
1210
+ <b><code>ignoreRemoteAttributeChanges:boolean</code></b>
1211
+ <dd>
1212
+ By default, the UndoManager will never overwrite remote changes. In some cases
1213
+ this is not the expected behavior. When set to <code>true</code>, undo/redo may
1214
+ overwrite remote attribute changes (e.g. on <code>Y.Map</code> keys or
1215
+ <code>Y.XmlElement</code> / <code>Y.XmlText</code> attributes). Defaults to
1216
+ <code>false</code>. <em>(previously named <code>ignoreRemoteMapChanges</code>)</em>
1217
+ </dd>
1194
1218
  <b><code>undo()</code></b>
1195
1219
  <dd></dd>
1196
1220
  <b><code>redo()</code></b>
@@ -1,3 +1,26 @@
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 { Doc, Transaction, YType as Type, YEvent, Item, AbstractStruct, GC, Skip, ContentBinary, ContentDeleted, ContentDoc, ContentEmbed, ContentFormat, ContentJSON, ContentAny, ContentString, ContentType, getTypeChildren, createRelativePositionFromTypeIndex, createRelativePositionFromJSON, createAbsolutePositionFromRelativePosition, compareRelativePositions, AbsolutePosition, RelativePosition, ID, createID, compareIDs, getState, Snapshot, createSnapshot, cleanupYTextFormatting, snapshot, emptySnapshot, findRootTypeKey, findIndexSS, getItem, getItemCleanStart, getItemCleanEnd, typeMapGetSnapshot, typeMapGetAllSnapshot, createDocFromSnapshot, applyUpdate, applyUpdateV2, readUpdate, readUpdateV2, encodeStateAsUpdate, encodeStateAsUpdateV2, encodeStateVector, UndoManager, decodeSnapshot, encodeSnapshot, decodeSnapshotV2, encodeSnapshotV2, decodeStateVector, logUpdate, logUpdateV2, decodeUpdate, decodeUpdateV2, relativePositionToJSON, isParentOf, equalSnapshots, tryGc, transact, logType, mergeUpdates, mergeUpdatesV2, encodeStateVectorFromUpdate, encodeStateVectorFromUpdateV2, encodeRelativePosition, decodeRelativePosition, diffUpdate, diffUpdateV2, convertUpdateFormatV1ToV2, convertUpdateFormatV2ToV1, obfuscateUpdate, obfuscateUpdateV2, UpdateEncoderV1, UpdateEncoderV2, UpdateDecoderV1, UpdateDecoderV2, snapshotContainsUpdate, IdSet, equalIdSets, createDeleteSetFromStructStore, IdMap, createIdMap, createContentAttribute, createInsertSetFromStructStore, diffIdMap, diffIdSet, ContentAttribute, encodeIdMap, createIdMapFromIdSet, TwosetAttributionManager, noAttributionsManager, AbstractAttributionManager, iterateStructsByIdSet, createAttributionManagerFromDiff, DiffAttributionManager, createAttributionManagerFromSnapshots, SnapshotAttributionManager, createIdSet, mergeIdSets, cloneDoc, createContentIdsFromUpdate, createContentIdsFromUpdateV2, insertIntoIdMap, insertIntoIdSet, mergeIdMaps, readIdMap, readIdSet, decodeIdMap, diffDocsToDelta, getPathTo, Attributions, filterIdMap, undoContentIds, intersectUpdateWithContentIds, intersectUpdateWithContentIdsV2, createDocFromUpdate, createDocFromUpdateV2 } from "./internals.js";
9
+ export type ContentIds = import("./utils/ids.js").ContentIds;
10
+ export type ContentMap = import("./utils/ids.js").ContentMap;
11
+ export { IdSet, equalIdSets, createDeleteSetFromStructStore, createInsertSetFromStructStore, diffIdSet, createIdSet, mergeIdSets, insertIntoIdSet, iterateStructsByIdSet, gcIdSet, readIdSet, writeIdSet, encodeIdSet, decodeIdSet, IdMap, createIdMap, createContentAttribute, ContentAttribute, diffIdMap, encodeIdMap, createIdMapFromIdSet, createIdSetFromIdMap, insertIntoIdMap, mergeIdMaps, readIdMap, writeIdMap, decodeIdMap, filterIdMap, intersectSets, intersectMaps } from "./utils/ids.js";
12
+ export { UpdateDecoderV1, UpdateDecoderV2 } from "./utils/UpdateDecoder.js";
13
+ export { UpdateEncoderV1, UpdateEncoderV2 } from "./utils/UpdateEncoder.js";
14
+ export { applyUpdate, applyUpdateV2, readUpdate, readUpdateV2, encodeStateAsUpdate, encodeStateAsUpdateV2, encodeStateVector, decodeStateVector, diffUpdate, diffUpdateV2, mergeUpdates, mergeUpdatesV2, createDocFromUpdate, createDocFromUpdateV2, cloneDoc } from "./utils/encoding.js";
15
+ export { ID, createID, compareIDs, findRootTypeKey } from "./utils/ID.js";
16
+ export { createRelativePositionFromTypeIndex, createRelativePositionFromJSON, createAbsolutePositionFromRelativePosition, compareRelativePositions, AbsolutePosition, RelativePosition, relativePositionToJSON, encodeRelativePosition, decodeRelativePosition } from "./utils/RelativePosition.js";
17
+ export { Snapshot, createSnapshot, snapshot, emptySnapshot, createDocFromSnapshot, decodeSnapshot, encodeSnapshot, decodeSnapshotV2, encodeSnapshotV2, equalSnapshots, snapshotContainsUpdate } from "./utils/Snapshot.js";
18
+ export { findIndexSS, getItemCleanStart, getItemCleanEnd, tryGc } from "./utils/transaction-helpers.js";
19
+ export { Transaction, transact, cleanupYTextFormatting } from "./utils/Transaction.js";
20
+ export { UndoManager, undoContentIds } from "./utils/UndoManager.js";
21
+ export { logUpdate, logUpdateV2, decodeUpdate, decodeUpdateV2, encodeStateVectorFromUpdate, encodeStateVectorFromUpdateV2, convertUpdateFormatV1ToV2, convertUpdateFormatV2ToV1, obfuscateUpdate, obfuscateUpdateV2, createContentIdsFromUpdate, createContentIdsFromUpdateV2, intersectUpdateWithContentIds, intersectUpdateWithContentIdsV2 } from "./utils/updates.js";
22
+ export { YEvent, getPathTo } from "./utils/YEvent.js";
23
+ export { TwosetRenderer, baseRenderer, AbstractRenderer, createDiffRenderer, DiffRenderer, createSnapshotRenderer, SnapshotRenderer, Attributions, $renderer } from "./utils/Renderer.js";
24
+ export { YType as Type, getTypeChildren, typeMapGetSnapshot, typeMapGetAllSnapshot, $ytype, $ytypeAny } from "./ytype.js";
25
+ export { Item, ContentBinary, ContentDeleted, ContentDoc, ContentEmbed, ContentFormat, ContentJSON, ContentAny, ContentString, ContentType } from "./structs/Item.js";
3
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;yBA+Ba,OAAO,gBAAgB,EAAE,UAAU;yBAGnC,OAAO,gBAAgB,EAAE,UAAU"}
@@ -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 {AbstractStruct} right
17
+ * @param {GC|Item|Skip} _right
18
18
  * @return {boolean} whether this merged with right
19
19
  */
20
- mergeWith(right: AbstractStruct): boolean;
20
+ mergeWith(_right: GC | Item | Skip): boolean;
21
21
  /**
22
- * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.
23
- * @param {number} offset
24
- * @param {number} encodingRef
22
+ * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder The encoder to write data to.
23
+ * @param {number} _offset
24
+ * @param {number} _encodingRef
25
25
  */
26
- write(encoder: UpdateEncoderV1 | UpdateEncoderV2, offset: number, encodingRef: number): void;
26
+ write(_encoder: UpdateEncoderV1 | UpdateEncoderV2, _offset: number, _encodingRef: number): void;
27
27
  /**
28
- * @param {Transaction} transaction
29
- * @param {number} offset
28
+ * @param {Transaction} _transaction
29
+ * @param {number} _offset
30
30
  */
31
- integrate(transaction: Transaction, offset: number): void;
31
+ integrate(_transaction: Transaction, _offset: number): void;
32
32
  /**
33
- * @param {number} diff
34
- * @return {import('../internals.js').GC|import('../internals.js').Item}
33
+ * @param {number} _diff
34
+ * @return {GC|Item|Skip}
35
35
  */
36
- splice(diff: number): import("../internals.js").GC | import("../internals.js").Item;
36
+ splice(_diff: number): GC | Item | Skip;
37
37
  }
38
- import { ID } from '../internals.js';
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":"AAMA;IACE;;;OAGG;IACH,gBAHW,EAAE,UACF,MAAM,EAKhB;IAFC,OAAY;IACZ,eAAoB;IAGtB;;OAEG;IACH,eAFU,OAAO,CAIhB;IAED;;;;;;OAMG;IACH,iBAHW,cAAc,GACb,OAAO,CAIlB;IAED;;;;OAIG;IACH,eAJW,eAAe,GAAG,eAAe,UACjC,MAAM,eACN,MAAM,QAIhB;IAED;;;OAGG;IACH,uBAHW,WAAW,UACX,MAAM,QAIhB;IAED;;;OAGG;IACH,aAHW,MAAM,GACL,OAAO,iBAAiB,EAAE,EAAE,GAAC,OAAO,iBAAiB,EAAE,IAAI,CAItE;CACF;mBAxDM,iBAAiB;gCAAjB,iBAAiB;gCAAjB,iBAAiB;4BAAjB,iBAAiB"}
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"}
@@ -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 '../internals.js';
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":"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"}
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"}