@kreuzberg/html-to-markdown-wasm 3.2.6 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/html_to_markdown_wasm.d.ts +528 -41
- package/dist/html_to_markdown_wasm_bg.js +741 -296
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/html_to_markdown_wasm_bg.wasm.d.ts +29 -40
- package/dist/package.json +1 -1
- package/dist-node/html_to_markdown_wasm.d.ts +528 -41
- package/dist-node/html_to_markdown_wasm.js +746 -300
- package/dist-node/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-node/html_to_markdown_wasm_bg.wasm.d.ts +29 -40
- package/dist-node/package.json +1 -1
- package/dist-web/html_to_markdown_wasm.d.ts +557 -81
- package/dist-web/html_to_markdown_wasm.js +741 -296
- package/dist-web/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-web/html_to_markdown_wasm_bg.wasm.d.ts +29 -40
- package/dist-web/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* The type of an inline text annotation.
|
|
3
|
+
*
|
|
4
|
+
* Uses internally tagged representation (`"annotation_type": "bold"`) for JSON serialization.
|
|
2
5
|
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}
|
|
3
6
|
*/
|
|
4
7
|
export const WasmAnnotationKind = Object.freeze({
|
|
@@ -14,6 +17,9 @@ export const WasmAnnotationKind = Object.freeze({
|
|
|
14
17
|
});
|
|
15
18
|
|
|
16
19
|
/**
|
|
20
|
+
* Code block fence style in Markdown output.
|
|
21
|
+
*
|
|
22
|
+
* Determines how code blocks (`<pre><code>`) are rendered in Markdown.
|
|
17
23
|
* @enum {0 | 1 | 2}
|
|
18
24
|
*/
|
|
19
25
|
export const WasmCodeBlockStyle = Object.freeze({
|
|
@@ -22,6 +28,23 @@ export const WasmCodeBlockStyle = Object.freeze({
|
|
|
22
28
|
Tildes: 2, "2": "Tildes",
|
|
23
29
|
});
|
|
24
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Main conversion options for HTML to Markdown conversion.
|
|
33
|
+
*
|
|
34
|
+
* Use [`ConversionOptions::builder()`] to construct, or [`Default::default()`] for defaults.
|
|
35
|
+
*
|
|
36
|
+
* # Example
|
|
37
|
+
*
|
|
38
|
+
* ```text
|
|
39
|
+
* use html_to_markdown_rs::ConversionOptions;
|
|
40
|
+
*
|
|
41
|
+
* let options = ConversionOptions::builder()
|
|
42
|
+
* .heading_style(HeadingStyle::Atx)
|
|
43
|
+
* .wrap(true)
|
|
44
|
+
* .wrap_width(100)
|
|
45
|
+
* .build();
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
25
48
|
export class WasmConversionOptions {
|
|
26
49
|
static __wrap(ptr) {
|
|
27
50
|
ptr = ptr >>> 0;
|
|
@@ -41,6 +64,7 @@ export class WasmConversionOptions {
|
|
|
41
64
|
wasm.__wbg_wasmconversionoptions_free(ptr, 0);
|
|
42
65
|
}
|
|
43
66
|
/**
|
|
67
|
+
* Apply a partial update to these conversion options.
|
|
44
68
|
* @param {WasmConversionOptionsUpdate} _update
|
|
45
69
|
*/
|
|
46
70
|
applyUpdate(_update) {
|
|
@@ -63,6 +87,7 @@ export class WasmConversionOptions {
|
|
|
63
87
|
return ret !== 0;
|
|
64
88
|
}
|
|
65
89
|
/**
|
|
90
|
+
* Create a new builder with default values.
|
|
66
91
|
* @returns {WasmConversionOptionsBuilder}
|
|
67
92
|
*/
|
|
68
93
|
static builder() {
|
|
@@ -85,7 +110,7 @@ export class WasmConversionOptions {
|
|
|
85
110
|
return getStringFromWasm0(r0, r1);
|
|
86
111
|
} finally {
|
|
87
112
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
88
|
-
wasm.
|
|
113
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
89
114
|
}
|
|
90
115
|
}
|
|
91
116
|
/**
|
|
@@ -118,7 +143,7 @@ export class WasmConversionOptions {
|
|
|
118
143
|
return getStringFromWasm0(r0, r1);
|
|
119
144
|
} finally {
|
|
120
145
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
121
|
-
wasm.
|
|
146
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
122
147
|
}
|
|
123
148
|
}
|
|
124
149
|
/**
|
|
@@ -165,7 +190,7 @@ export class WasmConversionOptions {
|
|
|
165
190
|
return getStringFromWasm0(r0, r1);
|
|
166
191
|
} finally {
|
|
167
192
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
168
|
-
wasm.
|
|
193
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
169
194
|
}
|
|
170
195
|
}
|
|
171
196
|
/**
|
|
@@ -196,6 +221,22 @@ export class WasmConversionOptions {
|
|
|
196
221
|
const ret = wasm.wasmconversionoptions_escapeUnderscores(this.__wbg_ptr);
|
|
197
222
|
return ret !== 0;
|
|
198
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* @returns {string[]}
|
|
226
|
+
*/
|
|
227
|
+
get excludeSelectors() {
|
|
228
|
+
try {
|
|
229
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
230
|
+
wasm.wasmconversionoptions_excludeSelectors(retptr, this.__wbg_ptr);
|
|
231
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
232
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
233
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
234
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
235
|
+
return v1;
|
|
236
|
+
} finally {
|
|
237
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
199
240
|
/**
|
|
200
241
|
* @returns {boolean}
|
|
201
242
|
*/
|
|
@@ -221,6 +262,7 @@ export class WasmConversionOptions {
|
|
|
221
262
|
return WasmConversionOptions.__wrap(ret);
|
|
222
263
|
}
|
|
223
264
|
/**
|
|
265
|
+
* Create from a partial update, applying to defaults.
|
|
224
266
|
* @param {WasmConversionOptionsUpdate} update
|
|
225
267
|
* @returns {WasmConversionOptions}
|
|
226
268
|
*/
|
|
@@ -268,7 +310,7 @@ export class WasmConversionOptions {
|
|
|
268
310
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
269
311
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
270
312
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
271
|
-
wasm.
|
|
313
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
272
314
|
return v1;
|
|
273
315
|
} finally {
|
|
274
316
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -348,9 +390,10 @@ export class WasmConversionOptions {
|
|
|
348
390
|
* @param {bigint | null} [max_image_size]
|
|
349
391
|
* @param {boolean | null} [capture_svg]
|
|
350
392
|
* @param {boolean | null} [infer_dimensions]
|
|
393
|
+
* @param {string[] | null} [exclude_selectors]
|
|
351
394
|
* @param {number | null} [max_depth]
|
|
352
395
|
*/
|
|
353
|
-
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) {
|
|
396
|
+
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) {
|
|
354
397
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
355
398
|
var len0 = WASM_VECTOR_LEN;
|
|
356
399
|
var ptr1 = isLikeNone(strong_em_symbol) ? 0 : passStringToWasm0(strong_em_symbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -374,7 +417,9 @@ export class WasmConversionOptions {
|
|
|
374
417
|
var len8 = WASM_VECTOR_LEN;
|
|
375
418
|
var ptr9 = isLikeNone(preserve_tags) ? 0 : passArrayJsValueToWasm0(preserve_tags, wasm.__wbindgen_export);
|
|
376
419
|
var len9 = WASM_VECTOR_LEN;
|
|
377
|
-
|
|
420
|
+
var ptr10 = isLikeNone(exclude_selectors) ? 0 : passArrayJsValueToWasm0(exclude_selectors, wasm.__wbindgen_export);
|
|
421
|
+
var len10 = WASM_VECTOR_LEN;
|
|
422
|
+
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);
|
|
378
423
|
this.__wbg_ptr = ret >>> 0;
|
|
379
424
|
WasmConversionOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
380
425
|
return this;
|
|
@@ -410,7 +455,7 @@ export class WasmConversionOptions {
|
|
|
410
455
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
411
456
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
412
457
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
413
|
-
wasm.
|
|
458
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
414
459
|
return v1;
|
|
415
460
|
} finally {
|
|
416
461
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -506,6 +551,14 @@ export class WasmConversionOptions {
|
|
|
506
551
|
set escapeUnderscores(value) {
|
|
507
552
|
wasm.wasmconversionoptions_set_escapeUnderscores(this.__wbg_ptr, value);
|
|
508
553
|
}
|
|
554
|
+
/**
|
|
555
|
+
* @param {string[]} value
|
|
556
|
+
*/
|
|
557
|
+
set excludeSelectors(value) {
|
|
558
|
+
const ptr0 = passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
|
|
559
|
+
const len0 = WASM_VECTOR_LEN;
|
|
560
|
+
wasm.wasmconversionoptions_set_excludeSelectors(this.__wbg_ptr, ptr0, len0);
|
|
561
|
+
}
|
|
509
562
|
/**
|
|
510
563
|
* @param {boolean} value
|
|
511
564
|
*/
|
|
@@ -694,7 +747,7 @@ export class WasmConversionOptions {
|
|
|
694
747
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
695
748
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
696
749
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
697
|
-
wasm.
|
|
750
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
698
751
|
return v1;
|
|
699
752
|
} finally {
|
|
700
753
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -716,7 +769,7 @@ export class WasmConversionOptions {
|
|
|
716
769
|
return getStringFromWasm0(r0, r1);
|
|
717
770
|
} finally {
|
|
718
771
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
719
|
-
wasm.
|
|
772
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
720
773
|
}
|
|
721
774
|
}
|
|
722
775
|
/**
|
|
@@ -735,7 +788,7 @@ export class WasmConversionOptions {
|
|
|
735
788
|
return getStringFromWasm0(r0, r1);
|
|
736
789
|
} finally {
|
|
737
790
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
738
|
-
wasm.
|
|
791
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
739
792
|
}
|
|
740
793
|
}
|
|
741
794
|
/**
|
|
@@ -754,7 +807,7 @@ export class WasmConversionOptions {
|
|
|
754
807
|
return getStringFromWasm0(r0, r1);
|
|
755
808
|
} finally {
|
|
756
809
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
757
|
-
wasm.
|
|
810
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
758
811
|
}
|
|
759
812
|
}
|
|
760
813
|
/**
|
|
@@ -781,6 +834,11 @@ export class WasmConversionOptions {
|
|
|
781
834
|
}
|
|
782
835
|
if (Symbol.dispose) WasmConversionOptions.prototype[Symbol.dispose] = WasmConversionOptions.prototype.free;
|
|
783
836
|
|
|
837
|
+
/**
|
|
838
|
+
* Builder for [`ConversionOptions`].
|
|
839
|
+
*
|
|
840
|
+
* All fields start with default values. Call `.build()` to produce the final options.
|
|
841
|
+
*/
|
|
784
842
|
export class WasmConversionOptionsBuilder {
|
|
785
843
|
static __wrap(ptr) {
|
|
786
844
|
ptr = ptr >>> 0;
|
|
@@ -800,6 +858,7 @@ export class WasmConversionOptionsBuilder {
|
|
|
800
858
|
wasm.__wbg_wasmconversionoptionsbuilder_free(ptr, 0);
|
|
801
859
|
}
|
|
802
860
|
/**
|
|
861
|
+
* Build the final [`ConversionOptions`].
|
|
803
862
|
* @returns {WasmConversionOptions}
|
|
804
863
|
*/
|
|
805
864
|
build() {
|
|
@@ -807,6 +866,18 @@ export class WasmConversionOptionsBuilder {
|
|
|
807
866
|
return WasmConversionOptions.__wrap(ret);
|
|
808
867
|
}
|
|
809
868
|
/**
|
|
869
|
+
* Set the list of CSS selectors for elements to exclude entirely from output.
|
|
870
|
+
* @param {string[]} selectors
|
|
871
|
+
* @returns {WasmConversionOptionsBuilder}
|
|
872
|
+
*/
|
|
873
|
+
excludeSelectors(selectors) {
|
|
874
|
+
const ptr0 = passArrayJsValueToWasm0(selectors, wasm.__wbindgen_export);
|
|
875
|
+
const len0 = WASM_VECTOR_LEN;
|
|
876
|
+
const ret = wasm.wasmconversionoptionsbuilder_excludeSelectors(this.__wbg_ptr, ptr0, len0);
|
|
877
|
+
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Set the list of HTML tag names whose `<img>` children are kept inline.
|
|
810
881
|
* @param {string[]} tags
|
|
811
882
|
* @returns {WasmConversionOptionsBuilder}
|
|
812
883
|
*/
|
|
@@ -817,6 +888,7 @@ export class WasmConversionOptionsBuilder {
|
|
|
817
888
|
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
818
889
|
}
|
|
819
890
|
/**
|
|
891
|
+
* Set the pre-processing options applied to the HTML before conversion.
|
|
820
892
|
* @param {WasmPreprocessingOptions} preprocessing
|
|
821
893
|
* @returns {WasmConversionOptionsBuilder}
|
|
822
894
|
*/
|
|
@@ -827,6 +899,7 @@ export class WasmConversionOptionsBuilder {
|
|
|
827
899
|
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
828
900
|
}
|
|
829
901
|
/**
|
|
902
|
+
* Set the list of HTML tag names that are preserved verbatim in output.
|
|
830
903
|
* @param {string[]} tags
|
|
831
904
|
* @returns {WasmConversionOptionsBuilder}
|
|
832
905
|
*/
|
|
@@ -837,6 +910,7 @@ export class WasmConversionOptionsBuilder {
|
|
|
837
910
|
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
838
911
|
}
|
|
839
912
|
/**
|
|
913
|
+
* Set the list of HTML tag names whose content is stripped from output.
|
|
840
914
|
* @param {string[]} tags
|
|
841
915
|
* @returns {WasmConversionOptionsBuilder}
|
|
842
916
|
*/
|
|
@@ -849,6 +923,12 @@ export class WasmConversionOptionsBuilder {
|
|
|
849
923
|
}
|
|
850
924
|
if (Symbol.dispose) WasmConversionOptionsBuilder.prototype[Symbol.dispose] = WasmConversionOptionsBuilder.prototype.free;
|
|
851
925
|
|
|
926
|
+
/**
|
|
927
|
+
* Partial update for `ConversionOptions`.
|
|
928
|
+
*
|
|
929
|
+
* Uses `Option<T>` fields for selective updates. Bindings use this to construct
|
|
930
|
+
* options from language-native types. Prefer [`ConversionOptionsBuilder`] for Rust code.
|
|
931
|
+
*/
|
|
852
932
|
export class WasmConversionOptionsUpdate {
|
|
853
933
|
__destroy_into_raw() {
|
|
854
934
|
const ptr = this.__wbg_ptr;
|
|
@@ -886,7 +966,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
886
966
|
let v1;
|
|
887
967
|
if (r0 !== 0) {
|
|
888
968
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
889
|
-
wasm.
|
|
969
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
890
970
|
}
|
|
891
971
|
return v1;
|
|
892
972
|
} finally {
|
|
@@ -919,7 +999,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
919
999
|
let v1;
|
|
920
1000
|
if (r0 !== 0) {
|
|
921
1001
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
922
|
-
wasm.
|
|
1002
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
923
1003
|
}
|
|
924
1004
|
return v1;
|
|
925
1005
|
} finally {
|
|
@@ -959,7 +1039,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
959
1039
|
let v1;
|
|
960
1040
|
if (r0 !== 0) {
|
|
961
1041
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
962
|
-
wasm.
|
|
1042
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
963
1043
|
}
|
|
964
1044
|
return v1;
|
|
965
1045
|
} finally {
|
|
@@ -994,6 +1074,25 @@ export class WasmConversionOptionsUpdate {
|
|
|
994
1074
|
const ret = wasm.wasmconversionoptionsupdate_escapeUnderscores(this.__wbg_ptr);
|
|
995
1075
|
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
996
1076
|
}
|
|
1077
|
+
/**
|
|
1078
|
+
* @returns {string[] | undefined}
|
|
1079
|
+
*/
|
|
1080
|
+
get excludeSelectors() {
|
|
1081
|
+
try {
|
|
1082
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1083
|
+
wasm.wasmconversionoptionsupdate_excludeSelectors(retptr, this.__wbg_ptr);
|
|
1084
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1085
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1086
|
+
let v1;
|
|
1087
|
+
if (r0 !== 0) {
|
|
1088
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1089
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1090
|
+
}
|
|
1091
|
+
return v1;
|
|
1092
|
+
} finally {
|
|
1093
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
997
1096
|
/**
|
|
998
1097
|
* @returns {boolean | undefined}
|
|
999
1098
|
*/
|
|
@@ -1048,7 +1147,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1048
1147
|
let v1;
|
|
1049
1148
|
if (r0 !== 0) {
|
|
1050
1149
|
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1051
|
-
wasm.
|
|
1150
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1052
1151
|
}
|
|
1053
1152
|
return v1;
|
|
1054
1153
|
} finally {
|
|
@@ -1137,8 +1236,9 @@ export class WasmConversionOptionsUpdate {
|
|
|
1137
1236
|
* @param {boolean | null} [capture_svg]
|
|
1138
1237
|
* @param {boolean | null} [infer_dimensions]
|
|
1139
1238
|
* @param {number | null} [max_depth]
|
|
1239
|
+
* @param {string[] | null} [exclude_selectors]
|
|
1140
1240
|
*/
|
|
1141
|
-
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) {
|
|
1241
|
+
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) {
|
|
1142
1242
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1143
1243
|
var len0 = WASM_VECTOR_LEN;
|
|
1144
1244
|
var ptr1 = isLikeNone(strong_em_symbol) ? 0 : passStringToWasm0(strong_em_symbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -1162,7 +1262,9 @@ export class WasmConversionOptionsUpdate {
|
|
|
1162
1262
|
var len8 = WASM_VECTOR_LEN;
|
|
1163
1263
|
var ptr9 = isLikeNone(preserve_tags) ? 0 : passArrayJsValueToWasm0(preserve_tags, wasm.__wbindgen_export);
|
|
1164
1264
|
var len9 = WASM_VECTOR_LEN;
|
|
1165
|
-
|
|
1265
|
+
var ptr10 = isLikeNone(exclude_selectors) ? 0 : passArrayJsValueToWasm0(exclude_selectors, wasm.__wbindgen_export);
|
|
1266
|
+
var len10 = WASM_VECTOR_LEN;
|
|
1267
|
+
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);
|
|
1166
1268
|
this.__wbg_ptr = ret >>> 0;
|
|
1167
1269
|
WasmConversionOptionsUpdateFinalization.register(this, this.__wbg_ptr, this);
|
|
1168
1270
|
return this;
|
|
@@ -1200,7 +1302,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1200
1302
|
let v1;
|
|
1201
1303
|
if (r0 !== 0) {
|
|
1202
1304
|
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1203
|
-
wasm.
|
|
1305
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1204
1306
|
}
|
|
1205
1307
|
return v1;
|
|
1206
1308
|
} finally {
|
|
@@ -1297,6 +1399,14 @@ export class WasmConversionOptionsUpdate {
|
|
|
1297
1399
|
set escapeUnderscores(value) {
|
|
1298
1400
|
wasm.wasmconversionoptionsupdate_set_escapeUnderscores(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
|
|
1299
1401
|
}
|
|
1402
|
+
/**
|
|
1403
|
+
* @param {string[] | null} [value]
|
|
1404
|
+
*/
|
|
1405
|
+
set excludeSelectors(value) {
|
|
1406
|
+
var ptr0 = isLikeNone(value) ? 0 : passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
|
|
1407
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1408
|
+
wasm.wasmconversionoptionsupdate_set_excludeSelectors(this.__wbg_ptr, ptr0, len0);
|
|
1409
|
+
}
|
|
1300
1410
|
/**
|
|
1301
1411
|
* @param {boolean | null} [value]
|
|
1302
1412
|
*/
|
|
@@ -1490,7 +1600,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1490
1600
|
let v1;
|
|
1491
1601
|
if (r0 !== 0) {
|
|
1492
1602
|
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1493
|
-
wasm.
|
|
1603
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1494
1604
|
}
|
|
1495
1605
|
return v1;
|
|
1496
1606
|
} finally {
|
|
@@ -1509,7 +1619,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1509
1619
|
let v1;
|
|
1510
1620
|
if (r0 !== 0) {
|
|
1511
1621
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1512
|
-
wasm.
|
|
1622
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1513
1623
|
}
|
|
1514
1624
|
return v1;
|
|
1515
1625
|
} finally {
|
|
@@ -1528,7 +1638,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1528
1638
|
let v1;
|
|
1529
1639
|
if (r0 !== 0) {
|
|
1530
1640
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1531
|
-
wasm.
|
|
1641
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1532
1642
|
}
|
|
1533
1643
|
return v1;
|
|
1534
1644
|
} finally {
|
|
@@ -1547,7 +1657,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1547
1657
|
let v1;
|
|
1548
1658
|
if (r0 !== 0) {
|
|
1549
1659
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1550
|
-
wasm.
|
|
1660
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1551
1661
|
}
|
|
1552
1662
|
return v1;
|
|
1553
1663
|
} finally {
|
|
@@ -1578,6 +1688,22 @@ export class WasmConversionOptionsUpdate {
|
|
|
1578
1688
|
}
|
|
1579
1689
|
if (Symbol.dispose) WasmConversionOptionsUpdate.prototype[Symbol.dispose] = WasmConversionOptionsUpdate.prototype.free;
|
|
1580
1690
|
|
|
1691
|
+
/**
|
|
1692
|
+
* The primary result of HTML conversion and extraction.
|
|
1693
|
+
*
|
|
1694
|
+
* Contains the converted text output, optional structured document tree,
|
|
1695
|
+
* metadata, extracted tables, images, and processing warnings.
|
|
1696
|
+
*
|
|
1697
|
+
* # Example
|
|
1698
|
+
*
|
|
1699
|
+
* ```text
|
|
1700
|
+
* use html_to_markdown_rs::{convert, ConversionOptions};
|
|
1701
|
+
*
|
|
1702
|
+
* let result = convert("<h1>Hello</h1><p>World</p>", None)?;
|
|
1703
|
+
* assert!(result.content.is_some());
|
|
1704
|
+
* assert!(result.warnings.is_empty());
|
|
1705
|
+
* ```
|
|
1706
|
+
*/
|
|
1581
1707
|
export class WasmConversionResult {
|
|
1582
1708
|
static __wrap(ptr) {
|
|
1583
1709
|
ptr = ptr >>> 0;
|
|
@@ -1608,7 +1734,7 @@ export class WasmConversionResult {
|
|
|
1608
1734
|
let v1;
|
|
1609
1735
|
if (r0 !== 0) {
|
|
1610
1736
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1611
|
-
wasm.
|
|
1737
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1612
1738
|
}
|
|
1613
1739
|
return v1;
|
|
1614
1740
|
} finally {
|
|
@@ -1632,7 +1758,7 @@ export class WasmConversionResult {
|
|
|
1632
1758
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1633
1759
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1634
1760
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1635
|
-
wasm.
|
|
1761
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1636
1762
|
return v1;
|
|
1637
1763
|
} finally {
|
|
1638
1764
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1738,7 +1864,7 @@ export class WasmConversionResult {
|
|
|
1738
1864
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1739
1865
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1740
1866
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1741
|
-
wasm.
|
|
1867
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1742
1868
|
return v1;
|
|
1743
1869
|
} finally {
|
|
1744
1870
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1754,7 +1880,7 @@ export class WasmConversionResult {
|
|
|
1754
1880
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1755
1881
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1756
1882
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1757
|
-
wasm.
|
|
1883
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1758
1884
|
return v1;
|
|
1759
1885
|
} finally {
|
|
1760
1886
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1763,6 +1889,26 @@ export class WasmConversionResult {
|
|
|
1763
1889
|
}
|
|
1764
1890
|
if (Symbol.dispose) WasmConversionResult.prototype[Symbol.dispose] = WasmConversionResult.prototype.free;
|
|
1765
1891
|
|
|
1892
|
+
/**
|
|
1893
|
+
* Document-level metadata extracted from `<head>` and top-level elements.
|
|
1894
|
+
*
|
|
1895
|
+
* Contains all metadata typically used by search engines, social media platforms,
|
|
1896
|
+
* and browsers for document indexing and presentation.
|
|
1897
|
+
*
|
|
1898
|
+
* # Examples
|
|
1899
|
+
*
|
|
1900
|
+
* ```
|
|
1901
|
+
* # use html_to_markdown_rs::metadata::DocumentMetadata;
|
|
1902
|
+
* let doc = DocumentMetadata {
|
|
1903
|
+
* title: Some("My Article".to_string()),
|
|
1904
|
+
* description: Some("A great article about Rust".to_string()),
|
|
1905
|
+
* keywords: vec!["rust".to_string(), "programming".to_string()],
|
|
1906
|
+
* ..Default::default()
|
|
1907
|
+
* };
|
|
1908
|
+
*
|
|
1909
|
+
* assert_eq!(doc.title, Some("My Article".to_string()));
|
|
1910
|
+
* ```
|
|
1911
|
+
*/
|
|
1766
1912
|
export class WasmDocumentMetadata {
|
|
1767
1913
|
static __wrap(ptr) {
|
|
1768
1914
|
ptr = ptr >>> 0;
|
|
@@ -1793,7 +1939,7 @@ export class WasmDocumentMetadata {
|
|
|
1793
1939
|
let v1;
|
|
1794
1940
|
if (r0 !== 0) {
|
|
1795
1941
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1796
|
-
wasm.
|
|
1942
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1797
1943
|
}
|
|
1798
1944
|
return v1;
|
|
1799
1945
|
} finally {
|
|
@@ -1812,7 +1958,7 @@ export class WasmDocumentMetadata {
|
|
|
1812
1958
|
let v1;
|
|
1813
1959
|
if (r0 !== 0) {
|
|
1814
1960
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1815
|
-
wasm.
|
|
1961
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1816
1962
|
}
|
|
1817
1963
|
return v1;
|
|
1818
1964
|
} finally {
|
|
@@ -1831,7 +1977,7 @@ export class WasmDocumentMetadata {
|
|
|
1831
1977
|
let v1;
|
|
1832
1978
|
if (r0 !== 0) {
|
|
1833
1979
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1834
|
-
wasm.
|
|
1980
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1835
1981
|
}
|
|
1836
1982
|
return v1;
|
|
1837
1983
|
} finally {
|
|
@@ -1850,7 +1996,7 @@ export class WasmDocumentMetadata {
|
|
|
1850
1996
|
let v1;
|
|
1851
1997
|
if (r0 !== 0) {
|
|
1852
1998
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1853
|
-
wasm.
|
|
1999
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1854
2000
|
}
|
|
1855
2001
|
return v1;
|
|
1856
2002
|
} finally {
|
|
@@ -1867,7 +2013,7 @@ export class WasmDocumentMetadata {
|
|
|
1867
2013
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1868
2014
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1869
2015
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1870
|
-
wasm.
|
|
2016
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1871
2017
|
return v1;
|
|
1872
2018
|
} finally {
|
|
1873
2019
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1885,7 +2031,7 @@ export class WasmDocumentMetadata {
|
|
|
1885
2031
|
let v1;
|
|
1886
2032
|
if (r0 !== 0) {
|
|
1887
2033
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1888
|
-
wasm.
|
|
2034
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1889
2035
|
}
|
|
1890
2036
|
return v1;
|
|
1891
2037
|
} finally {
|
|
@@ -2038,7 +2184,7 @@ export class WasmDocumentMetadata {
|
|
|
2038
2184
|
let v1;
|
|
2039
2185
|
if (r0 !== 0) {
|
|
2040
2186
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2041
|
-
wasm.
|
|
2187
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2042
2188
|
}
|
|
2043
2189
|
return v1;
|
|
2044
2190
|
} finally {
|
|
@@ -2055,6 +2201,9 @@ export class WasmDocumentMetadata {
|
|
|
2055
2201
|
}
|
|
2056
2202
|
if (Symbol.dispose) WasmDocumentMetadata.prototype[Symbol.dispose] = WasmDocumentMetadata.prototype.free;
|
|
2057
2203
|
|
|
2204
|
+
/**
|
|
2205
|
+
* A single node in the document tree.
|
|
2206
|
+
*/
|
|
2058
2207
|
export class WasmDocumentNode {
|
|
2059
2208
|
static __wrap(ptr) {
|
|
2060
2209
|
ptr = ptr >>> 0;
|
|
@@ -2089,7 +2238,7 @@ export class WasmDocumentNode {
|
|
|
2089
2238
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2090
2239
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2091
2240
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2092
|
-
wasm.
|
|
2241
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2093
2242
|
return v1;
|
|
2094
2243
|
} finally {
|
|
2095
2244
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2112,7 +2261,7 @@ export class WasmDocumentNode {
|
|
|
2112
2261
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2113
2262
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2114
2263
|
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
2115
|
-
wasm.
|
|
2264
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2116
2265
|
return v1;
|
|
2117
2266
|
} finally {
|
|
2118
2267
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2141,7 +2290,7 @@ export class WasmDocumentNode {
|
|
|
2141
2290
|
return getStringFromWasm0(r0, r1);
|
|
2142
2291
|
} finally {
|
|
2143
2292
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2144
|
-
wasm.
|
|
2293
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2145
2294
|
}
|
|
2146
2295
|
}
|
|
2147
2296
|
/**
|
|
@@ -2216,6 +2365,11 @@ export class WasmDocumentNode {
|
|
|
2216
2365
|
}
|
|
2217
2366
|
if (Symbol.dispose) WasmDocumentNode.prototype[Symbol.dispose] = WasmDocumentNode.prototype.free;
|
|
2218
2367
|
|
|
2368
|
+
/**
|
|
2369
|
+
* A structured document tree representing the semantic content of an HTML document.
|
|
2370
|
+
*
|
|
2371
|
+
* Uses a flat node array with index-based parent/child references for efficient traversal.
|
|
2372
|
+
*/
|
|
2219
2373
|
export class WasmDocumentStructure {
|
|
2220
2374
|
static __wrap(ptr) {
|
|
2221
2375
|
ptr = ptr >>> 0;
|
|
@@ -2258,7 +2412,7 @@ export class WasmDocumentStructure {
|
|
|
2258
2412
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2259
2413
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2260
2414
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2261
|
-
wasm.
|
|
2415
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2262
2416
|
return v1;
|
|
2263
2417
|
} finally {
|
|
2264
2418
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2292,7 +2446,7 @@ export class WasmDocumentStructure {
|
|
|
2292
2446
|
let v1;
|
|
2293
2447
|
if (r0 !== 0) {
|
|
2294
2448
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2295
|
-
wasm.
|
|
2449
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2296
2450
|
}
|
|
2297
2451
|
return v1;
|
|
2298
2452
|
} finally {
|
|
@@ -2302,6 +2456,9 @@ export class WasmDocumentStructure {
|
|
|
2302
2456
|
}
|
|
2303
2457
|
if (Symbol.dispose) WasmDocumentStructure.prototype[Symbol.dispose] = WasmDocumentStructure.prototype.free;
|
|
2304
2458
|
|
|
2459
|
+
/**
|
|
2460
|
+
* A single cell in a table grid.
|
|
2461
|
+
*/
|
|
2305
2462
|
export class WasmGridCell {
|
|
2306
2463
|
static __wrap(ptr) {
|
|
2307
2464
|
ptr = ptr >>> 0;
|
|
@@ -2356,7 +2513,7 @@ export class WasmGridCell {
|
|
|
2356
2513
|
return getStringFromWasm0(r0, r1);
|
|
2357
2514
|
} finally {
|
|
2358
2515
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2359
|
-
wasm.
|
|
2516
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2360
2517
|
}
|
|
2361
2518
|
}
|
|
2362
2519
|
/**
|
|
@@ -2437,6 +2594,28 @@ export class WasmGridCell {
|
|
|
2437
2594
|
}
|
|
2438
2595
|
if (Symbol.dispose) WasmGridCell.prototype[Symbol.dispose] = WasmGridCell.prototype.free;
|
|
2439
2596
|
|
|
2597
|
+
/**
|
|
2598
|
+
* Header element metadata with hierarchy tracking.
|
|
2599
|
+
*
|
|
2600
|
+
* Captures heading elements (h1-h6) with their text content, identifiers,
|
|
2601
|
+
* and position in the document structure.
|
|
2602
|
+
*
|
|
2603
|
+
* # Examples
|
|
2604
|
+
*
|
|
2605
|
+
* ```
|
|
2606
|
+
* # use html_to_markdown_rs::metadata::HeaderMetadata;
|
|
2607
|
+
* let header = HeaderMetadata {
|
|
2608
|
+
* level: 1,
|
|
2609
|
+
* text: "Main Title".to_string(),
|
|
2610
|
+
* id: Some("main-title".to_string()),
|
|
2611
|
+
* depth: 0,
|
|
2612
|
+
* html_offset: 145,
|
|
2613
|
+
* };
|
|
2614
|
+
*
|
|
2615
|
+
* assert_eq!(header.level, 1);
|
|
2616
|
+
* assert!(header.is_valid());
|
|
2617
|
+
* ```
|
|
2618
|
+
*/
|
|
2440
2619
|
export class WasmHeaderMetadata {
|
|
2441
2620
|
static __wrap(ptr) {
|
|
2442
2621
|
ptr = ptr >>> 0;
|
|
@@ -2487,7 +2666,7 @@ export class WasmHeaderMetadata {
|
|
|
2487
2666
|
let v1;
|
|
2488
2667
|
if (r0 !== 0) {
|
|
2489
2668
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2490
|
-
wasm.
|
|
2669
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2491
2670
|
}
|
|
2492
2671
|
return v1;
|
|
2493
2672
|
} finally {
|
|
@@ -2495,6 +2674,34 @@ export class WasmHeaderMetadata {
|
|
|
2495
2674
|
}
|
|
2496
2675
|
}
|
|
2497
2676
|
/**
|
|
2677
|
+
* Validate that the header level is within valid range (1-6).
|
|
2678
|
+
*
|
|
2679
|
+
* # Returns
|
|
2680
|
+
*
|
|
2681
|
+
* `true` if level is 1-6, `false` otherwise.
|
|
2682
|
+
*
|
|
2683
|
+
* # Examples
|
|
2684
|
+
*
|
|
2685
|
+
* ```
|
|
2686
|
+
* # use html_to_markdown_rs::metadata::HeaderMetadata;
|
|
2687
|
+
* let valid = HeaderMetadata {
|
|
2688
|
+
* level: 3,
|
|
2689
|
+
* text: "Title".to_string(),
|
|
2690
|
+
* id: None,
|
|
2691
|
+
* depth: 2,
|
|
2692
|
+
* html_offset: 100,
|
|
2693
|
+
* };
|
|
2694
|
+
* assert!(valid.is_valid());
|
|
2695
|
+
*
|
|
2696
|
+
* let invalid = HeaderMetadata {
|
|
2697
|
+
* level: 7, // Invalid
|
|
2698
|
+
* text: "Title".to_string(),
|
|
2699
|
+
* id: None,
|
|
2700
|
+
* depth: 2,
|
|
2701
|
+
* html_offset: 100,
|
|
2702
|
+
* };
|
|
2703
|
+
* assert!(!invalid.is_valid());
|
|
2704
|
+
* ```
|
|
2498
2705
|
* @returns {boolean}
|
|
2499
2706
|
*/
|
|
2500
2707
|
isValid() {
|
|
@@ -2575,13 +2782,16 @@ export class WasmHeaderMetadata {
|
|
|
2575
2782
|
return getStringFromWasm0(r0, r1);
|
|
2576
2783
|
} finally {
|
|
2577
2784
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2578
|
-
wasm.
|
|
2785
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2579
2786
|
}
|
|
2580
2787
|
}
|
|
2581
2788
|
}
|
|
2582
2789
|
if (Symbol.dispose) WasmHeaderMetadata.prototype[Symbol.dispose] = WasmHeaderMetadata.prototype.free;
|
|
2583
2790
|
|
|
2584
2791
|
/**
|
|
2792
|
+
* Heading style options for Markdown output.
|
|
2793
|
+
*
|
|
2794
|
+
* Controls how headings (h1-h6) are rendered in the output Markdown.
|
|
2585
2795
|
* @enum {0 | 1 | 2}
|
|
2586
2796
|
*/
|
|
2587
2797
|
export const WasmHeadingStyle = Object.freeze({
|
|
@@ -2591,6 +2801,9 @@ export const WasmHeadingStyle = Object.freeze({
|
|
|
2591
2801
|
});
|
|
2592
2802
|
|
|
2593
2803
|
/**
|
|
2804
|
+
* Highlight rendering style for `<mark>` elements.
|
|
2805
|
+
*
|
|
2806
|
+
* Controls how highlighted text is rendered in Markdown output.
|
|
2594
2807
|
* @enum {0 | 1 | 2 | 3}
|
|
2595
2808
|
*/
|
|
2596
2809
|
export const WasmHighlightStyle = Object.freeze({
|
|
@@ -2600,6 +2813,27 @@ export const WasmHighlightStyle = Object.freeze({
|
|
|
2600
2813
|
None: 3, "3": "None",
|
|
2601
2814
|
});
|
|
2602
2815
|
|
|
2816
|
+
/**
|
|
2817
|
+
* Comprehensive metadata extraction result from HTML document.
|
|
2818
|
+
*
|
|
2819
|
+
* Contains all extracted metadata types in a single structure,
|
|
2820
|
+
* suitable for serialization and transmission across language boundaries.
|
|
2821
|
+
*
|
|
2822
|
+
* # Examples
|
|
2823
|
+
*
|
|
2824
|
+
* ```
|
|
2825
|
+
* # use html_to_markdown_rs::metadata::HtmlMetadata;
|
|
2826
|
+
* let metadata = HtmlMetadata {
|
|
2827
|
+
* document: Default::default(),
|
|
2828
|
+
* headers: Vec::new(),
|
|
2829
|
+
* links: Vec::new(),
|
|
2830
|
+
* images: Vec::new(),
|
|
2831
|
+
* structured_data: Vec::new(),
|
|
2832
|
+
* };
|
|
2833
|
+
*
|
|
2834
|
+
* assert!(metadata.headers.is_empty());
|
|
2835
|
+
* ```
|
|
2836
|
+
*/
|
|
2603
2837
|
export class WasmHtmlMetadata {
|
|
2604
2838
|
static __wrap(ptr) {
|
|
2605
2839
|
ptr = ptr >>> 0;
|
|
@@ -2635,7 +2869,7 @@ export class WasmHtmlMetadata {
|
|
|
2635
2869
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2636
2870
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2637
2871
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2638
|
-
wasm.
|
|
2872
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2639
2873
|
return v1;
|
|
2640
2874
|
} finally {
|
|
2641
2875
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2651,7 +2885,7 @@ export class WasmHtmlMetadata {
|
|
|
2651
2885
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2652
2886
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2653
2887
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2654
|
-
wasm.
|
|
2888
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2655
2889
|
return v1;
|
|
2656
2890
|
} finally {
|
|
2657
2891
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2667,7 +2901,7 @@ export class WasmHtmlMetadata {
|
|
|
2667
2901
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2668
2902
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2669
2903
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2670
|
-
wasm.
|
|
2904
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2671
2905
|
return v1;
|
|
2672
2906
|
} finally {
|
|
2673
2907
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2749,7 +2983,7 @@ export class WasmHtmlMetadata {
|
|
|
2749
2983
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2750
2984
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2751
2985
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2752
|
-
wasm.
|
|
2986
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2753
2987
|
return v1;
|
|
2754
2988
|
} finally {
|
|
2755
2989
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2758,6 +2992,28 @@ export class WasmHtmlMetadata {
|
|
|
2758
2992
|
}
|
|
2759
2993
|
if (Symbol.dispose) WasmHtmlMetadata.prototype[Symbol.dispose] = WasmHtmlMetadata.prototype.free;
|
|
2760
2994
|
|
|
2995
|
+
/**
|
|
2996
|
+
* Image metadata with source and dimensions.
|
|
2997
|
+
*
|
|
2998
|
+
* Captures `<img>` elements and inline `<svg>` elements with metadata
|
|
2999
|
+
* for image analysis and optimization.
|
|
3000
|
+
*
|
|
3001
|
+
* # Examples
|
|
3002
|
+
*
|
|
3003
|
+
* ```
|
|
3004
|
+
* # use html_to_markdown_rs::metadata::{ImageMetadata, ImageType};
|
|
3005
|
+
* let img = ImageMetadata {
|
|
3006
|
+
* src: "https://example.com/image.jpg".to_string(),
|
|
3007
|
+
* alt: Some("An example image".to_string()),
|
|
3008
|
+
* title: Some("Example".to_string()),
|
|
3009
|
+
* dimensions: Some((800, 600)),
|
|
3010
|
+
* image_type: ImageType::External,
|
|
3011
|
+
* attributes: Default::default(),
|
|
3012
|
+
* };
|
|
3013
|
+
*
|
|
3014
|
+
* assert_eq!(img.image_type, ImageType::External);
|
|
3015
|
+
* ```
|
|
3016
|
+
*/
|
|
2761
3017
|
export class WasmImageMetadata {
|
|
2762
3018
|
static __wrap(ptr) {
|
|
2763
3019
|
ptr = ptr >>> 0;
|
|
@@ -2794,7 +3050,7 @@ export class WasmImageMetadata {
|
|
|
2794
3050
|
let v1;
|
|
2795
3051
|
if (r0 !== 0) {
|
|
2796
3052
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2797
|
-
wasm.
|
|
3053
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2798
3054
|
}
|
|
2799
3055
|
return v1;
|
|
2800
3056
|
} finally {
|
|
@@ -2809,7 +3065,7 @@ export class WasmImageMetadata {
|
|
|
2809
3065
|
return takeObject(ret);
|
|
2810
3066
|
}
|
|
2811
3067
|
/**
|
|
2812
|
-
* @returns {
|
|
3068
|
+
* @returns {Uint32Array | undefined}
|
|
2813
3069
|
*/
|
|
2814
3070
|
get dimensions() {
|
|
2815
3071
|
try {
|
|
@@ -2819,8 +3075,8 @@ export class WasmImageMetadata {
|
|
|
2819
3075
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2820
3076
|
let v1;
|
|
2821
3077
|
if (r0 !== 0) {
|
|
2822
|
-
v1 =
|
|
2823
|
-
wasm.
|
|
3078
|
+
v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
3079
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2824
3080
|
}
|
|
2825
3081
|
return v1;
|
|
2826
3082
|
} finally {
|
|
@@ -2840,7 +3096,7 @@ export class WasmImageMetadata {
|
|
|
2840
3096
|
* @param {any} attributes
|
|
2841
3097
|
* @param {string | null} [alt]
|
|
2842
3098
|
* @param {string | null} [title]
|
|
2843
|
-
* @param {
|
|
3099
|
+
* @param {Uint32Array | null} [dimensions]
|
|
2844
3100
|
*/
|
|
2845
3101
|
constructor(src, image_type, attributes, alt, title, dimensions) {
|
|
2846
3102
|
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -2849,7 +3105,7 @@ export class WasmImageMetadata {
|
|
|
2849
3105
|
var len1 = WASM_VECTOR_LEN;
|
|
2850
3106
|
var ptr2 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2851
3107
|
var len2 = WASM_VECTOR_LEN;
|
|
2852
|
-
var ptr3 = isLikeNone(dimensions) ? 0 :
|
|
3108
|
+
var ptr3 = isLikeNone(dimensions) ? 0 : passArray32ToWasm0(dimensions, wasm.__wbindgen_export);
|
|
2853
3109
|
var len3 = WASM_VECTOR_LEN;
|
|
2854
3110
|
const ret = wasm.wasmimagemetadata_new(ptr0, len0, image_type, addHeapObject(attributes), ptr1, len1, ptr2, len2, ptr3, len3);
|
|
2855
3111
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -2871,10 +3127,10 @@ export class WasmImageMetadata {
|
|
|
2871
3127
|
wasm.wasmimagemetadata_set_attributes(this.__wbg_ptr, addHeapObject(value));
|
|
2872
3128
|
}
|
|
2873
3129
|
/**
|
|
2874
|
-
* @param {
|
|
3130
|
+
* @param {Uint32Array | null} [value]
|
|
2875
3131
|
*/
|
|
2876
3132
|
set dimensions(value) {
|
|
2877
|
-
var ptr0 = isLikeNone(value) ? 0 :
|
|
3133
|
+
var ptr0 = isLikeNone(value) ? 0 : passArray32ToWasm0(value, wasm.__wbindgen_export);
|
|
2878
3134
|
var len0 = WASM_VECTOR_LEN;
|
|
2879
3135
|
wasm.wasmimagemetadata_set_dimensions(this.__wbg_ptr, ptr0, len0);
|
|
2880
3136
|
}
|
|
@@ -2916,7 +3172,7 @@ export class WasmImageMetadata {
|
|
|
2916
3172
|
return getStringFromWasm0(r0, r1);
|
|
2917
3173
|
} finally {
|
|
2918
3174
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2919
|
-
wasm.
|
|
3175
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2920
3176
|
}
|
|
2921
3177
|
}
|
|
2922
3178
|
/**
|
|
@@ -2931,7 +3187,7 @@ export class WasmImageMetadata {
|
|
|
2931
3187
|
let v1;
|
|
2932
3188
|
if (r0 !== 0) {
|
|
2933
3189
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2934
|
-
wasm.
|
|
3190
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2935
3191
|
}
|
|
2936
3192
|
return v1;
|
|
2937
3193
|
} finally {
|
|
@@ -2942,6 +3198,9 @@ export class WasmImageMetadata {
|
|
|
2942
3198
|
if (Symbol.dispose) WasmImageMetadata.prototype[Symbol.dispose] = WasmImageMetadata.prototype.free;
|
|
2943
3199
|
|
|
2944
3200
|
/**
|
|
3201
|
+
* Image source classification for proper handling and processing.
|
|
3202
|
+
*
|
|
3203
|
+
* Determines whether an image is embedded (data URI), inline SVG, external, or relative.
|
|
2945
3204
|
* @enum {0 | 1 | 2 | 3}
|
|
2946
3205
|
*/
|
|
2947
3206
|
export const WasmImageType = Object.freeze({
|
|
@@ -2951,6 +3210,28 @@ export const WasmImageType = Object.freeze({
|
|
|
2951
3210
|
Relative: 3, "3": "Relative",
|
|
2952
3211
|
});
|
|
2953
3212
|
|
|
3213
|
+
/**
|
|
3214
|
+
* Hyperlink metadata with categorization and attributes.
|
|
3215
|
+
*
|
|
3216
|
+
* Represents `<a>` elements with parsed href values, text content, and link type classification.
|
|
3217
|
+
*
|
|
3218
|
+
* # Examples
|
|
3219
|
+
*
|
|
3220
|
+
* ```
|
|
3221
|
+
* # use html_to_markdown_rs::metadata::{LinkMetadata, LinkType};
|
|
3222
|
+
* let link = LinkMetadata {
|
|
3223
|
+
* href: "https://example.com".to_string(),
|
|
3224
|
+
* text: "Example".to_string(),
|
|
3225
|
+
* title: Some("Visit Example".to_string()),
|
|
3226
|
+
* link_type: LinkType::External,
|
|
3227
|
+
* rel: vec!["nofollow".to_string()],
|
|
3228
|
+
* attributes: Default::default(),
|
|
3229
|
+
* };
|
|
3230
|
+
*
|
|
3231
|
+
* assert_eq!(link.link_type, LinkType::External);
|
|
3232
|
+
* assert_eq!(link.text, "Example");
|
|
3233
|
+
* ```
|
|
3234
|
+
*/
|
|
2954
3235
|
export class WasmLinkMetadata {
|
|
2955
3236
|
static __wrap(ptr) {
|
|
2956
3237
|
ptr = ptr >>> 0;
|
|
@@ -2983,6 +3264,25 @@ export class WasmLinkMetadata {
|
|
|
2983
3264
|
return takeObject(ret);
|
|
2984
3265
|
}
|
|
2985
3266
|
/**
|
|
3267
|
+
* Classify a link based on href value.
|
|
3268
|
+
*
|
|
3269
|
+
* # Arguments
|
|
3270
|
+
*
|
|
3271
|
+
* * `href` - The href attribute value
|
|
3272
|
+
*
|
|
3273
|
+
* # Returns
|
|
3274
|
+
*
|
|
3275
|
+
* Appropriate [`LinkType`] based on protocol and content.
|
|
3276
|
+
*
|
|
3277
|
+
* # Examples
|
|
3278
|
+
*
|
|
3279
|
+
* ```
|
|
3280
|
+
* # use html_to_markdown_rs::metadata::{LinkMetadata, LinkType};
|
|
3281
|
+
* assert_eq!(LinkMetadata::classify_link("#section"), LinkType::Anchor);
|
|
3282
|
+
* assert_eq!(LinkMetadata::classify_link("mailto:test@example.com"), LinkType::Email);
|
|
3283
|
+
* assert_eq!(LinkMetadata::classify_link("tel:+1234567890"), LinkType::Phone);
|
|
3284
|
+
* assert_eq!(LinkMetadata::classify_link("https://example.com"), LinkType::External);
|
|
3285
|
+
* ```
|
|
2986
3286
|
* @param {string} href
|
|
2987
3287
|
* @returns {WasmLinkType}
|
|
2988
3288
|
*/
|
|
@@ -3008,7 +3308,7 @@ export class WasmLinkMetadata {
|
|
|
3008
3308
|
return getStringFromWasm0(r0, r1);
|
|
3009
3309
|
} finally {
|
|
3010
3310
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3011
|
-
wasm.
|
|
3311
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3012
3312
|
}
|
|
3013
3313
|
}
|
|
3014
3314
|
/**
|
|
@@ -3050,7 +3350,7 @@ export class WasmLinkMetadata {
|
|
|
3050
3350
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3051
3351
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3052
3352
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
3053
|
-
wasm.
|
|
3353
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
3054
3354
|
return v1;
|
|
3055
3355
|
} finally {
|
|
3056
3356
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -3116,7 +3416,7 @@ export class WasmLinkMetadata {
|
|
|
3116
3416
|
return getStringFromWasm0(r0, r1);
|
|
3117
3417
|
} finally {
|
|
3118
3418
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3119
|
-
wasm.
|
|
3419
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3120
3420
|
}
|
|
3121
3421
|
}
|
|
3122
3422
|
/**
|
|
@@ -3131,7 +3431,7 @@ export class WasmLinkMetadata {
|
|
|
3131
3431
|
let v1;
|
|
3132
3432
|
if (r0 !== 0) {
|
|
3133
3433
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3134
|
-
wasm.
|
|
3434
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3135
3435
|
}
|
|
3136
3436
|
return v1;
|
|
3137
3437
|
} finally {
|
|
@@ -3142,6 +3442,10 @@ export class WasmLinkMetadata {
|
|
|
3142
3442
|
if (Symbol.dispose) WasmLinkMetadata.prototype[Symbol.dispose] = WasmLinkMetadata.prototype.free;
|
|
3143
3443
|
|
|
3144
3444
|
/**
|
|
3445
|
+
* Link rendering style in Markdown output.
|
|
3446
|
+
*
|
|
3447
|
+
* Controls whether links and images use inline `[text](url)` syntax or
|
|
3448
|
+
* reference-style `[text][1]` syntax with definitions collected at the end.
|
|
3145
3449
|
* @enum {0 | 1}
|
|
3146
3450
|
*/
|
|
3147
3451
|
export const WasmLinkStyle = Object.freeze({
|
|
@@ -3150,6 +3454,9 @@ export const WasmLinkStyle = Object.freeze({
|
|
|
3150
3454
|
});
|
|
3151
3455
|
|
|
3152
3456
|
/**
|
|
3457
|
+
* Link classification based on href value and document context.
|
|
3458
|
+
*
|
|
3459
|
+
* Used to categorize links during extraction for filtering and analysis.
|
|
3153
3460
|
* @enum {0 | 1 | 2 | 3 | 4 | 5}
|
|
3154
3461
|
*/
|
|
3155
3462
|
export const WasmLinkType = Object.freeze({
|
|
@@ -3162,6 +3469,9 @@ export const WasmLinkType = Object.freeze({
|
|
|
3162
3469
|
});
|
|
3163
3470
|
|
|
3164
3471
|
/**
|
|
3472
|
+
* List indentation character type.
|
|
3473
|
+
*
|
|
3474
|
+
* Controls whether list items are indented with spaces or tabs.
|
|
3165
3475
|
* @enum {0 | 1}
|
|
3166
3476
|
*/
|
|
3167
3477
|
export const WasmListIndentType = Object.freeze({
|
|
@@ -3169,295 +3479,299 @@ export const WasmListIndentType = Object.freeze({
|
|
|
3169
3479
|
Tabs: 1, "1": "Tabs",
|
|
3170
3480
|
});
|
|
3171
3481
|
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3482
|
+
/**
|
|
3483
|
+
* Line break syntax in Markdown output.
|
|
3484
|
+
*
|
|
3485
|
+
* Controls how soft line breaks (from `<br>` or line breaks in source) are rendered.
|
|
3486
|
+
* @enum {0 | 1}
|
|
3487
|
+
*/
|
|
3488
|
+
export const WasmNewlineStyle = Object.freeze({
|
|
3489
|
+
Spaces: 0, "0": "Spaces",
|
|
3490
|
+
Backslash: 1, "1": "Backslash",
|
|
3491
|
+
});
|
|
3492
|
+
|
|
3493
|
+
/**
|
|
3494
|
+
* The semantic content type of a document node.
|
|
3495
|
+
*
|
|
3496
|
+
* Uses internally tagged representation (`"node_type": "heading"`) for JSON serialization.
|
|
3497
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}
|
|
3498
|
+
*/
|
|
3499
|
+
export const WasmNodeContent = Object.freeze({
|
|
3500
|
+
Heading: 0, "0": "Heading",
|
|
3501
|
+
Paragraph: 1, "1": "Paragraph",
|
|
3502
|
+
List: 2, "2": "List",
|
|
3503
|
+
ListItem: 3, "3": "ListItem",
|
|
3504
|
+
Table: 4, "4": "Table",
|
|
3505
|
+
Image: 5, "5": "Image",
|
|
3506
|
+
Code: 6, "6": "Code",
|
|
3507
|
+
Quote: 7, "7": "Quote",
|
|
3508
|
+
DefinitionList: 8, "8": "DefinitionList",
|
|
3509
|
+
DefinitionItem: 9, "9": "DefinitionItem",
|
|
3510
|
+
RawBlock: 10, "10": "RawBlock",
|
|
3511
|
+
MetadataBlock: 11, "11": "MetadataBlock",
|
|
3512
|
+
Group: 12, "12": "Group",
|
|
3513
|
+
});
|
|
3514
|
+
|
|
3515
|
+
/**
|
|
3516
|
+
* Context information passed to all visitor methods.
|
|
3517
|
+
*
|
|
3518
|
+
* Provides comprehensive metadata about the current node being visited,
|
|
3519
|
+
* including its type, attributes, position in the DOM tree, and parent context.
|
|
3520
|
+
*/
|
|
3521
|
+
export class WasmNodeContext {
|
|
3180
3522
|
__destroy_into_raw() {
|
|
3181
3523
|
const ptr = this.__wbg_ptr;
|
|
3182
3524
|
this.__wbg_ptr = 0;
|
|
3183
|
-
|
|
3525
|
+
WasmNodeContextFinalization.unregister(this);
|
|
3184
3526
|
return ptr;
|
|
3185
3527
|
}
|
|
3186
3528
|
free() {
|
|
3187
3529
|
const ptr = this.__destroy_into_raw();
|
|
3188
|
-
wasm.
|
|
3189
|
-
}
|
|
3190
|
-
/**
|
|
3191
|
-
* @returns {boolean}
|
|
3192
|
-
*/
|
|
3193
|
-
anyEnabled() {
|
|
3194
|
-
const ret = wasm.wasmmetadataconfig_anyEnabled(this.__wbg_ptr);
|
|
3195
|
-
return ret !== 0;
|
|
3196
|
-
}
|
|
3197
|
-
/**
|
|
3198
|
-
* @param {WasmMetadataConfigUpdate} _update
|
|
3199
|
-
*/
|
|
3200
|
-
applyUpdate(_update) {
|
|
3201
|
-
_assertClass(_update, WasmMetadataConfigUpdate);
|
|
3202
|
-
var ptr0 = _update.__destroy_into_raw();
|
|
3203
|
-
wasm.wasmmetadataconfig_applyUpdate(this.__wbg_ptr, ptr0);
|
|
3204
|
-
}
|
|
3205
|
-
/**
|
|
3206
|
-
* @returns {WasmMetadataConfig}
|
|
3207
|
-
*/
|
|
3208
|
-
static default() {
|
|
3209
|
-
const ret = wasm.wasmmetadataconfig_default();
|
|
3210
|
-
return WasmMetadataConfig.__wrap(ret);
|
|
3530
|
+
wasm.__wbg_wasmnodecontext_free(ptr, 0);
|
|
3211
3531
|
}
|
|
3212
3532
|
/**
|
|
3213
|
-
* @returns {
|
|
3214
|
-
*/
|
|
3215
|
-
get extractDocument() {
|
|
3216
|
-
const ret = wasm.wasmmetadataconfig_extractDocument(this.__wbg_ptr);
|
|
3217
|
-
return ret !== 0;
|
|
3218
|
-
}
|
|
3219
|
-
/**
|
|
3220
|
-
* @returns {boolean}
|
|
3533
|
+
* @returns {WasmConversionResult}
|
|
3221
3534
|
*/
|
|
3222
|
-
get
|
|
3223
|
-
const ret = wasm.
|
|
3224
|
-
return ret
|
|
3535
|
+
get attributes() {
|
|
3536
|
+
const ret = wasm.wasmnodecontext_attributes(this.__wbg_ptr);
|
|
3537
|
+
return takeObject(ret);
|
|
3225
3538
|
}
|
|
3226
3539
|
/**
|
|
3227
|
-
* @returns {
|
|
3540
|
+
* @returns {number}
|
|
3228
3541
|
*/
|
|
3229
|
-
get
|
|
3230
|
-
const ret = wasm.
|
|
3231
|
-
return ret
|
|
3542
|
+
get depth() {
|
|
3543
|
+
const ret = wasm.wasmnodecontext_depth(this.__wbg_ptr);
|
|
3544
|
+
return ret >>> 0;
|
|
3232
3545
|
}
|
|
3233
3546
|
/**
|
|
3234
|
-
* @returns {
|
|
3547
|
+
* @returns {number}
|
|
3235
3548
|
*/
|
|
3236
|
-
get
|
|
3237
|
-
const ret = wasm.
|
|
3238
|
-
return ret
|
|
3549
|
+
get indexInParent() {
|
|
3550
|
+
const ret = wasm.wasmnodecontext_indexInParent(this.__wbg_ptr);
|
|
3551
|
+
return ret >>> 0;
|
|
3239
3552
|
}
|
|
3240
3553
|
/**
|
|
3241
3554
|
* @returns {boolean}
|
|
3242
3555
|
*/
|
|
3243
|
-
get
|
|
3244
|
-
const ret = wasm.
|
|
3556
|
+
get isInline() {
|
|
3557
|
+
const ret = wasm.wasmnodecontext_isInline(this.__wbg_ptr);
|
|
3245
3558
|
return ret !== 0;
|
|
3246
3559
|
}
|
|
3247
3560
|
/**
|
|
3248
|
-
* @param {
|
|
3249
|
-
* @
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
return WasmMetadataConfig.__wrap(ret);
|
|
3256
|
-
}
|
|
3257
|
-
/**
|
|
3258
|
-
* @param {WasmMetadataConfigUpdate} update
|
|
3259
|
-
* @returns {WasmMetadataConfig}
|
|
3260
|
-
*/
|
|
3261
|
-
static fromUpdate(update) {
|
|
3262
|
-
_assertClass(update, WasmMetadataConfigUpdate);
|
|
3263
|
-
var ptr0 = update.__destroy_into_raw();
|
|
3264
|
-
const ret = wasm.wasmmetadataconfig_fromUpdate(ptr0);
|
|
3265
|
-
return WasmMetadataConfig.__wrap(ret);
|
|
3266
|
-
}
|
|
3267
|
-
/**
|
|
3268
|
-
* @returns {number}
|
|
3269
|
-
*/
|
|
3270
|
-
get maxStructuredDataSize() {
|
|
3271
|
-
const ret = wasm.wasmmetadataconfig_maxStructuredDataSize(this.__wbg_ptr);
|
|
3272
|
-
return ret >>> 0;
|
|
3273
|
-
}
|
|
3274
|
-
/**
|
|
3275
|
-
* @param {boolean | null} [extract_document]
|
|
3276
|
-
* @param {boolean | null} [extract_headers]
|
|
3277
|
-
* @param {boolean | null} [extract_links]
|
|
3278
|
-
* @param {boolean | null} [extract_images]
|
|
3279
|
-
* @param {boolean | null} [extract_structured_data]
|
|
3280
|
-
* @param {number | null} [max_structured_data_size]
|
|
3561
|
+
* @param {WasmNodeType} node_type
|
|
3562
|
+
* @param {string} tag_name
|
|
3563
|
+
* @param {any} attributes
|
|
3564
|
+
* @param {number} depth
|
|
3565
|
+
* @param {number} index_in_parent
|
|
3566
|
+
* @param {boolean} is_inline
|
|
3567
|
+
* @param {string | null} [parent_tag]
|
|
3281
3568
|
*/
|
|
3282
|
-
constructor(
|
|
3283
|
-
const
|
|
3569
|
+
constructor(node_type, tag_name, attributes, depth, index_in_parent, is_inline, parent_tag) {
|
|
3570
|
+
const ptr0 = passStringToWasm0(tag_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3571
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3572
|
+
var ptr1 = isLikeNone(parent_tag) ? 0 : passStringToWasm0(parent_tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3573
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3574
|
+
const ret = wasm.wasmnodecontext_new(node_type, ptr0, len0, addHeapObject(attributes), depth, index_in_parent, is_inline, ptr1, len1);
|
|
3284
3575
|
this.__wbg_ptr = ret >>> 0;
|
|
3285
|
-
|
|
3576
|
+
WasmNodeContextFinalization.register(this, this.__wbg_ptr, this);
|
|
3286
3577
|
return this;
|
|
3287
3578
|
}
|
|
3288
3579
|
/**
|
|
3289
|
-
* @
|
|
3290
|
-
*/
|
|
3291
|
-
set extractDocument(value) {
|
|
3292
|
-
wasm.wasmmetadataconfig_set_extractDocument(this.__wbg_ptr, value);
|
|
3293
|
-
}
|
|
3294
|
-
/**
|
|
3295
|
-
* @param {boolean} value
|
|
3580
|
+
* @returns {WasmNodeType}
|
|
3296
3581
|
*/
|
|
3297
|
-
|
|
3298
|
-
wasm.
|
|
3299
|
-
|
|
3300
|
-
/**
|
|
3301
|
-
* @param {boolean} value
|
|
3302
|
-
*/
|
|
3303
|
-
set extractImages(value) {
|
|
3304
|
-
wasm.wasmmetadataconfig_set_extractImages(this.__wbg_ptr, value);
|
|
3582
|
+
get nodeType() {
|
|
3583
|
+
const ret = wasm.wasmnodecontext_nodeType(this.__wbg_ptr);
|
|
3584
|
+
return ret;
|
|
3305
3585
|
}
|
|
3306
3586
|
/**
|
|
3307
|
-
* @
|
|
3587
|
+
* @returns {string | undefined}
|
|
3308
3588
|
*/
|
|
3309
|
-
|
|
3310
|
-
|
|
3589
|
+
get parentTag() {
|
|
3590
|
+
try {
|
|
3591
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3592
|
+
wasm.wasmnodecontext_parentTag(retptr, this.__wbg_ptr);
|
|
3593
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3594
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3595
|
+
let v1;
|
|
3596
|
+
if (r0 !== 0) {
|
|
3597
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3598
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3599
|
+
}
|
|
3600
|
+
return v1;
|
|
3601
|
+
} finally {
|
|
3602
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3603
|
+
}
|
|
3311
3604
|
}
|
|
3312
3605
|
/**
|
|
3313
|
-
* @param {
|
|
3606
|
+
* @param {any} value
|
|
3314
3607
|
*/
|
|
3315
|
-
set
|
|
3316
|
-
wasm.
|
|
3608
|
+
set attributes(value) {
|
|
3609
|
+
wasm.wasmnodecontext_set_attributes(this.__wbg_ptr, addHeapObject(value));
|
|
3317
3610
|
}
|
|
3318
3611
|
/**
|
|
3319
3612
|
* @param {number} value
|
|
3320
3613
|
*/
|
|
3321
|
-
set
|
|
3322
|
-
wasm.
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
|
-
if (Symbol.dispose) WasmMetadataConfig.prototype[Symbol.dispose] = WasmMetadataConfig.prototype.free;
|
|
3326
|
-
|
|
3327
|
-
export class WasmMetadataConfigUpdate {
|
|
3328
|
-
__destroy_into_raw() {
|
|
3329
|
-
const ptr = this.__wbg_ptr;
|
|
3330
|
-
this.__wbg_ptr = 0;
|
|
3331
|
-
WasmMetadataConfigUpdateFinalization.unregister(this);
|
|
3332
|
-
return ptr;
|
|
3333
|
-
}
|
|
3334
|
-
free() {
|
|
3335
|
-
const ptr = this.__destroy_into_raw();
|
|
3336
|
-
wasm.__wbg_wasmmetadataconfigupdate_free(ptr, 0);
|
|
3337
|
-
}
|
|
3338
|
-
/**
|
|
3339
|
-
* @returns {boolean | undefined}
|
|
3340
|
-
*/
|
|
3341
|
-
get extractDocument() {
|
|
3342
|
-
const ret = wasm.wasmmetadataconfigupdate_extractDocument(this.__wbg_ptr);
|
|
3343
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3344
|
-
}
|
|
3345
|
-
/**
|
|
3346
|
-
* @returns {boolean | undefined}
|
|
3347
|
-
*/
|
|
3348
|
-
get extractHeaders() {
|
|
3349
|
-
const ret = wasm.wasmmetadataconfigupdate_extractHeaders(this.__wbg_ptr);
|
|
3350
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3351
|
-
}
|
|
3352
|
-
/**
|
|
3353
|
-
* @returns {boolean | undefined}
|
|
3354
|
-
*/
|
|
3355
|
-
get extractImages() {
|
|
3356
|
-
const ret = wasm.wasmmetadataconfigupdate_extractImages(this.__wbg_ptr);
|
|
3357
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3358
|
-
}
|
|
3359
|
-
/**
|
|
3360
|
-
* @returns {boolean | undefined}
|
|
3361
|
-
*/
|
|
3362
|
-
get extractLinks() {
|
|
3363
|
-
const ret = wasm.wasmmetadataconfigupdate_extractLinks(this.__wbg_ptr);
|
|
3364
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3365
|
-
}
|
|
3366
|
-
/**
|
|
3367
|
-
* @returns {boolean | undefined}
|
|
3368
|
-
*/
|
|
3369
|
-
get extractStructuredData() {
|
|
3370
|
-
const ret = wasm.wasmmetadataconfigupdate_extractStructuredData(this.__wbg_ptr);
|
|
3371
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3372
|
-
}
|
|
3373
|
-
/**
|
|
3374
|
-
* @returns {number | undefined}
|
|
3375
|
-
*/
|
|
3376
|
-
get maxStructuredDataSize() {
|
|
3377
|
-
const ret = wasm.wasmmetadataconfigupdate_maxStructuredDataSize(this.__wbg_ptr);
|
|
3378
|
-
return ret === 0x100000001 ? undefined : ret;
|
|
3379
|
-
}
|
|
3380
|
-
/**
|
|
3381
|
-
* @param {boolean | null} [extract_document]
|
|
3382
|
-
* @param {boolean | null} [extract_headers]
|
|
3383
|
-
* @param {boolean | null} [extract_links]
|
|
3384
|
-
* @param {boolean | null} [extract_images]
|
|
3385
|
-
* @param {boolean | null} [extract_structured_data]
|
|
3386
|
-
* @param {number | null} [max_structured_data_size]
|
|
3387
|
-
*/
|
|
3388
|
-
constructor(extract_document, extract_headers, extract_links, extract_images, extract_structured_data, max_structured_data_size) {
|
|
3389
|
-
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);
|
|
3390
|
-
this.__wbg_ptr = ret >>> 0;
|
|
3391
|
-
WasmMetadataConfigUpdateFinalization.register(this, this.__wbg_ptr, this);
|
|
3392
|
-
return this;
|
|
3614
|
+
set depth(value) {
|
|
3615
|
+
wasm.wasmnodecontext_set_depth(this.__wbg_ptr, value);
|
|
3393
3616
|
}
|
|
3394
3617
|
/**
|
|
3395
|
-
* @param {
|
|
3618
|
+
* @param {number} value
|
|
3396
3619
|
*/
|
|
3397
|
-
set
|
|
3398
|
-
wasm.
|
|
3620
|
+
set indexInParent(value) {
|
|
3621
|
+
wasm.wasmnodecontext_set_indexInParent(this.__wbg_ptr, value);
|
|
3399
3622
|
}
|
|
3400
3623
|
/**
|
|
3401
|
-
* @param {boolean
|
|
3624
|
+
* @param {boolean} value
|
|
3402
3625
|
*/
|
|
3403
|
-
set
|
|
3404
|
-
wasm.
|
|
3626
|
+
set isInline(value) {
|
|
3627
|
+
wasm.wasmnodecontext_set_isInline(this.__wbg_ptr, value);
|
|
3405
3628
|
}
|
|
3406
3629
|
/**
|
|
3407
|
-
* @param {
|
|
3630
|
+
* @param {WasmNodeType} value
|
|
3408
3631
|
*/
|
|
3409
|
-
set
|
|
3410
|
-
wasm.
|
|
3632
|
+
set nodeType(value) {
|
|
3633
|
+
wasm.wasmnodecontext_set_nodeType(this.__wbg_ptr, value);
|
|
3411
3634
|
}
|
|
3412
3635
|
/**
|
|
3413
|
-
* @param {
|
|
3636
|
+
* @param {string | null} [value]
|
|
3414
3637
|
*/
|
|
3415
|
-
set
|
|
3416
|
-
|
|
3638
|
+
set parentTag(value) {
|
|
3639
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3640
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3641
|
+
wasm.wasmnodecontext_set_parentTag(this.__wbg_ptr, ptr0, len0);
|
|
3417
3642
|
}
|
|
3418
3643
|
/**
|
|
3419
|
-
* @param {
|
|
3644
|
+
* @param {string} value
|
|
3420
3645
|
*/
|
|
3421
|
-
set
|
|
3422
|
-
|
|
3646
|
+
set tagName(value) {
|
|
3647
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3648
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3649
|
+
wasm.wasmnodecontext_set_tagName(this.__wbg_ptr, ptr0, len0);
|
|
3423
3650
|
}
|
|
3424
3651
|
/**
|
|
3425
|
-
* @
|
|
3652
|
+
* @returns {string}
|
|
3426
3653
|
*/
|
|
3427
|
-
|
|
3428
|
-
|
|
3654
|
+
get tagName() {
|
|
3655
|
+
let deferred1_0;
|
|
3656
|
+
let deferred1_1;
|
|
3657
|
+
try {
|
|
3658
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3659
|
+
wasm.wasmnodecontext_tagName(retptr, this.__wbg_ptr);
|
|
3660
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3661
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3662
|
+
deferred1_0 = r0;
|
|
3663
|
+
deferred1_1 = r1;
|
|
3664
|
+
return getStringFromWasm0(r0, r1);
|
|
3665
|
+
} finally {
|
|
3666
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3667
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3668
|
+
}
|
|
3429
3669
|
}
|
|
3430
3670
|
}
|
|
3431
|
-
if (Symbol.dispose)
|
|
3671
|
+
if (Symbol.dispose) WasmNodeContext.prototype[Symbol.dispose] = WasmNodeContext.prototype.free;
|
|
3432
3672
|
|
|
3433
3673
|
/**
|
|
3434
|
-
*
|
|
3674
|
+
* Node type enumeration covering all HTML element types.
|
|
3675
|
+
*
|
|
3676
|
+
* This enum categorizes all HTML elements that the converter recognizes,
|
|
3677
|
+
* providing a coarse-grained classification for visitor dispatch.
|
|
3678
|
+
* @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}
|
|
3435
3679
|
*/
|
|
3436
|
-
export const
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3680
|
+
export const WasmNodeType = Object.freeze({
|
|
3681
|
+
Text: 0, "0": "Text",
|
|
3682
|
+
Element: 1, "1": "Element",
|
|
3683
|
+
Heading: 2, "2": "Heading",
|
|
3684
|
+
Paragraph: 3, "3": "Paragraph",
|
|
3685
|
+
Div: 4, "4": "Div",
|
|
3686
|
+
Blockquote: 5, "5": "Blockquote",
|
|
3687
|
+
Pre: 6, "6": "Pre",
|
|
3688
|
+
Hr: 7, "7": "Hr",
|
|
3689
|
+
List: 8, "8": "List",
|
|
3690
|
+
ListItem: 9, "9": "ListItem",
|
|
3691
|
+
DefinitionList: 10, "10": "DefinitionList",
|
|
3692
|
+
DefinitionTerm: 11, "11": "DefinitionTerm",
|
|
3693
|
+
DefinitionDescription: 12, "12": "DefinitionDescription",
|
|
3694
|
+
Table: 13, "13": "Table",
|
|
3695
|
+
TableRow: 14, "14": "TableRow",
|
|
3696
|
+
TableCell: 15, "15": "TableCell",
|
|
3697
|
+
TableHeader: 16, "16": "TableHeader",
|
|
3698
|
+
TableBody: 17, "17": "TableBody",
|
|
3699
|
+
TableHead: 18, "18": "TableHead",
|
|
3700
|
+
TableFoot: 19, "19": "TableFoot",
|
|
3701
|
+
Link: 20, "20": "Link",
|
|
3702
|
+
Image: 21, "21": "Image",
|
|
3703
|
+
Strong: 22, "22": "Strong",
|
|
3704
|
+
Em: 23, "23": "Em",
|
|
3705
|
+
Code: 24, "24": "Code",
|
|
3706
|
+
Strikethrough: 25, "25": "Strikethrough",
|
|
3707
|
+
Underline: 26, "26": "Underline",
|
|
3708
|
+
Subscript: 27, "27": "Subscript",
|
|
3709
|
+
Superscript: 28, "28": "Superscript",
|
|
3710
|
+
Mark: 29, "29": "Mark",
|
|
3711
|
+
Small: 30, "30": "Small",
|
|
3712
|
+
Br: 31, "31": "Br",
|
|
3713
|
+
Span: 32, "32": "Span",
|
|
3714
|
+
Article: 33, "33": "Article",
|
|
3715
|
+
Section: 34, "34": "Section",
|
|
3716
|
+
Nav: 35, "35": "Nav",
|
|
3717
|
+
Aside: 36, "36": "Aside",
|
|
3718
|
+
Header: 37, "37": "Header",
|
|
3719
|
+
Footer: 38, "38": "Footer",
|
|
3720
|
+
Main: 39, "39": "Main",
|
|
3721
|
+
Figure: 40, "40": "Figure",
|
|
3722
|
+
Figcaption: 41, "41": "Figcaption",
|
|
3723
|
+
Time: 42, "42": "Time",
|
|
3724
|
+
Details: 43, "43": "Details",
|
|
3725
|
+
Summary: 44, "44": "Summary",
|
|
3726
|
+
Form: 45, "45": "Form",
|
|
3727
|
+
Input: 46, "46": "Input",
|
|
3728
|
+
Select: 47, "47": "Select",
|
|
3729
|
+
Option: 48, "48": "Option",
|
|
3730
|
+
Button: 49, "49": "Button",
|
|
3731
|
+
Textarea: 50, "50": "Textarea",
|
|
3732
|
+
Label: 51, "51": "Label",
|
|
3733
|
+
Fieldset: 52, "52": "Fieldset",
|
|
3734
|
+
Legend: 53, "53": "Legend",
|
|
3735
|
+
Audio: 54, "54": "Audio",
|
|
3736
|
+
Video: 55, "55": "Video",
|
|
3737
|
+
Picture: 56, "56": "Picture",
|
|
3738
|
+
Source: 57, "57": "Source",
|
|
3739
|
+
Iframe: 58, "58": "Iframe",
|
|
3740
|
+
Svg: 59, "59": "Svg",
|
|
3741
|
+
Canvas: 60, "60": "Canvas",
|
|
3742
|
+
Ruby: 61, "61": "Ruby",
|
|
3743
|
+
Rt: 62, "62": "Rt",
|
|
3744
|
+
Rp: 63, "63": "Rp",
|
|
3745
|
+
Abbr: 64, "64": "Abbr",
|
|
3746
|
+
Kbd: 65, "65": "Kbd",
|
|
3747
|
+
Samp: 66, "66": "Samp",
|
|
3748
|
+
Var: 67, "67": "Var",
|
|
3749
|
+
Cite: 68, "68": "Cite",
|
|
3750
|
+
Q: 69, "69": "Q",
|
|
3751
|
+
Del: 70, "70": "Del",
|
|
3752
|
+
Ins: 71, "71": "Ins",
|
|
3753
|
+
Data: 72, "72": "Data",
|
|
3754
|
+
Meter: 73, "73": "Meter",
|
|
3755
|
+
Progress: 74, "74": "Progress",
|
|
3756
|
+
Output: 75, "75": "Output",
|
|
3757
|
+
Template: 76, "76": "Template",
|
|
3758
|
+
Slot: 77, "77": "Slot",
|
|
3759
|
+
Html: 78, "78": "Html",
|
|
3760
|
+
Head: 79, "79": "Head",
|
|
3761
|
+
Body: 80, "80": "Body",
|
|
3762
|
+
Title: 81, "81": "Title",
|
|
3763
|
+
Meta: 82, "82": "Meta",
|
|
3764
|
+
LinkTag: 83, "83": "LinkTag",
|
|
3765
|
+
Style: 84, "84": "Style",
|
|
3766
|
+
Script: 85, "85": "Script",
|
|
3767
|
+
Base: 86, "86": "Base",
|
|
3768
|
+
Custom: 87, "87": "Custom",
|
|
3458
3769
|
});
|
|
3459
3770
|
|
|
3460
3771
|
/**
|
|
3772
|
+
* Output format for conversion.
|
|
3773
|
+
*
|
|
3774
|
+
* Specifies the target markup language format for the conversion output.
|
|
3461
3775
|
* @enum {0 | 1 | 2}
|
|
3462
3776
|
*/
|
|
3463
3777
|
export const WasmOutputFormat = Object.freeze({
|
|
@@ -3466,6 +3780,9 @@ export const WasmOutputFormat = Object.freeze({
|
|
|
3466
3780
|
Plain: 2, "2": "Plain",
|
|
3467
3781
|
});
|
|
3468
3782
|
|
|
3783
|
+
/**
|
|
3784
|
+
* HTML preprocessing options for document cleanup before conversion.
|
|
3785
|
+
*/
|
|
3469
3786
|
export class WasmPreprocessingOptions {
|
|
3470
3787
|
static __wrap(ptr) {
|
|
3471
3788
|
ptr = ptr >>> 0;
|
|
@@ -3485,6 +3802,14 @@ export class WasmPreprocessingOptions {
|
|
|
3485
3802
|
wasm.__wbg_wasmpreprocessingoptions_free(ptr, 0);
|
|
3486
3803
|
}
|
|
3487
3804
|
/**
|
|
3805
|
+
* Apply a partial update to these preprocessing options.
|
|
3806
|
+
*
|
|
3807
|
+
* Any specified fields in the update will override the current values.
|
|
3808
|
+
* Unspecified fields (None) are left unchanged.
|
|
3809
|
+
*
|
|
3810
|
+
* # Arguments
|
|
3811
|
+
*
|
|
3812
|
+
* * `update` - Partial preprocessing options update
|
|
3488
3813
|
* @param {WasmPreprocessingOptionsUpdate} _update
|
|
3489
3814
|
*/
|
|
3490
3815
|
applyUpdate(_update) {
|
|
@@ -3517,6 +3842,18 @@ export class WasmPreprocessingOptions {
|
|
|
3517
3842
|
return WasmPreprocessingOptions.__wrap(ret);
|
|
3518
3843
|
}
|
|
3519
3844
|
/**
|
|
3845
|
+
* Create new preprocessing options from a partial update.
|
|
3846
|
+
*
|
|
3847
|
+
* Creates a new `PreprocessingOptions` struct with defaults, then applies the update.
|
|
3848
|
+
* Fields not specified in the update keep their default values.
|
|
3849
|
+
*
|
|
3850
|
+
* # Arguments
|
|
3851
|
+
*
|
|
3852
|
+
* * `update` - Partial preprocessing options update
|
|
3853
|
+
*
|
|
3854
|
+
* # Returns
|
|
3855
|
+
*
|
|
3856
|
+
* New `PreprocessingOptions` with specified updates applied to defaults
|
|
3520
3857
|
* @param {WasmPreprocessingOptionsUpdate} update
|
|
3521
3858
|
* @returns {WasmPreprocessingOptions}
|
|
3522
3859
|
*/
|
|
@@ -3586,6 +3923,13 @@ export class WasmPreprocessingOptions {
|
|
|
3586
3923
|
}
|
|
3587
3924
|
if (Symbol.dispose) WasmPreprocessingOptions.prototype[Symbol.dispose] = WasmPreprocessingOptions.prototype.free;
|
|
3588
3925
|
|
|
3926
|
+
/**
|
|
3927
|
+
* Partial update for `PreprocessingOptions`.
|
|
3928
|
+
*
|
|
3929
|
+
* This struct uses `Option<T>` to represent optional fields that can be selectively updated.
|
|
3930
|
+
* Only specified fields (Some values) will override existing options; None values leave the
|
|
3931
|
+
* corresponding fields unchanged when applied via [`PreprocessingOptions::apply_update`].
|
|
3932
|
+
*/
|
|
3589
3933
|
export class WasmPreprocessingOptionsUpdate {
|
|
3590
3934
|
static __wrap(ptr) {
|
|
3591
3935
|
ptr = ptr >>> 0;
|
|
@@ -3672,6 +4016,9 @@ export class WasmPreprocessingOptionsUpdate {
|
|
|
3672
4016
|
if (Symbol.dispose) WasmPreprocessingOptionsUpdate.prototype[Symbol.dispose] = WasmPreprocessingOptionsUpdate.prototype.free;
|
|
3673
4017
|
|
|
3674
4018
|
/**
|
|
4019
|
+
* HTML preprocessing aggressiveness level.
|
|
4020
|
+
*
|
|
4021
|
+
* Controls the extent of cleanup performed before conversion. Higher levels remove more elements.
|
|
3675
4022
|
* @enum {0 | 1 | 2}
|
|
3676
4023
|
*/
|
|
3677
4024
|
export const WasmPreprocessingPreset = Object.freeze({
|
|
@@ -3680,6 +4027,9 @@ export const WasmPreprocessingPreset = Object.freeze({
|
|
|
3680
4027
|
Aggressive: 2, "2": "Aggressive",
|
|
3681
4028
|
});
|
|
3682
4029
|
|
|
4030
|
+
/**
|
|
4031
|
+
* A non-fatal warning generated during HTML processing.
|
|
4032
|
+
*/
|
|
3683
4033
|
export class WasmProcessingWarning {
|
|
3684
4034
|
static __wrap(ptr) {
|
|
3685
4035
|
ptr = ptr >>> 0;
|
|
@@ -3727,7 +4077,7 @@ export class WasmProcessingWarning {
|
|
|
3727
4077
|
return getStringFromWasm0(r0, r1);
|
|
3728
4078
|
} finally {
|
|
3729
4079
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3730
|
-
wasm.
|
|
4080
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3731
4081
|
}
|
|
3732
4082
|
}
|
|
3733
4083
|
/**
|
|
@@ -3759,6 +4109,25 @@ export class WasmProcessingWarning {
|
|
|
3759
4109
|
}
|
|
3760
4110
|
if (Symbol.dispose) WasmProcessingWarning.prototype[Symbol.dispose] = WasmProcessingWarning.prototype.free;
|
|
3761
4111
|
|
|
4112
|
+
/**
|
|
4113
|
+
* Structured data block (JSON-LD, Microdata, or RDFa).
|
|
4114
|
+
*
|
|
4115
|
+
* Represents machine-readable structured data found in the document.
|
|
4116
|
+
* JSON-LD blocks are collected as raw JSON strings for flexibility.
|
|
4117
|
+
*
|
|
4118
|
+
* # Examples
|
|
4119
|
+
*
|
|
4120
|
+
* ```
|
|
4121
|
+
* # use html_to_markdown_rs::metadata::{StructuredData, StructuredDataType};
|
|
4122
|
+
* let schema = StructuredData {
|
|
4123
|
+
* data_type: StructuredDataType::JsonLd,
|
|
4124
|
+
* raw_json: r#"{"@context":"https://schema.org","@type":"Article"}"#.to_string(),
|
|
4125
|
+
* schema_type: Some("Article".to_string()),
|
|
4126
|
+
* };
|
|
4127
|
+
*
|
|
4128
|
+
* assert_eq!(schema.data_type, StructuredDataType::JsonLd);
|
|
4129
|
+
* ```
|
|
4130
|
+
*/
|
|
3762
4131
|
export class WasmStructuredData {
|
|
3763
4132
|
static __wrap(ptr) {
|
|
3764
4133
|
ptr = ptr >>> 0;
|
|
@@ -3821,7 +4190,7 @@ export class WasmStructuredData {
|
|
|
3821
4190
|
return getStringFromWasm0(r0, r1);
|
|
3822
4191
|
} finally {
|
|
3823
4192
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3824
|
-
wasm.
|
|
4193
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3825
4194
|
}
|
|
3826
4195
|
}
|
|
3827
4196
|
/**
|
|
@@ -3836,7 +4205,7 @@ export class WasmStructuredData {
|
|
|
3836
4205
|
let v1;
|
|
3837
4206
|
if (r0 !== 0) {
|
|
3838
4207
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3839
|
-
wasm.
|
|
4208
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3840
4209
|
}
|
|
3841
4210
|
return v1;
|
|
3842
4211
|
} finally {
|
|
@@ -3869,6 +4238,9 @@ export class WasmStructuredData {
|
|
|
3869
4238
|
if (Symbol.dispose) WasmStructuredData.prototype[Symbol.dispose] = WasmStructuredData.prototype.free;
|
|
3870
4239
|
|
|
3871
4240
|
/**
|
|
4241
|
+
* Structured data format type.
|
|
4242
|
+
*
|
|
4243
|
+
* Identifies the schema/format used for structured data markup.
|
|
3872
4244
|
* @enum {0 | 1 | 2}
|
|
3873
4245
|
*/
|
|
3874
4246
|
export const WasmStructuredDataType = Object.freeze({
|
|
@@ -3877,6 +4249,9 @@ export const WasmStructuredDataType = Object.freeze({
|
|
|
3877
4249
|
RDFa: 2, "2": "RDFa",
|
|
3878
4250
|
});
|
|
3879
4251
|
|
|
4252
|
+
/**
|
|
4253
|
+
* A top-level extracted table with both structured data and markdown representation.
|
|
4254
|
+
*/
|
|
3880
4255
|
export class WasmTableData {
|
|
3881
4256
|
static __wrap(ptr) {
|
|
3882
4257
|
ptr = ptr >>> 0;
|
|
@@ -3924,7 +4299,7 @@ export class WasmTableData {
|
|
|
3924
4299
|
return getStringFromWasm0(r0, r1);
|
|
3925
4300
|
} finally {
|
|
3926
4301
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3927
|
-
wasm.
|
|
4302
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3928
4303
|
}
|
|
3929
4304
|
}
|
|
3930
4305
|
/**
|
|
@@ -3960,6 +4335,9 @@ export class WasmTableData {
|
|
|
3960
4335
|
}
|
|
3961
4336
|
if (Symbol.dispose) WasmTableData.prototype[Symbol.dispose] = WasmTableData.prototype.free;
|
|
3962
4337
|
|
|
4338
|
+
/**
|
|
4339
|
+
* A structured table grid with cell-level data including spans.
|
|
4340
|
+
*/
|
|
3963
4341
|
export class WasmTableGrid {
|
|
3964
4342
|
static __wrap(ptr) {
|
|
3965
4343
|
ptr = ptr >>> 0;
|
|
@@ -3988,7 +4366,7 @@ export class WasmTableGrid {
|
|
|
3988
4366
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3989
4367
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3990
4368
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
3991
|
-
wasm.
|
|
4369
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
3992
4370
|
return v1;
|
|
3993
4371
|
} finally {
|
|
3994
4372
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -4044,6 +4422,11 @@ export class WasmTableGrid {
|
|
|
4044
4422
|
}
|
|
4045
4423
|
if (Symbol.dispose) WasmTableGrid.prototype[Symbol.dispose] = WasmTableGrid.prototype.free;
|
|
4046
4424
|
|
|
4425
|
+
/**
|
|
4426
|
+
* An inline text annotation with byte-range offsets.
|
|
4427
|
+
*
|
|
4428
|
+
* Annotations describe formatting (bold, italic, etc.) and links within a node's text content.
|
|
4429
|
+
*/
|
|
4047
4430
|
export class WasmTextAnnotation {
|
|
4048
4431
|
static __wrap(ptr) {
|
|
4049
4432
|
ptr = ptr >>> 0;
|
|
@@ -4122,6 +4505,9 @@ export class WasmTextAnnotation {
|
|
|
4122
4505
|
if (Symbol.dispose) WasmTextAnnotation.prototype[Symbol.dispose] = WasmTextAnnotation.prototype.free;
|
|
4123
4506
|
|
|
4124
4507
|
/**
|
|
4508
|
+
* Text directionality of document content.
|
|
4509
|
+
*
|
|
4510
|
+
* Corresponds to the HTML `dir` attribute and `bdi` element directionality.
|
|
4125
4511
|
* @enum {0 | 1 | 2}
|
|
4126
4512
|
*/
|
|
4127
4513
|
export const WasmTextDirection = Object.freeze({
|
|
@@ -4131,6 +4517,23 @@ export const WasmTextDirection = Object.freeze({
|
|
|
4131
4517
|
});
|
|
4132
4518
|
|
|
4133
4519
|
/**
|
|
4520
|
+
* Result of a visitor callback.
|
|
4521
|
+
*
|
|
4522
|
+
* Allows visitors to control the conversion flow by either proceeding
|
|
4523
|
+
* with default behavior, providing custom output, skipping elements,
|
|
4524
|
+
* preserving HTML, or signaling errors.
|
|
4525
|
+
* @enum {0 | 1 | 2 | 3 | 4}
|
|
4526
|
+
*/
|
|
4527
|
+
export const WasmVisitResult = Object.freeze({
|
|
4528
|
+
Continue: 0, "0": "Continue",
|
|
4529
|
+
Custom: 1, "1": "Custom",
|
|
4530
|
+
Skip: 2, "2": "Skip",
|
|
4531
|
+
PreserveHtml: 3, "3": "PreserveHtml",
|
|
4532
|
+
Error: 4, "4": "Error",
|
|
4533
|
+
});
|
|
4534
|
+
|
|
4535
|
+
/**
|
|
4536
|
+
* Categories of processing warnings.
|
|
4134
4537
|
* @enum {0 | 1 | 2 | 3 | 4 | 5}
|
|
4135
4538
|
*/
|
|
4136
4539
|
export const WasmWarningKind = Object.freeze({
|
|
@@ -4143,6 +4546,9 @@ export const WasmWarningKind = Object.freeze({
|
|
|
4143
4546
|
});
|
|
4144
4547
|
|
|
4145
4548
|
/**
|
|
4549
|
+
* Whitespace handling strategy during conversion.
|
|
4550
|
+
*
|
|
4551
|
+
* Determines how sequences of whitespace characters (spaces, tabs, newlines) are processed.
|
|
4146
4552
|
* @enum {0 | 1}
|
|
4147
4553
|
*/
|
|
4148
4554
|
export const WasmWhitespaceMode = Object.freeze({
|
|
@@ -4153,9 +4559,10 @@ export const WasmWhitespaceMode = Object.freeze({
|
|
|
4153
4559
|
/**
|
|
4154
4560
|
* @param {string} html
|
|
4155
4561
|
* @param {WasmConversionOptions | null} [options]
|
|
4562
|
+
* @param {any | null} [visitor]
|
|
4156
4563
|
* @returns {WasmConversionResult}
|
|
4157
4564
|
*/
|
|
4158
|
-
export function convert(html, options) {
|
|
4565
|
+
export function convert(html, options, visitor) {
|
|
4159
4566
|
try {
|
|
4160
4567
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4161
4568
|
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -4165,7 +4572,7 @@ export function convert(html, options) {
|
|
|
4165
4572
|
_assertClass(options, WasmConversionOptions);
|
|
4166
4573
|
ptr1 = options.__destroy_into_raw();
|
|
4167
4574
|
}
|
|
4168
|
-
wasm.convert(retptr, ptr0, len0, ptr1);
|
|
4575
|
+
wasm.convert(retptr, ptr0, len0, ptr1, isLikeNone(visitor) ? 0 : addHeapObject(visitor));
|
|
4169
4576
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4170
4577
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4171
4578
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -4181,6 +4588,10 @@ export function __wbg_Error_960c155d3d49e4c2(arg0, arg1) {
|
|
|
4181
4588
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
4182
4589
|
return addHeapObject(ret);
|
|
4183
4590
|
}
|
|
4591
|
+
export function __wbg___wbindgen_is_function_3baa9db1a987f47d(arg0) {
|
|
4592
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
4593
|
+
return ret;
|
|
4594
|
+
}
|
|
4184
4595
|
export function __wbg___wbindgen_is_string_6df3bf7ef1164ed3(arg0) {
|
|
4185
4596
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
4186
4597
|
return ret;
|
|
@@ -4200,14 +4611,38 @@ export function __wbg___wbindgen_string_get_7ed5322991caaec5(arg0, arg1) {
|
|
|
4200
4611
|
export function __wbg___wbindgen_throw_6b64449b9b9ed33c(arg0, arg1) {
|
|
4201
4612
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
4202
4613
|
}
|
|
4614
|
+
export function __wbg_apply_4c35bd236dda9c14() { return handleError(function (arg0, arg1, arg2) {
|
|
4615
|
+
const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
|
|
4616
|
+
return addHeapObject(ret);
|
|
4617
|
+
}, arguments); }
|
|
4618
|
+
export function __wbg_get_6011fa3a58f61074() { return handleError(function (arg0, arg1) {
|
|
4619
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
4620
|
+
return addHeapObject(ret);
|
|
4621
|
+
}, arguments); }
|
|
4622
|
+
export function __wbg_has_880f1d472f7cecba() { return handleError(function (arg0, arg1) {
|
|
4623
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
4624
|
+
return ret;
|
|
4625
|
+
}, arguments); }
|
|
4203
4626
|
export function __wbg_new_34d45cc8e36aaead() {
|
|
4204
4627
|
const ret = new Map();
|
|
4205
4628
|
return addHeapObject(ret);
|
|
4206
4629
|
}
|
|
4630
|
+
export function __wbg_new_682678e2f47e32bc() {
|
|
4631
|
+
const ret = new Array();
|
|
4632
|
+
return addHeapObject(ret);
|
|
4633
|
+
}
|
|
4207
4634
|
export function __wbg_new_aa8d0fa9762c29bd() {
|
|
4208
4635
|
const ret = new Object();
|
|
4209
4636
|
return addHeapObject(ret);
|
|
4210
4637
|
}
|
|
4638
|
+
export function __wbg_push_471a5b068a5295f6(arg0, arg1) {
|
|
4639
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
4640
|
+
return ret;
|
|
4641
|
+
}
|
|
4642
|
+
export function __wbg_set_022bee52d0b05b19() { return handleError(function (arg0, arg1, arg2) {
|
|
4643
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
4644
|
+
return ret;
|
|
4645
|
+
}, arguments); }
|
|
4211
4646
|
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
4212
4647
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
4213
4648
|
}
|
|
@@ -4287,7 +4722,12 @@ export function __wbg_wasmtextannotation_unwrap(arg0) {
|
|
|
4287
4722
|
const ret = WasmTextAnnotation.__unwrap(getObject(arg0));
|
|
4288
4723
|
return ret;
|
|
4289
4724
|
}
|
|
4290
|
-
export function __wbindgen_cast_0000000000000001(arg0
|
|
4725
|
+
export function __wbindgen_cast_0000000000000001(arg0) {
|
|
4726
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
4727
|
+
const ret = arg0;
|
|
4728
|
+
return addHeapObject(ret);
|
|
4729
|
+
}
|
|
4730
|
+
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
4291
4731
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
4292
4732
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
4293
4733
|
return addHeapObject(ret);
|
|
@@ -4335,12 +4775,9 @@ const WasmImageMetadataFinalization = (typeof FinalizationRegistry === 'undefine
|
|
|
4335
4775
|
const WasmLinkMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4336
4776
|
? { register: () => {}, unregister: () => {} }
|
|
4337
4777
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmlinkmetadata_free(ptr >>> 0, 1));
|
|
4338
|
-
const
|
|
4778
|
+
const WasmNodeContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4339
4779
|
? { register: () => {}, unregister: () => {} }
|
|
4340
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
4341
|
-
const WasmMetadataConfigUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4342
|
-
? { register: () => {}, unregister: () => {} }
|
|
4343
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmmetadataconfigupdate_free(ptr >>> 0, 1));
|
|
4780
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnodecontext_free(ptr >>> 0, 1));
|
|
4344
4781
|
const WasmPreprocessingOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4345
4782
|
? { register: () => {}, unregister: () => {} }
|
|
4346
4783
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpreprocessingoptions_free(ptr >>> 0, 1));
|
|
@@ -4430,6 +4867,14 @@ function getUint8ArrayMemory0() {
|
|
|
4430
4867
|
|
|
4431
4868
|
function getObject(idx) { return heap[idx]; }
|
|
4432
4869
|
|
|
4870
|
+
function handleError(f, args) {
|
|
4871
|
+
try {
|
|
4872
|
+
return f.apply(this, args);
|
|
4873
|
+
} catch (e) {
|
|
4874
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
|
|
4433
4878
|
let heap = new Array(1024).fill(undefined);
|
|
4434
4879
|
heap.push(undefined, null, true, false);
|
|
4435
4880
|
|