@quillmark/wasm 0.81.0-rc.2 → 0.81.0

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/bundler/wasm.d.ts CHANGED
@@ -275,6 +275,12 @@ export class Document {
275
275
  * Compare a payload's [`schemaVersionOf`](Document::schema_version_of)
276
276
  * against this to detect mismatches before calling
277
277
  * [`fromJson`](Document::from_json).
278
+ *
279
+ * The tag tracks the **`Document` model version** — the crate version
280
+ * at which the wire format was last changed — not the running crate
281
+ * version. Every patch and minor release within the same model
282
+ * generation returns the same string; the tag advances only when a
283
+ * new schema variant ships.
278
284
  */
279
285
  static currentSchemaVersion(): string;
280
286
  /**
@@ -455,6 +461,22 @@ export class Document {
455
461
  * The result is standard JSON text, so callers that want to inspect it
456
462
  * may `JSON.parse` it — but treating it as an opaque blob is the
457
463
  * intended use.
464
+ *
465
+ * ## Byte-stability
466
+ *
467
+ * The output is a **byte-deterministic** function of the document's
468
+ * value within a given `schema` version: two documents that compare
469
+ * equal under [`equals`](Document::equals) serialize to byte-equal
470
+ * strings, and the same document re-serialized in a later patch or
471
+ * minor release of this crate (same `schema`) produces the same bytes.
472
+ * Content-hash use cases (template-divergence detection, cache keys)
473
+ * can rely on this without re-canonicalizing.
474
+ *
475
+ * Specifics: object fields are emitted in struct-declaration order;
476
+ * frontmatter field values preserve their YAML insertion order (no
477
+ * key sorting); whitespace is `serde_json`'s compact form (no spaces
478
+ * between tokens, no trailing newline); strings use `serde_json`'s
479
+ * standard escape set. A schema-version bump may change any of these.
458
480
  */
459
481
  toJson(): string;
460
482
  /**
@@ -67,6 +67,12 @@ export class Document {
67
67
  * Compare a payload's [`schemaVersionOf`](Document::schema_version_of)
68
68
  * against this to detect mismatches before calling
69
69
  * [`fromJson`](Document::from_json).
70
+ *
71
+ * The tag tracks the **`Document` model version** — the crate version
72
+ * at which the wire format was last changed — not the running crate
73
+ * version. Every patch and minor release within the same model
74
+ * generation returns the same string; the tag advances only when a
75
+ * new schema variant ships.
70
76
  * @returns {string}
71
77
  */
72
78
  static currentSchemaVersion() {
@@ -509,30 +515,38 @@ export class Document {
509
515
  * The result is standard JSON text, so callers that want to inspect it
510
516
  * may `JSON.parse` it — but treating it as an opaque blob is the
511
517
  * intended use.
518
+ *
519
+ * ## Byte-stability
520
+ *
521
+ * The output is a **byte-deterministic** function of the document's
522
+ * value within a given `schema` version: two documents that compare
523
+ * equal under [`equals`](Document::equals) serialize to byte-equal
524
+ * strings, and the same document re-serialized in a later patch or
525
+ * minor release of this crate (same `schema`) produces the same bytes.
526
+ * Content-hash use cases (template-divergence detection, cache keys)
527
+ * can rely on this without re-canonicalizing.
528
+ *
529
+ * Specifics: object fields are emitted in struct-declaration order;
530
+ * frontmatter field values preserve their YAML insertion order (no
531
+ * key sorting); whitespace is `serde_json`'s compact form (no spaces
532
+ * between tokens, no trailing newline); strings use `serde_json`'s
533
+ * standard escape set. A schema-version bump may change any of these.
512
534
  * @returns {string}
513
535
  */
514
536
  toJson() {
515
- let deferred2_0;
516
- let deferred2_1;
537
+ let deferred1_0;
538
+ let deferred1_1;
517
539
  try {
518
540
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
519
541
  wasm.document_toJson(retptr, this.__wbg_ptr);
520
542
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
521
543
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
522
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
523
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
524
- var ptr1 = r0;
525
- var len1 = r1;
526
- if (r3) {
527
- ptr1 = 0; len1 = 0;
528
- throw takeObject(r2);
529
- }
530
- deferred2_0 = ptr1;
531
- deferred2_1 = len1;
532
- return getStringFromWasm0(ptr1, len1);
544
+ deferred1_0 = r0;
545
+ deferred1_1 = r1;
546
+ return getStringFromWasm0(r0, r1);
533
547
  } finally {
534
548
  wasm.__wbindgen_add_to_stack_pointer(16);
535
- wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
549
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
536
550
  }
537
551
  }
538
552
  /**
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillmark/wasm",
3
- "version": "0.81.0-rc.2",
3
+ "version": "0.81.0",
4
4
  "description": "WebAssembly bindings for quillmark",
5
5
  "type": "module",
6
6
  "license": "MIT OR Apache-2.0",