@gmb/bitmark-parser 6.10.0 → 6.11.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.
Files changed (50) hide show
  1. package/README.md +194 -20
  2. package/dist/browser/bitmark-parser.min.js +4 -4
  3. package/dist/browser/bitmark-parser.min.js.map +1 -1
  4. package/dist/browser/cjs/index.cjs +726 -180
  5. package/dist/browser/cjs/index.cjs.map +1 -1
  6. package/dist/browser/cjs/index.d.cts +1031 -29
  7. package/dist/browser/esm/index.d.ts +1031 -29
  8. package/dist/browser/esm/index.js +723 -180
  9. package/dist/browser/esm/index.js.map +1 -1
  10. package/dist/browser/esm/worker-entry.js +599 -96
  11. package/dist/browser/esm/worker-entry.js.map +1 -1
  12. package/dist/browser/wasm/bitmark_browser_full_wasm_bg.wasm +0 -0
  13. package/dist/browser/wasm/bitmark_json_wasm_bg.wasm +0 -0
  14. package/dist/browser/wasm/bitmark_wasm_bg.wasm +0 -0
  15. package/dist/index.cjs +52 -9
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +1031 -29
  18. package/dist/index.d.ts +1031 -29
  19. package/dist/index.js +49 -9
  20. package/dist/index.js.map +1 -1
  21. package/dist/legacy.cjs +4 -4
  22. package/dist/legacy.cjs.map +1 -1
  23. package/dist/legacy.js +4 -4
  24. package/dist/legacy.js.map +1 -1
  25. package/dist/worker-entry.cjs +7 -1
  26. package/dist/worker-entry.cjs.map +1 -1
  27. package/package.json +14 -8
  28. package/schema/bitmark.schema.json +2746 -573
  29. package/translations/translations.json +2940 -0
  30. package/wasm/bitmark_wasm.d.ts +30 -12
  31. package/wasm/bitmark_wasm.js +91 -47
  32. package/wasm/bitmark_wasm_bg.wasm +0 -0
  33. package/wasm/bitmark_wasm_bg.wasm.d.ts +2 -1
  34. package/wasm/package.json +1 -1
  35. package/wasm-bitmark-json/bitmark_json_wasm.d.ts +30 -12
  36. package/wasm-bitmark-json/bitmark_json_wasm.js +97 -53
  37. package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
  38. package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +2 -1
  39. package/wasm-bitmark-json/package.json +1 -1
  40. package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +126 -0
  41. package/wasm-browser-full/bitmark_browser_full_wasm.js +567 -0
  42. package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
  43. package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm.d.ts +21 -0
  44. package/wasm-browser-full/package.json +20 -0
  45. package/dist/browser/bitmark_json_wasm_bg.wasm +0 -0
  46. package/dist/browser/bitmark_wasm_bg.wasm +0 -0
  47. package/dist/browser/cjs/bitmark_json_wasm_bg.wasm +0 -0
  48. package/dist/browser/cjs/bitmark_wasm_bg.wasm +0 -0
  49. package/dist/browser/esm/bitmark_json_wasm_bg.wasm +0 -0
  50. package/dist/browser/esm/bitmark_wasm_bg.wasm +0 -0
