tiptap-rusty-parser 0.2.1 → 0.2.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tiptap-rusty-parser",
3
3
  "type": "module",
4
4
  "description": "Fast WASM parser/manipulator for Tiptap/ProseMirror JSONContent",
5
- "version": "0.2.1",
5
+ "version": "0.2.2",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -72,6 +72,14 @@ export class TiptapDoc {
72
72
  * The node at `path`, or `undefined`.
73
73
  */
74
74
  nodeAt(path: any): any;
75
+ /**
76
+ * Normalize the document tree in place (merge adjacent text, drop empties).
77
+ */
78
+ normalize(): void;
79
+ /**
80
+ * Normalize with an options object (see `NormalizeOptions`).
81
+ */
82
+ normalizeWith(options: any): void;
75
83
  /**
76
84
  * Index paths of every node whose attribute `key` equals `value`.
77
85
  */
@@ -212,6 +212,22 @@ export class TiptapDoc {
212
212
  }
213
213
  return takeFromExternrefTable0(ret[0]);
214
214
  }
215
+ /**
216
+ * Normalize the document tree in place (merge adjacent text, drop empties).
217
+ */
218
+ normalize() {
219
+ wasm.tiptapdoc_normalize(this.__wbg_ptr);
220
+ }
221
+ /**
222
+ * Normalize with an options object (see `NormalizeOptions`).
223
+ * @param {any} options
224
+ */
225
+ normalizeWith(options) {
226
+ const ret = wasm.tiptapdoc_normalizeWith(this.__wbg_ptr, options);
227
+ if (ret[1]) {
228
+ throw takeFromExternrefTable0(ret[0]);
229
+ }
230
+ }
215
231
  /**
216
232
  * Index paths of every node whose attribute `key` equals `value`.
217
233
  * @param {string} key
Binary file