@mmds/wasm 1.1.0 → 1.2.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/mmdflux_wasm.d.ts CHANGED
@@ -5,4 +5,13 @@ export function detect(input: string): string | undefined;
5
5
 
6
6
  export function render(input: string, format: string, config_json: string): string;
7
7
 
8
+ /**
9
+ * Validate Mermaid input and return structured parse diagnostics as JSON.
10
+ *
11
+ * Returns a JSON string with shape:
12
+ * - `{"valid": true}` on success
13
+ * - `{"valid": false, "diagnostics": [{"line": N, "column": N, ...}]}` on error
14
+ */
15
+ export function validate(input: string): string;
16
+
8
17
  export function version(): string;
package/mmdflux_wasm.js CHANGED
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./mmdflux_wasm_bg.js";
5
5
  __wbg_set_wasm(wasm);
6
6
  wasm.__wbindgen_start();
7
7
  export {
8
- detect, render, version
8
+ detect, render, validate, version
9
9
  } from "./mmdflux_wasm_bg.js";
@@ -45,6 +45,30 @@ export function render(input, format, config_json) {
45
45
  }
46
46
  }
47
47
 
48
+ /**
49
+ * Validate Mermaid input and return structured parse diagnostics as JSON.
50
+ *
51
+ * Returns a JSON string with shape:
52
+ * - `{"valid": true}` on success
53
+ * - `{"valid": false, "diagnostics": [{"line": N, "column": N, ...}]}` on error
54
+ * @param {string} input
55
+ * @returns {string}
56
+ */
57
+ export function validate(input) {
58
+ let deferred2_0;
59
+ let deferred2_1;
60
+ try {
61
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
62
+ const len0 = WASM_VECTOR_LEN;
63
+ const ret = wasm.validate(ptr0, len0);
64
+ deferred2_0 = ret[0];
65
+ deferred2_1 = ret[1];
66
+ return getStringFromWasm0(ret[0], ret[1]);
67
+ } finally {
68
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
69
+ }
70
+ }
71
+
48
72
  /**
49
73
  * @returns {string}
50
74
  */
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@mmds/wasm",
3
3
  "type": "module",
4
4
  "description": "wasm-bindgen bindings for mmdflux",
5
- "version": "1.1.0",
5
+ "version": "1.2.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",