@iyulab/m3l-wasm 0.5.0 → 0.5.1
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/m3l_wasm.d.ts +9 -0
- package/m3l_wasm.js +1 -1
- package/m3l_wasm_bg.js +27 -0
- package/m3l_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/m3l_wasm.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Lint M3L content and return diagnostics as JSON.
|
|
6
|
+
*
|
|
7
|
+
* @param content - M3L markdown text
|
|
8
|
+
* @param config_json - JSON config `{ rules?: Record<string, "off"|"warn"|"error"> }`
|
|
9
|
+
* @returns JSON string with `{ success: boolean, data?: LintResult, error?: string }`
|
|
10
|
+
*/
|
|
11
|
+
export function lint(content: string, config_json: string): string;
|
|
12
|
+
|
|
4
13
|
/**
|
|
5
14
|
* Parse a single M3L file and return the AST as JSON.
|
|
6
15
|
*
|
package/m3l_wasm.js
CHANGED
package/m3l_wasm_bg.js
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lint M3L content and return diagnostics as JSON.
|
|
3
|
+
*
|
|
4
|
+
* @param content - M3L markdown text
|
|
5
|
+
* @param config_json - JSON config `{ rules?: Record<string, "off"|"warn"|"error"> }`
|
|
6
|
+
* @returns JSON string with `{ success: boolean, data?: LintResult, error?: string }`
|
|
7
|
+
* @param {string} content
|
|
8
|
+
* @param {string} config_json
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
11
|
+
export function lint(content, config_json) {
|
|
12
|
+
let deferred3_0;
|
|
13
|
+
let deferred3_1;
|
|
14
|
+
try {
|
|
15
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
16
|
+
const len0 = WASM_VECTOR_LEN;
|
|
17
|
+
const ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18
|
+
const len1 = WASM_VECTOR_LEN;
|
|
19
|
+
const ret = wasm.lint(ptr0, len0, ptr1, len1);
|
|
20
|
+
deferred3_0 = ret[0];
|
|
21
|
+
deferred3_1 = ret[1];
|
|
22
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
23
|
+
} finally {
|
|
24
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
1
28
|
/**
|
|
2
29
|
* Parse a single M3L file and return the AST as JSON.
|
|
3
30
|
*
|
package/m3l_wasm_bg.wasm
CHANGED
|
Binary file
|