@kreuzberg/html-to-markdown-wasm 3.2.6 → 3.3.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.
@@ -5,6 +5,9 @@
5
5
  /* @ts-self-types="./html_to_markdown_wasm.d.ts" */
6
6
 
7
7
  /**
8
+ * The type of an inline text annotation.
9
+ *
10
+ * Uses internally tagged representation (`"annotation_type": "bold"`) for JSON serialization.
8
11
  * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}
9
12
  */
10
13
  const WasmAnnotationKind = Object.freeze({
@@ -21,6 +24,9 @@ const WasmAnnotationKind = Object.freeze({
21
24
  exports.WasmAnnotationKind = WasmAnnotationKind;
22
25
 
23
26
  /**
27
+ * Code block fence style in Markdown output.
28
+ *
29
+ * Determines how code blocks (`<pre><code>`) are rendered in Markdown.
24
30
  * @enum {0 | 1 | 2}
25
31
  */
26
32
  const WasmCodeBlockStyle = Object.freeze({
@@ -30,6 +36,23 @@ const WasmCodeBlockStyle = Object.freeze({
30
36
  });
31
37
  exports.WasmCodeBlockStyle = WasmCodeBlockStyle;
32
38
 
39
+ /**
40
+ * Main conversion options for HTML to Markdown conversion.
41
+ *
42
+ * Use [`ConversionOptions::builder()`] to construct, or [`Default::default()`] for defaults.
43
+ *
44
+ * # Example
45
+ *
46
+ * ```text
47
+ * use html_to_markdown_rs::ConversionOptions;
48
+ *
49
+ * let options = ConversionOptions::builder()
50
+ * .heading_style(HeadingStyle::Atx)
51
+ * .wrap(true)
52
+ * .wrap_width(100)
53
+ * .build();
54
+ * ```
55
+ */
33
56
  class WasmConversionOptions {
34
57
  static __wrap(ptr) {
35
58
  ptr = ptr >>> 0;
@@ -49,6 +72,7 @@ class WasmConversionOptions {
49
72
  wasm.__wbg_wasmconversionoptions_free(ptr, 0);
50
73
  }
51
74
  /**
75
+ * Apply a partial update to these conversion options.
52
76
  * @param {WasmConversionOptionsUpdate} _update
53
77
  */
54
78
  applyUpdate(_update) {
@@ -71,6 +95,7 @@ class WasmConversionOptions {
71
95
  return ret !== 0;
72
96
  }
73
97
  /**
98
+ * Create a new builder with default values.
74
99
  * @returns {WasmConversionOptionsBuilder}
75
100
  */
76
101
  static builder() {
@@ -93,7 +118,7 @@ class WasmConversionOptions {
93
118
  return getStringFromWasm0(r0, r1);
94
119
  } finally {
95
120
  wasm.__wbindgen_add_to_stack_pointer(16);
96
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
121
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
97
122
  }
98
123
  }
99
124
  /**
@@ -126,7 +151,7 @@ class WasmConversionOptions {
126
151
  return getStringFromWasm0(r0, r1);
127
152
  } finally {
128
153
  wasm.__wbindgen_add_to_stack_pointer(16);
129
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
154
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
130
155
  }
131
156
  }
132
157
  /**
@@ -173,7 +198,7 @@ class WasmConversionOptions {
173
198
  return getStringFromWasm0(r0, r1);
174
199
  } finally {
175
200
  wasm.__wbindgen_add_to_stack_pointer(16);
176
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
201
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
177
202
  }
178
203
  }
179
204
  /**
@@ -204,6 +229,22 @@ class WasmConversionOptions {
204
229
  const ret = wasm.wasmconversionoptions_escapeUnderscores(this.__wbg_ptr);
205
230
  return ret !== 0;
206
231
  }
232
+ /**
233
+ * @returns {string[]}
234
+ */
235
+ get excludeSelectors() {
236
+ try {
237
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
238
+ wasm.wasmconversionoptions_excludeSelectors(retptr, this.__wbg_ptr);
239
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
240
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
241
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
242
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
243
+ return v1;
244
+ } finally {
245
+ wasm.__wbindgen_add_to_stack_pointer(16);
246
+ }
247
+ }
207
248
  /**
208
249
  * @returns {boolean}
209
250
  */
@@ -229,6 +270,7 @@ class WasmConversionOptions {
229
270
  return WasmConversionOptions.__wrap(ret);
230
271
  }
231
272
  /**
273
+ * Create from a partial update, applying to defaults.
232
274
  * @param {WasmConversionOptionsUpdate} update
233
275
  * @returns {WasmConversionOptions}
234
276
  */
@@ -276,7 +318,7 @@ class WasmConversionOptions {
276
318
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
277
319
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
278
320
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
279
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
321
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
280
322
  return v1;
281
323
  } finally {
282
324
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -356,9 +398,10 @@ class WasmConversionOptions {
356
398
  * @param {bigint | null} [max_image_size]
357
399
  * @param {boolean | null} [capture_svg]
358
400
  * @param {boolean | null} [infer_dimensions]
401
+ * @param {string[] | null} [exclude_selectors]
359
402
  * @param {number | null} [max_depth]
360
403
  */
361
- constructor(heading_style, list_indent_type, list_indent_width, bullets, strong_em_symbol, escape_asterisks, escape_underscores, escape_misc, escape_ascii, code_language, autolinks, default_title, br_in_tables, highlight_style, extract_metadata, whitespace_mode, strip_newlines, wrap, wrap_width, convert_as_inline, sub_symbol, sup_symbol, newline_style, code_block_style, keep_inline_images_in, preprocessing, encoding, debug, strip_tags, preserve_tags, skip_images, link_style, output_format, include_document_structure, extract_images, max_image_size, capture_svg, infer_dimensions, max_depth) {
404
+ constructor(heading_style, list_indent_type, list_indent_width, bullets, strong_em_symbol, escape_asterisks, escape_underscores, escape_misc, escape_ascii, code_language, autolinks, default_title, br_in_tables, highlight_style, extract_metadata, whitespace_mode, strip_newlines, wrap, wrap_width, convert_as_inline, sub_symbol, sup_symbol, newline_style, code_block_style, keep_inline_images_in, preprocessing, encoding, debug, strip_tags, preserve_tags, skip_images, link_style, output_format, include_document_structure, extract_images, max_image_size, capture_svg, infer_dimensions, exclude_selectors, max_depth) {
362
405
  var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
363
406
  var len0 = WASM_VECTOR_LEN;
364
407
  var ptr1 = isLikeNone(strong_em_symbol) ? 0 : passStringToWasm0(strong_em_symbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -382,7 +425,9 @@ class WasmConversionOptions {
382
425
  var len8 = WASM_VECTOR_LEN;
383
426
  var ptr9 = isLikeNone(preserve_tags) ? 0 : passArrayJsValueToWasm0(preserve_tags, wasm.__wbindgen_export);
384
427
  var len9 = WASM_VECTOR_LEN;
385
- const ret = wasm.wasmconversionoptions_new(isLikeNone(heading_style) ? 3 : heading_style, isLikeNone(list_indent_type) ? 2 : list_indent_type, isLikeNone(list_indent_width) ? 0x100000001 : (list_indent_width) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escape_asterisks) ? 0xFFFFFF : escape_asterisks ? 1 : 0, isLikeNone(escape_underscores) ? 0xFFFFFF : escape_underscores ? 1 : 0, isLikeNone(escape_misc) ? 0xFFFFFF : escape_misc ? 1 : 0, isLikeNone(escape_ascii) ? 0xFFFFFF : escape_ascii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(default_title) ? 0xFFFFFF : default_title ? 1 : 0, isLikeNone(br_in_tables) ? 0xFFFFFF : br_in_tables ? 1 : 0, isLikeNone(highlight_style) ? 4 : highlight_style, isLikeNone(extract_metadata) ? 0xFFFFFF : extract_metadata ? 1 : 0, isLikeNone(whitespace_mode) ? 2 : whitespace_mode, isLikeNone(strip_newlines) ? 0xFFFFFF : strip_newlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrap_width) ? 0x100000001 : (wrap_width) >>> 0, isLikeNone(convert_as_inline) ? 0xFFFFFF : convert_as_inline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newline_style) ? 2 : newline_style, isLikeNone(code_block_style) ? 3 : code_block_style, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skip_images) ? 0xFFFFFF : skip_images ? 1 : 0, isLikeNone(link_style) ? 2 : link_style, isLikeNone(output_format) ? 3 : output_format, isLikeNone(include_document_structure) ? 0xFFFFFF : include_document_structure ? 1 : 0, isLikeNone(extract_images) ? 0xFFFFFF : extract_images ? 1 : 0, !isLikeNone(max_image_size), isLikeNone(max_image_size) ? BigInt(0) : max_image_size, isLikeNone(capture_svg) ? 0xFFFFFF : capture_svg ? 1 : 0, isLikeNone(infer_dimensions) ? 0xFFFFFF : infer_dimensions ? 1 : 0, isLikeNone(max_depth) ? 0x100000001 : (max_depth) >>> 0);
428
+ var ptr10 = isLikeNone(exclude_selectors) ? 0 : passArrayJsValueToWasm0(exclude_selectors, wasm.__wbindgen_export);
429
+ var len10 = WASM_VECTOR_LEN;
430
+ const ret = wasm.wasmconversionoptions_new(isLikeNone(heading_style) ? 3 : heading_style, isLikeNone(list_indent_type) ? 2 : list_indent_type, isLikeNone(list_indent_width) ? 0x100000001 : (list_indent_width) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escape_asterisks) ? 0xFFFFFF : escape_asterisks ? 1 : 0, isLikeNone(escape_underscores) ? 0xFFFFFF : escape_underscores ? 1 : 0, isLikeNone(escape_misc) ? 0xFFFFFF : escape_misc ? 1 : 0, isLikeNone(escape_ascii) ? 0xFFFFFF : escape_ascii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(default_title) ? 0xFFFFFF : default_title ? 1 : 0, isLikeNone(br_in_tables) ? 0xFFFFFF : br_in_tables ? 1 : 0, isLikeNone(highlight_style) ? 4 : highlight_style, isLikeNone(extract_metadata) ? 0xFFFFFF : extract_metadata ? 1 : 0, isLikeNone(whitespace_mode) ? 2 : whitespace_mode, isLikeNone(strip_newlines) ? 0xFFFFFF : strip_newlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrap_width) ? 0x100000001 : (wrap_width) >>> 0, isLikeNone(convert_as_inline) ? 0xFFFFFF : convert_as_inline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newline_style) ? 2 : newline_style, isLikeNone(code_block_style) ? 3 : code_block_style, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skip_images) ? 0xFFFFFF : skip_images ? 1 : 0, isLikeNone(link_style) ? 2 : link_style, isLikeNone(output_format) ? 3 : output_format, isLikeNone(include_document_structure) ? 0xFFFFFF : include_document_structure ? 1 : 0, isLikeNone(extract_images) ? 0xFFFFFF : extract_images ? 1 : 0, !isLikeNone(max_image_size), isLikeNone(max_image_size) ? BigInt(0) : max_image_size, isLikeNone(capture_svg) ? 0xFFFFFF : capture_svg ? 1 : 0, isLikeNone(infer_dimensions) ? 0xFFFFFF : infer_dimensions ? 1 : 0, ptr10, len10, isLikeNone(max_depth) ? 0x100000001 : (max_depth) >>> 0);
386
431
  this.__wbg_ptr = ret >>> 0;
387
432
  WasmConversionOptionsFinalization.register(this, this.__wbg_ptr, this);
388
433
  return this;
@@ -418,7 +463,7 @@ class WasmConversionOptions {
418
463
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
419
464
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
420
465
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
421
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
466
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
422
467
  return v1;
423
468
  } finally {
424
469
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -514,6 +559,14 @@ class WasmConversionOptions {
514
559
  set escapeUnderscores(value) {
515
560
  wasm.wasmconversionoptions_set_escapeUnderscores(this.__wbg_ptr, value);
516
561
  }
562
+ /**
563
+ * @param {string[]} value
564
+ */
565
+ set excludeSelectors(value) {
566
+ const ptr0 = passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
567
+ const len0 = WASM_VECTOR_LEN;
568
+ wasm.wasmconversionoptions_set_excludeSelectors(this.__wbg_ptr, ptr0, len0);
569
+ }
517
570
  /**
518
571
  * @param {boolean} value
519
572
  */
@@ -702,7 +755,7 @@ class WasmConversionOptions {
702
755
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
703
756
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
704
757
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
705
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
758
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
706
759
  return v1;
707
760
  } finally {
708
761
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -724,7 +777,7 @@ class WasmConversionOptions {
724
777
  return getStringFromWasm0(r0, r1);
725
778
  } finally {
726
779
  wasm.__wbindgen_add_to_stack_pointer(16);
727
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
780
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
728
781
  }
729
782
  }
730
783
  /**
@@ -743,7 +796,7 @@ class WasmConversionOptions {
743
796
  return getStringFromWasm0(r0, r1);
744
797
  } finally {
745
798
  wasm.__wbindgen_add_to_stack_pointer(16);
746
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
799
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
747
800
  }
748
801
  }
749
802
  /**
@@ -762,7 +815,7 @@ class WasmConversionOptions {
762
815
  return getStringFromWasm0(r0, r1);
763
816
  } finally {
764
817
  wasm.__wbindgen_add_to_stack_pointer(16);
765
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
818
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
766
819
  }
767
820
  }
768
821
  /**
@@ -790,6 +843,11 @@ class WasmConversionOptions {
790
843
  if (Symbol.dispose) WasmConversionOptions.prototype[Symbol.dispose] = WasmConversionOptions.prototype.free;
791
844
  exports.WasmConversionOptions = WasmConversionOptions;
792
845
 
846
+ /**
847
+ * Builder for [`ConversionOptions`].
848
+ *
849
+ * All fields start with default values. Call `.build()` to produce the final options.
850
+ */
793
851
  class WasmConversionOptionsBuilder {
794
852
  static __wrap(ptr) {
795
853
  ptr = ptr >>> 0;
@@ -809,6 +867,7 @@ class WasmConversionOptionsBuilder {
809
867
  wasm.__wbg_wasmconversionoptionsbuilder_free(ptr, 0);
810
868
  }
811
869
  /**
870
+ * Build the final [`ConversionOptions`].
812
871
  * @returns {WasmConversionOptions}
813
872
  */
814
873
  build() {
@@ -816,6 +875,18 @@ class WasmConversionOptionsBuilder {
816
875
  return WasmConversionOptions.__wrap(ret);
817
876
  }
818
877
  /**
878
+ * Set the list of CSS selectors for elements to exclude entirely from output.
879
+ * @param {string[]} selectors
880
+ * @returns {WasmConversionOptionsBuilder}
881
+ */
882
+ excludeSelectors(selectors) {
883
+ const ptr0 = passArrayJsValueToWasm0(selectors, wasm.__wbindgen_export);
884
+ const len0 = WASM_VECTOR_LEN;
885
+ const ret = wasm.wasmconversionoptionsbuilder_excludeSelectors(this.__wbg_ptr, ptr0, len0);
886
+ return WasmConversionOptionsBuilder.__wrap(ret);
887
+ }
888
+ /**
889
+ * Set the list of HTML tag names whose `<img>` children are kept inline.
819
890
  * @param {string[]} tags
820
891
  * @returns {WasmConversionOptionsBuilder}
821
892
  */
@@ -826,6 +897,7 @@ class WasmConversionOptionsBuilder {
826
897
  return WasmConversionOptionsBuilder.__wrap(ret);
827
898
  }
828
899
  /**
900
+ * Set the pre-processing options applied to the HTML before conversion.
829
901
  * @param {WasmPreprocessingOptions} preprocessing
830
902
  * @returns {WasmConversionOptionsBuilder}
831
903
  */
@@ -836,6 +908,7 @@ class WasmConversionOptionsBuilder {
836
908
  return WasmConversionOptionsBuilder.__wrap(ret);
837
909
  }
838
910
  /**
911
+ * Set the list of HTML tag names that are preserved verbatim in output.
839
912
  * @param {string[]} tags
840
913
  * @returns {WasmConversionOptionsBuilder}
841
914
  */
@@ -846,6 +919,7 @@ class WasmConversionOptionsBuilder {
846
919
  return WasmConversionOptionsBuilder.__wrap(ret);
847
920
  }
848
921
  /**
922
+ * Set the list of HTML tag names whose content is stripped from output.
849
923
  * @param {string[]} tags
850
924
  * @returns {WasmConversionOptionsBuilder}
851
925
  */
@@ -859,6 +933,12 @@ class WasmConversionOptionsBuilder {
859
933
  if (Symbol.dispose) WasmConversionOptionsBuilder.prototype[Symbol.dispose] = WasmConversionOptionsBuilder.prototype.free;
860
934
  exports.WasmConversionOptionsBuilder = WasmConversionOptionsBuilder;
861
935
 
936
+ /**
937
+ * Partial update for `ConversionOptions`.
938
+ *
939
+ * Uses `Option<T>` fields for selective updates. Bindings use this to construct
940
+ * options from language-native types. Prefer [`ConversionOptionsBuilder`] for Rust code.
941
+ */
862
942
  class WasmConversionOptionsUpdate {
863
943
  __destroy_into_raw() {
864
944
  const ptr = this.__wbg_ptr;
@@ -896,7 +976,7 @@ class WasmConversionOptionsUpdate {
896
976
  let v1;
897
977
  if (r0 !== 0) {
898
978
  v1 = getStringFromWasm0(r0, r1).slice();
899
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
979
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
900
980
  }
901
981
  return v1;
902
982
  } finally {
@@ -929,7 +1009,7 @@ class WasmConversionOptionsUpdate {
929
1009
  let v1;
930
1010
  if (r0 !== 0) {
931
1011
  v1 = getStringFromWasm0(r0, r1).slice();
932
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1012
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
933
1013
  }
934
1014
  return v1;
935
1015
  } finally {
@@ -969,7 +1049,7 @@ class WasmConversionOptionsUpdate {
969
1049
  let v1;
970
1050
  if (r0 !== 0) {
971
1051
  v1 = getStringFromWasm0(r0, r1).slice();
972
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1052
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
973
1053
  }
974
1054
  return v1;
975
1055
  } finally {
@@ -1004,6 +1084,25 @@ class WasmConversionOptionsUpdate {
1004
1084
  const ret = wasm.wasmconversionoptionsupdate_escapeUnderscores(this.__wbg_ptr);
1005
1085
  return ret === 0xFFFFFF ? undefined : ret !== 0;
1006
1086
  }
1087
+ /**
1088
+ * @returns {string[] | undefined}
1089
+ */
1090
+ get excludeSelectors() {
1091
+ try {
1092
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1093
+ wasm.wasmconversionoptionsupdate_excludeSelectors(retptr, this.__wbg_ptr);
1094
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1095
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1096
+ let v1;
1097
+ if (r0 !== 0) {
1098
+ v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1099
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1100
+ }
1101
+ return v1;
1102
+ } finally {
1103
+ wasm.__wbindgen_add_to_stack_pointer(16);
1104
+ }
1105
+ }
1007
1106
  /**
1008
1107
  * @returns {boolean | undefined}
1009
1108
  */
@@ -1058,7 +1157,7 @@ class WasmConversionOptionsUpdate {
1058
1157
  let v1;
1059
1158
  if (r0 !== 0) {
1060
1159
  v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1061
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
1160
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1062
1161
  }
1063
1162
  return v1;
1064
1163
  } finally {
@@ -1147,8 +1246,9 @@ class WasmConversionOptionsUpdate {
1147
1246
  * @param {boolean | null} [capture_svg]
1148
1247
  * @param {boolean | null} [infer_dimensions]
1149
1248
  * @param {number | null} [max_depth]
1249
+ * @param {string[] | null} [exclude_selectors]
1150
1250
  */
1151
- constructor(heading_style, list_indent_type, list_indent_width, bullets, strong_em_symbol, escape_asterisks, escape_underscores, escape_misc, escape_ascii, code_language, autolinks, default_title, br_in_tables, highlight_style, extract_metadata, whitespace_mode, strip_newlines, wrap, wrap_width, convert_as_inline, sub_symbol, sup_symbol, newline_style, code_block_style, keep_inline_images_in, preprocessing, encoding, debug, strip_tags, preserve_tags, skip_images, link_style, output_format, include_document_structure, extract_images, max_image_size, capture_svg, infer_dimensions, max_depth) {
1251
+ constructor(heading_style, list_indent_type, list_indent_width, bullets, strong_em_symbol, escape_asterisks, escape_underscores, escape_misc, escape_ascii, code_language, autolinks, default_title, br_in_tables, highlight_style, extract_metadata, whitespace_mode, strip_newlines, wrap, wrap_width, convert_as_inline, sub_symbol, sup_symbol, newline_style, code_block_style, keep_inline_images_in, preprocessing, encoding, debug, strip_tags, preserve_tags, skip_images, link_style, output_format, include_document_structure, extract_images, max_image_size, capture_svg, infer_dimensions, max_depth, exclude_selectors) {
1152
1252
  var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1153
1253
  var len0 = WASM_VECTOR_LEN;
1154
1254
  var ptr1 = isLikeNone(strong_em_symbol) ? 0 : passStringToWasm0(strong_em_symbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -1172,7 +1272,9 @@ class WasmConversionOptionsUpdate {
1172
1272
  var len8 = WASM_VECTOR_LEN;
1173
1273
  var ptr9 = isLikeNone(preserve_tags) ? 0 : passArrayJsValueToWasm0(preserve_tags, wasm.__wbindgen_export);
1174
1274
  var len9 = WASM_VECTOR_LEN;
1175
- const ret = wasm.wasmconversionoptionsupdate_new(isLikeNone(heading_style) ? 3 : heading_style, isLikeNone(list_indent_type) ? 2 : list_indent_type, isLikeNone(list_indent_width) ? 0x100000001 : (list_indent_width) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escape_asterisks) ? 0xFFFFFF : escape_asterisks ? 1 : 0, isLikeNone(escape_underscores) ? 0xFFFFFF : escape_underscores ? 1 : 0, isLikeNone(escape_misc) ? 0xFFFFFF : escape_misc ? 1 : 0, isLikeNone(escape_ascii) ? 0xFFFFFF : escape_ascii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(default_title) ? 0xFFFFFF : default_title ? 1 : 0, isLikeNone(br_in_tables) ? 0xFFFFFF : br_in_tables ? 1 : 0, isLikeNone(highlight_style) ? 4 : highlight_style, isLikeNone(extract_metadata) ? 0xFFFFFF : extract_metadata ? 1 : 0, isLikeNone(whitespace_mode) ? 2 : whitespace_mode, isLikeNone(strip_newlines) ? 0xFFFFFF : strip_newlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrap_width) ? 0x100000001 : (wrap_width) >>> 0, isLikeNone(convert_as_inline) ? 0xFFFFFF : convert_as_inline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newline_style) ? 2 : newline_style, isLikeNone(code_block_style) ? 3 : code_block_style, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skip_images) ? 0xFFFFFF : skip_images ? 1 : 0, isLikeNone(link_style) ? 2 : link_style, isLikeNone(output_format) ? 3 : output_format, isLikeNone(include_document_structure) ? 0xFFFFFF : include_document_structure ? 1 : 0, isLikeNone(extract_images) ? 0xFFFFFF : extract_images ? 1 : 0, !isLikeNone(max_image_size), isLikeNone(max_image_size) ? BigInt(0) : max_image_size, isLikeNone(capture_svg) ? 0xFFFFFF : capture_svg ? 1 : 0, isLikeNone(infer_dimensions) ? 0xFFFFFF : infer_dimensions ? 1 : 0, isLikeNone(max_depth) ? 0x100000001 : (max_depth) >>> 0);
1275
+ var ptr10 = isLikeNone(exclude_selectors) ? 0 : passArrayJsValueToWasm0(exclude_selectors, wasm.__wbindgen_export);
1276
+ var len10 = WASM_VECTOR_LEN;
1277
+ const ret = wasm.wasmconversionoptionsupdate_new(isLikeNone(heading_style) ? 3 : heading_style, isLikeNone(list_indent_type) ? 2 : list_indent_type, isLikeNone(list_indent_width) ? 0x100000001 : (list_indent_width) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escape_asterisks) ? 0xFFFFFF : escape_asterisks ? 1 : 0, isLikeNone(escape_underscores) ? 0xFFFFFF : escape_underscores ? 1 : 0, isLikeNone(escape_misc) ? 0xFFFFFF : escape_misc ? 1 : 0, isLikeNone(escape_ascii) ? 0xFFFFFF : escape_ascii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(default_title) ? 0xFFFFFF : default_title ? 1 : 0, isLikeNone(br_in_tables) ? 0xFFFFFF : br_in_tables ? 1 : 0, isLikeNone(highlight_style) ? 4 : highlight_style, isLikeNone(extract_metadata) ? 0xFFFFFF : extract_metadata ? 1 : 0, isLikeNone(whitespace_mode) ? 2 : whitespace_mode, isLikeNone(strip_newlines) ? 0xFFFFFF : strip_newlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrap_width) ? 0x100000001 : (wrap_width) >>> 0, isLikeNone(convert_as_inline) ? 0xFFFFFF : convert_as_inline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newline_style) ? 2 : newline_style, isLikeNone(code_block_style) ? 3 : code_block_style, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skip_images) ? 0xFFFFFF : skip_images ? 1 : 0, isLikeNone(link_style) ? 2 : link_style, isLikeNone(output_format) ? 3 : output_format, isLikeNone(include_document_structure) ? 0xFFFFFF : include_document_structure ? 1 : 0, isLikeNone(extract_images) ? 0xFFFFFF : extract_images ? 1 : 0, !isLikeNone(max_image_size), isLikeNone(max_image_size) ? BigInt(0) : max_image_size, isLikeNone(capture_svg) ? 0xFFFFFF : capture_svg ? 1 : 0, isLikeNone(infer_dimensions) ? 0xFFFFFF : infer_dimensions ? 1 : 0, isLikeNone(max_depth) ? 0x100000001 : (max_depth) >>> 0, ptr10, len10);
1176
1278
  this.__wbg_ptr = ret >>> 0;
1177
1279
  WasmConversionOptionsUpdateFinalization.register(this, this.__wbg_ptr, this);
1178
1280
  return this;
@@ -1210,7 +1312,7 @@ class WasmConversionOptionsUpdate {
1210
1312
  let v1;
1211
1313
  if (r0 !== 0) {
1212
1314
  v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1213
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
1315
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1214
1316
  }
1215
1317
  return v1;
1216
1318
  } finally {
@@ -1307,6 +1409,14 @@ class WasmConversionOptionsUpdate {
1307
1409
  set escapeUnderscores(value) {
1308
1410
  wasm.wasmconversionoptionsupdate_set_escapeUnderscores(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
1309
1411
  }
1412
+ /**
1413
+ * @param {string[] | null} [value]
1414
+ */
1415
+ set excludeSelectors(value) {
1416
+ var ptr0 = isLikeNone(value) ? 0 : passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
1417
+ var len0 = WASM_VECTOR_LEN;
1418
+ wasm.wasmconversionoptionsupdate_set_excludeSelectors(this.__wbg_ptr, ptr0, len0);
1419
+ }
1310
1420
  /**
1311
1421
  * @param {boolean | null} [value]
1312
1422
  */
@@ -1500,7 +1610,7 @@ class WasmConversionOptionsUpdate {
1500
1610
  let v1;
1501
1611
  if (r0 !== 0) {
1502
1612
  v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1503
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
1613
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1504
1614
  }
1505
1615
  return v1;
1506
1616
  } finally {
@@ -1519,7 +1629,7 @@ class WasmConversionOptionsUpdate {
1519
1629
  let v1;
1520
1630
  if (r0 !== 0) {
1521
1631
  v1 = getStringFromWasm0(r0, r1).slice();
1522
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1632
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1523
1633
  }
1524
1634
  return v1;
1525
1635
  } finally {
@@ -1538,7 +1648,7 @@ class WasmConversionOptionsUpdate {
1538
1648
  let v1;
1539
1649
  if (r0 !== 0) {
1540
1650
  v1 = getStringFromWasm0(r0, r1).slice();
1541
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1651
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1542
1652
  }
1543
1653
  return v1;
1544
1654
  } finally {
@@ -1557,7 +1667,7 @@ class WasmConversionOptionsUpdate {
1557
1667
  let v1;
1558
1668
  if (r0 !== 0) {
1559
1669
  v1 = getStringFromWasm0(r0, r1).slice();
1560
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1670
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1561
1671
  }
1562
1672
  return v1;
1563
1673
  } finally {
@@ -1589,6 +1699,22 @@ class WasmConversionOptionsUpdate {
1589
1699
  if (Symbol.dispose) WasmConversionOptionsUpdate.prototype[Symbol.dispose] = WasmConversionOptionsUpdate.prototype.free;
1590
1700
  exports.WasmConversionOptionsUpdate = WasmConversionOptionsUpdate;
1591
1701
 
1702
+ /**
1703
+ * The primary result of HTML conversion and extraction.
1704
+ *
1705
+ * Contains the converted text output, optional structured document tree,
1706
+ * metadata, extracted tables, images, and processing warnings.
1707
+ *
1708
+ * # Example
1709
+ *
1710
+ * ```text
1711
+ * use html_to_markdown_rs::{convert, ConversionOptions};
1712
+ *
1713
+ * let result = convert("<h1>Hello</h1><p>World</p>", None)?;
1714
+ * assert!(result.content.is_some());
1715
+ * assert!(result.warnings.is_empty());
1716
+ * ```
1717
+ */
1592
1718
  class WasmConversionResult {
1593
1719
  static __wrap(ptr) {
1594
1720
  ptr = ptr >>> 0;
@@ -1619,7 +1745,7 @@ class WasmConversionResult {
1619
1745
  let v1;
1620
1746
  if (r0 !== 0) {
1621
1747
  v1 = getStringFromWasm0(r0, r1).slice();
1622
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1748
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1623
1749
  }
1624
1750
  return v1;
1625
1751
  } finally {
@@ -1643,7 +1769,7 @@ class WasmConversionResult {
1643
1769
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1644
1770
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1645
1771
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1646
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
1772
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1647
1773
  return v1;
1648
1774
  } finally {
1649
1775
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -1749,7 +1875,7 @@ class WasmConversionResult {
1749
1875
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1750
1876
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1751
1877
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1752
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
1878
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1753
1879
  return v1;
1754
1880
  } finally {
1755
1881
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -1765,7 +1891,7 @@ class WasmConversionResult {
1765
1891
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1766
1892
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1767
1893
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1768
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
1894
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1769
1895
  return v1;
1770
1896
  } finally {
1771
1897
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -1775,6 +1901,26 @@ class WasmConversionResult {
1775
1901
  if (Symbol.dispose) WasmConversionResult.prototype[Symbol.dispose] = WasmConversionResult.prototype.free;
1776
1902
  exports.WasmConversionResult = WasmConversionResult;
1777
1903
 
1904
+ /**
1905
+ * Document-level metadata extracted from `<head>` and top-level elements.
1906
+ *
1907
+ * Contains all metadata typically used by search engines, social media platforms,
1908
+ * and browsers for document indexing and presentation.
1909
+ *
1910
+ * # Examples
1911
+ *
1912
+ * ```
1913
+ * # use html_to_markdown_rs::metadata::DocumentMetadata;
1914
+ * let doc = DocumentMetadata {
1915
+ * title: Some("My Article".to_string()),
1916
+ * description: Some("A great article about Rust".to_string()),
1917
+ * keywords: vec!["rust".to_string(), "programming".to_string()],
1918
+ * ..Default::default()
1919
+ * };
1920
+ *
1921
+ * assert_eq!(doc.title, Some("My Article".to_string()));
1922
+ * ```
1923
+ */
1778
1924
  class WasmDocumentMetadata {
1779
1925
  static __wrap(ptr) {
1780
1926
  ptr = ptr >>> 0;
@@ -1805,7 +1951,7 @@ class WasmDocumentMetadata {
1805
1951
  let v1;
1806
1952
  if (r0 !== 0) {
1807
1953
  v1 = getStringFromWasm0(r0, r1).slice();
1808
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1954
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1809
1955
  }
1810
1956
  return v1;
1811
1957
  } finally {
@@ -1824,7 +1970,7 @@ class WasmDocumentMetadata {
1824
1970
  let v1;
1825
1971
  if (r0 !== 0) {
1826
1972
  v1 = getStringFromWasm0(r0, r1).slice();
1827
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1973
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1828
1974
  }
1829
1975
  return v1;
1830
1976
  } finally {
@@ -1843,7 +1989,7 @@ class WasmDocumentMetadata {
1843
1989
  let v1;
1844
1990
  if (r0 !== 0) {
1845
1991
  v1 = getStringFromWasm0(r0, r1).slice();
1846
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
1992
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1847
1993
  }
1848
1994
  return v1;
1849
1995
  } finally {
@@ -1862,7 +2008,7 @@ class WasmDocumentMetadata {
1862
2008
  let v1;
1863
2009
  if (r0 !== 0) {
1864
2010
  v1 = getStringFromWasm0(r0, r1).slice();
1865
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
2011
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1866
2012
  }
1867
2013
  return v1;
1868
2014
  } finally {
@@ -1879,7 +2025,7 @@ class WasmDocumentMetadata {
1879
2025
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1880
2026
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1881
2027
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1882
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
2028
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1883
2029
  return v1;
1884
2030
  } finally {
1885
2031
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -1897,7 +2043,7 @@ class WasmDocumentMetadata {
1897
2043
  let v1;
1898
2044
  if (r0 !== 0) {
1899
2045
  v1 = getStringFromWasm0(r0, r1).slice();
1900
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
2046
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1901
2047
  }
1902
2048
  return v1;
1903
2049
  } finally {
@@ -2050,7 +2196,7 @@ class WasmDocumentMetadata {
2050
2196
  let v1;
2051
2197
  if (r0 !== 0) {
2052
2198
  v1 = getStringFromWasm0(r0, r1).slice();
2053
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
2199
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2054
2200
  }
2055
2201
  return v1;
2056
2202
  } finally {
@@ -2068,6 +2214,9 @@ class WasmDocumentMetadata {
2068
2214
  if (Symbol.dispose) WasmDocumentMetadata.prototype[Symbol.dispose] = WasmDocumentMetadata.prototype.free;
2069
2215
  exports.WasmDocumentMetadata = WasmDocumentMetadata;
2070
2216
 
2217
+ /**
2218
+ * A single node in the document tree.
2219
+ */
2071
2220
  class WasmDocumentNode {
2072
2221
  static __wrap(ptr) {
2073
2222
  ptr = ptr >>> 0;
@@ -2102,7 +2251,7 @@ class WasmDocumentNode {
2102
2251
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2103
2252
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2104
2253
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2105
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
2254
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2106
2255
  return v1;
2107
2256
  } finally {
2108
2257
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -2125,7 +2274,7 @@ class WasmDocumentNode {
2125
2274
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2126
2275
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2127
2276
  var v1 = getArrayU32FromWasm0(r0, r1).slice();
2128
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
2277
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2129
2278
  return v1;
2130
2279
  } finally {
2131
2280
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -2154,7 +2303,7 @@ class WasmDocumentNode {
2154
2303
  return getStringFromWasm0(r0, r1);
2155
2304
  } finally {
2156
2305
  wasm.__wbindgen_add_to_stack_pointer(16);
2157
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
2306
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2158
2307
  }
2159
2308
  }
2160
2309
  /**
@@ -2230,6 +2379,11 @@ class WasmDocumentNode {
2230
2379
  if (Symbol.dispose) WasmDocumentNode.prototype[Symbol.dispose] = WasmDocumentNode.prototype.free;
2231
2380
  exports.WasmDocumentNode = WasmDocumentNode;
2232
2381
 
2382
+ /**
2383
+ * A structured document tree representing the semantic content of an HTML document.
2384
+ *
2385
+ * Uses a flat node array with index-based parent/child references for efficient traversal.
2386
+ */
2233
2387
  class WasmDocumentStructure {
2234
2388
  static __wrap(ptr) {
2235
2389
  ptr = ptr >>> 0;
@@ -2272,7 +2426,7 @@ class WasmDocumentStructure {
2272
2426
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2273
2427
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2274
2428
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2275
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
2429
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2276
2430
  return v1;
2277
2431
  } finally {
2278
2432
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -2306,7 +2460,7 @@ class WasmDocumentStructure {
2306
2460
  let v1;
2307
2461
  if (r0 !== 0) {
2308
2462
  v1 = getStringFromWasm0(r0, r1).slice();
2309
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
2463
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2310
2464
  }
2311
2465
  return v1;
2312
2466
  } finally {
@@ -2317,6 +2471,9 @@ class WasmDocumentStructure {
2317
2471
  if (Symbol.dispose) WasmDocumentStructure.prototype[Symbol.dispose] = WasmDocumentStructure.prototype.free;
2318
2472
  exports.WasmDocumentStructure = WasmDocumentStructure;
2319
2473
 
2474
+ /**
2475
+ * A single cell in a table grid.
2476
+ */
2320
2477
  class WasmGridCell {
2321
2478
  static __wrap(ptr) {
2322
2479
  ptr = ptr >>> 0;
@@ -2371,7 +2528,7 @@ class WasmGridCell {
2371
2528
  return getStringFromWasm0(r0, r1);
2372
2529
  } finally {
2373
2530
  wasm.__wbindgen_add_to_stack_pointer(16);
2374
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
2531
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2375
2532
  }
2376
2533
  }
2377
2534
  /**
@@ -2453,6 +2610,28 @@ class WasmGridCell {
2453
2610
  if (Symbol.dispose) WasmGridCell.prototype[Symbol.dispose] = WasmGridCell.prototype.free;
2454
2611
  exports.WasmGridCell = WasmGridCell;
2455
2612
 
2613
+ /**
2614
+ * Header element metadata with hierarchy tracking.
2615
+ *
2616
+ * Captures heading elements (h1-h6) with their text content, identifiers,
2617
+ * and position in the document structure.
2618
+ *
2619
+ * # Examples
2620
+ *
2621
+ * ```
2622
+ * # use html_to_markdown_rs::metadata::HeaderMetadata;
2623
+ * let header = HeaderMetadata {
2624
+ * level: 1,
2625
+ * text: "Main Title".to_string(),
2626
+ * id: Some("main-title".to_string()),
2627
+ * depth: 0,
2628
+ * html_offset: 145,
2629
+ * };
2630
+ *
2631
+ * assert_eq!(header.level, 1);
2632
+ * assert!(header.is_valid());
2633
+ * ```
2634
+ */
2456
2635
  class WasmHeaderMetadata {
2457
2636
  static __wrap(ptr) {
2458
2637
  ptr = ptr >>> 0;
@@ -2503,7 +2682,7 @@ class WasmHeaderMetadata {
2503
2682
  let v1;
2504
2683
  if (r0 !== 0) {
2505
2684
  v1 = getStringFromWasm0(r0, r1).slice();
2506
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
2685
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2507
2686
  }
2508
2687
  return v1;
2509
2688
  } finally {
@@ -2511,6 +2690,34 @@ class WasmHeaderMetadata {
2511
2690
  }
2512
2691
  }
2513
2692
  /**
2693
+ * Validate that the header level is within valid range (1-6).
2694
+ *
2695
+ * # Returns
2696
+ *
2697
+ * `true` if level is 1-6, `false` otherwise.
2698
+ *
2699
+ * # Examples
2700
+ *
2701
+ * ```
2702
+ * # use html_to_markdown_rs::metadata::HeaderMetadata;
2703
+ * let valid = HeaderMetadata {
2704
+ * level: 3,
2705
+ * text: "Title".to_string(),
2706
+ * id: None,
2707
+ * depth: 2,
2708
+ * html_offset: 100,
2709
+ * };
2710
+ * assert!(valid.is_valid());
2711
+ *
2712
+ * let invalid = HeaderMetadata {
2713
+ * level: 7, // Invalid
2714
+ * text: "Title".to_string(),
2715
+ * id: None,
2716
+ * depth: 2,
2717
+ * html_offset: 100,
2718
+ * };
2719
+ * assert!(!invalid.is_valid());
2720
+ * ```
2514
2721
  * @returns {boolean}
2515
2722
  */
2516
2723
  isValid() {
@@ -2591,7 +2798,7 @@ class WasmHeaderMetadata {
2591
2798
  return getStringFromWasm0(r0, r1);
2592
2799
  } finally {
2593
2800
  wasm.__wbindgen_add_to_stack_pointer(16);
2594
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
2801
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2595
2802
  }
2596
2803
  }
2597
2804
  }
@@ -2599,6 +2806,9 @@ if (Symbol.dispose) WasmHeaderMetadata.prototype[Symbol.dispose] = WasmHeaderMet
2599
2806
  exports.WasmHeaderMetadata = WasmHeaderMetadata;
2600
2807
 
2601
2808
  /**
2809
+ * Heading style options for Markdown output.
2810
+ *
2811
+ * Controls how headings (h1-h6) are rendered in the output Markdown.
2602
2812
  * @enum {0 | 1 | 2}
2603
2813
  */
2604
2814
  const WasmHeadingStyle = Object.freeze({
@@ -2609,6 +2819,9 @@ const WasmHeadingStyle = Object.freeze({
2609
2819
  exports.WasmHeadingStyle = WasmHeadingStyle;
2610
2820
 
2611
2821
  /**
2822
+ * Highlight rendering style for `<mark>` elements.
2823
+ *
2824
+ * Controls how highlighted text is rendered in Markdown output.
2612
2825
  * @enum {0 | 1 | 2 | 3}
2613
2826
  */
2614
2827
  const WasmHighlightStyle = Object.freeze({
@@ -2619,6 +2832,27 @@ const WasmHighlightStyle = Object.freeze({
2619
2832
  });
2620
2833
  exports.WasmHighlightStyle = WasmHighlightStyle;
2621
2834
 
2835
+ /**
2836
+ * Comprehensive metadata extraction result from HTML document.
2837
+ *
2838
+ * Contains all extracted metadata types in a single structure,
2839
+ * suitable for serialization and transmission across language boundaries.
2840
+ *
2841
+ * # Examples
2842
+ *
2843
+ * ```
2844
+ * # use html_to_markdown_rs::metadata::HtmlMetadata;
2845
+ * let metadata = HtmlMetadata {
2846
+ * document: Default::default(),
2847
+ * headers: Vec::new(),
2848
+ * links: Vec::new(),
2849
+ * images: Vec::new(),
2850
+ * structured_data: Vec::new(),
2851
+ * };
2852
+ *
2853
+ * assert!(metadata.headers.is_empty());
2854
+ * ```
2855
+ */
2622
2856
  class WasmHtmlMetadata {
2623
2857
  static __wrap(ptr) {
2624
2858
  ptr = ptr >>> 0;
@@ -2654,7 +2888,7 @@ class WasmHtmlMetadata {
2654
2888
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2655
2889
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2656
2890
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2657
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
2891
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2658
2892
  return v1;
2659
2893
  } finally {
2660
2894
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -2670,7 +2904,7 @@ class WasmHtmlMetadata {
2670
2904
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2671
2905
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2672
2906
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2673
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
2907
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2674
2908
  return v1;
2675
2909
  } finally {
2676
2910
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -2686,7 +2920,7 @@ class WasmHtmlMetadata {
2686
2920
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2687
2921
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2688
2922
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2689
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
2923
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2690
2924
  return v1;
2691
2925
  } finally {
2692
2926
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -2768,7 +3002,7 @@ class WasmHtmlMetadata {
2768
3002
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2769
3003
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2770
3004
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2771
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
3005
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2772
3006
  return v1;
2773
3007
  } finally {
2774
3008
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -2778,6 +3012,28 @@ class WasmHtmlMetadata {
2778
3012
  if (Symbol.dispose) WasmHtmlMetadata.prototype[Symbol.dispose] = WasmHtmlMetadata.prototype.free;
2779
3013
  exports.WasmHtmlMetadata = WasmHtmlMetadata;
2780
3014
 
3015
+ /**
3016
+ * Image metadata with source and dimensions.
3017
+ *
3018
+ * Captures `<img>` elements and inline `<svg>` elements with metadata
3019
+ * for image analysis and optimization.
3020
+ *
3021
+ * # Examples
3022
+ *
3023
+ * ```
3024
+ * # use html_to_markdown_rs::metadata::{ImageMetadata, ImageType};
3025
+ * let img = ImageMetadata {
3026
+ * src: "https://example.com/image.jpg".to_string(),
3027
+ * alt: Some("An example image".to_string()),
3028
+ * title: Some("Example".to_string()),
3029
+ * dimensions: Some((800, 600)),
3030
+ * image_type: ImageType::External,
3031
+ * attributes: Default::default(),
3032
+ * };
3033
+ *
3034
+ * assert_eq!(img.image_type, ImageType::External);
3035
+ * ```
3036
+ */
2781
3037
  class WasmImageMetadata {
2782
3038
  static __wrap(ptr) {
2783
3039
  ptr = ptr >>> 0;
@@ -2814,7 +3070,7 @@ class WasmImageMetadata {
2814
3070
  let v1;
2815
3071
  if (r0 !== 0) {
2816
3072
  v1 = getStringFromWasm0(r0, r1).slice();
2817
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
3073
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2818
3074
  }
2819
3075
  return v1;
2820
3076
  } finally {
@@ -2829,7 +3085,7 @@ class WasmImageMetadata {
2829
3085
  return takeObject(ret);
2830
3086
  }
2831
3087
  /**
2832
- * @returns {string | undefined}
3088
+ * @returns {Uint32Array | undefined}
2833
3089
  */
2834
3090
  get dimensions() {
2835
3091
  try {
@@ -2839,8 +3095,8 @@ class WasmImageMetadata {
2839
3095
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2840
3096
  let v1;
2841
3097
  if (r0 !== 0) {
2842
- v1 = getStringFromWasm0(r0, r1).slice();
2843
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
3098
+ v1 = getArrayU32FromWasm0(r0, r1).slice();
3099
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2844
3100
  }
2845
3101
  return v1;
2846
3102
  } finally {
@@ -2860,7 +3116,7 @@ class WasmImageMetadata {
2860
3116
  * @param {any} attributes
2861
3117
  * @param {string | null} [alt]
2862
3118
  * @param {string | null} [title]
2863
- * @param {string | null} [dimensions]
3119
+ * @param {Uint32Array | null} [dimensions]
2864
3120
  */
2865
3121
  constructor(src, image_type, attributes, alt, title, dimensions) {
2866
3122
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -2869,7 +3125,7 @@ class WasmImageMetadata {
2869
3125
  var len1 = WASM_VECTOR_LEN;
2870
3126
  var ptr2 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2871
3127
  var len2 = WASM_VECTOR_LEN;
2872
- var ptr3 = isLikeNone(dimensions) ? 0 : passStringToWasm0(dimensions, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3128
+ var ptr3 = isLikeNone(dimensions) ? 0 : passArray32ToWasm0(dimensions, wasm.__wbindgen_export);
2873
3129
  var len3 = WASM_VECTOR_LEN;
2874
3130
  const ret = wasm.wasmimagemetadata_new(ptr0, len0, image_type, addHeapObject(attributes), ptr1, len1, ptr2, len2, ptr3, len3);
2875
3131
  this.__wbg_ptr = ret >>> 0;
@@ -2891,10 +3147,10 @@ class WasmImageMetadata {
2891
3147
  wasm.wasmimagemetadata_set_attributes(this.__wbg_ptr, addHeapObject(value));
2892
3148
  }
2893
3149
  /**
2894
- * @param {string | null} [value]
3150
+ * @param {Uint32Array | null} [value]
2895
3151
  */
2896
3152
  set dimensions(value) {
2897
- var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3153
+ var ptr0 = isLikeNone(value) ? 0 : passArray32ToWasm0(value, wasm.__wbindgen_export);
2898
3154
  var len0 = WASM_VECTOR_LEN;
2899
3155
  wasm.wasmimagemetadata_set_dimensions(this.__wbg_ptr, ptr0, len0);
2900
3156
  }
@@ -2936,7 +3192,7 @@ class WasmImageMetadata {
2936
3192
  return getStringFromWasm0(r0, r1);
2937
3193
  } finally {
2938
3194
  wasm.__wbindgen_add_to_stack_pointer(16);
2939
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
3195
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2940
3196
  }
2941
3197
  }
2942
3198
  /**
@@ -2951,7 +3207,7 @@ class WasmImageMetadata {
2951
3207
  let v1;
2952
3208
  if (r0 !== 0) {
2953
3209
  v1 = getStringFromWasm0(r0, r1).slice();
2954
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
3210
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2955
3211
  }
2956
3212
  return v1;
2957
3213
  } finally {
@@ -2963,6 +3219,9 @@ if (Symbol.dispose) WasmImageMetadata.prototype[Symbol.dispose] = WasmImageMetad
2963
3219
  exports.WasmImageMetadata = WasmImageMetadata;
2964
3220
 
2965
3221
  /**
3222
+ * Image source classification for proper handling and processing.
3223
+ *
3224
+ * Determines whether an image is embedded (data URI), inline SVG, external, or relative.
2966
3225
  * @enum {0 | 1 | 2 | 3}
2967
3226
  */
2968
3227
  const WasmImageType = Object.freeze({
@@ -2973,6 +3232,28 @@ const WasmImageType = Object.freeze({
2973
3232
  });
2974
3233
  exports.WasmImageType = WasmImageType;
2975
3234
 
3235
+ /**
3236
+ * Hyperlink metadata with categorization and attributes.
3237
+ *
3238
+ * Represents `<a>` elements with parsed href values, text content, and link type classification.
3239
+ *
3240
+ * # Examples
3241
+ *
3242
+ * ```
3243
+ * # use html_to_markdown_rs::metadata::{LinkMetadata, LinkType};
3244
+ * let link = LinkMetadata {
3245
+ * href: "https://example.com".to_string(),
3246
+ * text: "Example".to_string(),
3247
+ * title: Some("Visit Example".to_string()),
3248
+ * link_type: LinkType::External,
3249
+ * rel: vec!["nofollow".to_string()],
3250
+ * attributes: Default::default(),
3251
+ * };
3252
+ *
3253
+ * assert_eq!(link.link_type, LinkType::External);
3254
+ * assert_eq!(link.text, "Example");
3255
+ * ```
3256
+ */
2976
3257
  class WasmLinkMetadata {
2977
3258
  static __wrap(ptr) {
2978
3259
  ptr = ptr >>> 0;
@@ -3005,6 +3286,25 @@ class WasmLinkMetadata {
3005
3286
  return takeObject(ret);
3006
3287
  }
3007
3288
  /**
3289
+ * Classify a link based on href value.
3290
+ *
3291
+ * # Arguments
3292
+ *
3293
+ * * `href` - The href attribute value
3294
+ *
3295
+ * # Returns
3296
+ *
3297
+ * Appropriate [`LinkType`] based on protocol and content.
3298
+ *
3299
+ * # Examples
3300
+ *
3301
+ * ```
3302
+ * # use html_to_markdown_rs::metadata::{LinkMetadata, LinkType};
3303
+ * assert_eq!(LinkMetadata::classify_link("#section"), LinkType::Anchor);
3304
+ * assert_eq!(LinkMetadata::classify_link("mailto:test@example.com"), LinkType::Email);
3305
+ * assert_eq!(LinkMetadata::classify_link("tel:+1234567890"), LinkType::Phone);
3306
+ * assert_eq!(LinkMetadata::classify_link("https://example.com"), LinkType::External);
3307
+ * ```
3008
3308
  * @param {string} href
3009
3309
  * @returns {WasmLinkType}
3010
3310
  */
@@ -3030,7 +3330,7 @@ class WasmLinkMetadata {
3030
3330
  return getStringFromWasm0(r0, r1);
3031
3331
  } finally {
3032
3332
  wasm.__wbindgen_add_to_stack_pointer(16);
3033
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
3333
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
3034
3334
  }
3035
3335
  }
3036
3336
  /**
@@ -3072,7 +3372,7 @@ class WasmLinkMetadata {
3072
3372
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3073
3373
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3074
3374
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
3075
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
3375
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
3076
3376
  return v1;
3077
3377
  } finally {
3078
3378
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -3138,7 +3438,7 @@ class WasmLinkMetadata {
3138
3438
  return getStringFromWasm0(r0, r1);
3139
3439
  } finally {
3140
3440
  wasm.__wbindgen_add_to_stack_pointer(16);
3141
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
3441
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
3142
3442
  }
3143
3443
  }
3144
3444
  /**
@@ -3153,7 +3453,7 @@ class WasmLinkMetadata {
3153
3453
  let v1;
3154
3454
  if (r0 !== 0) {
3155
3455
  v1 = getStringFromWasm0(r0, r1).slice();
3156
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
3456
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
3157
3457
  }
3158
3458
  return v1;
3159
3459
  } finally {
@@ -3165,6 +3465,10 @@ if (Symbol.dispose) WasmLinkMetadata.prototype[Symbol.dispose] = WasmLinkMetadat
3165
3465
  exports.WasmLinkMetadata = WasmLinkMetadata;
3166
3466
 
3167
3467
  /**
3468
+ * Link rendering style in Markdown output.
3469
+ *
3470
+ * Controls whether links and images use inline `[text](url)` syntax or
3471
+ * reference-style `[text][1]` syntax with definitions collected at the end.
3168
3472
  * @enum {0 | 1}
3169
3473
  */
3170
3474
  const WasmLinkStyle = Object.freeze({
@@ -3174,6 +3478,9 @@ const WasmLinkStyle = Object.freeze({
3174
3478
  exports.WasmLinkStyle = WasmLinkStyle;
3175
3479
 
3176
3480
  /**
3481
+ * Link classification based on href value and document context.
3482
+ *
3483
+ * Used to categorize links during extraction for filtering and analysis.
3177
3484
  * @enum {0 | 1 | 2 | 3 | 4 | 5}
3178
3485
  */
3179
3486
  const WasmLinkType = Object.freeze({
@@ -3187,6 +3494,9 @@ const WasmLinkType = Object.freeze({
3187
3494
  exports.WasmLinkType = WasmLinkType;
3188
3495
 
3189
3496
  /**
3497
+ * List indentation character type.
3498
+ *
3499
+ * Controls whether list items are indented with spaces or tabs.
3190
3500
  * @enum {0 | 1}
3191
3501
  */
3192
3502
  const WasmListIndentType = Object.freeze({
@@ -3195,299 +3505,303 @@ const WasmListIndentType = Object.freeze({
3195
3505
  });
3196
3506
  exports.WasmListIndentType = WasmListIndentType;
3197
3507
 
3198
- class WasmMetadataConfig {
3199
- static __wrap(ptr) {
3200
- ptr = ptr >>> 0;
3201
- const obj = Object.create(WasmMetadataConfig.prototype);
3202
- obj.__wbg_ptr = ptr;
3203
- WasmMetadataConfigFinalization.register(obj, obj.__wbg_ptr, obj);
3204
- return obj;
3205
- }
3508
+ /**
3509
+ * Line break syntax in Markdown output.
3510
+ *
3511
+ * Controls how soft line breaks (from `<br>` or line breaks in source) are rendered.
3512
+ * @enum {0 | 1}
3513
+ */
3514
+ const WasmNewlineStyle = Object.freeze({
3515
+ Spaces: 0, "0": "Spaces",
3516
+ Backslash: 1, "1": "Backslash",
3517
+ });
3518
+ exports.WasmNewlineStyle = WasmNewlineStyle;
3519
+
3520
+ /**
3521
+ * The semantic content type of a document node.
3522
+ *
3523
+ * Uses internally tagged representation (`"node_type": "heading"`) for JSON serialization.
3524
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}
3525
+ */
3526
+ const WasmNodeContent = Object.freeze({
3527
+ Heading: 0, "0": "Heading",
3528
+ Paragraph: 1, "1": "Paragraph",
3529
+ List: 2, "2": "List",
3530
+ ListItem: 3, "3": "ListItem",
3531
+ Table: 4, "4": "Table",
3532
+ Image: 5, "5": "Image",
3533
+ Code: 6, "6": "Code",
3534
+ Quote: 7, "7": "Quote",
3535
+ DefinitionList: 8, "8": "DefinitionList",
3536
+ DefinitionItem: 9, "9": "DefinitionItem",
3537
+ RawBlock: 10, "10": "RawBlock",
3538
+ MetadataBlock: 11, "11": "MetadataBlock",
3539
+ Group: 12, "12": "Group",
3540
+ });
3541
+ exports.WasmNodeContent = WasmNodeContent;
3542
+
3543
+ /**
3544
+ * Context information passed to all visitor methods.
3545
+ *
3546
+ * Provides comprehensive metadata about the current node being visited,
3547
+ * including its type, attributes, position in the DOM tree, and parent context.
3548
+ */
3549
+ class WasmNodeContext {
3206
3550
  __destroy_into_raw() {
3207
3551
  const ptr = this.__wbg_ptr;
3208
3552
  this.__wbg_ptr = 0;
3209
- WasmMetadataConfigFinalization.unregister(this);
3553
+ WasmNodeContextFinalization.unregister(this);
3210
3554
  return ptr;
3211
3555
  }
3212
3556
  free() {
3213
3557
  const ptr = this.__destroy_into_raw();
3214
- wasm.__wbg_wasmmetadataconfig_free(ptr, 0);
3215
- }
3216
- /**
3217
- * @returns {boolean}
3218
- */
3219
- anyEnabled() {
3220
- const ret = wasm.wasmmetadataconfig_anyEnabled(this.__wbg_ptr);
3221
- return ret !== 0;
3222
- }
3223
- /**
3224
- * @param {WasmMetadataConfigUpdate} _update
3225
- */
3226
- applyUpdate(_update) {
3227
- _assertClass(_update, WasmMetadataConfigUpdate);
3228
- var ptr0 = _update.__destroy_into_raw();
3229
- wasm.wasmmetadataconfig_applyUpdate(this.__wbg_ptr, ptr0);
3230
- }
3231
- /**
3232
- * @returns {WasmMetadataConfig}
3233
- */
3234
- static default() {
3235
- const ret = wasm.wasmmetadataconfig_default();
3236
- return WasmMetadataConfig.__wrap(ret);
3237
- }
3238
- /**
3239
- * @returns {boolean}
3240
- */
3241
- get extractDocument() {
3242
- const ret = wasm.wasmmetadataconfig_extractDocument(this.__wbg_ptr);
3243
- return ret !== 0;
3558
+ wasm.__wbg_wasmnodecontext_free(ptr, 0);
3244
3559
  }
3245
3560
  /**
3246
- * @returns {boolean}
3561
+ * @returns {WasmConversionResult}
3247
3562
  */
3248
- get extractHeaders() {
3249
- const ret = wasm.wasmmetadataconfig_extractHeaders(this.__wbg_ptr);
3250
- return ret !== 0;
3563
+ get attributes() {
3564
+ const ret = wasm.wasmnodecontext_attributes(this.__wbg_ptr);
3565
+ return takeObject(ret);
3251
3566
  }
3252
3567
  /**
3253
- * @returns {boolean}
3568
+ * @returns {number}
3254
3569
  */
3255
- get extractImages() {
3256
- const ret = wasm.wasmmetadataconfig_extractImages(this.__wbg_ptr);
3257
- return ret !== 0;
3570
+ get depth() {
3571
+ const ret = wasm.wasmnodecontext_depth(this.__wbg_ptr);
3572
+ return ret >>> 0;
3258
3573
  }
3259
3574
  /**
3260
- * @returns {boolean}
3575
+ * @returns {number}
3261
3576
  */
3262
- get extractLinks() {
3263
- const ret = wasm.wasmmetadataconfig_extractLinks(this.__wbg_ptr);
3264
- return ret !== 0;
3577
+ get indexInParent() {
3578
+ const ret = wasm.wasmnodecontext_indexInParent(this.__wbg_ptr);
3579
+ return ret >>> 0;
3265
3580
  }
3266
3581
  /**
3267
3582
  * @returns {boolean}
3268
3583
  */
3269
- get extractStructuredData() {
3270
- const ret = wasm.wasmmetadataconfig_extractStructuredData(this.__wbg_ptr);
3584
+ get isInline() {
3585
+ const ret = wasm.wasmnodecontext_isInline(this.__wbg_ptr);
3271
3586
  return ret !== 0;
3272
3587
  }
3273
3588
  /**
3274
- * @param {WasmMetadataConfigUpdate} update
3275
- * @returns {WasmMetadataConfig}
3276
- */
3277
- static from(update) {
3278
- _assertClass(update, WasmMetadataConfigUpdate);
3279
- var ptr0 = update.__destroy_into_raw();
3280
- const ret = wasm.wasmmetadataconfig_from(ptr0);
3281
- return WasmMetadataConfig.__wrap(ret);
3282
- }
3283
- /**
3284
- * @param {WasmMetadataConfigUpdate} update
3285
- * @returns {WasmMetadataConfig}
3286
- */
3287
- static fromUpdate(update) {
3288
- _assertClass(update, WasmMetadataConfigUpdate);
3289
- var ptr0 = update.__destroy_into_raw();
3290
- const ret = wasm.wasmmetadataconfig_fromUpdate(ptr0);
3291
- return WasmMetadataConfig.__wrap(ret);
3292
- }
3293
- /**
3294
- * @returns {number}
3295
- */
3296
- get maxStructuredDataSize() {
3297
- const ret = wasm.wasmmetadataconfig_maxStructuredDataSize(this.__wbg_ptr);
3298
- return ret >>> 0;
3299
- }
3300
- /**
3301
- * @param {boolean | null} [extract_document]
3302
- * @param {boolean | null} [extract_headers]
3303
- * @param {boolean | null} [extract_links]
3304
- * @param {boolean | null} [extract_images]
3305
- * @param {boolean | null} [extract_structured_data]
3306
- * @param {number | null} [max_structured_data_size]
3589
+ * @param {WasmNodeType} node_type
3590
+ * @param {string} tag_name
3591
+ * @param {any} attributes
3592
+ * @param {number} depth
3593
+ * @param {number} index_in_parent
3594
+ * @param {boolean} is_inline
3595
+ * @param {string | null} [parent_tag]
3307
3596
  */
3308
- constructor(extract_document, extract_headers, extract_links, extract_images, extract_structured_data, max_structured_data_size) {
3309
- const ret = wasm.wasmmetadataconfig_new(isLikeNone(extract_document) ? 0xFFFFFF : extract_document ? 1 : 0, isLikeNone(extract_headers) ? 0xFFFFFF : extract_headers ? 1 : 0, isLikeNone(extract_links) ? 0xFFFFFF : extract_links ? 1 : 0, isLikeNone(extract_images) ? 0xFFFFFF : extract_images ? 1 : 0, isLikeNone(extract_structured_data) ? 0xFFFFFF : extract_structured_data ? 1 : 0, isLikeNone(max_structured_data_size) ? 0x100000001 : (max_structured_data_size) >>> 0);
3597
+ constructor(node_type, tag_name, attributes, depth, index_in_parent, is_inline, parent_tag) {
3598
+ const ptr0 = passStringToWasm0(tag_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3599
+ const len0 = WASM_VECTOR_LEN;
3600
+ var ptr1 = isLikeNone(parent_tag) ? 0 : passStringToWasm0(parent_tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3601
+ var len1 = WASM_VECTOR_LEN;
3602
+ const ret = wasm.wasmnodecontext_new(node_type, ptr0, len0, addHeapObject(attributes), depth, index_in_parent, is_inline, ptr1, len1);
3310
3603
  this.__wbg_ptr = ret >>> 0;
3311
- WasmMetadataConfigFinalization.register(this, this.__wbg_ptr, this);
3604
+ WasmNodeContextFinalization.register(this, this.__wbg_ptr, this);
3312
3605
  return this;
3313
3606
  }
3314
3607
  /**
3315
- * @param {boolean} value
3316
- */
3317
- set extractDocument(value) {
3318
- wasm.wasmmetadataconfig_set_extractDocument(this.__wbg_ptr, value);
3319
- }
3320
- /**
3321
- * @param {boolean} value
3608
+ * @returns {WasmNodeType}
3322
3609
  */
3323
- set extractHeaders(value) {
3324
- wasm.wasmmetadataconfig_set_extractHeaders(this.__wbg_ptr, value);
3325
- }
3326
- /**
3327
- * @param {boolean} value
3328
- */
3329
- set extractImages(value) {
3330
- wasm.wasmmetadataconfig_set_extractImages(this.__wbg_ptr, value);
3610
+ get nodeType() {
3611
+ const ret = wasm.wasmnodecontext_nodeType(this.__wbg_ptr);
3612
+ return ret;
3331
3613
  }
3332
3614
  /**
3333
- * @param {boolean} value
3615
+ * @returns {string | undefined}
3334
3616
  */
3335
- set extractLinks(value) {
3336
- wasm.wasmmetadataconfig_set_extractLinks(this.__wbg_ptr, value);
3617
+ get parentTag() {
3618
+ try {
3619
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3620
+ wasm.wasmnodecontext_parentTag(retptr, this.__wbg_ptr);
3621
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3622
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3623
+ let v1;
3624
+ if (r0 !== 0) {
3625
+ v1 = getStringFromWasm0(r0, r1).slice();
3626
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
3627
+ }
3628
+ return v1;
3629
+ } finally {
3630
+ wasm.__wbindgen_add_to_stack_pointer(16);
3631
+ }
3337
3632
  }
3338
3633
  /**
3339
- * @param {boolean} value
3634
+ * @param {any} value
3340
3635
  */
3341
- set extractStructuredData(value) {
3342
- wasm.wasmmetadataconfig_set_extractStructuredData(this.__wbg_ptr, value);
3636
+ set attributes(value) {
3637
+ wasm.wasmnodecontext_set_attributes(this.__wbg_ptr, addHeapObject(value));
3343
3638
  }
3344
3639
  /**
3345
3640
  * @param {number} value
3346
3641
  */
3347
- set maxStructuredDataSize(value) {
3348
- wasm.wasmmetadataconfig_set_maxStructuredDataSize(this.__wbg_ptr, value);
3349
- }
3350
- }
3351
- if (Symbol.dispose) WasmMetadataConfig.prototype[Symbol.dispose] = WasmMetadataConfig.prototype.free;
3352
- exports.WasmMetadataConfig = WasmMetadataConfig;
3353
-
3354
- class WasmMetadataConfigUpdate {
3355
- __destroy_into_raw() {
3356
- const ptr = this.__wbg_ptr;
3357
- this.__wbg_ptr = 0;
3358
- WasmMetadataConfigUpdateFinalization.unregister(this);
3359
- return ptr;
3360
- }
3361
- free() {
3362
- const ptr = this.__destroy_into_raw();
3363
- wasm.__wbg_wasmmetadataconfigupdate_free(ptr, 0);
3364
- }
3365
- /**
3366
- * @returns {boolean | undefined}
3367
- */
3368
- get extractDocument() {
3369
- const ret = wasm.wasmmetadataconfigupdate_extractDocument(this.__wbg_ptr);
3370
- return ret === 0xFFFFFF ? undefined : ret !== 0;
3371
- }
3372
- /**
3373
- * @returns {boolean | undefined}
3374
- */
3375
- get extractHeaders() {
3376
- const ret = wasm.wasmmetadataconfigupdate_extractHeaders(this.__wbg_ptr);
3377
- return ret === 0xFFFFFF ? undefined : ret !== 0;
3378
- }
3379
- /**
3380
- * @returns {boolean | undefined}
3381
- */
3382
- get extractImages() {
3383
- const ret = wasm.wasmmetadataconfigupdate_extractImages(this.__wbg_ptr);
3384
- return ret === 0xFFFFFF ? undefined : ret !== 0;
3385
- }
3386
- /**
3387
- * @returns {boolean | undefined}
3388
- */
3389
- get extractLinks() {
3390
- const ret = wasm.wasmmetadataconfigupdate_extractLinks(this.__wbg_ptr);
3391
- return ret === 0xFFFFFF ? undefined : ret !== 0;
3392
- }
3393
- /**
3394
- * @returns {boolean | undefined}
3395
- */
3396
- get extractStructuredData() {
3397
- const ret = wasm.wasmmetadataconfigupdate_extractStructuredData(this.__wbg_ptr);
3398
- return ret === 0xFFFFFF ? undefined : ret !== 0;
3399
- }
3400
- /**
3401
- * @returns {number | undefined}
3402
- */
3403
- get maxStructuredDataSize() {
3404
- const ret = wasm.wasmmetadataconfigupdate_maxStructuredDataSize(this.__wbg_ptr);
3405
- return ret === 0x100000001 ? undefined : ret;
3406
- }
3407
- /**
3408
- * @param {boolean | null} [extract_document]
3409
- * @param {boolean | null} [extract_headers]
3410
- * @param {boolean | null} [extract_links]
3411
- * @param {boolean | null} [extract_images]
3412
- * @param {boolean | null} [extract_structured_data]
3413
- * @param {number | null} [max_structured_data_size]
3414
- */
3415
- constructor(extract_document, extract_headers, extract_links, extract_images, extract_structured_data, max_structured_data_size) {
3416
- const ret = wasm.wasmmetadataconfigupdate_new(isLikeNone(extract_document) ? 0xFFFFFF : extract_document ? 1 : 0, isLikeNone(extract_headers) ? 0xFFFFFF : extract_headers ? 1 : 0, isLikeNone(extract_links) ? 0xFFFFFF : extract_links ? 1 : 0, isLikeNone(extract_images) ? 0xFFFFFF : extract_images ? 1 : 0, isLikeNone(extract_structured_data) ? 0xFFFFFF : extract_structured_data ? 1 : 0, isLikeNone(max_structured_data_size) ? 0x100000001 : (max_structured_data_size) >>> 0);
3417
- this.__wbg_ptr = ret >>> 0;
3418
- WasmMetadataConfigUpdateFinalization.register(this, this.__wbg_ptr, this);
3419
- return this;
3642
+ set depth(value) {
3643
+ wasm.wasmnodecontext_set_depth(this.__wbg_ptr, value);
3420
3644
  }
3421
3645
  /**
3422
- * @param {boolean | null} [value]
3646
+ * @param {number} value
3423
3647
  */
3424
- set extractDocument(value) {
3425
- wasm.wasmmetadataconfigupdate_set_extractDocument(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
3648
+ set indexInParent(value) {
3649
+ wasm.wasmnodecontext_set_indexInParent(this.__wbg_ptr, value);
3426
3650
  }
3427
3651
  /**
3428
- * @param {boolean | null} [value]
3652
+ * @param {boolean} value
3429
3653
  */
3430
- set extractHeaders(value) {
3431
- wasm.wasmmetadataconfigupdate_set_extractHeaders(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
3654
+ set isInline(value) {
3655
+ wasm.wasmnodecontext_set_isInline(this.__wbg_ptr, value);
3432
3656
  }
3433
3657
  /**
3434
- * @param {boolean | null} [value]
3658
+ * @param {WasmNodeType} value
3435
3659
  */
3436
- set extractImages(value) {
3437
- wasm.wasmmetadataconfigupdate_set_extractImages(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
3660
+ set nodeType(value) {
3661
+ wasm.wasmnodecontext_set_nodeType(this.__wbg_ptr, value);
3438
3662
  }
3439
3663
  /**
3440
- * @param {boolean | null} [value]
3664
+ * @param {string | null} [value]
3441
3665
  */
3442
- set extractLinks(value) {
3443
- wasm.wasmmetadataconfigupdate_set_extractLinks(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
3666
+ set parentTag(value) {
3667
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3668
+ var len0 = WASM_VECTOR_LEN;
3669
+ wasm.wasmnodecontext_set_parentTag(this.__wbg_ptr, ptr0, len0);
3444
3670
  }
3445
3671
  /**
3446
- * @param {boolean | null} [value]
3672
+ * @param {string} value
3447
3673
  */
3448
- set extractStructuredData(value) {
3449
- wasm.wasmmetadataconfigupdate_set_extractStructuredData(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
3674
+ set tagName(value) {
3675
+ const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3676
+ const len0 = WASM_VECTOR_LEN;
3677
+ wasm.wasmnodecontext_set_tagName(this.__wbg_ptr, ptr0, len0);
3450
3678
  }
3451
3679
  /**
3452
- * @param {number | null} [value]
3680
+ * @returns {string}
3453
3681
  */
3454
- set maxStructuredDataSize(value) {
3455
- wasm.wasmmetadataconfigupdate_set_maxStructuredDataSize(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
3682
+ get tagName() {
3683
+ let deferred1_0;
3684
+ let deferred1_1;
3685
+ try {
3686
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3687
+ wasm.wasmnodecontext_tagName(retptr, this.__wbg_ptr);
3688
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3689
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3690
+ deferred1_0 = r0;
3691
+ deferred1_1 = r1;
3692
+ return getStringFromWasm0(r0, r1);
3693
+ } finally {
3694
+ wasm.__wbindgen_add_to_stack_pointer(16);
3695
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
3696
+ }
3456
3697
  }
3457
3698
  }
3458
- if (Symbol.dispose) WasmMetadataConfigUpdate.prototype[Symbol.dispose] = WasmMetadataConfigUpdate.prototype.free;
3459
- exports.WasmMetadataConfigUpdate = WasmMetadataConfigUpdate;
3460
-
3461
- /**
3462
- * @enum {0 | 1}
3463
- */
3464
- const WasmNewlineStyle = Object.freeze({
3465
- Spaces: 0, "0": "Spaces",
3466
- Backslash: 1, "1": "Backslash",
3467
- });
3468
- exports.WasmNewlineStyle = WasmNewlineStyle;
3699
+ if (Symbol.dispose) WasmNodeContext.prototype[Symbol.dispose] = WasmNodeContext.prototype.free;
3700
+ exports.WasmNodeContext = WasmNodeContext;
3469
3701
 
3470
3702
  /**
3471
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}
3703
+ * Node type enumeration covering all HTML element types.
3704
+ *
3705
+ * This enum categorizes all HTML elements that the converter recognizes,
3706
+ * providing a coarse-grained classification for visitor dispatch.
3707
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87}
3472
3708
  */
3473
- const WasmNodeContent = Object.freeze({
3474
- Heading: 0, "0": "Heading",
3475
- Paragraph: 1, "1": "Paragraph",
3476
- List: 2, "2": "List",
3477
- ListItem: 3, "3": "ListItem",
3478
- Table: 4, "4": "Table",
3479
- Image: 5, "5": "Image",
3480
- Code: 6, "6": "Code",
3481
- Quote: 7, "7": "Quote",
3482
- DefinitionList: 8, "8": "DefinitionList",
3483
- DefinitionItem: 9, "9": "DefinitionItem",
3484
- RawBlock: 10, "10": "RawBlock",
3485
- MetadataBlock: 11, "11": "MetadataBlock",
3486
- Group: 12, "12": "Group",
3709
+ const WasmNodeType = Object.freeze({
3710
+ Text: 0, "0": "Text",
3711
+ Element: 1, "1": "Element",
3712
+ Heading: 2, "2": "Heading",
3713
+ Paragraph: 3, "3": "Paragraph",
3714
+ Div: 4, "4": "Div",
3715
+ Blockquote: 5, "5": "Blockquote",
3716
+ Pre: 6, "6": "Pre",
3717
+ Hr: 7, "7": "Hr",
3718
+ List: 8, "8": "List",
3719
+ ListItem: 9, "9": "ListItem",
3720
+ DefinitionList: 10, "10": "DefinitionList",
3721
+ DefinitionTerm: 11, "11": "DefinitionTerm",
3722
+ DefinitionDescription: 12, "12": "DefinitionDescription",
3723
+ Table: 13, "13": "Table",
3724
+ TableRow: 14, "14": "TableRow",
3725
+ TableCell: 15, "15": "TableCell",
3726
+ TableHeader: 16, "16": "TableHeader",
3727
+ TableBody: 17, "17": "TableBody",
3728
+ TableHead: 18, "18": "TableHead",
3729
+ TableFoot: 19, "19": "TableFoot",
3730
+ Link: 20, "20": "Link",
3731
+ Image: 21, "21": "Image",
3732
+ Strong: 22, "22": "Strong",
3733
+ Em: 23, "23": "Em",
3734
+ Code: 24, "24": "Code",
3735
+ Strikethrough: 25, "25": "Strikethrough",
3736
+ Underline: 26, "26": "Underline",
3737
+ Subscript: 27, "27": "Subscript",
3738
+ Superscript: 28, "28": "Superscript",
3739
+ Mark: 29, "29": "Mark",
3740
+ Small: 30, "30": "Small",
3741
+ Br: 31, "31": "Br",
3742
+ Span: 32, "32": "Span",
3743
+ Article: 33, "33": "Article",
3744
+ Section: 34, "34": "Section",
3745
+ Nav: 35, "35": "Nav",
3746
+ Aside: 36, "36": "Aside",
3747
+ Header: 37, "37": "Header",
3748
+ Footer: 38, "38": "Footer",
3749
+ Main: 39, "39": "Main",
3750
+ Figure: 40, "40": "Figure",
3751
+ Figcaption: 41, "41": "Figcaption",
3752
+ Time: 42, "42": "Time",
3753
+ Details: 43, "43": "Details",
3754
+ Summary: 44, "44": "Summary",
3755
+ Form: 45, "45": "Form",
3756
+ Input: 46, "46": "Input",
3757
+ Select: 47, "47": "Select",
3758
+ Option: 48, "48": "Option",
3759
+ Button: 49, "49": "Button",
3760
+ Textarea: 50, "50": "Textarea",
3761
+ Label: 51, "51": "Label",
3762
+ Fieldset: 52, "52": "Fieldset",
3763
+ Legend: 53, "53": "Legend",
3764
+ Audio: 54, "54": "Audio",
3765
+ Video: 55, "55": "Video",
3766
+ Picture: 56, "56": "Picture",
3767
+ Source: 57, "57": "Source",
3768
+ Iframe: 58, "58": "Iframe",
3769
+ Svg: 59, "59": "Svg",
3770
+ Canvas: 60, "60": "Canvas",
3771
+ Ruby: 61, "61": "Ruby",
3772
+ Rt: 62, "62": "Rt",
3773
+ Rp: 63, "63": "Rp",
3774
+ Abbr: 64, "64": "Abbr",
3775
+ Kbd: 65, "65": "Kbd",
3776
+ Samp: 66, "66": "Samp",
3777
+ Var: 67, "67": "Var",
3778
+ Cite: 68, "68": "Cite",
3779
+ Q: 69, "69": "Q",
3780
+ Del: 70, "70": "Del",
3781
+ Ins: 71, "71": "Ins",
3782
+ Data: 72, "72": "Data",
3783
+ Meter: 73, "73": "Meter",
3784
+ Progress: 74, "74": "Progress",
3785
+ Output: 75, "75": "Output",
3786
+ Template: 76, "76": "Template",
3787
+ Slot: 77, "77": "Slot",
3788
+ Html: 78, "78": "Html",
3789
+ Head: 79, "79": "Head",
3790
+ Body: 80, "80": "Body",
3791
+ Title: 81, "81": "Title",
3792
+ Meta: 82, "82": "Meta",
3793
+ LinkTag: 83, "83": "LinkTag",
3794
+ Style: 84, "84": "Style",
3795
+ Script: 85, "85": "Script",
3796
+ Base: 86, "86": "Base",
3797
+ Custom: 87, "87": "Custom",
3487
3798
  });
3488
- exports.WasmNodeContent = WasmNodeContent;
3799
+ exports.WasmNodeType = WasmNodeType;
3489
3800
 
3490
3801
  /**
3802
+ * Output format for conversion.
3803
+ *
3804
+ * Specifies the target markup language format for the conversion output.
3491
3805
  * @enum {0 | 1 | 2}
3492
3806
  */
3493
3807
  const WasmOutputFormat = Object.freeze({
@@ -3497,6 +3811,9 @@ const WasmOutputFormat = Object.freeze({
3497
3811
  });
3498
3812
  exports.WasmOutputFormat = WasmOutputFormat;
3499
3813
 
3814
+ /**
3815
+ * HTML preprocessing options for document cleanup before conversion.
3816
+ */
3500
3817
  class WasmPreprocessingOptions {
3501
3818
  static __wrap(ptr) {
3502
3819
  ptr = ptr >>> 0;
@@ -3516,6 +3833,14 @@ class WasmPreprocessingOptions {
3516
3833
  wasm.__wbg_wasmpreprocessingoptions_free(ptr, 0);
3517
3834
  }
3518
3835
  /**
3836
+ * Apply a partial update to these preprocessing options.
3837
+ *
3838
+ * Any specified fields in the update will override the current values.
3839
+ * Unspecified fields (None) are left unchanged.
3840
+ *
3841
+ * # Arguments
3842
+ *
3843
+ * * `update` - Partial preprocessing options update
3519
3844
  * @param {WasmPreprocessingOptionsUpdate} _update
3520
3845
  */
3521
3846
  applyUpdate(_update) {
@@ -3548,6 +3873,18 @@ class WasmPreprocessingOptions {
3548
3873
  return WasmPreprocessingOptions.__wrap(ret);
3549
3874
  }
3550
3875
  /**
3876
+ * Create new preprocessing options from a partial update.
3877
+ *
3878
+ * Creates a new `PreprocessingOptions` struct with defaults, then applies the update.
3879
+ * Fields not specified in the update keep their default values.
3880
+ *
3881
+ * # Arguments
3882
+ *
3883
+ * * `update` - Partial preprocessing options update
3884
+ *
3885
+ * # Returns
3886
+ *
3887
+ * New `PreprocessingOptions` with specified updates applied to defaults
3551
3888
  * @param {WasmPreprocessingOptionsUpdate} update
3552
3889
  * @returns {WasmPreprocessingOptions}
3553
3890
  */
@@ -3618,6 +3955,13 @@ class WasmPreprocessingOptions {
3618
3955
  if (Symbol.dispose) WasmPreprocessingOptions.prototype[Symbol.dispose] = WasmPreprocessingOptions.prototype.free;
3619
3956
  exports.WasmPreprocessingOptions = WasmPreprocessingOptions;
3620
3957
 
3958
+ /**
3959
+ * Partial update for `PreprocessingOptions`.
3960
+ *
3961
+ * This struct uses `Option<T>` to represent optional fields that can be selectively updated.
3962
+ * Only specified fields (Some values) will override existing options; None values leave the
3963
+ * corresponding fields unchanged when applied via [`PreprocessingOptions::apply_update`].
3964
+ */
3621
3965
  class WasmPreprocessingOptionsUpdate {
3622
3966
  static __wrap(ptr) {
3623
3967
  ptr = ptr >>> 0;
@@ -3705,6 +4049,9 @@ if (Symbol.dispose) WasmPreprocessingOptionsUpdate.prototype[Symbol.dispose] = W
3705
4049
  exports.WasmPreprocessingOptionsUpdate = WasmPreprocessingOptionsUpdate;
3706
4050
 
3707
4051
  /**
4052
+ * HTML preprocessing aggressiveness level.
4053
+ *
4054
+ * Controls the extent of cleanup performed before conversion. Higher levels remove more elements.
3708
4055
  * @enum {0 | 1 | 2}
3709
4056
  */
3710
4057
  const WasmPreprocessingPreset = Object.freeze({
@@ -3714,6 +4061,9 @@ const WasmPreprocessingPreset = Object.freeze({
3714
4061
  });
3715
4062
  exports.WasmPreprocessingPreset = WasmPreprocessingPreset;
3716
4063
 
4064
+ /**
4065
+ * A non-fatal warning generated during HTML processing.
4066
+ */
3717
4067
  class WasmProcessingWarning {
3718
4068
  static __wrap(ptr) {
3719
4069
  ptr = ptr >>> 0;
@@ -3761,7 +4111,7 @@ class WasmProcessingWarning {
3761
4111
  return getStringFromWasm0(r0, r1);
3762
4112
  } finally {
3763
4113
  wasm.__wbindgen_add_to_stack_pointer(16);
3764
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
4114
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
3765
4115
  }
3766
4116
  }
3767
4117
  /**
@@ -3794,6 +4144,25 @@ class WasmProcessingWarning {
3794
4144
  if (Symbol.dispose) WasmProcessingWarning.prototype[Symbol.dispose] = WasmProcessingWarning.prototype.free;
3795
4145
  exports.WasmProcessingWarning = WasmProcessingWarning;
3796
4146
 
4147
+ /**
4148
+ * Structured data block (JSON-LD, Microdata, or RDFa).
4149
+ *
4150
+ * Represents machine-readable structured data found in the document.
4151
+ * JSON-LD blocks are collected as raw JSON strings for flexibility.
4152
+ *
4153
+ * # Examples
4154
+ *
4155
+ * ```
4156
+ * # use html_to_markdown_rs::metadata::{StructuredData, StructuredDataType};
4157
+ * let schema = StructuredData {
4158
+ * data_type: StructuredDataType::JsonLd,
4159
+ * raw_json: r#"{"@context":"https://schema.org","@type":"Article"}"#.to_string(),
4160
+ * schema_type: Some("Article".to_string()),
4161
+ * };
4162
+ *
4163
+ * assert_eq!(schema.data_type, StructuredDataType::JsonLd);
4164
+ * ```
4165
+ */
3797
4166
  class WasmStructuredData {
3798
4167
  static __wrap(ptr) {
3799
4168
  ptr = ptr >>> 0;
@@ -3856,7 +4225,7 @@ class WasmStructuredData {
3856
4225
  return getStringFromWasm0(r0, r1);
3857
4226
  } finally {
3858
4227
  wasm.__wbindgen_add_to_stack_pointer(16);
3859
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
4228
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
3860
4229
  }
3861
4230
  }
3862
4231
  /**
@@ -3871,7 +4240,7 @@ class WasmStructuredData {
3871
4240
  let v1;
3872
4241
  if (r0 !== 0) {
3873
4242
  v1 = getStringFromWasm0(r0, r1).slice();
3874
- wasm.__wbindgen_export3(r0, r1 * 1, 1);
4243
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
3875
4244
  }
3876
4245
  return v1;
3877
4246
  } finally {
@@ -3905,6 +4274,9 @@ if (Symbol.dispose) WasmStructuredData.prototype[Symbol.dispose] = WasmStructure
3905
4274
  exports.WasmStructuredData = WasmStructuredData;
3906
4275
 
3907
4276
  /**
4277
+ * Structured data format type.
4278
+ *
4279
+ * Identifies the schema/format used for structured data markup.
3908
4280
  * @enum {0 | 1 | 2}
3909
4281
  */
3910
4282
  const WasmStructuredDataType = Object.freeze({
@@ -3914,6 +4286,9 @@ const WasmStructuredDataType = Object.freeze({
3914
4286
  });
3915
4287
  exports.WasmStructuredDataType = WasmStructuredDataType;
3916
4288
 
4289
+ /**
4290
+ * A top-level extracted table with both structured data and markdown representation.
4291
+ */
3917
4292
  class WasmTableData {
3918
4293
  static __wrap(ptr) {
3919
4294
  ptr = ptr >>> 0;
@@ -3961,7 +4336,7 @@ class WasmTableData {
3961
4336
  return getStringFromWasm0(r0, r1);
3962
4337
  } finally {
3963
4338
  wasm.__wbindgen_add_to_stack_pointer(16);
3964
- wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
4339
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
3965
4340
  }
3966
4341
  }
3967
4342
  /**
@@ -3998,6 +4373,9 @@ class WasmTableData {
3998
4373
  if (Symbol.dispose) WasmTableData.prototype[Symbol.dispose] = WasmTableData.prototype.free;
3999
4374
  exports.WasmTableData = WasmTableData;
4000
4375
 
4376
+ /**
4377
+ * A structured table grid with cell-level data including spans.
4378
+ */
4001
4379
  class WasmTableGrid {
4002
4380
  static __wrap(ptr) {
4003
4381
  ptr = ptr >>> 0;
@@ -4026,7 +4404,7 @@ class WasmTableGrid {
4026
4404
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4027
4405
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4028
4406
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
4029
- wasm.__wbindgen_export3(r0, r1 * 4, 4);
4407
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
4030
4408
  return v1;
4031
4409
  } finally {
4032
4410
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -4083,6 +4461,11 @@ class WasmTableGrid {
4083
4461
  if (Symbol.dispose) WasmTableGrid.prototype[Symbol.dispose] = WasmTableGrid.prototype.free;
4084
4462
  exports.WasmTableGrid = WasmTableGrid;
4085
4463
 
4464
+ /**
4465
+ * An inline text annotation with byte-range offsets.
4466
+ *
4467
+ * Annotations describe formatting (bold, italic, etc.) and links within a node's text content.
4468
+ */
4086
4469
  class WasmTextAnnotation {
4087
4470
  static __wrap(ptr) {
4088
4471
  ptr = ptr >>> 0;
@@ -4162,6 +4545,9 @@ if (Symbol.dispose) WasmTextAnnotation.prototype[Symbol.dispose] = WasmTextAnnot
4162
4545
  exports.WasmTextAnnotation = WasmTextAnnotation;
4163
4546
 
4164
4547
  /**
4548
+ * Text directionality of document content.
4549
+ *
4550
+ * Corresponds to the HTML `dir` attribute and `bdi` element directionality.
4165
4551
  * @enum {0 | 1 | 2}
4166
4552
  */
4167
4553
  const WasmTextDirection = Object.freeze({
@@ -4172,6 +4558,24 @@ const WasmTextDirection = Object.freeze({
4172
4558
  exports.WasmTextDirection = WasmTextDirection;
4173
4559
 
4174
4560
  /**
4561
+ * Result of a visitor callback.
4562
+ *
4563
+ * Allows visitors to control the conversion flow by either proceeding
4564
+ * with default behavior, providing custom output, skipping elements,
4565
+ * preserving HTML, or signaling errors.
4566
+ * @enum {0 | 1 | 2 | 3 | 4}
4567
+ */
4568
+ const WasmVisitResult = Object.freeze({
4569
+ Continue: 0, "0": "Continue",
4570
+ Custom: 1, "1": "Custom",
4571
+ Skip: 2, "2": "Skip",
4572
+ PreserveHtml: 3, "3": "PreserveHtml",
4573
+ Error: 4, "4": "Error",
4574
+ });
4575
+ exports.WasmVisitResult = WasmVisitResult;
4576
+
4577
+ /**
4578
+ * Categories of processing warnings.
4175
4579
  * @enum {0 | 1 | 2 | 3 | 4 | 5}
4176
4580
  */
4177
4581
  const WasmWarningKind = Object.freeze({
@@ -4185,6 +4589,9 @@ const WasmWarningKind = Object.freeze({
4185
4589
  exports.WasmWarningKind = WasmWarningKind;
4186
4590
 
4187
4591
  /**
4592
+ * Whitespace handling strategy during conversion.
4593
+ *
4594
+ * Determines how sequences of whitespace characters (spaces, tabs, newlines) are processed.
4188
4595
  * @enum {0 | 1}
4189
4596
  */
4190
4597
  const WasmWhitespaceMode = Object.freeze({
@@ -4196,9 +4603,10 @@ exports.WasmWhitespaceMode = WasmWhitespaceMode;
4196
4603
  /**
4197
4604
  * @param {string} html
4198
4605
  * @param {WasmConversionOptions | null} [options]
4606
+ * @param {any | null} [visitor]
4199
4607
  * @returns {WasmConversionResult}
4200
4608
  */
4201
- function convert(html, options) {
4609
+ function convert(html, options, visitor) {
4202
4610
  try {
4203
4611
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4204
4612
  const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -4208,7 +4616,7 @@ function convert(html, options) {
4208
4616
  _assertClass(options, WasmConversionOptions);
4209
4617
  ptr1 = options.__destroy_into_raw();
4210
4618
  }
4211
- wasm.convert(retptr, ptr0, len0, ptr1);
4619
+ wasm.convert(retptr, ptr0, len0, ptr1, isLikeNone(visitor) ? 0 : addHeapObject(visitor));
4212
4620
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4213
4621
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4214
4622
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4228,6 +4636,10 @@ function __wbg_get_imports() {
4228
4636
  const ret = Error(getStringFromWasm0(arg0, arg1));
4229
4637
  return addHeapObject(ret);
4230
4638
  },
4639
+ __wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
4640
+ const ret = typeof(getObject(arg0)) === 'function';
4641
+ return ret;
4642
+ },
4231
4643
  __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
4232
4644
  const ret = typeof(getObject(arg0)) === 'string';
4233
4645
  return ret;
@@ -4247,14 +4659,38 @@ function __wbg_get_imports() {
4247
4659
  __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
4248
4660
  throw new Error(getStringFromWasm0(arg0, arg1));
4249
4661
  },
4662
+ __wbg_apply_4c35bd236dda9c14: function() { return handleError(function (arg0, arg1, arg2) {
4663
+ const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
4664
+ return addHeapObject(ret);
4665
+ }, arguments); },
4666
+ __wbg_get_6011fa3a58f61074: function() { return handleError(function (arg0, arg1) {
4667
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
4668
+ return addHeapObject(ret);
4669
+ }, arguments); },
4670
+ __wbg_has_880f1d472f7cecba: function() { return handleError(function (arg0, arg1) {
4671
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
4672
+ return ret;
4673
+ }, arguments); },
4250
4674
  __wbg_new_34d45cc8e36aaead: function() {
4251
4675
  const ret = new Map();
4252
4676
  return addHeapObject(ret);
4253
4677
  },
4678
+ __wbg_new_682678e2f47e32bc: function() {
4679
+ const ret = new Array();
4680
+ return addHeapObject(ret);
4681
+ },
4254
4682
  __wbg_new_aa8d0fa9762c29bd: function() {
4255
4683
  const ret = new Object();
4256
4684
  return addHeapObject(ret);
4257
4685
  },
4686
+ __wbg_push_471a5b068a5295f6: function(arg0, arg1) {
4687
+ const ret = getObject(arg0).push(getObject(arg1));
4688
+ return ret;
4689
+ },
4690
+ __wbg_set_022bee52d0b05b19: function() { return handleError(function (arg0, arg1, arg2) {
4691
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
4692
+ return ret;
4693
+ }, arguments); },
4258
4694
  __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
4259
4695
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4260
4696
  },
@@ -4334,7 +4770,12 @@ function __wbg_get_imports() {
4334
4770
  const ret = WasmTextAnnotation.__unwrap(getObject(arg0));
4335
4771
  return ret;
4336
4772
  },
4337
- __wbindgen_cast_0000000000000001: function(arg0, arg1) {
4773
+ __wbindgen_cast_0000000000000001: function(arg0) {
4774
+ // Cast intrinsic for `F64 -> Externref`.
4775
+ const ret = arg0;
4776
+ return addHeapObject(ret);
4777
+ },
4778
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
4338
4779
  // Cast intrinsic for `Ref(String) -> Externref`.
4339
4780
  const ret = getStringFromWasm0(arg0, arg1);
4340
4781
  return addHeapObject(ret);
@@ -4389,12 +4830,9 @@ const WasmImageMetadataFinalization = (typeof FinalizationRegistry === 'undefine
4389
4830
  const WasmLinkMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
4390
4831
  ? { register: () => {}, unregister: () => {} }
4391
4832
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmlinkmetadata_free(ptr >>> 0, 1));
4392
- const WasmMetadataConfigFinalization = (typeof FinalizationRegistry === 'undefined')
4833
+ const WasmNodeContextFinalization = (typeof FinalizationRegistry === 'undefined')
4393
4834
  ? { register: () => {}, unregister: () => {} }
4394
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmmetadataconfig_free(ptr >>> 0, 1));
4395
- const WasmMetadataConfigUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
4396
- ? { register: () => {}, unregister: () => {} }
4397
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmmetadataconfigupdate_free(ptr >>> 0, 1));
4835
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmnodecontext_free(ptr >>> 0, 1));
4398
4836
  const WasmPreprocessingOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
4399
4837
  ? { register: () => {}, unregister: () => {} }
4400
4838
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmpreprocessingoptions_free(ptr >>> 0, 1));
@@ -4484,6 +4922,14 @@ function getUint8ArrayMemory0() {
4484
4922
 
4485
4923
  function getObject(idx) { return heap[idx]; }
4486
4924
 
4925
+ function handleError(f, args) {
4926
+ try {
4927
+ return f.apply(this, args);
4928
+ } catch (e) {
4929
+ wasm.__wbindgen_export3(addHeapObject(e));
4930
+ }
4931
+ }
4932
+
4487
4933
  let heap = new Array(1024).fill(undefined);
4488
4934
  heap.push(undefined, null, true, false);
4489
4935