@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
|
@@ -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
|
export const WasmAnnotationKind = Object.freeze({
|
|
@@ -20,6 +23,9 @@ export const WasmAnnotationKind = Object.freeze({
|
|
|
20
23
|
});
|
|
21
24
|
|
|
22
25
|
/**
|
|
26
|
+
* Code block fence style in Markdown output.
|
|
27
|
+
*
|
|
28
|
+
* Determines how code blocks (`<pre><code>`) are rendered in Markdown.
|
|
23
29
|
* @enum {0 | 1 | 2}
|
|
24
30
|
*/
|
|
25
31
|
export const WasmCodeBlockStyle = Object.freeze({
|
|
@@ -28,6 +34,23 @@ export const WasmCodeBlockStyle = Object.freeze({
|
|
|
28
34
|
Tildes: 2, "2": "Tildes",
|
|
29
35
|
});
|
|
30
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Main conversion options for HTML to Markdown conversion.
|
|
39
|
+
*
|
|
40
|
+
* Use [`ConversionOptions::builder()`] to construct, or [`Default::default()`] for defaults.
|
|
41
|
+
*
|
|
42
|
+
* # Example
|
|
43
|
+
*
|
|
44
|
+
* ```text
|
|
45
|
+
* use html_to_markdown_rs::ConversionOptions;
|
|
46
|
+
*
|
|
47
|
+
* let options = ConversionOptions::builder()
|
|
48
|
+
* .heading_style(HeadingStyle::Atx)
|
|
49
|
+
* .wrap(true)
|
|
50
|
+
* .wrap_width(100)
|
|
51
|
+
* .build();
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
31
54
|
export class WasmConversionOptions {
|
|
32
55
|
static __wrap(ptr) {
|
|
33
56
|
ptr = ptr >>> 0;
|
|
@@ -47,6 +70,7 @@ export class WasmConversionOptions {
|
|
|
47
70
|
wasm.__wbg_wasmconversionoptions_free(ptr, 0);
|
|
48
71
|
}
|
|
49
72
|
/**
|
|
73
|
+
* Apply a partial update to these conversion options.
|
|
50
74
|
* @param {WasmConversionOptionsUpdate} _update
|
|
51
75
|
*/
|
|
52
76
|
applyUpdate(_update) {
|
|
@@ -69,6 +93,7 @@ export class WasmConversionOptions {
|
|
|
69
93
|
return ret !== 0;
|
|
70
94
|
}
|
|
71
95
|
/**
|
|
96
|
+
* Create a new builder with default values.
|
|
72
97
|
* @returns {WasmConversionOptionsBuilder}
|
|
73
98
|
*/
|
|
74
99
|
static builder() {
|
|
@@ -91,7 +116,7 @@ export class WasmConversionOptions {
|
|
|
91
116
|
return getStringFromWasm0(r0, r1);
|
|
92
117
|
} finally {
|
|
93
118
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
94
|
-
wasm.
|
|
119
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
95
120
|
}
|
|
96
121
|
}
|
|
97
122
|
/**
|
|
@@ -124,7 +149,7 @@ export class WasmConversionOptions {
|
|
|
124
149
|
return getStringFromWasm0(r0, r1);
|
|
125
150
|
} finally {
|
|
126
151
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
127
|
-
wasm.
|
|
152
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
128
153
|
}
|
|
129
154
|
}
|
|
130
155
|
/**
|
|
@@ -171,7 +196,7 @@ export class WasmConversionOptions {
|
|
|
171
196
|
return getStringFromWasm0(r0, r1);
|
|
172
197
|
} finally {
|
|
173
198
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
174
|
-
wasm.
|
|
199
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
175
200
|
}
|
|
176
201
|
}
|
|
177
202
|
/**
|
|
@@ -202,6 +227,22 @@ export class WasmConversionOptions {
|
|
|
202
227
|
const ret = wasm.wasmconversionoptions_escapeUnderscores(this.__wbg_ptr);
|
|
203
228
|
return ret !== 0;
|
|
204
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* @returns {string[]}
|
|
232
|
+
*/
|
|
233
|
+
get excludeSelectors() {
|
|
234
|
+
try {
|
|
235
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
236
|
+
wasm.wasmconversionoptions_excludeSelectors(retptr, this.__wbg_ptr);
|
|
237
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
238
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
239
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
240
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
241
|
+
return v1;
|
|
242
|
+
} finally {
|
|
243
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
205
246
|
/**
|
|
206
247
|
* @returns {boolean}
|
|
207
248
|
*/
|
|
@@ -227,6 +268,7 @@ export class WasmConversionOptions {
|
|
|
227
268
|
return WasmConversionOptions.__wrap(ret);
|
|
228
269
|
}
|
|
229
270
|
/**
|
|
271
|
+
* Create from a partial update, applying to defaults.
|
|
230
272
|
* @param {WasmConversionOptionsUpdate} update
|
|
231
273
|
* @returns {WasmConversionOptions}
|
|
232
274
|
*/
|
|
@@ -274,7 +316,7 @@ export class WasmConversionOptions {
|
|
|
274
316
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
275
317
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
276
318
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
277
|
-
wasm.
|
|
319
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
278
320
|
return v1;
|
|
279
321
|
} finally {
|
|
280
322
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -354,9 +396,10 @@ export class WasmConversionOptions {
|
|
|
354
396
|
* @param {bigint | null} [max_image_size]
|
|
355
397
|
* @param {boolean | null} [capture_svg]
|
|
356
398
|
* @param {boolean | null} [infer_dimensions]
|
|
399
|
+
* @param {string[] | null} [exclude_selectors]
|
|
357
400
|
* @param {number | null} [max_depth]
|
|
358
401
|
*/
|
|
359
|
-
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) {
|
|
402
|
+
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) {
|
|
360
403
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
361
404
|
var len0 = WASM_VECTOR_LEN;
|
|
362
405
|
var ptr1 = isLikeNone(strong_em_symbol) ? 0 : passStringToWasm0(strong_em_symbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -380,7 +423,9 @@ export class WasmConversionOptions {
|
|
|
380
423
|
var len8 = WASM_VECTOR_LEN;
|
|
381
424
|
var ptr9 = isLikeNone(preserve_tags) ? 0 : passArrayJsValueToWasm0(preserve_tags, wasm.__wbindgen_export);
|
|
382
425
|
var len9 = WASM_VECTOR_LEN;
|
|
383
|
-
|
|
426
|
+
var ptr10 = isLikeNone(exclude_selectors) ? 0 : passArrayJsValueToWasm0(exclude_selectors, wasm.__wbindgen_export);
|
|
427
|
+
var len10 = WASM_VECTOR_LEN;
|
|
428
|
+
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);
|
|
384
429
|
this.__wbg_ptr = ret >>> 0;
|
|
385
430
|
WasmConversionOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
386
431
|
return this;
|
|
@@ -416,7 +461,7 @@ export class WasmConversionOptions {
|
|
|
416
461
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
417
462
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
418
463
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
419
|
-
wasm.
|
|
464
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
420
465
|
return v1;
|
|
421
466
|
} finally {
|
|
422
467
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -512,6 +557,14 @@ export class WasmConversionOptions {
|
|
|
512
557
|
set escapeUnderscores(value) {
|
|
513
558
|
wasm.wasmconversionoptions_set_escapeUnderscores(this.__wbg_ptr, value);
|
|
514
559
|
}
|
|
560
|
+
/**
|
|
561
|
+
* @param {string[]} value
|
|
562
|
+
*/
|
|
563
|
+
set excludeSelectors(value) {
|
|
564
|
+
const ptr0 = passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
|
|
565
|
+
const len0 = WASM_VECTOR_LEN;
|
|
566
|
+
wasm.wasmconversionoptions_set_excludeSelectors(this.__wbg_ptr, ptr0, len0);
|
|
567
|
+
}
|
|
515
568
|
/**
|
|
516
569
|
* @param {boolean} value
|
|
517
570
|
*/
|
|
@@ -700,7 +753,7 @@ export class WasmConversionOptions {
|
|
|
700
753
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
701
754
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
702
755
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
703
|
-
wasm.
|
|
756
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
704
757
|
return v1;
|
|
705
758
|
} finally {
|
|
706
759
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -722,7 +775,7 @@ export class WasmConversionOptions {
|
|
|
722
775
|
return getStringFromWasm0(r0, r1);
|
|
723
776
|
} finally {
|
|
724
777
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
725
|
-
wasm.
|
|
778
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
726
779
|
}
|
|
727
780
|
}
|
|
728
781
|
/**
|
|
@@ -741,7 +794,7 @@ export class WasmConversionOptions {
|
|
|
741
794
|
return getStringFromWasm0(r0, r1);
|
|
742
795
|
} finally {
|
|
743
796
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
744
|
-
wasm.
|
|
797
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
745
798
|
}
|
|
746
799
|
}
|
|
747
800
|
/**
|
|
@@ -760,7 +813,7 @@ export class WasmConversionOptions {
|
|
|
760
813
|
return getStringFromWasm0(r0, r1);
|
|
761
814
|
} finally {
|
|
762
815
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
763
|
-
wasm.
|
|
816
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
764
817
|
}
|
|
765
818
|
}
|
|
766
819
|
/**
|
|
@@ -787,6 +840,11 @@ export class WasmConversionOptions {
|
|
|
787
840
|
}
|
|
788
841
|
if (Symbol.dispose) WasmConversionOptions.prototype[Symbol.dispose] = WasmConversionOptions.prototype.free;
|
|
789
842
|
|
|
843
|
+
/**
|
|
844
|
+
* Builder for [`ConversionOptions`].
|
|
845
|
+
*
|
|
846
|
+
* All fields start with default values. Call `.build()` to produce the final options.
|
|
847
|
+
*/
|
|
790
848
|
export class WasmConversionOptionsBuilder {
|
|
791
849
|
static __wrap(ptr) {
|
|
792
850
|
ptr = ptr >>> 0;
|
|
@@ -806,6 +864,7 @@ export class WasmConversionOptionsBuilder {
|
|
|
806
864
|
wasm.__wbg_wasmconversionoptionsbuilder_free(ptr, 0);
|
|
807
865
|
}
|
|
808
866
|
/**
|
|
867
|
+
* Build the final [`ConversionOptions`].
|
|
809
868
|
* @returns {WasmConversionOptions}
|
|
810
869
|
*/
|
|
811
870
|
build() {
|
|
@@ -813,6 +872,18 @@ export class WasmConversionOptionsBuilder {
|
|
|
813
872
|
return WasmConversionOptions.__wrap(ret);
|
|
814
873
|
}
|
|
815
874
|
/**
|
|
875
|
+
* Set the list of CSS selectors for elements to exclude entirely from output.
|
|
876
|
+
* @param {string[]} selectors
|
|
877
|
+
* @returns {WasmConversionOptionsBuilder}
|
|
878
|
+
*/
|
|
879
|
+
excludeSelectors(selectors) {
|
|
880
|
+
const ptr0 = passArrayJsValueToWasm0(selectors, wasm.__wbindgen_export);
|
|
881
|
+
const len0 = WASM_VECTOR_LEN;
|
|
882
|
+
const ret = wasm.wasmconversionoptionsbuilder_excludeSelectors(this.__wbg_ptr, ptr0, len0);
|
|
883
|
+
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Set the list of HTML tag names whose `<img>` children are kept inline.
|
|
816
887
|
* @param {string[]} tags
|
|
817
888
|
* @returns {WasmConversionOptionsBuilder}
|
|
818
889
|
*/
|
|
@@ -823,6 +894,7 @@ export class WasmConversionOptionsBuilder {
|
|
|
823
894
|
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
824
895
|
}
|
|
825
896
|
/**
|
|
897
|
+
* Set the pre-processing options applied to the HTML before conversion.
|
|
826
898
|
* @param {WasmPreprocessingOptions} preprocessing
|
|
827
899
|
* @returns {WasmConversionOptionsBuilder}
|
|
828
900
|
*/
|
|
@@ -833,6 +905,7 @@ export class WasmConversionOptionsBuilder {
|
|
|
833
905
|
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
834
906
|
}
|
|
835
907
|
/**
|
|
908
|
+
* Set the list of HTML tag names that are preserved verbatim in output.
|
|
836
909
|
* @param {string[]} tags
|
|
837
910
|
* @returns {WasmConversionOptionsBuilder}
|
|
838
911
|
*/
|
|
@@ -843,6 +916,7 @@ export class WasmConversionOptionsBuilder {
|
|
|
843
916
|
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
844
917
|
}
|
|
845
918
|
/**
|
|
919
|
+
* Set the list of HTML tag names whose content is stripped from output.
|
|
846
920
|
* @param {string[]} tags
|
|
847
921
|
* @returns {WasmConversionOptionsBuilder}
|
|
848
922
|
*/
|
|
@@ -855,6 +929,12 @@ export class WasmConversionOptionsBuilder {
|
|
|
855
929
|
}
|
|
856
930
|
if (Symbol.dispose) WasmConversionOptionsBuilder.prototype[Symbol.dispose] = WasmConversionOptionsBuilder.prototype.free;
|
|
857
931
|
|
|
932
|
+
/**
|
|
933
|
+
* Partial update for `ConversionOptions`.
|
|
934
|
+
*
|
|
935
|
+
* Uses `Option<T>` fields for selective updates. Bindings use this to construct
|
|
936
|
+
* options from language-native types. Prefer [`ConversionOptionsBuilder`] for Rust code.
|
|
937
|
+
*/
|
|
858
938
|
export class WasmConversionOptionsUpdate {
|
|
859
939
|
__destroy_into_raw() {
|
|
860
940
|
const ptr = this.__wbg_ptr;
|
|
@@ -892,7 +972,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
892
972
|
let v1;
|
|
893
973
|
if (r0 !== 0) {
|
|
894
974
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
895
|
-
wasm.
|
|
975
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
896
976
|
}
|
|
897
977
|
return v1;
|
|
898
978
|
} finally {
|
|
@@ -925,7 +1005,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
925
1005
|
let v1;
|
|
926
1006
|
if (r0 !== 0) {
|
|
927
1007
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
928
|
-
wasm.
|
|
1008
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
929
1009
|
}
|
|
930
1010
|
return v1;
|
|
931
1011
|
} finally {
|
|
@@ -965,7 +1045,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
965
1045
|
let v1;
|
|
966
1046
|
if (r0 !== 0) {
|
|
967
1047
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
968
|
-
wasm.
|
|
1048
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
969
1049
|
}
|
|
970
1050
|
return v1;
|
|
971
1051
|
} finally {
|
|
@@ -1000,6 +1080,25 @@ export class WasmConversionOptionsUpdate {
|
|
|
1000
1080
|
const ret = wasm.wasmconversionoptionsupdate_escapeUnderscores(this.__wbg_ptr);
|
|
1001
1081
|
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
1002
1082
|
}
|
|
1083
|
+
/**
|
|
1084
|
+
* @returns {string[] | undefined}
|
|
1085
|
+
*/
|
|
1086
|
+
get excludeSelectors() {
|
|
1087
|
+
try {
|
|
1088
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1089
|
+
wasm.wasmconversionoptionsupdate_excludeSelectors(retptr, this.__wbg_ptr);
|
|
1090
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1091
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1092
|
+
let v1;
|
|
1093
|
+
if (r0 !== 0) {
|
|
1094
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1095
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1096
|
+
}
|
|
1097
|
+
return v1;
|
|
1098
|
+
} finally {
|
|
1099
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1003
1102
|
/**
|
|
1004
1103
|
* @returns {boolean | undefined}
|
|
1005
1104
|
*/
|
|
@@ -1054,7 +1153,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1054
1153
|
let v1;
|
|
1055
1154
|
if (r0 !== 0) {
|
|
1056
1155
|
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1057
|
-
wasm.
|
|
1156
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1058
1157
|
}
|
|
1059
1158
|
return v1;
|
|
1060
1159
|
} finally {
|
|
@@ -1143,8 +1242,9 @@ export class WasmConversionOptionsUpdate {
|
|
|
1143
1242
|
* @param {boolean | null} [capture_svg]
|
|
1144
1243
|
* @param {boolean | null} [infer_dimensions]
|
|
1145
1244
|
* @param {number | null} [max_depth]
|
|
1245
|
+
* @param {string[] | null} [exclude_selectors]
|
|
1146
1246
|
*/
|
|
1147
|
-
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) {
|
|
1247
|
+
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) {
|
|
1148
1248
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1149
1249
|
var len0 = WASM_VECTOR_LEN;
|
|
1150
1250
|
var ptr1 = isLikeNone(strong_em_symbol) ? 0 : passStringToWasm0(strong_em_symbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -1168,7 +1268,9 @@ export class WasmConversionOptionsUpdate {
|
|
|
1168
1268
|
var len8 = WASM_VECTOR_LEN;
|
|
1169
1269
|
var ptr9 = isLikeNone(preserve_tags) ? 0 : passArrayJsValueToWasm0(preserve_tags, wasm.__wbindgen_export);
|
|
1170
1270
|
var len9 = WASM_VECTOR_LEN;
|
|
1171
|
-
|
|
1271
|
+
var ptr10 = isLikeNone(exclude_selectors) ? 0 : passArrayJsValueToWasm0(exclude_selectors, wasm.__wbindgen_export);
|
|
1272
|
+
var len10 = WASM_VECTOR_LEN;
|
|
1273
|
+
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);
|
|
1172
1274
|
this.__wbg_ptr = ret >>> 0;
|
|
1173
1275
|
WasmConversionOptionsUpdateFinalization.register(this, this.__wbg_ptr, this);
|
|
1174
1276
|
return this;
|
|
@@ -1206,7 +1308,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1206
1308
|
let v1;
|
|
1207
1309
|
if (r0 !== 0) {
|
|
1208
1310
|
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1209
|
-
wasm.
|
|
1311
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1210
1312
|
}
|
|
1211
1313
|
return v1;
|
|
1212
1314
|
} finally {
|
|
@@ -1303,6 +1405,14 @@ export class WasmConversionOptionsUpdate {
|
|
|
1303
1405
|
set escapeUnderscores(value) {
|
|
1304
1406
|
wasm.wasmconversionoptionsupdate_set_escapeUnderscores(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
|
|
1305
1407
|
}
|
|
1408
|
+
/**
|
|
1409
|
+
* @param {string[] | null} [value]
|
|
1410
|
+
*/
|
|
1411
|
+
set excludeSelectors(value) {
|
|
1412
|
+
var ptr0 = isLikeNone(value) ? 0 : passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
|
|
1413
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1414
|
+
wasm.wasmconversionoptionsupdate_set_excludeSelectors(this.__wbg_ptr, ptr0, len0);
|
|
1415
|
+
}
|
|
1306
1416
|
/**
|
|
1307
1417
|
* @param {boolean | null} [value]
|
|
1308
1418
|
*/
|
|
@@ -1496,7 +1606,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1496
1606
|
let v1;
|
|
1497
1607
|
if (r0 !== 0) {
|
|
1498
1608
|
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1499
|
-
wasm.
|
|
1609
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1500
1610
|
}
|
|
1501
1611
|
return v1;
|
|
1502
1612
|
} finally {
|
|
@@ -1515,7 +1625,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1515
1625
|
let v1;
|
|
1516
1626
|
if (r0 !== 0) {
|
|
1517
1627
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1518
|
-
wasm.
|
|
1628
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1519
1629
|
}
|
|
1520
1630
|
return v1;
|
|
1521
1631
|
} finally {
|
|
@@ -1534,7 +1644,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1534
1644
|
let v1;
|
|
1535
1645
|
if (r0 !== 0) {
|
|
1536
1646
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1537
|
-
wasm.
|
|
1647
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1538
1648
|
}
|
|
1539
1649
|
return v1;
|
|
1540
1650
|
} finally {
|
|
@@ -1553,7 +1663,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1553
1663
|
let v1;
|
|
1554
1664
|
if (r0 !== 0) {
|
|
1555
1665
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1556
|
-
wasm.
|
|
1666
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1557
1667
|
}
|
|
1558
1668
|
return v1;
|
|
1559
1669
|
} finally {
|
|
@@ -1584,6 +1694,22 @@ export class WasmConversionOptionsUpdate {
|
|
|
1584
1694
|
}
|
|
1585
1695
|
if (Symbol.dispose) WasmConversionOptionsUpdate.prototype[Symbol.dispose] = WasmConversionOptionsUpdate.prototype.free;
|
|
1586
1696
|
|
|
1697
|
+
/**
|
|
1698
|
+
* The primary result of HTML conversion and extraction.
|
|
1699
|
+
*
|
|
1700
|
+
* Contains the converted text output, optional structured document tree,
|
|
1701
|
+
* metadata, extracted tables, images, and processing warnings.
|
|
1702
|
+
*
|
|
1703
|
+
* # Example
|
|
1704
|
+
*
|
|
1705
|
+
* ```text
|
|
1706
|
+
* use html_to_markdown_rs::{convert, ConversionOptions};
|
|
1707
|
+
*
|
|
1708
|
+
* let result = convert("<h1>Hello</h1><p>World</p>", None)?;
|
|
1709
|
+
* assert!(result.content.is_some());
|
|
1710
|
+
* assert!(result.warnings.is_empty());
|
|
1711
|
+
* ```
|
|
1712
|
+
*/
|
|
1587
1713
|
export class WasmConversionResult {
|
|
1588
1714
|
static __wrap(ptr) {
|
|
1589
1715
|
ptr = ptr >>> 0;
|
|
@@ -1614,7 +1740,7 @@ export class WasmConversionResult {
|
|
|
1614
1740
|
let v1;
|
|
1615
1741
|
if (r0 !== 0) {
|
|
1616
1742
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1617
|
-
wasm.
|
|
1743
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1618
1744
|
}
|
|
1619
1745
|
return v1;
|
|
1620
1746
|
} finally {
|
|
@@ -1638,7 +1764,7 @@ export class WasmConversionResult {
|
|
|
1638
1764
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1639
1765
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1640
1766
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1641
|
-
wasm.
|
|
1767
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1642
1768
|
return v1;
|
|
1643
1769
|
} finally {
|
|
1644
1770
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1744,7 +1870,7 @@ export class WasmConversionResult {
|
|
|
1744
1870
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1745
1871
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1746
1872
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1747
|
-
wasm.
|
|
1873
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1748
1874
|
return v1;
|
|
1749
1875
|
} finally {
|
|
1750
1876
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1760,7 +1886,7 @@ export class WasmConversionResult {
|
|
|
1760
1886
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1761
1887
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1762
1888
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1763
|
-
wasm.
|
|
1889
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1764
1890
|
return v1;
|
|
1765
1891
|
} finally {
|
|
1766
1892
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1769,6 +1895,26 @@ export class WasmConversionResult {
|
|
|
1769
1895
|
}
|
|
1770
1896
|
if (Symbol.dispose) WasmConversionResult.prototype[Symbol.dispose] = WasmConversionResult.prototype.free;
|
|
1771
1897
|
|
|
1898
|
+
/**
|
|
1899
|
+
* Document-level metadata extracted from `<head>` and top-level elements.
|
|
1900
|
+
*
|
|
1901
|
+
* Contains all metadata typically used by search engines, social media platforms,
|
|
1902
|
+
* and browsers for document indexing and presentation.
|
|
1903
|
+
*
|
|
1904
|
+
* # Examples
|
|
1905
|
+
*
|
|
1906
|
+
* ```
|
|
1907
|
+
* # use html_to_markdown_rs::metadata::DocumentMetadata;
|
|
1908
|
+
* let doc = DocumentMetadata {
|
|
1909
|
+
* title: Some("My Article".to_string()),
|
|
1910
|
+
* description: Some("A great article about Rust".to_string()),
|
|
1911
|
+
* keywords: vec!["rust".to_string(), "programming".to_string()],
|
|
1912
|
+
* ..Default::default()
|
|
1913
|
+
* };
|
|
1914
|
+
*
|
|
1915
|
+
* assert_eq!(doc.title, Some("My Article".to_string()));
|
|
1916
|
+
* ```
|
|
1917
|
+
*/
|
|
1772
1918
|
export class WasmDocumentMetadata {
|
|
1773
1919
|
static __wrap(ptr) {
|
|
1774
1920
|
ptr = ptr >>> 0;
|
|
@@ -1799,7 +1945,7 @@ export class WasmDocumentMetadata {
|
|
|
1799
1945
|
let v1;
|
|
1800
1946
|
if (r0 !== 0) {
|
|
1801
1947
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1802
|
-
wasm.
|
|
1948
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1803
1949
|
}
|
|
1804
1950
|
return v1;
|
|
1805
1951
|
} finally {
|
|
@@ -1818,7 +1964,7 @@ export class WasmDocumentMetadata {
|
|
|
1818
1964
|
let v1;
|
|
1819
1965
|
if (r0 !== 0) {
|
|
1820
1966
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1821
|
-
wasm.
|
|
1967
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1822
1968
|
}
|
|
1823
1969
|
return v1;
|
|
1824
1970
|
} finally {
|
|
@@ -1837,7 +1983,7 @@ export class WasmDocumentMetadata {
|
|
|
1837
1983
|
let v1;
|
|
1838
1984
|
if (r0 !== 0) {
|
|
1839
1985
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1840
|
-
wasm.
|
|
1986
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1841
1987
|
}
|
|
1842
1988
|
return v1;
|
|
1843
1989
|
} finally {
|
|
@@ -1856,7 +2002,7 @@ export class WasmDocumentMetadata {
|
|
|
1856
2002
|
let v1;
|
|
1857
2003
|
if (r0 !== 0) {
|
|
1858
2004
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1859
|
-
wasm.
|
|
2005
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1860
2006
|
}
|
|
1861
2007
|
return v1;
|
|
1862
2008
|
} finally {
|
|
@@ -1873,7 +2019,7 @@ export class WasmDocumentMetadata {
|
|
|
1873
2019
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1874
2020
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1875
2021
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1876
|
-
wasm.
|
|
2022
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1877
2023
|
return v1;
|
|
1878
2024
|
} finally {
|
|
1879
2025
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -1891,7 +2037,7 @@ export class WasmDocumentMetadata {
|
|
|
1891
2037
|
let v1;
|
|
1892
2038
|
if (r0 !== 0) {
|
|
1893
2039
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1894
|
-
wasm.
|
|
2040
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1895
2041
|
}
|
|
1896
2042
|
return v1;
|
|
1897
2043
|
} finally {
|
|
@@ -2044,7 +2190,7 @@ export class WasmDocumentMetadata {
|
|
|
2044
2190
|
let v1;
|
|
2045
2191
|
if (r0 !== 0) {
|
|
2046
2192
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2047
|
-
wasm.
|
|
2193
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2048
2194
|
}
|
|
2049
2195
|
return v1;
|
|
2050
2196
|
} finally {
|
|
@@ -2061,6 +2207,9 @@ export class WasmDocumentMetadata {
|
|
|
2061
2207
|
}
|
|
2062
2208
|
if (Symbol.dispose) WasmDocumentMetadata.prototype[Symbol.dispose] = WasmDocumentMetadata.prototype.free;
|
|
2063
2209
|
|
|
2210
|
+
/**
|
|
2211
|
+
* A single node in the document tree.
|
|
2212
|
+
*/
|
|
2064
2213
|
export class WasmDocumentNode {
|
|
2065
2214
|
static __wrap(ptr) {
|
|
2066
2215
|
ptr = ptr >>> 0;
|
|
@@ -2095,7 +2244,7 @@ export class WasmDocumentNode {
|
|
|
2095
2244
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2096
2245
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2097
2246
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2098
|
-
wasm.
|
|
2247
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2099
2248
|
return v1;
|
|
2100
2249
|
} finally {
|
|
2101
2250
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2118,7 +2267,7 @@ export class WasmDocumentNode {
|
|
|
2118
2267
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2119
2268
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2120
2269
|
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
2121
|
-
wasm.
|
|
2270
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2122
2271
|
return v1;
|
|
2123
2272
|
} finally {
|
|
2124
2273
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2147,7 +2296,7 @@ export class WasmDocumentNode {
|
|
|
2147
2296
|
return getStringFromWasm0(r0, r1);
|
|
2148
2297
|
} finally {
|
|
2149
2298
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2150
|
-
wasm.
|
|
2299
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2151
2300
|
}
|
|
2152
2301
|
}
|
|
2153
2302
|
/**
|
|
@@ -2222,6 +2371,11 @@ export class WasmDocumentNode {
|
|
|
2222
2371
|
}
|
|
2223
2372
|
if (Symbol.dispose) WasmDocumentNode.prototype[Symbol.dispose] = WasmDocumentNode.prototype.free;
|
|
2224
2373
|
|
|
2374
|
+
/**
|
|
2375
|
+
* A structured document tree representing the semantic content of an HTML document.
|
|
2376
|
+
*
|
|
2377
|
+
* Uses a flat node array with index-based parent/child references for efficient traversal.
|
|
2378
|
+
*/
|
|
2225
2379
|
export class WasmDocumentStructure {
|
|
2226
2380
|
static __wrap(ptr) {
|
|
2227
2381
|
ptr = ptr >>> 0;
|
|
@@ -2264,7 +2418,7 @@ export class WasmDocumentStructure {
|
|
|
2264
2418
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2265
2419
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2266
2420
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2267
|
-
wasm.
|
|
2421
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2268
2422
|
return v1;
|
|
2269
2423
|
} finally {
|
|
2270
2424
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2298,7 +2452,7 @@ export class WasmDocumentStructure {
|
|
|
2298
2452
|
let v1;
|
|
2299
2453
|
if (r0 !== 0) {
|
|
2300
2454
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2301
|
-
wasm.
|
|
2455
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2302
2456
|
}
|
|
2303
2457
|
return v1;
|
|
2304
2458
|
} finally {
|
|
@@ -2308,6 +2462,9 @@ export class WasmDocumentStructure {
|
|
|
2308
2462
|
}
|
|
2309
2463
|
if (Symbol.dispose) WasmDocumentStructure.prototype[Symbol.dispose] = WasmDocumentStructure.prototype.free;
|
|
2310
2464
|
|
|
2465
|
+
/**
|
|
2466
|
+
* A single cell in a table grid.
|
|
2467
|
+
*/
|
|
2311
2468
|
export class WasmGridCell {
|
|
2312
2469
|
static __wrap(ptr) {
|
|
2313
2470
|
ptr = ptr >>> 0;
|
|
@@ -2362,7 +2519,7 @@ export class WasmGridCell {
|
|
|
2362
2519
|
return getStringFromWasm0(r0, r1);
|
|
2363
2520
|
} finally {
|
|
2364
2521
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2365
|
-
wasm.
|
|
2522
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2366
2523
|
}
|
|
2367
2524
|
}
|
|
2368
2525
|
/**
|
|
@@ -2443,6 +2600,28 @@ export class WasmGridCell {
|
|
|
2443
2600
|
}
|
|
2444
2601
|
if (Symbol.dispose) WasmGridCell.prototype[Symbol.dispose] = WasmGridCell.prototype.free;
|
|
2445
2602
|
|
|
2603
|
+
/**
|
|
2604
|
+
* Header element metadata with hierarchy tracking.
|
|
2605
|
+
*
|
|
2606
|
+
* Captures heading elements (h1-h6) with their text content, identifiers,
|
|
2607
|
+
* and position in the document structure.
|
|
2608
|
+
*
|
|
2609
|
+
* # Examples
|
|
2610
|
+
*
|
|
2611
|
+
* ```
|
|
2612
|
+
* # use html_to_markdown_rs::metadata::HeaderMetadata;
|
|
2613
|
+
* let header = HeaderMetadata {
|
|
2614
|
+
* level: 1,
|
|
2615
|
+
* text: "Main Title".to_string(),
|
|
2616
|
+
* id: Some("main-title".to_string()),
|
|
2617
|
+
* depth: 0,
|
|
2618
|
+
* html_offset: 145,
|
|
2619
|
+
* };
|
|
2620
|
+
*
|
|
2621
|
+
* assert_eq!(header.level, 1);
|
|
2622
|
+
* assert!(header.is_valid());
|
|
2623
|
+
* ```
|
|
2624
|
+
*/
|
|
2446
2625
|
export class WasmHeaderMetadata {
|
|
2447
2626
|
static __wrap(ptr) {
|
|
2448
2627
|
ptr = ptr >>> 0;
|
|
@@ -2493,7 +2672,7 @@ export class WasmHeaderMetadata {
|
|
|
2493
2672
|
let v1;
|
|
2494
2673
|
if (r0 !== 0) {
|
|
2495
2674
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2496
|
-
wasm.
|
|
2675
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2497
2676
|
}
|
|
2498
2677
|
return v1;
|
|
2499
2678
|
} finally {
|
|
@@ -2501,6 +2680,34 @@ export class WasmHeaderMetadata {
|
|
|
2501
2680
|
}
|
|
2502
2681
|
}
|
|
2503
2682
|
/**
|
|
2683
|
+
* Validate that the header level is within valid range (1-6).
|
|
2684
|
+
*
|
|
2685
|
+
* # Returns
|
|
2686
|
+
*
|
|
2687
|
+
* `true` if level is 1-6, `false` otherwise.
|
|
2688
|
+
*
|
|
2689
|
+
* # Examples
|
|
2690
|
+
*
|
|
2691
|
+
* ```
|
|
2692
|
+
* # use html_to_markdown_rs::metadata::HeaderMetadata;
|
|
2693
|
+
* let valid = HeaderMetadata {
|
|
2694
|
+
* level: 3,
|
|
2695
|
+
* text: "Title".to_string(),
|
|
2696
|
+
* id: None,
|
|
2697
|
+
* depth: 2,
|
|
2698
|
+
* html_offset: 100,
|
|
2699
|
+
* };
|
|
2700
|
+
* assert!(valid.is_valid());
|
|
2701
|
+
*
|
|
2702
|
+
* let invalid = HeaderMetadata {
|
|
2703
|
+
* level: 7, // Invalid
|
|
2704
|
+
* text: "Title".to_string(),
|
|
2705
|
+
* id: None,
|
|
2706
|
+
* depth: 2,
|
|
2707
|
+
* html_offset: 100,
|
|
2708
|
+
* };
|
|
2709
|
+
* assert!(!invalid.is_valid());
|
|
2710
|
+
* ```
|
|
2504
2711
|
* @returns {boolean}
|
|
2505
2712
|
*/
|
|
2506
2713
|
isValid() {
|
|
@@ -2581,13 +2788,16 @@ export class WasmHeaderMetadata {
|
|
|
2581
2788
|
return getStringFromWasm0(r0, r1);
|
|
2582
2789
|
} finally {
|
|
2583
2790
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2584
|
-
wasm.
|
|
2791
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2585
2792
|
}
|
|
2586
2793
|
}
|
|
2587
2794
|
}
|
|
2588
2795
|
if (Symbol.dispose) WasmHeaderMetadata.prototype[Symbol.dispose] = WasmHeaderMetadata.prototype.free;
|
|
2589
2796
|
|
|
2590
2797
|
/**
|
|
2798
|
+
* Heading style options for Markdown output.
|
|
2799
|
+
*
|
|
2800
|
+
* Controls how headings (h1-h6) are rendered in the output Markdown.
|
|
2591
2801
|
* @enum {0 | 1 | 2}
|
|
2592
2802
|
*/
|
|
2593
2803
|
export const WasmHeadingStyle = Object.freeze({
|
|
@@ -2597,6 +2807,9 @@ export const WasmHeadingStyle = Object.freeze({
|
|
|
2597
2807
|
});
|
|
2598
2808
|
|
|
2599
2809
|
/**
|
|
2810
|
+
* Highlight rendering style for `<mark>` elements.
|
|
2811
|
+
*
|
|
2812
|
+
* Controls how highlighted text is rendered in Markdown output.
|
|
2600
2813
|
* @enum {0 | 1 | 2 | 3}
|
|
2601
2814
|
*/
|
|
2602
2815
|
export const WasmHighlightStyle = Object.freeze({
|
|
@@ -2606,6 +2819,27 @@ export const WasmHighlightStyle = Object.freeze({
|
|
|
2606
2819
|
None: 3, "3": "None",
|
|
2607
2820
|
});
|
|
2608
2821
|
|
|
2822
|
+
/**
|
|
2823
|
+
* Comprehensive metadata extraction result from HTML document.
|
|
2824
|
+
*
|
|
2825
|
+
* Contains all extracted metadata types in a single structure,
|
|
2826
|
+
* suitable for serialization and transmission across language boundaries.
|
|
2827
|
+
*
|
|
2828
|
+
* # Examples
|
|
2829
|
+
*
|
|
2830
|
+
* ```
|
|
2831
|
+
* # use html_to_markdown_rs::metadata::HtmlMetadata;
|
|
2832
|
+
* let metadata = HtmlMetadata {
|
|
2833
|
+
* document: Default::default(),
|
|
2834
|
+
* headers: Vec::new(),
|
|
2835
|
+
* links: Vec::new(),
|
|
2836
|
+
* images: Vec::new(),
|
|
2837
|
+
* structured_data: Vec::new(),
|
|
2838
|
+
* };
|
|
2839
|
+
*
|
|
2840
|
+
* assert!(metadata.headers.is_empty());
|
|
2841
|
+
* ```
|
|
2842
|
+
*/
|
|
2609
2843
|
export class WasmHtmlMetadata {
|
|
2610
2844
|
static __wrap(ptr) {
|
|
2611
2845
|
ptr = ptr >>> 0;
|
|
@@ -2641,7 +2875,7 @@ export class WasmHtmlMetadata {
|
|
|
2641
2875
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2642
2876
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2643
2877
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2644
|
-
wasm.
|
|
2878
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2645
2879
|
return v1;
|
|
2646
2880
|
} finally {
|
|
2647
2881
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2657,7 +2891,7 @@ export class WasmHtmlMetadata {
|
|
|
2657
2891
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2658
2892
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2659
2893
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2660
|
-
wasm.
|
|
2894
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2661
2895
|
return v1;
|
|
2662
2896
|
} finally {
|
|
2663
2897
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2673,7 +2907,7 @@ export class WasmHtmlMetadata {
|
|
|
2673
2907
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2674
2908
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2675
2909
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2676
|
-
wasm.
|
|
2910
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2677
2911
|
return v1;
|
|
2678
2912
|
} finally {
|
|
2679
2913
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2755,7 +2989,7 @@ export class WasmHtmlMetadata {
|
|
|
2755
2989
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2756
2990
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2757
2991
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2758
|
-
wasm.
|
|
2992
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2759
2993
|
return v1;
|
|
2760
2994
|
} finally {
|
|
2761
2995
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -2764,6 +2998,28 @@ export class WasmHtmlMetadata {
|
|
|
2764
2998
|
}
|
|
2765
2999
|
if (Symbol.dispose) WasmHtmlMetadata.prototype[Symbol.dispose] = WasmHtmlMetadata.prototype.free;
|
|
2766
3000
|
|
|
3001
|
+
/**
|
|
3002
|
+
* Image metadata with source and dimensions.
|
|
3003
|
+
*
|
|
3004
|
+
* Captures `<img>` elements and inline `<svg>` elements with metadata
|
|
3005
|
+
* for image analysis and optimization.
|
|
3006
|
+
*
|
|
3007
|
+
* # Examples
|
|
3008
|
+
*
|
|
3009
|
+
* ```
|
|
3010
|
+
* # use html_to_markdown_rs::metadata::{ImageMetadata, ImageType};
|
|
3011
|
+
* let img = ImageMetadata {
|
|
3012
|
+
* src: "https://example.com/image.jpg".to_string(),
|
|
3013
|
+
* alt: Some("An example image".to_string()),
|
|
3014
|
+
* title: Some("Example".to_string()),
|
|
3015
|
+
* dimensions: Some((800, 600)),
|
|
3016
|
+
* image_type: ImageType::External,
|
|
3017
|
+
* attributes: Default::default(),
|
|
3018
|
+
* };
|
|
3019
|
+
*
|
|
3020
|
+
* assert_eq!(img.image_type, ImageType::External);
|
|
3021
|
+
* ```
|
|
3022
|
+
*/
|
|
2767
3023
|
export class WasmImageMetadata {
|
|
2768
3024
|
static __wrap(ptr) {
|
|
2769
3025
|
ptr = ptr >>> 0;
|
|
@@ -2800,7 +3056,7 @@ export class WasmImageMetadata {
|
|
|
2800
3056
|
let v1;
|
|
2801
3057
|
if (r0 !== 0) {
|
|
2802
3058
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2803
|
-
wasm.
|
|
3059
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2804
3060
|
}
|
|
2805
3061
|
return v1;
|
|
2806
3062
|
} finally {
|
|
@@ -2815,7 +3071,7 @@ export class WasmImageMetadata {
|
|
|
2815
3071
|
return takeObject(ret);
|
|
2816
3072
|
}
|
|
2817
3073
|
/**
|
|
2818
|
-
* @returns {
|
|
3074
|
+
* @returns {Uint32Array | undefined}
|
|
2819
3075
|
*/
|
|
2820
3076
|
get dimensions() {
|
|
2821
3077
|
try {
|
|
@@ -2825,8 +3081,8 @@ export class WasmImageMetadata {
|
|
|
2825
3081
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2826
3082
|
let v1;
|
|
2827
3083
|
if (r0 !== 0) {
|
|
2828
|
-
v1 =
|
|
2829
|
-
wasm.
|
|
3084
|
+
v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
3085
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
2830
3086
|
}
|
|
2831
3087
|
return v1;
|
|
2832
3088
|
} finally {
|
|
@@ -2846,7 +3102,7 @@ export class WasmImageMetadata {
|
|
|
2846
3102
|
* @param {any} attributes
|
|
2847
3103
|
* @param {string | null} [alt]
|
|
2848
3104
|
* @param {string | null} [title]
|
|
2849
|
-
* @param {
|
|
3105
|
+
* @param {Uint32Array | null} [dimensions]
|
|
2850
3106
|
*/
|
|
2851
3107
|
constructor(src, image_type, attributes, alt, title, dimensions) {
|
|
2852
3108
|
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -2855,7 +3111,7 @@ export class WasmImageMetadata {
|
|
|
2855
3111
|
var len1 = WASM_VECTOR_LEN;
|
|
2856
3112
|
var ptr2 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2857
3113
|
var len2 = WASM_VECTOR_LEN;
|
|
2858
|
-
var ptr3 = isLikeNone(dimensions) ? 0 :
|
|
3114
|
+
var ptr3 = isLikeNone(dimensions) ? 0 : passArray32ToWasm0(dimensions, wasm.__wbindgen_export);
|
|
2859
3115
|
var len3 = WASM_VECTOR_LEN;
|
|
2860
3116
|
const ret = wasm.wasmimagemetadata_new(ptr0, len0, image_type, addHeapObject(attributes), ptr1, len1, ptr2, len2, ptr3, len3);
|
|
2861
3117
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -2877,10 +3133,10 @@ export class WasmImageMetadata {
|
|
|
2877
3133
|
wasm.wasmimagemetadata_set_attributes(this.__wbg_ptr, addHeapObject(value));
|
|
2878
3134
|
}
|
|
2879
3135
|
/**
|
|
2880
|
-
* @param {
|
|
3136
|
+
* @param {Uint32Array | null} [value]
|
|
2881
3137
|
*/
|
|
2882
3138
|
set dimensions(value) {
|
|
2883
|
-
var ptr0 = isLikeNone(value) ? 0 :
|
|
3139
|
+
var ptr0 = isLikeNone(value) ? 0 : passArray32ToWasm0(value, wasm.__wbindgen_export);
|
|
2884
3140
|
var len0 = WASM_VECTOR_LEN;
|
|
2885
3141
|
wasm.wasmimagemetadata_set_dimensions(this.__wbg_ptr, ptr0, len0);
|
|
2886
3142
|
}
|
|
@@ -2922,7 +3178,7 @@ export class WasmImageMetadata {
|
|
|
2922
3178
|
return getStringFromWasm0(r0, r1);
|
|
2923
3179
|
} finally {
|
|
2924
3180
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2925
|
-
wasm.
|
|
3181
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2926
3182
|
}
|
|
2927
3183
|
}
|
|
2928
3184
|
/**
|
|
@@ -2937,7 +3193,7 @@ export class WasmImageMetadata {
|
|
|
2937
3193
|
let v1;
|
|
2938
3194
|
if (r0 !== 0) {
|
|
2939
3195
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2940
|
-
wasm.
|
|
3196
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2941
3197
|
}
|
|
2942
3198
|
return v1;
|
|
2943
3199
|
} finally {
|
|
@@ -2948,6 +3204,9 @@ export class WasmImageMetadata {
|
|
|
2948
3204
|
if (Symbol.dispose) WasmImageMetadata.prototype[Symbol.dispose] = WasmImageMetadata.prototype.free;
|
|
2949
3205
|
|
|
2950
3206
|
/**
|
|
3207
|
+
* Image source classification for proper handling and processing.
|
|
3208
|
+
*
|
|
3209
|
+
* Determines whether an image is embedded (data URI), inline SVG, external, or relative.
|
|
2951
3210
|
* @enum {0 | 1 | 2 | 3}
|
|
2952
3211
|
*/
|
|
2953
3212
|
export const WasmImageType = Object.freeze({
|
|
@@ -2957,6 +3216,28 @@ export const WasmImageType = Object.freeze({
|
|
|
2957
3216
|
Relative: 3, "3": "Relative",
|
|
2958
3217
|
});
|
|
2959
3218
|
|
|
3219
|
+
/**
|
|
3220
|
+
* Hyperlink metadata with categorization and attributes.
|
|
3221
|
+
*
|
|
3222
|
+
* Represents `<a>` elements with parsed href values, text content, and link type classification.
|
|
3223
|
+
*
|
|
3224
|
+
* # Examples
|
|
3225
|
+
*
|
|
3226
|
+
* ```
|
|
3227
|
+
* # use html_to_markdown_rs::metadata::{LinkMetadata, LinkType};
|
|
3228
|
+
* let link = LinkMetadata {
|
|
3229
|
+
* href: "https://example.com".to_string(),
|
|
3230
|
+
* text: "Example".to_string(),
|
|
3231
|
+
* title: Some("Visit Example".to_string()),
|
|
3232
|
+
* link_type: LinkType::External,
|
|
3233
|
+
* rel: vec!["nofollow".to_string()],
|
|
3234
|
+
* attributes: Default::default(),
|
|
3235
|
+
* };
|
|
3236
|
+
*
|
|
3237
|
+
* assert_eq!(link.link_type, LinkType::External);
|
|
3238
|
+
* assert_eq!(link.text, "Example");
|
|
3239
|
+
* ```
|
|
3240
|
+
*/
|
|
2960
3241
|
export class WasmLinkMetadata {
|
|
2961
3242
|
static __wrap(ptr) {
|
|
2962
3243
|
ptr = ptr >>> 0;
|
|
@@ -2989,6 +3270,25 @@ export class WasmLinkMetadata {
|
|
|
2989
3270
|
return takeObject(ret);
|
|
2990
3271
|
}
|
|
2991
3272
|
/**
|
|
3273
|
+
* Classify a link based on href value.
|
|
3274
|
+
*
|
|
3275
|
+
* # Arguments
|
|
3276
|
+
*
|
|
3277
|
+
* * `href` - The href attribute value
|
|
3278
|
+
*
|
|
3279
|
+
* # Returns
|
|
3280
|
+
*
|
|
3281
|
+
* Appropriate [`LinkType`] based on protocol and content.
|
|
3282
|
+
*
|
|
3283
|
+
* # Examples
|
|
3284
|
+
*
|
|
3285
|
+
* ```
|
|
3286
|
+
* # use html_to_markdown_rs::metadata::{LinkMetadata, LinkType};
|
|
3287
|
+
* assert_eq!(LinkMetadata::classify_link("#section"), LinkType::Anchor);
|
|
3288
|
+
* assert_eq!(LinkMetadata::classify_link("mailto:test@example.com"), LinkType::Email);
|
|
3289
|
+
* assert_eq!(LinkMetadata::classify_link("tel:+1234567890"), LinkType::Phone);
|
|
3290
|
+
* assert_eq!(LinkMetadata::classify_link("https://example.com"), LinkType::External);
|
|
3291
|
+
* ```
|
|
2992
3292
|
* @param {string} href
|
|
2993
3293
|
* @returns {WasmLinkType}
|
|
2994
3294
|
*/
|
|
@@ -3014,7 +3314,7 @@ export class WasmLinkMetadata {
|
|
|
3014
3314
|
return getStringFromWasm0(r0, r1);
|
|
3015
3315
|
} finally {
|
|
3016
3316
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3017
|
-
wasm.
|
|
3317
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3018
3318
|
}
|
|
3019
3319
|
}
|
|
3020
3320
|
/**
|
|
@@ -3056,7 +3356,7 @@ export class WasmLinkMetadata {
|
|
|
3056
3356
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3057
3357
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3058
3358
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
3059
|
-
wasm.
|
|
3359
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
3060
3360
|
return v1;
|
|
3061
3361
|
} finally {
|
|
3062
3362
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -3122,7 +3422,7 @@ export class WasmLinkMetadata {
|
|
|
3122
3422
|
return getStringFromWasm0(r0, r1);
|
|
3123
3423
|
} finally {
|
|
3124
3424
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3125
|
-
wasm.
|
|
3425
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3126
3426
|
}
|
|
3127
3427
|
}
|
|
3128
3428
|
/**
|
|
@@ -3137,7 +3437,7 @@ export class WasmLinkMetadata {
|
|
|
3137
3437
|
let v1;
|
|
3138
3438
|
if (r0 !== 0) {
|
|
3139
3439
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3140
|
-
wasm.
|
|
3440
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3141
3441
|
}
|
|
3142
3442
|
return v1;
|
|
3143
3443
|
} finally {
|
|
@@ -3148,6 +3448,10 @@ export class WasmLinkMetadata {
|
|
|
3148
3448
|
if (Symbol.dispose) WasmLinkMetadata.prototype[Symbol.dispose] = WasmLinkMetadata.prototype.free;
|
|
3149
3449
|
|
|
3150
3450
|
/**
|
|
3451
|
+
* Link rendering style in Markdown output.
|
|
3452
|
+
*
|
|
3453
|
+
* Controls whether links and images use inline `[text](url)` syntax or
|
|
3454
|
+
* reference-style `[text][1]` syntax with definitions collected at the end.
|
|
3151
3455
|
* @enum {0 | 1}
|
|
3152
3456
|
*/
|
|
3153
3457
|
export const WasmLinkStyle = Object.freeze({
|
|
@@ -3156,6 +3460,9 @@ export const WasmLinkStyle = Object.freeze({
|
|
|
3156
3460
|
});
|
|
3157
3461
|
|
|
3158
3462
|
/**
|
|
3463
|
+
* Link classification based on href value and document context.
|
|
3464
|
+
*
|
|
3465
|
+
* Used to categorize links during extraction for filtering and analysis.
|
|
3159
3466
|
* @enum {0 | 1 | 2 | 3 | 4 | 5}
|
|
3160
3467
|
*/
|
|
3161
3468
|
export const WasmLinkType = Object.freeze({
|
|
@@ -3168,6 +3475,9 @@ export const WasmLinkType = Object.freeze({
|
|
|
3168
3475
|
});
|
|
3169
3476
|
|
|
3170
3477
|
/**
|
|
3478
|
+
* List indentation character type.
|
|
3479
|
+
*
|
|
3480
|
+
* Controls whether list items are indented with spaces or tabs.
|
|
3171
3481
|
* @enum {0 | 1}
|
|
3172
3482
|
*/
|
|
3173
3483
|
export const WasmListIndentType = Object.freeze({
|
|
@@ -3175,295 +3485,299 @@ export const WasmListIndentType = Object.freeze({
|
|
|
3175
3485
|
Tabs: 1, "1": "Tabs",
|
|
3176
3486
|
});
|
|
3177
3487
|
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3488
|
+
/**
|
|
3489
|
+
* Line break syntax in Markdown output.
|
|
3490
|
+
*
|
|
3491
|
+
* Controls how soft line breaks (from `<br>` or line breaks in source) are rendered.
|
|
3492
|
+
* @enum {0 | 1}
|
|
3493
|
+
*/
|
|
3494
|
+
export const WasmNewlineStyle = Object.freeze({
|
|
3495
|
+
Spaces: 0, "0": "Spaces",
|
|
3496
|
+
Backslash: 1, "1": "Backslash",
|
|
3497
|
+
});
|
|
3498
|
+
|
|
3499
|
+
/**
|
|
3500
|
+
* The semantic content type of a document node.
|
|
3501
|
+
*
|
|
3502
|
+
* Uses internally tagged representation (`"node_type": "heading"`) for JSON serialization.
|
|
3503
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}
|
|
3504
|
+
*/
|
|
3505
|
+
export const WasmNodeContent = Object.freeze({
|
|
3506
|
+
Heading: 0, "0": "Heading",
|
|
3507
|
+
Paragraph: 1, "1": "Paragraph",
|
|
3508
|
+
List: 2, "2": "List",
|
|
3509
|
+
ListItem: 3, "3": "ListItem",
|
|
3510
|
+
Table: 4, "4": "Table",
|
|
3511
|
+
Image: 5, "5": "Image",
|
|
3512
|
+
Code: 6, "6": "Code",
|
|
3513
|
+
Quote: 7, "7": "Quote",
|
|
3514
|
+
DefinitionList: 8, "8": "DefinitionList",
|
|
3515
|
+
DefinitionItem: 9, "9": "DefinitionItem",
|
|
3516
|
+
RawBlock: 10, "10": "RawBlock",
|
|
3517
|
+
MetadataBlock: 11, "11": "MetadataBlock",
|
|
3518
|
+
Group: 12, "12": "Group",
|
|
3519
|
+
});
|
|
3520
|
+
|
|
3521
|
+
/**
|
|
3522
|
+
* Context information passed to all visitor methods.
|
|
3523
|
+
*
|
|
3524
|
+
* Provides comprehensive metadata about the current node being visited,
|
|
3525
|
+
* including its type, attributes, position in the DOM tree, and parent context.
|
|
3526
|
+
*/
|
|
3527
|
+
export class WasmNodeContext {
|
|
3186
3528
|
__destroy_into_raw() {
|
|
3187
3529
|
const ptr = this.__wbg_ptr;
|
|
3188
3530
|
this.__wbg_ptr = 0;
|
|
3189
|
-
|
|
3531
|
+
WasmNodeContextFinalization.unregister(this);
|
|
3190
3532
|
return ptr;
|
|
3191
3533
|
}
|
|
3192
3534
|
free() {
|
|
3193
3535
|
const ptr = this.__destroy_into_raw();
|
|
3194
|
-
wasm.
|
|
3195
|
-
}
|
|
3196
|
-
/**
|
|
3197
|
-
* @returns {boolean}
|
|
3198
|
-
*/
|
|
3199
|
-
anyEnabled() {
|
|
3200
|
-
const ret = wasm.wasmmetadataconfig_anyEnabled(this.__wbg_ptr);
|
|
3201
|
-
return ret !== 0;
|
|
3202
|
-
}
|
|
3203
|
-
/**
|
|
3204
|
-
* @param {WasmMetadataConfigUpdate} _update
|
|
3205
|
-
*/
|
|
3206
|
-
applyUpdate(_update) {
|
|
3207
|
-
_assertClass(_update, WasmMetadataConfigUpdate);
|
|
3208
|
-
var ptr0 = _update.__destroy_into_raw();
|
|
3209
|
-
wasm.wasmmetadataconfig_applyUpdate(this.__wbg_ptr, ptr0);
|
|
3210
|
-
}
|
|
3211
|
-
/**
|
|
3212
|
-
* @returns {WasmMetadataConfig}
|
|
3213
|
-
*/
|
|
3214
|
-
static default() {
|
|
3215
|
-
const ret = wasm.wasmmetadataconfig_default();
|
|
3216
|
-
return WasmMetadataConfig.__wrap(ret);
|
|
3536
|
+
wasm.__wbg_wasmnodecontext_free(ptr, 0);
|
|
3217
3537
|
}
|
|
3218
3538
|
/**
|
|
3219
|
-
* @returns {
|
|
3220
|
-
*/
|
|
3221
|
-
get extractDocument() {
|
|
3222
|
-
const ret = wasm.wasmmetadataconfig_extractDocument(this.__wbg_ptr);
|
|
3223
|
-
return ret !== 0;
|
|
3224
|
-
}
|
|
3225
|
-
/**
|
|
3226
|
-
* @returns {boolean}
|
|
3539
|
+
* @returns {WasmConversionResult}
|
|
3227
3540
|
*/
|
|
3228
|
-
get
|
|
3229
|
-
const ret = wasm.
|
|
3230
|
-
return ret
|
|
3541
|
+
get attributes() {
|
|
3542
|
+
const ret = wasm.wasmnodecontext_attributes(this.__wbg_ptr);
|
|
3543
|
+
return takeObject(ret);
|
|
3231
3544
|
}
|
|
3232
3545
|
/**
|
|
3233
|
-
* @returns {
|
|
3546
|
+
* @returns {number}
|
|
3234
3547
|
*/
|
|
3235
|
-
get
|
|
3236
|
-
const ret = wasm.
|
|
3237
|
-
return ret
|
|
3548
|
+
get depth() {
|
|
3549
|
+
const ret = wasm.wasmnodecontext_depth(this.__wbg_ptr);
|
|
3550
|
+
return ret >>> 0;
|
|
3238
3551
|
}
|
|
3239
3552
|
/**
|
|
3240
|
-
* @returns {
|
|
3553
|
+
* @returns {number}
|
|
3241
3554
|
*/
|
|
3242
|
-
get
|
|
3243
|
-
const ret = wasm.
|
|
3244
|
-
return ret
|
|
3555
|
+
get indexInParent() {
|
|
3556
|
+
const ret = wasm.wasmnodecontext_indexInParent(this.__wbg_ptr);
|
|
3557
|
+
return ret >>> 0;
|
|
3245
3558
|
}
|
|
3246
3559
|
/**
|
|
3247
3560
|
* @returns {boolean}
|
|
3248
3561
|
*/
|
|
3249
|
-
get
|
|
3250
|
-
const ret = wasm.
|
|
3562
|
+
get isInline() {
|
|
3563
|
+
const ret = wasm.wasmnodecontext_isInline(this.__wbg_ptr);
|
|
3251
3564
|
return ret !== 0;
|
|
3252
3565
|
}
|
|
3253
3566
|
/**
|
|
3254
|
-
* @param {
|
|
3255
|
-
* @
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
return WasmMetadataConfig.__wrap(ret);
|
|
3262
|
-
}
|
|
3263
|
-
/**
|
|
3264
|
-
* @param {WasmMetadataConfigUpdate} update
|
|
3265
|
-
* @returns {WasmMetadataConfig}
|
|
3266
|
-
*/
|
|
3267
|
-
static fromUpdate(update) {
|
|
3268
|
-
_assertClass(update, WasmMetadataConfigUpdate);
|
|
3269
|
-
var ptr0 = update.__destroy_into_raw();
|
|
3270
|
-
const ret = wasm.wasmmetadataconfig_fromUpdate(ptr0);
|
|
3271
|
-
return WasmMetadataConfig.__wrap(ret);
|
|
3272
|
-
}
|
|
3273
|
-
/**
|
|
3274
|
-
* @returns {number}
|
|
3275
|
-
*/
|
|
3276
|
-
get maxStructuredDataSize() {
|
|
3277
|
-
const ret = wasm.wasmmetadataconfig_maxStructuredDataSize(this.__wbg_ptr);
|
|
3278
|
-
return ret >>> 0;
|
|
3279
|
-
}
|
|
3280
|
-
/**
|
|
3281
|
-
* @param {boolean | null} [extract_document]
|
|
3282
|
-
* @param {boolean | null} [extract_headers]
|
|
3283
|
-
* @param {boolean | null} [extract_links]
|
|
3284
|
-
* @param {boolean | null} [extract_images]
|
|
3285
|
-
* @param {boolean | null} [extract_structured_data]
|
|
3286
|
-
* @param {number | null} [max_structured_data_size]
|
|
3567
|
+
* @param {WasmNodeType} node_type
|
|
3568
|
+
* @param {string} tag_name
|
|
3569
|
+
* @param {any} attributes
|
|
3570
|
+
* @param {number} depth
|
|
3571
|
+
* @param {number} index_in_parent
|
|
3572
|
+
* @param {boolean} is_inline
|
|
3573
|
+
* @param {string | null} [parent_tag]
|
|
3287
3574
|
*/
|
|
3288
|
-
constructor(
|
|
3289
|
-
const
|
|
3575
|
+
constructor(node_type, tag_name, attributes, depth, index_in_parent, is_inline, parent_tag) {
|
|
3576
|
+
const ptr0 = passStringToWasm0(tag_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3577
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3578
|
+
var ptr1 = isLikeNone(parent_tag) ? 0 : passStringToWasm0(parent_tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3579
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3580
|
+
const ret = wasm.wasmnodecontext_new(node_type, ptr0, len0, addHeapObject(attributes), depth, index_in_parent, is_inline, ptr1, len1);
|
|
3290
3581
|
this.__wbg_ptr = ret >>> 0;
|
|
3291
|
-
|
|
3582
|
+
WasmNodeContextFinalization.register(this, this.__wbg_ptr, this);
|
|
3292
3583
|
return this;
|
|
3293
3584
|
}
|
|
3294
3585
|
/**
|
|
3295
|
-
* @
|
|
3296
|
-
*/
|
|
3297
|
-
set extractDocument(value) {
|
|
3298
|
-
wasm.wasmmetadataconfig_set_extractDocument(this.__wbg_ptr, value);
|
|
3299
|
-
}
|
|
3300
|
-
/**
|
|
3301
|
-
* @param {boolean} value
|
|
3586
|
+
* @returns {WasmNodeType}
|
|
3302
3587
|
*/
|
|
3303
|
-
|
|
3304
|
-
wasm.
|
|
3305
|
-
|
|
3306
|
-
/**
|
|
3307
|
-
* @param {boolean} value
|
|
3308
|
-
*/
|
|
3309
|
-
set extractImages(value) {
|
|
3310
|
-
wasm.wasmmetadataconfig_set_extractImages(this.__wbg_ptr, value);
|
|
3588
|
+
get nodeType() {
|
|
3589
|
+
const ret = wasm.wasmnodecontext_nodeType(this.__wbg_ptr);
|
|
3590
|
+
return ret;
|
|
3311
3591
|
}
|
|
3312
3592
|
/**
|
|
3313
|
-
* @
|
|
3593
|
+
* @returns {string | undefined}
|
|
3314
3594
|
*/
|
|
3315
|
-
|
|
3316
|
-
|
|
3595
|
+
get parentTag() {
|
|
3596
|
+
try {
|
|
3597
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3598
|
+
wasm.wasmnodecontext_parentTag(retptr, this.__wbg_ptr);
|
|
3599
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3600
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3601
|
+
let v1;
|
|
3602
|
+
if (r0 !== 0) {
|
|
3603
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3604
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3605
|
+
}
|
|
3606
|
+
return v1;
|
|
3607
|
+
} finally {
|
|
3608
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3609
|
+
}
|
|
3317
3610
|
}
|
|
3318
3611
|
/**
|
|
3319
|
-
* @param {
|
|
3612
|
+
* @param {any} value
|
|
3320
3613
|
*/
|
|
3321
|
-
set
|
|
3322
|
-
wasm.
|
|
3614
|
+
set attributes(value) {
|
|
3615
|
+
wasm.wasmnodecontext_set_attributes(this.__wbg_ptr, addHeapObject(value));
|
|
3323
3616
|
}
|
|
3324
3617
|
/**
|
|
3325
3618
|
* @param {number} value
|
|
3326
3619
|
*/
|
|
3327
|
-
set
|
|
3328
|
-
wasm.
|
|
3329
|
-
}
|
|
3330
|
-
}
|
|
3331
|
-
if (Symbol.dispose) WasmMetadataConfig.prototype[Symbol.dispose] = WasmMetadataConfig.prototype.free;
|
|
3332
|
-
|
|
3333
|
-
export class WasmMetadataConfigUpdate {
|
|
3334
|
-
__destroy_into_raw() {
|
|
3335
|
-
const ptr = this.__wbg_ptr;
|
|
3336
|
-
this.__wbg_ptr = 0;
|
|
3337
|
-
WasmMetadataConfigUpdateFinalization.unregister(this);
|
|
3338
|
-
return ptr;
|
|
3339
|
-
}
|
|
3340
|
-
free() {
|
|
3341
|
-
const ptr = this.__destroy_into_raw();
|
|
3342
|
-
wasm.__wbg_wasmmetadataconfigupdate_free(ptr, 0);
|
|
3343
|
-
}
|
|
3344
|
-
/**
|
|
3345
|
-
* @returns {boolean | undefined}
|
|
3346
|
-
*/
|
|
3347
|
-
get extractDocument() {
|
|
3348
|
-
const ret = wasm.wasmmetadataconfigupdate_extractDocument(this.__wbg_ptr);
|
|
3349
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3350
|
-
}
|
|
3351
|
-
/**
|
|
3352
|
-
* @returns {boolean | undefined}
|
|
3353
|
-
*/
|
|
3354
|
-
get extractHeaders() {
|
|
3355
|
-
const ret = wasm.wasmmetadataconfigupdate_extractHeaders(this.__wbg_ptr);
|
|
3356
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3357
|
-
}
|
|
3358
|
-
/**
|
|
3359
|
-
* @returns {boolean | undefined}
|
|
3360
|
-
*/
|
|
3361
|
-
get extractImages() {
|
|
3362
|
-
const ret = wasm.wasmmetadataconfigupdate_extractImages(this.__wbg_ptr);
|
|
3363
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3364
|
-
}
|
|
3365
|
-
/**
|
|
3366
|
-
* @returns {boolean | undefined}
|
|
3367
|
-
*/
|
|
3368
|
-
get extractLinks() {
|
|
3369
|
-
const ret = wasm.wasmmetadataconfigupdate_extractLinks(this.__wbg_ptr);
|
|
3370
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3371
|
-
}
|
|
3372
|
-
/**
|
|
3373
|
-
* @returns {boolean | undefined}
|
|
3374
|
-
*/
|
|
3375
|
-
get extractStructuredData() {
|
|
3376
|
-
const ret = wasm.wasmmetadataconfigupdate_extractStructuredData(this.__wbg_ptr);
|
|
3377
|
-
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3378
|
-
}
|
|
3379
|
-
/**
|
|
3380
|
-
* @returns {number | undefined}
|
|
3381
|
-
*/
|
|
3382
|
-
get maxStructuredDataSize() {
|
|
3383
|
-
const ret = wasm.wasmmetadataconfigupdate_maxStructuredDataSize(this.__wbg_ptr);
|
|
3384
|
-
return ret === 0x100000001 ? undefined : ret;
|
|
3385
|
-
}
|
|
3386
|
-
/**
|
|
3387
|
-
* @param {boolean | null} [extract_document]
|
|
3388
|
-
* @param {boolean | null} [extract_headers]
|
|
3389
|
-
* @param {boolean | null} [extract_links]
|
|
3390
|
-
* @param {boolean | null} [extract_images]
|
|
3391
|
-
* @param {boolean | null} [extract_structured_data]
|
|
3392
|
-
* @param {number | null} [max_structured_data_size]
|
|
3393
|
-
*/
|
|
3394
|
-
constructor(extract_document, extract_headers, extract_links, extract_images, extract_structured_data, max_structured_data_size) {
|
|
3395
|
-
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);
|
|
3396
|
-
this.__wbg_ptr = ret >>> 0;
|
|
3397
|
-
WasmMetadataConfigUpdateFinalization.register(this, this.__wbg_ptr, this);
|
|
3398
|
-
return this;
|
|
3620
|
+
set depth(value) {
|
|
3621
|
+
wasm.wasmnodecontext_set_depth(this.__wbg_ptr, value);
|
|
3399
3622
|
}
|
|
3400
3623
|
/**
|
|
3401
|
-
* @param {
|
|
3624
|
+
* @param {number} value
|
|
3402
3625
|
*/
|
|
3403
|
-
set
|
|
3404
|
-
wasm.
|
|
3626
|
+
set indexInParent(value) {
|
|
3627
|
+
wasm.wasmnodecontext_set_indexInParent(this.__wbg_ptr, value);
|
|
3405
3628
|
}
|
|
3406
3629
|
/**
|
|
3407
|
-
* @param {boolean
|
|
3630
|
+
* @param {boolean} value
|
|
3408
3631
|
*/
|
|
3409
|
-
set
|
|
3410
|
-
wasm.
|
|
3632
|
+
set isInline(value) {
|
|
3633
|
+
wasm.wasmnodecontext_set_isInline(this.__wbg_ptr, value);
|
|
3411
3634
|
}
|
|
3412
3635
|
/**
|
|
3413
|
-
* @param {
|
|
3636
|
+
* @param {WasmNodeType} value
|
|
3414
3637
|
*/
|
|
3415
|
-
set
|
|
3416
|
-
wasm.
|
|
3638
|
+
set nodeType(value) {
|
|
3639
|
+
wasm.wasmnodecontext_set_nodeType(this.__wbg_ptr, value);
|
|
3417
3640
|
}
|
|
3418
3641
|
/**
|
|
3419
|
-
* @param {
|
|
3642
|
+
* @param {string | null} [value]
|
|
3420
3643
|
*/
|
|
3421
|
-
set
|
|
3422
|
-
|
|
3644
|
+
set parentTag(value) {
|
|
3645
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3646
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3647
|
+
wasm.wasmnodecontext_set_parentTag(this.__wbg_ptr, ptr0, len0);
|
|
3423
3648
|
}
|
|
3424
3649
|
/**
|
|
3425
|
-
* @param {
|
|
3650
|
+
* @param {string} value
|
|
3426
3651
|
*/
|
|
3427
|
-
set
|
|
3428
|
-
|
|
3652
|
+
set tagName(value) {
|
|
3653
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3654
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3655
|
+
wasm.wasmnodecontext_set_tagName(this.__wbg_ptr, ptr0, len0);
|
|
3429
3656
|
}
|
|
3430
3657
|
/**
|
|
3431
|
-
* @
|
|
3658
|
+
* @returns {string}
|
|
3432
3659
|
*/
|
|
3433
|
-
|
|
3434
|
-
|
|
3660
|
+
get tagName() {
|
|
3661
|
+
let deferred1_0;
|
|
3662
|
+
let deferred1_1;
|
|
3663
|
+
try {
|
|
3664
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3665
|
+
wasm.wasmnodecontext_tagName(retptr, this.__wbg_ptr);
|
|
3666
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3667
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3668
|
+
deferred1_0 = r0;
|
|
3669
|
+
deferred1_1 = r1;
|
|
3670
|
+
return getStringFromWasm0(r0, r1);
|
|
3671
|
+
} finally {
|
|
3672
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3673
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3674
|
+
}
|
|
3435
3675
|
}
|
|
3436
3676
|
}
|
|
3437
|
-
if (Symbol.dispose)
|
|
3677
|
+
if (Symbol.dispose) WasmNodeContext.prototype[Symbol.dispose] = WasmNodeContext.prototype.free;
|
|
3438
3678
|
|
|
3439
3679
|
/**
|
|
3440
|
-
*
|
|
3680
|
+
* Node type enumeration covering all HTML element types.
|
|
3681
|
+
*
|
|
3682
|
+
* This enum categorizes all HTML elements that the converter recognizes,
|
|
3683
|
+
* providing a coarse-grained classification for visitor dispatch.
|
|
3684
|
+
* @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}
|
|
3441
3685
|
*/
|
|
3442
|
-
export const
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3686
|
+
export const WasmNodeType = Object.freeze({
|
|
3687
|
+
Text: 0, "0": "Text",
|
|
3688
|
+
Element: 1, "1": "Element",
|
|
3689
|
+
Heading: 2, "2": "Heading",
|
|
3690
|
+
Paragraph: 3, "3": "Paragraph",
|
|
3691
|
+
Div: 4, "4": "Div",
|
|
3692
|
+
Blockquote: 5, "5": "Blockquote",
|
|
3693
|
+
Pre: 6, "6": "Pre",
|
|
3694
|
+
Hr: 7, "7": "Hr",
|
|
3695
|
+
List: 8, "8": "List",
|
|
3696
|
+
ListItem: 9, "9": "ListItem",
|
|
3697
|
+
DefinitionList: 10, "10": "DefinitionList",
|
|
3698
|
+
DefinitionTerm: 11, "11": "DefinitionTerm",
|
|
3699
|
+
DefinitionDescription: 12, "12": "DefinitionDescription",
|
|
3700
|
+
Table: 13, "13": "Table",
|
|
3701
|
+
TableRow: 14, "14": "TableRow",
|
|
3702
|
+
TableCell: 15, "15": "TableCell",
|
|
3703
|
+
TableHeader: 16, "16": "TableHeader",
|
|
3704
|
+
TableBody: 17, "17": "TableBody",
|
|
3705
|
+
TableHead: 18, "18": "TableHead",
|
|
3706
|
+
TableFoot: 19, "19": "TableFoot",
|
|
3707
|
+
Link: 20, "20": "Link",
|
|
3708
|
+
Image: 21, "21": "Image",
|
|
3709
|
+
Strong: 22, "22": "Strong",
|
|
3710
|
+
Em: 23, "23": "Em",
|
|
3711
|
+
Code: 24, "24": "Code",
|
|
3712
|
+
Strikethrough: 25, "25": "Strikethrough",
|
|
3713
|
+
Underline: 26, "26": "Underline",
|
|
3714
|
+
Subscript: 27, "27": "Subscript",
|
|
3715
|
+
Superscript: 28, "28": "Superscript",
|
|
3716
|
+
Mark: 29, "29": "Mark",
|
|
3717
|
+
Small: 30, "30": "Small",
|
|
3718
|
+
Br: 31, "31": "Br",
|
|
3719
|
+
Span: 32, "32": "Span",
|
|
3720
|
+
Article: 33, "33": "Article",
|
|
3721
|
+
Section: 34, "34": "Section",
|
|
3722
|
+
Nav: 35, "35": "Nav",
|
|
3723
|
+
Aside: 36, "36": "Aside",
|
|
3724
|
+
Header: 37, "37": "Header",
|
|
3725
|
+
Footer: 38, "38": "Footer",
|
|
3726
|
+
Main: 39, "39": "Main",
|
|
3727
|
+
Figure: 40, "40": "Figure",
|
|
3728
|
+
Figcaption: 41, "41": "Figcaption",
|
|
3729
|
+
Time: 42, "42": "Time",
|
|
3730
|
+
Details: 43, "43": "Details",
|
|
3731
|
+
Summary: 44, "44": "Summary",
|
|
3732
|
+
Form: 45, "45": "Form",
|
|
3733
|
+
Input: 46, "46": "Input",
|
|
3734
|
+
Select: 47, "47": "Select",
|
|
3735
|
+
Option: 48, "48": "Option",
|
|
3736
|
+
Button: 49, "49": "Button",
|
|
3737
|
+
Textarea: 50, "50": "Textarea",
|
|
3738
|
+
Label: 51, "51": "Label",
|
|
3739
|
+
Fieldset: 52, "52": "Fieldset",
|
|
3740
|
+
Legend: 53, "53": "Legend",
|
|
3741
|
+
Audio: 54, "54": "Audio",
|
|
3742
|
+
Video: 55, "55": "Video",
|
|
3743
|
+
Picture: 56, "56": "Picture",
|
|
3744
|
+
Source: 57, "57": "Source",
|
|
3745
|
+
Iframe: 58, "58": "Iframe",
|
|
3746
|
+
Svg: 59, "59": "Svg",
|
|
3747
|
+
Canvas: 60, "60": "Canvas",
|
|
3748
|
+
Ruby: 61, "61": "Ruby",
|
|
3749
|
+
Rt: 62, "62": "Rt",
|
|
3750
|
+
Rp: 63, "63": "Rp",
|
|
3751
|
+
Abbr: 64, "64": "Abbr",
|
|
3752
|
+
Kbd: 65, "65": "Kbd",
|
|
3753
|
+
Samp: 66, "66": "Samp",
|
|
3754
|
+
Var: 67, "67": "Var",
|
|
3755
|
+
Cite: 68, "68": "Cite",
|
|
3756
|
+
Q: 69, "69": "Q",
|
|
3757
|
+
Del: 70, "70": "Del",
|
|
3758
|
+
Ins: 71, "71": "Ins",
|
|
3759
|
+
Data: 72, "72": "Data",
|
|
3760
|
+
Meter: 73, "73": "Meter",
|
|
3761
|
+
Progress: 74, "74": "Progress",
|
|
3762
|
+
Output: 75, "75": "Output",
|
|
3763
|
+
Template: 76, "76": "Template",
|
|
3764
|
+
Slot: 77, "77": "Slot",
|
|
3765
|
+
Html: 78, "78": "Html",
|
|
3766
|
+
Head: 79, "79": "Head",
|
|
3767
|
+
Body: 80, "80": "Body",
|
|
3768
|
+
Title: 81, "81": "Title",
|
|
3769
|
+
Meta: 82, "82": "Meta",
|
|
3770
|
+
LinkTag: 83, "83": "LinkTag",
|
|
3771
|
+
Style: 84, "84": "Style",
|
|
3772
|
+
Script: 85, "85": "Script",
|
|
3773
|
+
Base: 86, "86": "Base",
|
|
3774
|
+
Custom: 87, "87": "Custom",
|
|
3464
3775
|
});
|
|
3465
3776
|
|
|
3466
3777
|
/**
|
|
3778
|
+
* Output format for conversion.
|
|
3779
|
+
*
|
|
3780
|
+
* Specifies the target markup language format for the conversion output.
|
|
3467
3781
|
* @enum {0 | 1 | 2}
|
|
3468
3782
|
*/
|
|
3469
3783
|
export const WasmOutputFormat = Object.freeze({
|
|
@@ -3472,6 +3786,9 @@ export const WasmOutputFormat = Object.freeze({
|
|
|
3472
3786
|
Plain: 2, "2": "Plain",
|
|
3473
3787
|
});
|
|
3474
3788
|
|
|
3789
|
+
/**
|
|
3790
|
+
* HTML preprocessing options for document cleanup before conversion.
|
|
3791
|
+
*/
|
|
3475
3792
|
export class WasmPreprocessingOptions {
|
|
3476
3793
|
static __wrap(ptr) {
|
|
3477
3794
|
ptr = ptr >>> 0;
|
|
@@ -3491,6 +3808,14 @@ export class WasmPreprocessingOptions {
|
|
|
3491
3808
|
wasm.__wbg_wasmpreprocessingoptions_free(ptr, 0);
|
|
3492
3809
|
}
|
|
3493
3810
|
/**
|
|
3811
|
+
* Apply a partial update to these preprocessing options.
|
|
3812
|
+
*
|
|
3813
|
+
* Any specified fields in the update will override the current values.
|
|
3814
|
+
* Unspecified fields (None) are left unchanged.
|
|
3815
|
+
*
|
|
3816
|
+
* # Arguments
|
|
3817
|
+
*
|
|
3818
|
+
* * `update` - Partial preprocessing options update
|
|
3494
3819
|
* @param {WasmPreprocessingOptionsUpdate} _update
|
|
3495
3820
|
*/
|
|
3496
3821
|
applyUpdate(_update) {
|
|
@@ -3523,6 +3848,18 @@ export class WasmPreprocessingOptions {
|
|
|
3523
3848
|
return WasmPreprocessingOptions.__wrap(ret);
|
|
3524
3849
|
}
|
|
3525
3850
|
/**
|
|
3851
|
+
* Create new preprocessing options from a partial update.
|
|
3852
|
+
*
|
|
3853
|
+
* Creates a new `PreprocessingOptions` struct with defaults, then applies the update.
|
|
3854
|
+
* Fields not specified in the update keep their default values.
|
|
3855
|
+
*
|
|
3856
|
+
* # Arguments
|
|
3857
|
+
*
|
|
3858
|
+
* * `update` - Partial preprocessing options update
|
|
3859
|
+
*
|
|
3860
|
+
* # Returns
|
|
3861
|
+
*
|
|
3862
|
+
* New `PreprocessingOptions` with specified updates applied to defaults
|
|
3526
3863
|
* @param {WasmPreprocessingOptionsUpdate} update
|
|
3527
3864
|
* @returns {WasmPreprocessingOptions}
|
|
3528
3865
|
*/
|
|
@@ -3592,6 +3929,13 @@ export class WasmPreprocessingOptions {
|
|
|
3592
3929
|
}
|
|
3593
3930
|
if (Symbol.dispose) WasmPreprocessingOptions.prototype[Symbol.dispose] = WasmPreprocessingOptions.prototype.free;
|
|
3594
3931
|
|
|
3932
|
+
/**
|
|
3933
|
+
* Partial update for `PreprocessingOptions`.
|
|
3934
|
+
*
|
|
3935
|
+
* This struct uses `Option<T>` to represent optional fields that can be selectively updated.
|
|
3936
|
+
* Only specified fields (Some values) will override existing options; None values leave the
|
|
3937
|
+
* corresponding fields unchanged when applied via [`PreprocessingOptions::apply_update`].
|
|
3938
|
+
*/
|
|
3595
3939
|
export class WasmPreprocessingOptionsUpdate {
|
|
3596
3940
|
static __wrap(ptr) {
|
|
3597
3941
|
ptr = ptr >>> 0;
|
|
@@ -3678,6 +4022,9 @@ export class WasmPreprocessingOptionsUpdate {
|
|
|
3678
4022
|
if (Symbol.dispose) WasmPreprocessingOptionsUpdate.prototype[Symbol.dispose] = WasmPreprocessingOptionsUpdate.prototype.free;
|
|
3679
4023
|
|
|
3680
4024
|
/**
|
|
4025
|
+
* HTML preprocessing aggressiveness level.
|
|
4026
|
+
*
|
|
4027
|
+
* Controls the extent of cleanup performed before conversion. Higher levels remove more elements.
|
|
3681
4028
|
* @enum {0 | 1 | 2}
|
|
3682
4029
|
*/
|
|
3683
4030
|
export const WasmPreprocessingPreset = Object.freeze({
|
|
@@ -3686,6 +4033,9 @@ export const WasmPreprocessingPreset = Object.freeze({
|
|
|
3686
4033
|
Aggressive: 2, "2": "Aggressive",
|
|
3687
4034
|
});
|
|
3688
4035
|
|
|
4036
|
+
/**
|
|
4037
|
+
* A non-fatal warning generated during HTML processing.
|
|
4038
|
+
*/
|
|
3689
4039
|
export class WasmProcessingWarning {
|
|
3690
4040
|
static __wrap(ptr) {
|
|
3691
4041
|
ptr = ptr >>> 0;
|
|
@@ -3733,7 +4083,7 @@ export class WasmProcessingWarning {
|
|
|
3733
4083
|
return getStringFromWasm0(r0, r1);
|
|
3734
4084
|
} finally {
|
|
3735
4085
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3736
|
-
wasm.
|
|
4086
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3737
4087
|
}
|
|
3738
4088
|
}
|
|
3739
4089
|
/**
|
|
@@ -3765,6 +4115,25 @@ export class WasmProcessingWarning {
|
|
|
3765
4115
|
}
|
|
3766
4116
|
if (Symbol.dispose) WasmProcessingWarning.prototype[Symbol.dispose] = WasmProcessingWarning.prototype.free;
|
|
3767
4117
|
|
|
4118
|
+
/**
|
|
4119
|
+
* Structured data block (JSON-LD, Microdata, or RDFa).
|
|
4120
|
+
*
|
|
4121
|
+
* Represents machine-readable structured data found in the document.
|
|
4122
|
+
* JSON-LD blocks are collected as raw JSON strings for flexibility.
|
|
4123
|
+
*
|
|
4124
|
+
* # Examples
|
|
4125
|
+
*
|
|
4126
|
+
* ```
|
|
4127
|
+
* # use html_to_markdown_rs::metadata::{StructuredData, StructuredDataType};
|
|
4128
|
+
* let schema = StructuredData {
|
|
4129
|
+
* data_type: StructuredDataType::JsonLd,
|
|
4130
|
+
* raw_json: r#"{"@context":"https://schema.org","@type":"Article"}"#.to_string(),
|
|
4131
|
+
* schema_type: Some("Article".to_string()),
|
|
4132
|
+
* };
|
|
4133
|
+
*
|
|
4134
|
+
* assert_eq!(schema.data_type, StructuredDataType::JsonLd);
|
|
4135
|
+
* ```
|
|
4136
|
+
*/
|
|
3768
4137
|
export class WasmStructuredData {
|
|
3769
4138
|
static __wrap(ptr) {
|
|
3770
4139
|
ptr = ptr >>> 0;
|
|
@@ -3827,7 +4196,7 @@ export class WasmStructuredData {
|
|
|
3827
4196
|
return getStringFromWasm0(r0, r1);
|
|
3828
4197
|
} finally {
|
|
3829
4198
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3830
|
-
wasm.
|
|
4199
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3831
4200
|
}
|
|
3832
4201
|
}
|
|
3833
4202
|
/**
|
|
@@ -3842,7 +4211,7 @@ export class WasmStructuredData {
|
|
|
3842
4211
|
let v1;
|
|
3843
4212
|
if (r0 !== 0) {
|
|
3844
4213
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3845
|
-
wasm.
|
|
4214
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3846
4215
|
}
|
|
3847
4216
|
return v1;
|
|
3848
4217
|
} finally {
|
|
@@ -3875,6 +4244,9 @@ export class WasmStructuredData {
|
|
|
3875
4244
|
if (Symbol.dispose) WasmStructuredData.prototype[Symbol.dispose] = WasmStructuredData.prototype.free;
|
|
3876
4245
|
|
|
3877
4246
|
/**
|
|
4247
|
+
* Structured data format type.
|
|
4248
|
+
*
|
|
4249
|
+
* Identifies the schema/format used for structured data markup.
|
|
3878
4250
|
* @enum {0 | 1 | 2}
|
|
3879
4251
|
*/
|
|
3880
4252
|
export const WasmStructuredDataType = Object.freeze({
|
|
@@ -3883,6 +4255,9 @@ export const WasmStructuredDataType = Object.freeze({
|
|
|
3883
4255
|
RDFa: 2, "2": "RDFa",
|
|
3884
4256
|
});
|
|
3885
4257
|
|
|
4258
|
+
/**
|
|
4259
|
+
* A top-level extracted table with both structured data and markdown representation.
|
|
4260
|
+
*/
|
|
3886
4261
|
export class WasmTableData {
|
|
3887
4262
|
static __wrap(ptr) {
|
|
3888
4263
|
ptr = ptr >>> 0;
|
|
@@ -3930,7 +4305,7 @@ export class WasmTableData {
|
|
|
3930
4305
|
return getStringFromWasm0(r0, r1);
|
|
3931
4306
|
} finally {
|
|
3932
4307
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3933
|
-
wasm.
|
|
4308
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3934
4309
|
}
|
|
3935
4310
|
}
|
|
3936
4311
|
/**
|
|
@@ -3966,6 +4341,9 @@ export class WasmTableData {
|
|
|
3966
4341
|
}
|
|
3967
4342
|
if (Symbol.dispose) WasmTableData.prototype[Symbol.dispose] = WasmTableData.prototype.free;
|
|
3968
4343
|
|
|
4344
|
+
/**
|
|
4345
|
+
* A structured table grid with cell-level data including spans.
|
|
4346
|
+
*/
|
|
3969
4347
|
export class WasmTableGrid {
|
|
3970
4348
|
static __wrap(ptr) {
|
|
3971
4349
|
ptr = ptr >>> 0;
|
|
@@ -3994,7 +4372,7 @@ export class WasmTableGrid {
|
|
|
3994
4372
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3995
4373
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3996
4374
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
3997
|
-
wasm.
|
|
4375
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
3998
4376
|
return v1;
|
|
3999
4377
|
} finally {
|
|
4000
4378
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -4050,6 +4428,11 @@ export class WasmTableGrid {
|
|
|
4050
4428
|
}
|
|
4051
4429
|
if (Symbol.dispose) WasmTableGrid.prototype[Symbol.dispose] = WasmTableGrid.prototype.free;
|
|
4052
4430
|
|
|
4431
|
+
/**
|
|
4432
|
+
* An inline text annotation with byte-range offsets.
|
|
4433
|
+
*
|
|
4434
|
+
* Annotations describe formatting (bold, italic, etc.) and links within a node's text content.
|
|
4435
|
+
*/
|
|
4053
4436
|
export class WasmTextAnnotation {
|
|
4054
4437
|
static __wrap(ptr) {
|
|
4055
4438
|
ptr = ptr >>> 0;
|
|
@@ -4128,6 +4511,9 @@ export class WasmTextAnnotation {
|
|
|
4128
4511
|
if (Symbol.dispose) WasmTextAnnotation.prototype[Symbol.dispose] = WasmTextAnnotation.prototype.free;
|
|
4129
4512
|
|
|
4130
4513
|
/**
|
|
4514
|
+
* Text directionality of document content.
|
|
4515
|
+
*
|
|
4516
|
+
* Corresponds to the HTML `dir` attribute and `bdi` element directionality.
|
|
4131
4517
|
* @enum {0 | 1 | 2}
|
|
4132
4518
|
*/
|
|
4133
4519
|
export const WasmTextDirection = Object.freeze({
|
|
@@ -4137,6 +4523,23 @@ export const WasmTextDirection = Object.freeze({
|
|
|
4137
4523
|
});
|
|
4138
4524
|
|
|
4139
4525
|
/**
|
|
4526
|
+
* Result of a visitor callback.
|
|
4527
|
+
*
|
|
4528
|
+
* Allows visitors to control the conversion flow by either proceeding
|
|
4529
|
+
* with default behavior, providing custom output, skipping elements,
|
|
4530
|
+
* preserving HTML, or signaling errors.
|
|
4531
|
+
* @enum {0 | 1 | 2 | 3 | 4}
|
|
4532
|
+
*/
|
|
4533
|
+
export const WasmVisitResult = Object.freeze({
|
|
4534
|
+
Continue: 0, "0": "Continue",
|
|
4535
|
+
Custom: 1, "1": "Custom",
|
|
4536
|
+
Skip: 2, "2": "Skip",
|
|
4537
|
+
PreserveHtml: 3, "3": "PreserveHtml",
|
|
4538
|
+
Error: 4, "4": "Error",
|
|
4539
|
+
});
|
|
4540
|
+
|
|
4541
|
+
/**
|
|
4542
|
+
* Categories of processing warnings.
|
|
4140
4543
|
* @enum {0 | 1 | 2 | 3 | 4 | 5}
|
|
4141
4544
|
*/
|
|
4142
4545
|
export const WasmWarningKind = Object.freeze({
|
|
@@ -4149,6 +4552,9 @@ export const WasmWarningKind = Object.freeze({
|
|
|
4149
4552
|
});
|
|
4150
4553
|
|
|
4151
4554
|
/**
|
|
4555
|
+
* Whitespace handling strategy during conversion.
|
|
4556
|
+
*
|
|
4557
|
+
* Determines how sequences of whitespace characters (spaces, tabs, newlines) are processed.
|
|
4152
4558
|
* @enum {0 | 1}
|
|
4153
4559
|
*/
|
|
4154
4560
|
export const WasmWhitespaceMode = Object.freeze({
|
|
@@ -4159,9 +4565,10 @@ export const WasmWhitespaceMode = Object.freeze({
|
|
|
4159
4565
|
/**
|
|
4160
4566
|
* @param {string} html
|
|
4161
4567
|
* @param {WasmConversionOptions | null} [options]
|
|
4568
|
+
* @param {any | null} [visitor]
|
|
4162
4569
|
* @returns {WasmConversionResult}
|
|
4163
4570
|
*/
|
|
4164
|
-
export function convert(html, options) {
|
|
4571
|
+
export function convert(html, options, visitor) {
|
|
4165
4572
|
try {
|
|
4166
4573
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4167
4574
|
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -4171,7 +4578,7 @@ export function convert(html, options) {
|
|
|
4171
4578
|
_assertClass(options, WasmConversionOptions);
|
|
4172
4579
|
ptr1 = options.__destroy_into_raw();
|
|
4173
4580
|
}
|
|
4174
|
-
wasm.convert(retptr, ptr0, len0, ptr1);
|
|
4581
|
+
wasm.convert(retptr, ptr0, len0, ptr1, isLikeNone(visitor) ? 0 : addHeapObject(visitor));
|
|
4175
4582
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4176
4583
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4177
4584
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -4190,6 +4597,10 @@ function __wbg_get_imports() {
|
|
|
4190
4597
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
4191
4598
|
return addHeapObject(ret);
|
|
4192
4599
|
},
|
|
4600
|
+
__wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
|
|
4601
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
4602
|
+
return ret;
|
|
4603
|
+
},
|
|
4193
4604
|
__wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
|
|
4194
4605
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
4195
4606
|
return ret;
|
|
@@ -4209,14 +4620,38 @@ function __wbg_get_imports() {
|
|
|
4209
4620
|
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
|
|
4210
4621
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
4211
4622
|
},
|
|
4623
|
+
__wbg_apply_4c35bd236dda9c14: function() { return handleError(function (arg0, arg1, arg2) {
|
|
4624
|
+
const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
|
|
4625
|
+
return addHeapObject(ret);
|
|
4626
|
+
}, arguments); },
|
|
4627
|
+
__wbg_get_6011fa3a58f61074: function() { return handleError(function (arg0, arg1) {
|
|
4628
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
4629
|
+
return addHeapObject(ret);
|
|
4630
|
+
}, arguments); },
|
|
4631
|
+
__wbg_has_880f1d472f7cecba: function() { return handleError(function (arg0, arg1) {
|
|
4632
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
4633
|
+
return ret;
|
|
4634
|
+
}, arguments); },
|
|
4212
4635
|
__wbg_new_34d45cc8e36aaead: function() {
|
|
4213
4636
|
const ret = new Map();
|
|
4214
4637
|
return addHeapObject(ret);
|
|
4215
4638
|
},
|
|
4639
|
+
__wbg_new_682678e2f47e32bc: function() {
|
|
4640
|
+
const ret = new Array();
|
|
4641
|
+
return addHeapObject(ret);
|
|
4642
|
+
},
|
|
4216
4643
|
__wbg_new_aa8d0fa9762c29bd: function() {
|
|
4217
4644
|
const ret = new Object();
|
|
4218
4645
|
return addHeapObject(ret);
|
|
4219
4646
|
},
|
|
4647
|
+
__wbg_push_471a5b068a5295f6: function(arg0, arg1) {
|
|
4648
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
4649
|
+
return ret;
|
|
4650
|
+
},
|
|
4651
|
+
__wbg_set_022bee52d0b05b19: function() { return handleError(function (arg0, arg1, arg2) {
|
|
4652
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
4653
|
+
return ret;
|
|
4654
|
+
}, arguments); },
|
|
4220
4655
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
4221
4656
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
4222
4657
|
},
|
|
@@ -4296,7 +4731,12 @@ function __wbg_get_imports() {
|
|
|
4296
4731
|
const ret = WasmTextAnnotation.__unwrap(getObject(arg0));
|
|
4297
4732
|
return ret;
|
|
4298
4733
|
},
|
|
4299
|
-
__wbindgen_cast_0000000000000001: function(arg0
|
|
4734
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
4735
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
4736
|
+
const ret = arg0;
|
|
4737
|
+
return addHeapObject(ret);
|
|
4738
|
+
},
|
|
4739
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
4300
4740
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
4301
4741
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
4302
4742
|
return addHeapObject(ret);
|
|
@@ -4351,12 +4791,9 @@ const WasmImageMetadataFinalization = (typeof FinalizationRegistry === 'undefine
|
|
|
4351
4791
|
const WasmLinkMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4352
4792
|
? { register: () => {}, unregister: () => {} }
|
|
4353
4793
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmlinkmetadata_free(ptr >>> 0, 1));
|
|
4354
|
-
const
|
|
4794
|
+
const WasmNodeContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4355
4795
|
? { register: () => {}, unregister: () => {} }
|
|
4356
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
4357
|
-
const WasmMetadataConfigUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4358
|
-
? { register: () => {}, unregister: () => {} }
|
|
4359
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmmetadataconfigupdate_free(ptr >>> 0, 1));
|
|
4796
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnodecontext_free(ptr >>> 0, 1));
|
|
4360
4797
|
const WasmPreprocessingOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4361
4798
|
? { register: () => {}, unregister: () => {} }
|
|
4362
4799
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpreprocessingoptions_free(ptr >>> 0, 1));
|
|
@@ -4446,6 +4883,14 @@ function getUint8ArrayMemory0() {
|
|
|
4446
4883
|
|
|
4447
4884
|
function getObject(idx) { return heap[idx]; }
|
|
4448
4885
|
|
|
4886
|
+
function handleError(f, args) {
|
|
4887
|
+
try {
|
|
4888
|
+
return f.apply(this, args);
|
|
4889
|
+
} catch (e) {
|
|
4890
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
4891
|
+
}
|
|
4892
|
+
}
|
|
4893
|
+
|
|
4449
4894
|
let heap = new Array(1024).fill(undefined);
|
|
4450
4895
|
heap.push(undefined, null, true, false);
|
|
4451
4896
|
|