@@ -26,7 +26,8 @@ export function unbreakscape_text(input: string, format: string, location: strin
26
26
  /**
27
27
  * Query information about supported bit types.
28
28
  *
29
- * `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
29
+ * `info_type`: `"list"`, `"bit"`, `"all"`, `"deprecated"`, `"bit-groups"`,
30
+ * or `"resource-groups"`
30
31
  * `format`: `"text"` or `"json"`
31
32
  * `bit`: bit name (required when `info_type` is `"bit"`)
32
33
  * `pretty`: whether to pretty-print JSON output
@@ -36,8 +37,20 @@ export function unbreakscape_text(input: string, format: string, location: strin
36
37
  * `include_deprecated`)
37
38
  * `full`: complete outline for `bit`/`all` (default is the compact
38
39
  * one-line-per-tag view)
40
+ * `language`: BCP-47 tag(s) for display names — "" = English, `"de,fr"` for
41
+ * several (adds a `titles` map), `"all"` for every resolvable language
39
42
  */
40
- export function info(info_type: string, format: string, bit: string, pretty: boolean, indent: number, include_deprecated: boolean, only_deprecated: boolean, full: boolean): string;
43
+ export function info(info_type: string, format: string, bit: string, pretty: boolean, indent: number, include_deprecated: boolean, only_deprecated: boolean, full: boolean, language: string): string;
44
+ /**
45
+ * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).
46
+ *
47
+ * `direction`: `"textToAst"` | `"astToText"` | `"astToPlainText"`.
48
+ * `format`: a bitmark text format (`"bitmark++"`, `"bitmark+"`) parses
49
+ * inline marks; anything else is treated as plain text (textToAst only).
50
+ * `location`: `"body"` (default) or `"tag"`.
51
+ * Returns the converted fragment, or `error: …`.
52
+ */
53
+ export function convert_text(input: string, direction: string, format: string, location: string): string;
41
54
  /**
42
55
  * Apply a patch (a JSON array of patch entries) to every bit and re-emit.
43
56
  *
@@ -48,6 +61,21 @@ export function info(info_type: string, format: string, bit: string, pretty: boo
48
61
  * runs sequentially. Returns the document text/JSON, or `error: …`.
49
62
  */
50
63
  export function transform(input: string, input_format_sel: string, output_format_sel: string, mode: string, patch_json: string, pretty: boolean, indent: number, spaces_around_values: number): string;
64
+ /**
65
+ * Register data with the parser process (PLAN-173 P12).
66
+ *
67
+ * `data_type`: `"translations"` today. One verb rather than one function per
68
+ * registerable thing — the same discriminated-options idiom as `info`.
69
+ *
70
+ * `data` is the file's own text. Semantics are REPLACE: a second call
71
+ * supersedes the first entirely, and the built-in table (where the variant
72
+ * bakes one) stays underneath. Returns `""` on success, or an
73
+ * `error:`-prefixed message — matching the other string-returning exports.
74
+ *
75
+ * Available in EVERY variant, including those that bake nothing: that is
76
+ * exactly where a consumer must supply the file themselves.
77
+ */
78
+ export function register(data_type: string, data: string): string;
51
79
  /**
52
80
  * Convert between bitmark and JSON with explicit input/output formats + mode.
53
81
  *
@@ -96,13 +124,3 @@ export function split_json_bits(input: string): string;
96
124
  * matches the in-Rust recombination byte-for-byte.
97
125
  */
98
126
  export function prettify(json: string, indent: number): string;
99
- /**
100
- * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).
101
- *
102
- * `direction`: `"textToAst"` | `"astToText"` | `"astToPlainText"`.
103
- * `format`: a bitmark text format (`"bitmark++"`, `"bitmark+"`) parses
104
- * inline marks; anything else is treated as plain text (textToAst only).
105
- * `location`: `"body"` (default) or `"tag"`.
106
- * Returns the converted fragment, or `error: …`.
107
- */
108
- export function convert_text(input: string, direction: string, format: string, location: string): string;
@@ -186,7 +186,8 @@ module.exports.unbreakscape_text = function(input, format, location) {
186
186
  /**
187
187
  * Query information about supported bit types.
188
188
  *
189
- * `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
189
+ * `info_type`: `"list"`, `"bit"`, `"all"`, `"deprecated"`, `"bit-groups"`,
190
+ * or `"resource-groups"`
190
191
  * `format`: `"text"` or `"json"`
191
192
  * `bit`: bit name (required when `info_type` is `"bit"`)
192
193
  * `pretty`: whether to pretty-print JSON output
@@ -196,6 +197,8 @@ module.exports.unbreakscape_text = function(input, format, location) {
196
197
  * `include_deprecated`)
197
198
  * `full`: complete outline for `bit`/`all` (default is the compact
198
199
  * one-line-per-tag view)
200
+ * `language`: BCP-47 tag(s) for display names — "" = English, `"de,fr"` for
201
+ * several (adds a `titles` map), `"all"` for every resolvable language
199
202
  * @param {string} info_type
200
203
  * @param {string} format
201
204
  * @param {string} bit
@@ -204,11 +207,12 @@ module.exports.unbreakscape_text = function(input, format, location) {
204
207
  * @param {boolean} include_deprecated
205
208
  * @param {boolean} only_deprecated
206
209
  * @param {boolean} full
210
+ * @param {string} language
207
211
  * @returns {string}
208
212
  */
209
- module.exports.info = function(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
210
- let deferred4_0;
211
- let deferred4_1;
213
+ module.exports.info = function(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
214
+ let deferred5_0;
215
+ let deferred5_1;
212
216
  try {
213
217
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
214
218
  const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -217,15 +221,56 @@ module.exports.info = function(info_type, format, bit, pretty, indent, include_d
217
221
  const len1 = WASM_VECTOR_LEN;
218
222
  const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
219
223
  const len2 = WASM_VECTOR_LEN;
220
- wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full);
224
+ const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
225
+ const len3 = WASM_VECTOR_LEN;
226
+ wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
221
227
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
222
228
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
223
- deferred4_0 = r0;
224
- deferred4_1 = r1;
229
+ deferred5_0 = r0;
230
+ deferred5_1 = r1;
225
231
  return getStringFromWasm0(r0, r1);
226
232
  } finally {
227
233
  wasm.__wbindgen_add_to_stack_pointer(16);
228
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
234
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
235
+ }
236
+ };
237
+
238
+ /**
239
+ * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).
240
+ *
241
+ * `direction`: `"textToAst"` | `"astToText"` | `"astToPlainText"`.
242
+ * `format`: a bitmark text format (`"bitmark++"`, `"bitmark+"`) parses
243
+ * inline marks; anything else is treated as plain text (textToAst only).
244
+ * `location`: `"body"` (default) or `"tag"`.
245
+ * Returns the converted fragment, or `error: …`.
246
+ * @param {string} input
247
+ * @param {string} direction
248
+ * @param {string} format
249
+ * @param {string} location
250
+ * @returns {string}
251
+ */
252
+ module.exports.convert_text = function(input, direction, format, location) {
253
+ let deferred5_0;
254
+ let deferred5_1;
255
+ try {
256
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
257
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
258
+ const len0 = WASM_VECTOR_LEN;
259
+ const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
260
+ const len1 = WASM_VECTOR_LEN;
261
+ const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
262
+ const len2 = WASM_VECTOR_LEN;
263
+ const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
264
+ const len3 = WASM_VECTOR_LEN;
265
+ wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
266
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
267
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
268
+ deferred5_0 = r0;
269
+ deferred5_1 = r1;
270
+ return getStringFromWasm0(r0, r1);
271
+ } finally {
272
+ wasm.__wbindgen_add_to_stack_pointer(16);
273
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
229
274
  }
230
275
  };
231
276
 
@@ -274,6 +319,44 @@ module.exports.transform = function(input, input_format_sel, output_format_sel,
274
319
  }
275
320
  };
276
321
 
322
+ /**
323
+ * Register data with the parser process (PLAN-173 P12).
324
+ *
325
+ * `data_type`: `"translations"` today. One verb rather than one function per
326
+ * registerable thing — the same discriminated-options idiom as `info`.
327
+ *
328
+ * `data` is the file's own text. Semantics are REPLACE: a second call
329
+ * supersedes the first entirely, and the built-in table (where the variant
330
+ * bakes one) stays underneath. Returns `""` on success, or an
331
+ * `error:`-prefixed message — matching the other string-returning exports.
332
+ *
333
+ * Available in EVERY variant, including those that bake nothing: that is
334
+ * exactly where a consumer must supply the file themselves.
335
+ * @param {string} data_type
336
+ * @param {string} data
337
+ * @returns {string}
338
+ */
339
+ module.exports.register = function(data_type, data) {
340
+ let deferred3_0;
341
+ let deferred3_1;
342
+ try {
343
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
344
+ const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
345
+ const len0 = WASM_VECTOR_LEN;
346
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
347
+ const len1 = WASM_VECTOR_LEN;
348
+ wasm.register(retptr, ptr0, len0, ptr1, len1);
349
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
350
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
351
+ deferred3_0 = r0;
352
+ deferred3_1 = r1;
353
+ return getStringFromWasm0(r0, r1);
354
+ } finally {
355
+ wasm.__wbindgen_add_to_stack_pointer(16);
356
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
357
+ }
358
+ };
359
+
277
360
  /**
278
361
  * Convert between bitmark and JSON with explicit input/output formats + mode.
279
362
  *
@@ -474,45 +557,6 @@ module.exports.prettify = function(json, indent) {
474
557
  }
475
558
  };
476
559
 
477
- /**
478
- * Convert a standalone bitmark text fragment ↔ TextAst (ProseMirror JSON).
479
- *
480
- * `direction`: `"textToAst"` | `"astToText"` | `"astToPlainText"`.
481
- * `format`: a bitmark text format (`"bitmark++"`, `"bitmark+"`) parses
482
- * inline marks; anything else is treated as plain text (textToAst only).
483
- * `location`: `"body"` (default) or `"tag"`.
484
- * Returns the converted fragment, or `error: …`.
485
- * @param {string} input
486
- * @param {string} direction
487
- * @param {string} format
488
- * @param {string} location
489
- * @returns {string}
490
- */
491
- module.exports.convert_text = function(input, direction, format, location) {
492
- let deferred5_0;
493
- let deferred5_1;
494
- try {
495
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
496
- const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
497
- const len0 = WASM_VECTOR_LEN;
498
- const ptr1 = passStringToWasm0(direction, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
499
- const len1 = WASM_VECTOR_LEN;
500
- const ptr2 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
501
- const len2 = WASM_VECTOR_LEN;
502
- const ptr3 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
503
- const len3 = WASM_VECTOR_LEN;
504
- wasm.convert_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
505
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
506
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
507
- deferred5_0 = r0;
508
- deferred5_1 = r1;
509
- return getStringFromWasm0(r0, r1);
510
- } finally {
511
- wasm.__wbindgen_add_to_stack_pointer(16);
512
- wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
513
- }
514
- };
515
-
516
560
  const path = require('path').join(__dirname, 'bitmark_wasm_bg.wasm');
517
561
  const bytes = require('fs').readFileSync(path);
518
562
 
Binary file
@@ -6,10 +6,11 @@ export const canonicalize: (a: number, b: number, c: number, d: number, e: numbe
6
6
  export const convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
7
7
  export const convert_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
8
8
  export const count_bits: (a: number, b: number, c: number) => void;
9
- export const info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
9
+ export const info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
10
10
  export const is_bitmark: (a: number, b: number) => number;
11
11
  export const lex: (a: number, b: number, c: number, d: number, e: number) => void;
12
12
  export const prettify: (a: number, b: number, c: number, d: number) => void;
13
+ export const register: (a: number, b: number, c: number, d: number, e: number) => void;
13
14
  export const split_bits: (a: number, b: number, c: number) => void;
14
15
  export const split_json_bits: (a: number, b: number, c: number) => void;
15
16
  export const transform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
package/wasm/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Get More Brain Ltd <info@getmorebrain.com>"
5
5
  ],
6
6
  "description": "WebAssembly bindings for the bitmark parser",
7
- "version": "6.10.0",
7
+ "version": "6.11.0",
8
8
  "license": "ISC",
9
9
  "repository": {
10
10
  "type": "git",
@@ -17,7 +17,8 @@ export function unbreakscape_text(input: string, format: string, location: strin
17
17
  /**
18
18
  * Query information about supported bit types.
19
19
  *
20
- * `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
20
+ * `info_type`: `"list"`, `"bit"`, `"all"`, `"deprecated"`, `"bit-groups"`,
21
+ * or `"resource-groups"`
21
22
  * `format`: `"text"` or `"json"`
22
23
  * `bit`: bit name (required when `info_type` is `"bit"`)
23
24
  * `pretty`: whether to pretty-print JSON output
@@ -27,8 +28,35 @@ export function unbreakscape_text(input: string, format: string, location: strin
27
28
  * `include_deprecated`)
28
29
  * `full`: complete outline for `bit`/`all` (default is the compact
29
30
  * one-line-per-tag view)
31
+ * `language`: BCP-47 tag(s) for display names — "" = English, `"de,fr"` for
32
+ * several (adds a `titles` map), `"all"` for every resolvable language
30
33
  */
31
- export function info(info_type: string, format: string, bit: string, pretty: boolean, indent: number, include_deprecated: boolean, only_deprecated: boolean, full: boolean): string;
34
+ export function info(info_type: string, format: string, bit: string, pretty: boolean, indent: number, include_deprecated: boolean, only_deprecated: boolean, full: boolean, language: string): string;
35
+ /**
36
+ * Register data with the parser process (PLAN-173 P12).
37
+ *
38
+ * `data_type`: `"translations"` today. One verb rather than one function per
39
+ * registerable thing — the same discriminated-options idiom as `info`.
40
+ *
41
+ * `data` is the file's own text. Semantics are REPLACE: a second call
42
+ * supersedes the first entirely, and the built-in table (where the variant
43
+ * bakes one) stays underneath. Returns `""` on success, or an
44
+ * `error:`-prefixed message — matching the other string-returning exports.
45
+ *
46
+ * Available in EVERY variant, including those that bake nothing: that is
47
+ * exactly where a consumer must supply the file themselves.
48
+ */
49
+ export function register(data_type: string, data: string): string;
50
+ /**
51
+ * Apply a patch (a JSON array of patch entries) to every bit and re-emit.
52
+ *
53
+ * `input_format_sel`: `"auto"` | `"bitmark"` | `"json"`.
54
+ * `output_format_sel`: `"bitmark"` | `"json"` (default json).
55
+ * `patch_json`: the patch entry array (empty string = no patches, i.e. a
56
+ * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
57
+ * runs sequentially. Returns the document text/JSON, or `error: …`.
58
+ */
59
+ export function transform(input: string, input_format_sel: string, output_format_sel: string, mode: string, patch_json: string, pretty: boolean, indent: number, spaces_around_values: number): string;
32
60
  /**
33
61
  * Convert between bitmark and JSON with explicit input/output formats + mode.
34
62
  *
@@ -87,13 +115,3 @@ export function prettify(json: string, indent: number): string;
87
115
  * Returns the converted fragment, or `error: …`.
88
116
  */
89
117
  export function convert_text(input: string, direction: string, format: string, location: string): string;
90
- /**
91
- * Apply a patch (a JSON array of patch entries) to every bit and re-emit.
92
- *
93
- * `input_format_sel`: `"auto"` | `"bitmark"` | `"json"`.
94
- * `output_format_sel`: `"bitmark"` | `"json"` (default json).
95
- * `patch_json`: the patch entry array (empty string = no patches, i.e. a
96
- * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
97
- * runs sequentially. Returns the document text/JSON, or `error: …`.
98
- */
99
- export function transform(input: string, input_format_sel: string, output_format_sel: string, mode: string, patch_json: string, pretty: boolean, indent: number, spaces_around_values: number): string;
@@ -154,7 +154,8 @@ module.exports.unbreakscape_text = function(input, format, location) {
154
154
  /**
155
155
  * Query information about supported bit types.
156
156
  *
157
- * `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
157
+ * `info_type`: `"list"`, `"bit"`, `"all"`, `"deprecated"`, `"bit-groups"`,
158
+ * or `"resource-groups"`
158
159
  * `format`: `"text"` or `"json"`
159
160
  * `bit`: bit name (required when `info_type` is `"bit"`)
160
161
  * `pretty`: whether to pretty-print JSON output
@@ -164,6 +165,8 @@ module.exports.unbreakscape_text = function(input, format, location) {
164
165
  * `include_deprecated`)
165
166
  * `full`: complete outline for `bit`/`all` (default is the compact
166
167
  * one-line-per-tag view)
168
+ * `language`: BCP-47 tag(s) for display names — "" = English, `"de,fr"` for
169
+ * several (adds a `titles` map), `"all"` for every resolvable language
167
170
  * @param {string} info_type
168
171
  * @param {string} format
169
172
  * @param {string} bit
@@ -172,11 +175,12 @@ module.exports.unbreakscape_text = function(input, format, location) {
172
175
  * @param {boolean} include_deprecated
173
176
  * @param {boolean} only_deprecated
174
177
  * @param {boolean} full
178
+ * @param {string} language
175
179
  * @returns {string}
176
180
  */
177
- module.exports.info = function(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full) {
178
- let deferred4_0;
179
- let deferred4_1;
181
+ module.exports.info = function(info_type, format, bit, pretty, indent, include_deprecated, only_deprecated, full, language) {
182
+ let deferred5_0;
183
+ let deferred5_1;
180
184
  try {
181
185
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
182
186
  const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -185,15 +189,100 @@ module.exports.info = function(info_type, format, bit, pretty, indent, include_d
185
189
  const len1 = WASM_VECTOR_LEN;
186
190
  const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
187
191
  const len2 = WASM_VECTOR_LEN;
188
- wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full);
192
+ const ptr3 = passStringToWasm0(language, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
193
+ const len3 = WASM_VECTOR_LEN;
194
+ wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent, include_deprecated, only_deprecated, full, ptr3, len3);
189
195
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
190
196
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
191
- deferred4_0 = r0;
192
- deferred4_1 = r1;
197
+ deferred5_0 = r0;
198
+ deferred5_1 = r1;
193
199
  return getStringFromWasm0(r0, r1);
194
200
  } finally {
195
201
  wasm.__wbindgen_add_to_stack_pointer(16);
196
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
202
+ wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
203
+ }
204
+ };
205
+
206
+ /**
207
+ * Register data with the parser process (PLAN-173 P12).
208
+ *
209
+ * `data_type`: `"translations"` today. One verb rather than one function per
210
+ * registerable thing — the same discriminated-options idiom as `info`.
211
+ *
212
+ * `data` is the file's own text. Semantics are REPLACE: a second call
213
+ * supersedes the first entirely, and the built-in table (where the variant
214
+ * bakes one) stays underneath. Returns `""` on success, or an
215
+ * `error:`-prefixed message — matching the other string-returning exports.
216
+ *
217
+ * Available in EVERY variant, including those that bake nothing: that is
218
+ * exactly where a consumer must supply the file themselves.
219
+ * @param {string} data_type
220
+ * @param {string} data
221
+ * @returns {string}
222
+ */
223
+ module.exports.register = function(data_type, data) {
224
+ let deferred3_0;
225
+ let deferred3_1;
226
+ try {
227
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
228
+ const ptr0 = passStringToWasm0(data_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
229
+ const len0 = WASM_VECTOR_LEN;
230
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
231
+ const len1 = WASM_VECTOR_LEN;
232
+ wasm.register(retptr, ptr0, len0, ptr1, len1);
233
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
234
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
235
+ deferred3_0 = r0;
236
+ deferred3_1 = r1;
237
+ return getStringFromWasm0(r0, r1);
238
+ } finally {
239
+ wasm.__wbindgen_add_to_stack_pointer(16);
240
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
241
+ }
242
+ };
243
+
244
+ /**
245
+ * Apply a patch (a JSON array of patch entries) to every bit and re-emit.
246
+ *
247
+ * `input_format_sel`: `"auto"` | `"bitmark"` | `"json"`.
248
+ * `output_format_sel`: `"bitmark"` | `"json"` (default json).
249
+ * `patch_json`: the patch entry array (empty string = no patches, i.e. a
250
+ * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
251
+ * runs sequentially. Returns the document text/JSON, or `error: …`.
252
+ * @param {string} input
253
+ * @param {string} input_format_sel
254
+ * @param {string} output_format_sel
255
+ * @param {string} mode
256
+ * @param {string} patch_json
257
+ * @param {boolean} pretty
258
+ * @param {number} indent
259
+ * @param {number} spaces_around_values
260
+ * @returns {string}
261
+ */
262
+ module.exports.transform = function(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
263
+ let deferred6_0;
264
+ let deferred6_1;
265
+ try {
266
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
267
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
268
+ const len0 = WASM_VECTOR_LEN;
269
+ const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
270
+ const len1 = WASM_VECTOR_LEN;
271
+ const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
272
+ const len2 = WASM_VECTOR_LEN;
273
+ const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
274
+ const len3 = WASM_VECTOR_LEN;
275
+ const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
276
+ const len4 = WASM_VECTOR_LEN;
277
+ wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
278
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
279
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
280
+ deferred6_0 = r0;
281
+ deferred6_1 = r1;
282
+ return getStringFromWasm0(r0, r1);
283
+ } finally {
284
+ wasm.__wbindgen_add_to_stack_pointer(16);
285
+ wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
197
286
  }
198
287
  };
199
288
 
@@ -436,51 +525,6 @@ module.exports.convert_text = function(input, direction, format, location) {
436
525
  }
437
526
  };
438
527
 
439
- /**
440
- * Apply a patch (a JSON array of patch entries) to every bit and re-emit.
441
- *
442
- * `input_format_sel`: `"auto"` | `"bitmark"` | `"json"`.
443
- * `output_format_sel`: `"bitmark"` | `"json"` (default json).
444
- * `patch_json`: the patch entry array (empty string = no patches, i.e. a
445
- * canonicalizing pass). Parallelism is a JS-side concern (web workers); this
446
- * runs sequentially. Returns the document text/JSON, or `error: …`.
447
- * @param {string} input
448
- * @param {string} input_format_sel
449
- * @param {string} output_format_sel
450
- * @param {string} mode
451
- * @param {string} patch_json
452
- * @param {boolean} pretty
453
- * @param {number} indent
454
- * @param {number} spaces_around_values
455
- * @returns {string}
456
- */
457
- module.exports.transform = function(input, input_format_sel, output_format_sel, mode, patch_json, pretty, indent, spaces_around_values) {
458
- let deferred6_0;
459
- let deferred6_1;
460
- try {
461
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
462
- const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
463
- const len0 = WASM_VECTOR_LEN;
464
- const ptr1 = passStringToWasm0(input_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
465
- const len1 = WASM_VECTOR_LEN;
466
- const ptr2 = passStringToWasm0(output_format_sel, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
467
- const len2 = WASM_VECTOR_LEN;
468
- const ptr3 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
469
- const len3 = WASM_VECTOR_LEN;
470
- const ptr4 = passStringToWasm0(patch_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
471
- const len4 = WASM_VECTOR_LEN;
472
- wasm.transform(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, pretty, indent, spaces_around_values);
473
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
474
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
475
- deferred6_0 = r0;
476
- deferred6_1 = r1;
477
- return getStringFromWasm0(r0, r1);
478
- } finally {
479
- wasm.__wbindgen_add_to_stack_pointer(16);
480
- wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
481
- }
482
- };
483
-
484
528
  const path = require('path').join(__dirname, 'bitmark_json_wasm_bg.wasm');
485
529
  const bytes = require('fs').readFileSync(path);
486
530
 
@@ -6,9 +6,10 @@ export const canonicalize: (a: number, b: number, c: number, d: number, e: numbe
6
6
  export const convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
7
7
  export const convert_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
8
8
  export const count_bits: (a: number, b: number, c: number) => void;
9
- export const info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
9
+ export const info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
10
10
  export const is_bitmark: (a: number, b: number) => number;
11
11
  export const prettify: (a: number, b: number, c: number, d: number) => void;
12
+ export const register: (a: number, b: number, c: number, d: number, e: number) => void;
12
13
  export const split_bits: (a: number, b: number, c: number) => void;
13
14
  export const split_json_bits: (a: number, b: number, c: number) => void;
14
15
  export const transform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
@@ -4,7 +4,7 @@
4
4
  "Get More Brain Ltd <info@getmorebrain.com>"
5
5
  ],
6
6
  "description": "WebAssembly bindings for the bitmark parser",
7
- "version": "6.10.0",
7
+ "version": "6.11.0",
8
8
  "license": "ISC",
9
9
  "repository": {
10
10
  "type": "git",