@kreuzberg/html-to-markdown-wasm 3.4.1 → 3.5.0-rc.2
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/LICENSE +21 -0
- package/README.md +233 -0
- package/package.json +1 -1
- package/pkg/bundler/LICENSE +21 -0
- package/pkg/bundler/README.md +233 -0
- package/pkg/bundler/html_to_markdown_wasm.d.ts +107 -266
- package/pkg/bundler/html_to_markdown_wasm.js +1 -1
- package/pkg/bundler/html_to_markdown_wasm_bg.js +798 -591
- package/pkg/bundler/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/bundler/html_to_markdown_wasm_bg.wasm.d.ts +54 -20
- package/pkg/bundler/package.json +1 -1
- package/pkg/deno/LICENSE +21 -0
- package/pkg/deno/README.md +233 -0
- package/pkg/deno/html_to_markdown_wasm.d.ts +107 -266
- package/pkg/deno/html_to_markdown_wasm.js +798 -591
- package/pkg/deno/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/deno/html_to_markdown_wasm_bg.wasm.d.ts +54 -20
- package/pkg/nodejs/LICENSE +21 -0
- package/pkg/nodejs/README.md +233 -0
- package/pkg/nodejs/html_to_markdown_wasm.d.ts +107 -266
- package/pkg/nodejs/html_to_markdown_wasm.js +798 -592
- package/pkg/nodejs/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/nodejs/html_to_markdown_wasm_bg.wasm.d.ts +54 -20
- package/pkg/nodejs/package.json +1 -1
- package/pkg/web/LICENSE +21 -0
- package/pkg/web/README.md +233 -0
- package/pkg/web/html_to_markdown_wasm.d.ts +161 -286
- package/pkg/web/html_to_markdown_wasm.js +798 -591
- package/pkg/web/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/web/html_to_markdown_wasm_bg.wasm.d.ts +54 -20
- package/pkg/web/package.json +1 -1
|
@@ -4,19 +4,120 @@
|
|
|
4
4
|
* The type of an inline text annotation.
|
|
5
5
|
*
|
|
6
6
|
* Uses internally tagged representation (`"annotation_type": "bold"`) for JSON serialization.
|
|
7
|
-
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
class WasmAnnotationKind {
|
|
9
|
+
static __wrap(ptr) {
|
|
10
|
+
const obj = Object.create(WasmAnnotationKind.prototype);
|
|
11
|
+
obj.__wbg_ptr = ptr;
|
|
12
|
+
WasmAnnotationKindFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
__destroy_into_raw() {
|
|
16
|
+
const ptr = this.__wbg_ptr;
|
|
17
|
+
this.__wbg_ptr = 0;
|
|
18
|
+
WasmAnnotationKindFinalization.unregister(this);
|
|
19
|
+
return ptr;
|
|
20
|
+
}
|
|
21
|
+
free() {
|
|
22
|
+
const ptr = this.__destroy_into_raw();
|
|
23
|
+
wasm.__wbg_wasmannotationkind_free(ptr, 0);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
get annotationType() {
|
|
29
|
+
let deferred1_0;
|
|
30
|
+
let deferred1_1;
|
|
31
|
+
try {
|
|
32
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
33
|
+
wasm.wasmannotationkind_annotationType(retptr, this.__wbg_ptr);
|
|
34
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
35
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
36
|
+
deferred1_0 = r0;
|
|
37
|
+
deferred1_1 = r1;
|
|
38
|
+
return getStringFromWasm0(r0, r1);
|
|
39
|
+
} finally {
|
|
40
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
41
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @returns {WasmAnnotationKind}
|
|
46
|
+
*/
|
|
47
|
+
static default() {
|
|
48
|
+
const ret = wasm.wasmannotationkind_default();
|
|
49
|
+
return WasmAnnotationKind.__wrap(ret);
|
|
50
|
+
}
|
|
51
|
+
constructor() {
|
|
52
|
+
const ret = wasm.wasmannotationkind_new();
|
|
53
|
+
this.__wbg_ptr = ret;
|
|
54
|
+
WasmAnnotationKindFinalization.register(this, this.__wbg_ptr, this);
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} value
|
|
59
|
+
*/
|
|
60
|
+
set annotationType(value) {
|
|
61
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
62
|
+
const len0 = WASM_VECTOR_LEN;
|
|
63
|
+
wasm.wasmannotationkind_set_annotationType(this.__wbg_ptr, ptr0, len0);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @param {string | null} [value]
|
|
67
|
+
*/
|
|
68
|
+
set title(value) {
|
|
69
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
70
|
+
var len0 = WASM_VECTOR_LEN;
|
|
71
|
+
wasm.wasmannotationkind_set_title(this.__wbg_ptr, ptr0, len0);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @param {string | null} [value]
|
|
75
|
+
*/
|
|
76
|
+
set url(value) {
|
|
77
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
78
|
+
var len0 = WASM_VECTOR_LEN;
|
|
79
|
+
wasm.wasmannotationkind_set_url(this.__wbg_ptr, ptr0, len0);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @returns {string | undefined}
|
|
83
|
+
*/
|
|
84
|
+
get title() {
|
|
85
|
+
try {
|
|
86
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
87
|
+
wasm.wasmannotationkind_title(retptr, this.__wbg_ptr);
|
|
88
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
89
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
90
|
+
let v1;
|
|
91
|
+
if (r0 !== 0) {
|
|
92
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
93
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
94
|
+
}
|
|
95
|
+
return v1;
|
|
96
|
+
} finally {
|
|
97
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @returns {string | undefined}
|
|
102
|
+
*/
|
|
103
|
+
get url() {
|
|
104
|
+
try {
|
|
105
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
106
|
+
wasm.wasmannotationkind_url(retptr, this.__wbg_ptr);
|
|
107
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
108
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
109
|
+
let v1;
|
|
110
|
+
if (r0 !== 0) {
|
|
111
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
112
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
113
|
+
}
|
|
114
|
+
return v1;
|
|
115
|
+
} finally {
|
|
116
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (Symbol.dispose) WasmAnnotationKind.prototype[Symbol.dispose] = WasmAnnotationKind.prototype.free;
|
|
20
121
|
exports.WasmAnnotationKind = WasmAnnotationKind;
|
|
21
122
|
|
|
22
123
|
/**
|
|
@@ -35,19 +136,9 @@ exports.WasmCodeBlockStyle = WasmCodeBlockStyle;
|
|
|
35
136
|
/**
|
|
36
137
|
* Main conversion options for HTML to Markdown conversion.
|
|
37
138
|
*
|
|
38
|
-
* Use
|
|
139
|
+
* Use `ConversionOptions.builder()` to construct, or `Default.default()` for defaults.
|
|
39
140
|
*
|
|
40
141
|
* # Example
|
|
41
|
-
*
|
|
42
|
-
* ```text
|
|
43
|
-
* use html_to_markdown_rs::ConversionOptions;
|
|
44
|
-
*
|
|
45
|
-
* let options = ConversionOptions::builder()
|
|
46
|
-
* .heading_style(HeadingStyle::Atx)
|
|
47
|
-
* .wrap(true)
|
|
48
|
-
* .wrap_width(100)
|
|
49
|
-
* .build();
|
|
50
|
-
* ```
|
|
51
142
|
*/
|
|
52
143
|
class WasmConversionOptions {
|
|
53
144
|
static __wrap(ptr) {
|
|
@@ -66,15 +157,6 @@ class WasmConversionOptions {
|
|
|
66
157
|
const ptr = this.__destroy_into_raw();
|
|
67
158
|
wasm.__wbg_wasmconversionoptions_free(ptr, 0);
|
|
68
159
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Apply a partial update to these conversion options.
|
|
71
|
-
* @param {WasmConversionOptionsUpdate} update
|
|
72
|
-
*/
|
|
73
|
-
applyUpdate(update) {
|
|
74
|
-
_assertClass(update, WasmConversionOptionsUpdate);
|
|
75
|
-
var ptr0 = update.__destroy_into_raw();
|
|
76
|
-
wasm.wasmconversionoptions_applyUpdate(this.__wbg_ptr, ptr0);
|
|
77
|
-
}
|
|
78
160
|
/**
|
|
79
161
|
* @returns {boolean}
|
|
80
162
|
*/
|
|
@@ -89,14 +171,6 @@ class WasmConversionOptions {
|
|
|
89
171
|
const ret = wasm.wasmconversionoptions_brInTables(this.__wbg_ptr);
|
|
90
172
|
return ret !== 0;
|
|
91
173
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Create a new builder with default values.
|
|
94
|
-
* @returns {WasmConversionOptionsBuilder}
|
|
95
|
-
*/
|
|
96
|
-
static builder() {
|
|
97
|
-
const ret = wasm.wasmconversionoptions_builder();
|
|
98
|
-
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
99
|
-
}
|
|
100
174
|
/**
|
|
101
175
|
* @returns {string}
|
|
102
176
|
*/
|
|
@@ -161,6 +235,13 @@ class WasmConversionOptions {
|
|
|
161
235
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
162
236
|
}
|
|
163
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* @returns {boolean}
|
|
240
|
+
*/
|
|
241
|
+
get compactTables() {
|
|
242
|
+
const ret = wasm.wasmconversionoptions_compactTables(this.__wbg_ptr);
|
|
243
|
+
return ret !== 0;
|
|
244
|
+
}
|
|
164
245
|
/**
|
|
165
246
|
* @returns {boolean}
|
|
166
247
|
*/
|
|
@@ -266,27 +347,6 @@ class WasmConversionOptions {
|
|
|
266
347
|
const ret = wasm.wasmconversionoptions_extractMetadata(this.__wbg_ptr);
|
|
267
348
|
return ret !== 0;
|
|
268
349
|
}
|
|
269
|
-
/**
|
|
270
|
-
* @param {WasmConversionOptionsUpdate} update
|
|
271
|
-
* @returns {WasmConversionOptions}
|
|
272
|
-
*/
|
|
273
|
-
static from(update) {
|
|
274
|
-
_assertClass(update, WasmConversionOptionsUpdate);
|
|
275
|
-
var ptr0 = update.__destroy_into_raw();
|
|
276
|
-
const ret = wasm.wasmconversionoptions_from(ptr0);
|
|
277
|
-
return WasmConversionOptions.__wrap(ret);
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Create from a partial update, applying to defaults.
|
|
281
|
-
* @param {WasmConversionOptionsUpdate} update
|
|
282
|
-
* @returns {WasmConversionOptions}
|
|
283
|
-
*/
|
|
284
|
-
static fromUpdate(update) {
|
|
285
|
-
_assertClass(update, WasmConversionOptionsUpdate);
|
|
286
|
-
var ptr0 = update.__destroy_into_raw();
|
|
287
|
-
const ret = wasm.wasmconversionoptions_fromUpdate(ptr0);
|
|
288
|
-
return WasmConversionOptions.__wrap(ret);
|
|
289
|
-
}
|
|
290
350
|
/**
|
|
291
351
|
* @returns {string}
|
|
292
352
|
*/
|
|
@@ -415,59 +475,60 @@ class WasmConversionOptions {
|
|
|
415
475
|
return BigInt.asUintN(64, ret);
|
|
416
476
|
}
|
|
417
477
|
/**
|
|
418
|
-
* @param {WasmHeadingStyle | null} [
|
|
419
|
-
* @param {WasmListIndentType | null} [
|
|
420
|
-
* @param {number | null} [
|
|
478
|
+
* @param {WasmHeadingStyle | null} [headingStyle]
|
|
479
|
+
* @param {WasmListIndentType | null} [listIndentType]
|
|
480
|
+
* @param {number | null} [listIndentWidth]
|
|
421
481
|
* @param {string | null} [bullets]
|
|
422
|
-
* @param {string | null} [
|
|
423
|
-
* @param {boolean | null} [
|
|
424
|
-
* @param {boolean | null} [
|
|
425
|
-
* @param {boolean | null} [
|
|
426
|
-
* @param {boolean | null} [
|
|
427
|
-
* @param {string | null} [
|
|
482
|
+
* @param {string | null} [strongEmSymbol]
|
|
483
|
+
* @param {boolean | null} [escapeAsterisks]
|
|
484
|
+
* @param {boolean | null} [escapeUnderscores]
|
|
485
|
+
* @param {boolean | null} [escapeMisc]
|
|
486
|
+
* @param {boolean | null} [escapeAscii]
|
|
487
|
+
* @param {string | null} [codeLanguage]
|
|
428
488
|
* @param {boolean | null} [autolinks]
|
|
429
|
-
* @param {boolean | null} [
|
|
430
|
-
* @param {boolean | null} [
|
|
431
|
-
* @param {
|
|
432
|
-
* @param {
|
|
433
|
-
* @param {
|
|
434
|
-
* @param {
|
|
489
|
+
* @param {boolean | null} [defaultTitle]
|
|
490
|
+
* @param {boolean | null} [brInTables]
|
|
491
|
+
* @param {boolean | null} [compactTables]
|
|
492
|
+
* @param {WasmHighlightStyle | null} [highlightStyle]
|
|
493
|
+
* @param {boolean | null} [extractMetadata]
|
|
494
|
+
* @param {WasmWhitespaceMode | null} [whitespaceMode]
|
|
495
|
+
* @param {boolean | null} [stripNewlines]
|
|
435
496
|
* @param {boolean | null} [wrap]
|
|
436
|
-
* @param {number | null} [
|
|
437
|
-
* @param {boolean | null} [
|
|
438
|
-
* @param {string | null} [
|
|
439
|
-
* @param {string | null} [
|
|
440
|
-
* @param {WasmNewlineStyle | null} [
|
|
441
|
-
* @param {WasmCodeBlockStyle | null} [
|
|
442
|
-
* @param {string[] | null} [
|
|
497
|
+
* @param {number | null} [wrapWidth]
|
|
498
|
+
* @param {boolean | null} [convertAsInline]
|
|
499
|
+
* @param {string | null} [subSymbol]
|
|
500
|
+
* @param {string | null} [supSymbol]
|
|
501
|
+
* @param {WasmNewlineStyle | null} [newlineStyle]
|
|
502
|
+
* @param {WasmCodeBlockStyle | null} [codeBlockStyle]
|
|
503
|
+
* @param {string[] | null} [keepInlineImagesIn]
|
|
443
504
|
* @param {WasmPreprocessingOptions | null} [preprocessing]
|
|
444
505
|
* @param {string | null} [encoding]
|
|
445
506
|
* @param {boolean | null} [debug]
|
|
446
|
-
* @param {string[] | null} [
|
|
447
|
-
* @param {string[] | null} [
|
|
448
|
-
* @param {boolean | null} [
|
|
449
|
-
* @param {WasmLinkStyle | null} [
|
|
450
|
-
* @param {WasmOutputFormat | null} [
|
|
451
|
-
* @param {boolean | null} [
|
|
452
|
-
* @param {boolean | null} [
|
|
453
|
-
* @param {bigint | null} [
|
|
454
|
-
* @param {boolean | null} [
|
|
455
|
-
* @param {boolean | null} [
|
|
456
|
-
* @param {string[] | null} [
|
|
457
|
-
* @param {number | null} [
|
|
458
|
-
*/
|
|
459
|
-
constructor(
|
|
507
|
+
* @param {string[] | null} [stripTags]
|
|
508
|
+
* @param {string[] | null} [preserveTags]
|
|
509
|
+
* @param {boolean | null} [skipImages]
|
|
510
|
+
* @param {WasmLinkStyle | null} [linkStyle]
|
|
511
|
+
* @param {WasmOutputFormat | null} [outputFormat]
|
|
512
|
+
* @param {boolean | null} [includeDocumentStructure]
|
|
513
|
+
* @param {boolean | null} [extractImages]
|
|
514
|
+
* @param {bigint | null} [maxImageSize]
|
|
515
|
+
* @param {boolean | null} [captureSvg]
|
|
516
|
+
* @param {boolean | null} [inferDimensions]
|
|
517
|
+
* @param {string[] | null} [excludeSelectors]
|
|
518
|
+
* @param {number | null} [maxDepth]
|
|
519
|
+
*/
|
|
520
|
+
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, excludeSelectors, maxDepth) {
|
|
460
521
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
461
522
|
var len0 = WASM_VECTOR_LEN;
|
|
462
|
-
var ptr1 = isLikeNone(
|
|
523
|
+
var ptr1 = isLikeNone(strongEmSymbol) ? 0 : passStringToWasm0(strongEmSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
463
524
|
var len1 = WASM_VECTOR_LEN;
|
|
464
|
-
var ptr2 = isLikeNone(
|
|
525
|
+
var ptr2 = isLikeNone(codeLanguage) ? 0 : passStringToWasm0(codeLanguage, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
465
526
|
var len2 = WASM_VECTOR_LEN;
|
|
466
|
-
var ptr3 = isLikeNone(
|
|
527
|
+
var ptr3 = isLikeNone(subSymbol) ? 0 : passStringToWasm0(subSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
467
528
|
var len3 = WASM_VECTOR_LEN;
|
|
468
|
-
var ptr4 = isLikeNone(
|
|
529
|
+
var ptr4 = isLikeNone(supSymbol) ? 0 : passStringToWasm0(supSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
469
530
|
var len4 = WASM_VECTOR_LEN;
|
|
470
|
-
var ptr5 = isLikeNone(
|
|
531
|
+
var ptr5 = isLikeNone(keepInlineImagesIn) ? 0 : passArrayJsValueToWasm0(keepInlineImagesIn, wasm.__wbindgen_export);
|
|
471
532
|
var len5 = WASM_VECTOR_LEN;
|
|
472
533
|
let ptr6 = 0;
|
|
473
534
|
if (!isLikeNone(preprocessing)) {
|
|
@@ -476,13 +537,13 @@ class WasmConversionOptions {
|
|
|
476
537
|
}
|
|
477
538
|
var ptr7 = isLikeNone(encoding) ? 0 : passStringToWasm0(encoding, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
478
539
|
var len7 = WASM_VECTOR_LEN;
|
|
479
|
-
var ptr8 = isLikeNone(
|
|
540
|
+
var ptr8 = isLikeNone(stripTags) ? 0 : passArrayJsValueToWasm0(stripTags, wasm.__wbindgen_export);
|
|
480
541
|
var len8 = WASM_VECTOR_LEN;
|
|
481
|
-
var ptr9 = isLikeNone(
|
|
542
|
+
var ptr9 = isLikeNone(preserveTags) ? 0 : passArrayJsValueToWasm0(preserveTags, wasm.__wbindgen_export);
|
|
482
543
|
var len9 = WASM_VECTOR_LEN;
|
|
483
|
-
var ptr10 = isLikeNone(
|
|
544
|
+
var ptr10 = isLikeNone(excludeSelectors) ? 0 : passArrayJsValueToWasm0(excludeSelectors, wasm.__wbindgen_export);
|
|
484
545
|
var len10 = WASM_VECTOR_LEN;
|
|
485
|
-
const ret = wasm.wasmconversionoptions_new(isLikeNone(
|
|
546
|
+
const ret = wasm.wasmconversionoptions_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, ptr10, len10, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0);
|
|
486
547
|
this.__wbg_ptr = ret;
|
|
487
548
|
WasmConversionOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
488
549
|
return this;
|
|
@@ -588,6 +649,12 @@ class WasmConversionOptions {
|
|
|
588
649
|
const len0 = WASM_VECTOR_LEN;
|
|
589
650
|
wasm.wasmconversionoptions_set_codeLanguage(this.__wbg_ptr, ptr0, len0);
|
|
590
651
|
}
|
|
652
|
+
/**
|
|
653
|
+
* @param {boolean} value
|
|
654
|
+
*/
|
|
655
|
+
set compactTables(value) {
|
|
656
|
+
wasm.wasmconversionoptions_set_compactTables(this.__wbg_ptr, value);
|
|
657
|
+
}
|
|
591
658
|
/**
|
|
592
659
|
* @param {boolean} value
|
|
593
660
|
*/
|
|
@@ -952,114 +1019,11 @@ class WasmConversionOptions {
|
|
|
952
1019
|
if (Symbol.dispose) WasmConversionOptions.prototype[Symbol.dispose] = WasmConversionOptions.prototype.free;
|
|
953
1020
|
exports.WasmConversionOptions = WasmConversionOptions;
|
|
954
1021
|
|
|
955
|
-
/**
|
|
956
|
-
* Builder for [`ConversionOptions`].
|
|
957
|
-
*
|
|
958
|
-
* All fields start with default values. Call `.build()` to produce the final options.
|
|
959
|
-
*/
|
|
960
|
-
class WasmConversionOptionsBuilder {
|
|
961
|
-
static __wrap(ptr) {
|
|
962
|
-
const obj = Object.create(WasmConversionOptionsBuilder.prototype);
|
|
963
|
-
obj.__wbg_ptr = ptr;
|
|
964
|
-
WasmConversionOptionsBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
965
|
-
return obj;
|
|
966
|
-
}
|
|
967
|
-
__destroy_into_raw() {
|
|
968
|
-
const ptr = this.__wbg_ptr;
|
|
969
|
-
this.__wbg_ptr = 0;
|
|
970
|
-
WasmConversionOptionsBuilderFinalization.unregister(this);
|
|
971
|
-
return ptr;
|
|
972
|
-
}
|
|
973
|
-
free() {
|
|
974
|
-
const ptr = this.__destroy_into_raw();
|
|
975
|
-
wasm.__wbg_wasmconversionoptionsbuilder_free(ptr, 0);
|
|
976
|
-
}
|
|
977
|
-
/**
|
|
978
|
-
* Build the final [`ConversionOptions`].
|
|
979
|
-
* @returns {WasmConversionOptions}
|
|
980
|
-
*/
|
|
981
|
-
build() {
|
|
982
|
-
const ret = wasm.wasmconversionoptionsbuilder_build(this.__wbg_ptr);
|
|
983
|
-
return WasmConversionOptions.__wrap(ret);
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* Set the list of CSS selectors for elements to exclude entirely from output.
|
|
987
|
-
* @param {string[]} selectors
|
|
988
|
-
* @returns {WasmConversionOptionsBuilder}
|
|
989
|
-
*/
|
|
990
|
-
excludeSelectors(selectors) {
|
|
991
|
-
const ptr0 = passArrayJsValueToWasm0(selectors, wasm.__wbindgen_export);
|
|
992
|
-
const len0 = WASM_VECTOR_LEN;
|
|
993
|
-
const ret = wasm.wasmconversionoptionsbuilder_excludeSelectors(this.__wbg_ptr, ptr0, len0);
|
|
994
|
-
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
995
|
-
}
|
|
996
|
-
/**
|
|
997
|
-
* Set the list of HTML tag names whose `<img>` children are kept inline.
|
|
998
|
-
* @param {string[]} tags
|
|
999
|
-
* @returns {WasmConversionOptionsBuilder}
|
|
1000
|
-
*/
|
|
1001
|
-
keepInlineImagesIn(tags) {
|
|
1002
|
-
const ptr0 = passArrayJsValueToWasm0(tags, wasm.__wbindgen_export);
|
|
1003
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1004
|
-
const ret = wasm.wasmconversionoptionsbuilder_keepInlineImagesIn(this.__wbg_ptr, ptr0, len0);
|
|
1005
|
-
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
1006
|
-
}
|
|
1007
|
-
/**
|
|
1008
|
-
* Set the pre-processing options applied to the HTML before conversion.
|
|
1009
|
-
* @param {WasmPreprocessingOptions} preprocessing
|
|
1010
|
-
* @returns {WasmConversionOptionsBuilder}
|
|
1011
|
-
*/
|
|
1012
|
-
preprocessing(preprocessing) {
|
|
1013
|
-
_assertClass(preprocessing, WasmPreprocessingOptions);
|
|
1014
|
-
var ptr0 = preprocessing.__destroy_into_raw();
|
|
1015
|
-
const ret = wasm.wasmconversionoptionsbuilder_preprocessing(this.__wbg_ptr, ptr0);
|
|
1016
|
-
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
1017
|
-
}
|
|
1018
|
-
/**
|
|
1019
|
-
* Set the list of HTML tag names that are preserved verbatim in output.
|
|
1020
|
-
* @param {string[]} tags
|
|
1021
|
-
* @returns {WasmConversionOptionsBuilder}
|
|
1022
|
-
*/
|
|
1023
|
-
preserveTags(tags) {
|
|
1024
|
-
const ptr0 = passArrayJsValueToWasm0(tags, wasm.__wbindgen_export);
|
|
1025
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1026
|
-
const ret = wasm.wasmconversionoptionsbuilder_preserveTags(this.__wbg_ptr, ptr0, len0);
|
|
1027
|
-
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
1028
|
-
}
|
|
1029
|
-
/**
|
|
1030
|
-
* Set the list of HTML tag names whose content is stripped from output.
|
|
1031
|
-
* @param {string[]} tags
|
|
1032
|
-
* @returns {WasmConversionOptionsBuilder}
|
|
1033
|
-
*/
|
|
1034
|
-
stripTags(tags) {
|
|
1035
|
-
const ptr0 = passArrayJsValueToWasm0(tags, wasm.__wbindgen_export);
|
|
1036
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1037
|
-
const ret = wasm.wasmconversionoptionsbuilder_stripTags(this.__wbg_ptr, ptr0, len0);
|
|
1038
|
-
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
1039
|
-
}
|
|
1040
|
-
/**
|
|
1041
|
-
* Set the visitor used during conversion.
|
|
1042
|
-
* @param {WasmVisitorHandle | null} [visitor]
|
|
1043
|
-
* @returns {WasmConversionOptionsBuilder}
|
|
1044
|
-
*/
|
|
1045
|
-
visitor(visitor) {
|
|
1046
|
-
let ptr0 = 0;
|
|
1047
|
-
if (!isLikeNone(visitor)) {
|
|
1048
|
-
_assertClass(visitor, WasmVisitorHandle);
|
|
1049
|
-
ptr0 = visitor.__destroy_into_raw();
|
|
1050
|
-
}
|
|
1051
|
-
const ret = wasm.wasmconversionoptionsbuilder_visitor(this.__wbg_ptr, ptr0);
|
|
1052
|
-
return WasmConversionOptionsBuilder.__wrap(ret);
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
if (Symbol.dispose) WasmConversionOptionsBuilder.prototype[Symbol.dispose] = WasmConversionOptionsBuilder.prototype.free;
|
|
1056
|
-
exports.WasmConversionOptionsBuilder = WasmConversionOptionsBuilder;
|
|
1057
|
-
|
|
1058
1022
|
/**
|
|
1059
1023
|
* Partial update for `ConversionOptions`.
|
|
1060
1024
|
*
|
|
1061
1025
|
* Uses `Option<T>` fields for selective updates. Bindings use this to construct
|
|
1062
|
-
* options from language-native types. Prefer
|
|
1026
|
+
* options from language-native types. Prefer `ConversionOptionsBuilder` for Rust code.
|
|
1063
1027
|
*/
|
|
1064
1028
|
class WasmConversionOptionsUpdate {
|
|
1065
1029
|
static __wrap(ptr) {
|
|
@@ -1156,6 +1120,13 @@ class WasmConversionOptionsUpdate {
|
|
|
1156
1120
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1157
1121
|
}
|
|
1158
1122
|
}
|
|
1123
|
+
/**
|
|
1124
|
+
* @returns {boolean | undefined}
|
|
1125
|
+
*/
|
|
1126
|
+
get compactTables() {
|
|
1127
|
+
const ret = wasm.wasmconversionoptionsupdate_compactTables(this.__wbg_ptr);
|
|
1128
|
+
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
1129
|
+
}
|
|
1159
1130
|
/**
|
|
1160
1131
|
* @returns {boolean | undefined}
|
|
1161
1132
|
*/
|
|
@@ -1402,59 +1373,60 @@ class WasmConversionOptionsUpdate {
|
|
|
1402
1373
|
}
|
|
1403
1374
|
}
|
|
1404
1375
|
/**
|
|
1405
|
-
* @param {WasmHeadingStyle | null} [
|
|
1406
|
-
* @param {WasmListIndentType | null} [
|
|
1407
|
-
* @param {number | null} [
|
|
1376
|
+
* @param {WasmHeadingStyle | null} [headingStyle]
|
|
1377
|
+
* @param {WasmListIndentType | null} [listIndentType]
|
|
1378
|
+
* @param {number | null} [listIndentWidth]
|
|
1408
1379
|
* @param {string | null} [bullets]
|
|
1409
|
-
* @param {string | null} [
|
|
1410
|
-
* @param {boolean | null} [
|
|
1411
|
-
* @param {boolean | null} [
|
|
1412
|
-
* @param {boolean | null} [
|
|
1413
|
-
* @param {boolean | null} [
|
|
1414
|
-
* @param {string | null} [
|
|
1380
|
+
* @param {string | null} [strongEmSymbol]
|
|
1381
|
+
* @param {boolean | null} [escapeAsterisks]
|
|
1382
|
+
* @param {boolean | null} [escapeUnderscores]
|
|
1383
|
+
* @param {boolean | null} [escapeMisc]
|
|
1384
|
+
* @param {boolean | null} [escapeAscii]
|
|
1385
|
+
* @param {string | null} [codeLanguage]
|
|
1415
1386
|
* @param {boolean | null} [autolinks]
|
|
1416
|
-
* @param {boolean | null} [
|
|
1417
|
-
* @param {boolean | null} [
|
|
1418
|
-
* @param {
|
|
1419
|
-
* @param {
|
|
1420
|
-
* @param {
|
|
1421
|
-
* @param {
|
|
1387
|
+
* @param {boolean | null} [defaultTitle]
|
|
1388
|
+
* @param {boolean | null} [brInTables]
|
|
1389
|
+
* @param {boolean | null} [compactTables]
|
|
1390
|
+
* @param {WasmHighlightStyle | null} [highlightStyle]
|
|
1391
|
+
* @param {boolean | null} [extractMetadata]
|
|
1392
|
+
* @param {WasmWhitespaceMode | null} [whitespaceMode]
|
|
1393
|
+
* @param {boolean | null} [stripNewlines]
|
|
1422
1394
|
* @param {boolean | null} [wrap]
|
|
1423
|
-
* @param {number | null} [
|
|
1424
|
-
* @param {boolean | null} [
|
|
1425
|
-
* @param {string | null} [
|
|
1426
|
-
* @param {string | null} [
|
|
1427
|
-
* @param {WasmNewlineStyle | null} [
|
|
1428
|
-
* @param {WasmCodeBlockStyle | null} [
|
|
1429
|
-
* @param {string[] | null} [
|
|
1395
|
+
* @param {number | null} [wrapWidth]
|
|
1396
|
+
* @param {boolean | null} [convertAsInline]
|
|
1397
|
+
* @param {string | null} [subSymbol]
|
|
1398
|
+
* @param {string | null} [supSymbol]
|
|
1399
|
+
* @param {WasmNewlineStyle | null} [newlineStyle]
|
|
1400
|
+
* @param {WasmCodeBlockStyle | null} [codeBlockStyle]
|
|
1401
|
+
* @param {string[] | null} [keepInlineImagesIn]
|
|
1430
1402
|
* @param {WasmPreprocessingOptionsUpdate | null} [preprocessing]
|
|
1431
1403
|
* @param {string | null} [encoding]
|
|
1432
1404
|
* @param {boolean | null} [debug]
|
|
1433
|
-
* @param {string[] | null} [
|
|
1434
|
-
* @param {string[] | null} [
|
|
1435
|
-
* @param {boolean | null} [
|
|
1436
|
-
* @param {WasmLinkStyle | null} [
|
|
1437
|
-
* @param {WasmOutputFormat | null} [
|
|
1438
|
-
* @param {boolean | null} [
|
|
1439
|
-
* @param {boolean | null} [
|
|
1440
|
-
* @param {bigint | null} [
|
|
1441
|
-
* @param {boolean | null} [
|
|
1442
|
-
* @param {boolean | null} [
|
|
1443
|
-
* @param {number | null} [
|
|
1444
|
-
* @param {string[] | null} [
|
|
1445
|
-
*/
|
|
1446
|
-
constructor(
|
|
1405
|
+
* @param {string[] | null} [stripTags]
|
|
1406
|
+
* @param {string[] | null} [preserveTags]
|
|
1407
|
+
* @param {boolean | null} [skipImages]
|
|
1408
|
+
* @param {WasmLinkStyle | null} [linkStyle]
|
|
1409
|
+
* @param {WasmOutputFormat | null} [outputFormat]
|
|
1410
|
+
* @param {boolean | null} [includeDocumentStructure]
|
|
1411
|
+
* @param {boolean | null} [extractImages]
|
|
1412
|
+
* @param {bigint | null} [maxImageSize]
|
|
1413
|
+
* @param {boolean | null} [captureSvg]
|
|
1414
|
+
* @param {boolean | null} [inferDimensions]
|
|
1415
|
+
* @param {number | null} [maxDepth]
|
|
1416
|
+
* @param {string[] | null} [excludeSelectors]
|
|
1417
|
+
*/
|
|
1418
|
+
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, maxDepth, excludeSelectors) {
|
|
1447
1419
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1448
1420
|
var len0 = WASM_VECTOR_LEN;
|
|
1449
|
-
var ptr1 = isLikeNone(
|
|
1421
|
+
var ptr1 = isLikeNone(strongEmSymbol) ? 0 : passStringToWasm0(strongEmSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1450
1422
|
var len1 = WASM_VECTOR_LEN;
|
|
1451
|
-
var ptr2 = isLikeNone(
|
|
1423
|
+
var ptr2 = isLikeNone(codeLanguage) ? 0 : passStringToWasm0(codeLanguage, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1452
1424
|
var len2 = WASM_VECTOR_LEN;
|
|
1453
|
-
var ptr3 = isLikeNone(
|
|
1425
|
+
var ptr3 = isLikeNone(subSymbol) ? 0 : passStringToWasm0(subSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1454
1426
|
var len3 = WASM_VECTOR_LEN;
|
|
1455
|
-
var ptr4 = isLikeNone(
|
|
1427
|
+
var ptr4 = isLikeNone(supSymbol) ? 0 : passStringToWasm0(supSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1456
1428
|
var len4 = WASM_VECTOR_LEN;
|
|
1457
|
-
var ptr5 = isLikeNone(
|
|
1429
|
+
var ptr5 = isLikeNone(keepInlineImagesIn) ? 0 : passArrayJsValueToWasm0(keepInlineImagesIn, wasm.__wbindgen_export);
|
|
1458
1430
|
var len5 = WASM_VECTOR_LEN;
|
|
1459
1431
|
let ptr6 = 0;
|
|
1460
1432
|
if (!isLikeNone(preprocessing)) {
|
|
@@ -1463,13 +1435,13 @@ class WasmConversionOptionsUpdate {
|
|
|
1463
1435
|
}
|
|
1464
1436
|
var ptr7 = isLikeNone(encoding) ? 0 : passStringToWasm0(encoding, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1465
1437
|
var len7 = WASM_VECTOR_LEN;
|
|
1466
|
-
var ptr8 = isLikeNone(
|
|
1438
|
+
var ptr8 = isLikeNone(stripTags) ? 0 : passArrayJsValueToWasm0(stripTags, wasm.__wbindgen_export);
|
|
1467
1439
|
var len8 = WASM_VECTOR_LEN;
|
|
1468
|
-
var ptr9 = isLikeNone(
|
|
1440
|
+
var ptr9 = isLikeNone(preserveTags) ? 0 : passArrayJsValueToWasm0(preserveTags, wasm.__wbindgen_export);
|
|
1469
1441
|
var len9 = WASM_VECTOR_LEN;
|
|
1470
|
-
var ptr10 = isLikeNone(
|
|
1442
|
+
var ptr10 = isLikeNone(excludeSelectors) ? 0 : passArrayJsValueToWasm0(excludeSelectors, wasm.__wbindgen_export);
|
|
1471
1443
|
var len10 = WASM_VECTOR_LEN;
|
|
1472
|
-
const ret = wasm.wasmconversionoptionsupdate_new(isLikeNone(
|
|
1444
|
+
const ret = wasm.wasmconversionoptionsupdate_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, ptr10, len10);
|
|
1473
1445
|
this.__wbg_ptr = ret;
|
|
1474
1446
|
WasmConversionOptionsUpdateFinalization.register(this, this.__wbg_ptr, this);
|
|
1475
1447
|
return this;
|
|
@@ -1578,6 +1550,12 @@ class WasmConversionOptionsUpdate {
|
|
|
1578
1550
|
var len0 = WASM_VECTOR_LEN;
|
|
1579
1551
|
wasm.wasmconversionoptionsupdate_set_codeLanguage(this.__wbg_ptr, ptr0, len0);
|
|
1580
1552
|
}
|
|
1553
|
+
/**
|
|
1554
|
+
* @param {boolean | null} [value]
|
|
1555
|
+
*/
|
|
1556
|
+
set compactTables(value) {
|
|
1557
|
+
wasm.wasmconversionoptionsupdate_set_compactTables(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
|
|
1558
|
+
}
|
|
1581
1559
|
/**
|
|
1582
1560
|
* @param {boolean | null} [value]
|
|
1583
1561
|
*/
|
|
@@ -2154,17 +2132,6 @@ exports.WasmConversionResult = WasmConversionResult;
|
|
|
2154
2132
|
* and browsers for document indexing and presentation.
|
|
2155
2133
|
*
|
|
2156
2134
|
* # Examples
|
|
2157
|
-
*
|
|
2158
|
-
* ```
|
|
2159
|
-
* let doc = DocumentMetadata {
|
|
2160
|
-
* title: Some("My Article".to_string()),
|
|
2161
|
-
* description: Some("A great article about Rust".to_string()),
|
|
2162
|
-
* keywords: vec!["rust".to_string(), "programming".to_string()],
|
|
2163
|
-
* ..Default::default()
|
|
2164
|
-
* };
|
|
2165
|
-
*
|
|
2166
|
-
* assert_eq!(doc.title, Some("My Article".to_string()));
|
|
2167
|
-
* ```
|
|
2168
2135
|
*/
|
|
2169
2136
|
class WasmDocumentMetadata {
|
|
2170
2137
|
static __wrap(ptr) {
|
|
@@ -2310,18 +2277,18 @@ class WasmDocumentMetadata {
|
|
|
2310
2277
|
}
|
|
2311
2278
|
/**
|
|
2312
2279
|
* @param {string[] | null} [keywords]
|
|
2313
|
-
* @param {any | null} [
|
|
2314
|
-
* @param {any | null} [
|
|
2315
|
-
* @param {any | null} [
|
|
2280
|
+
* @param {any | null} [openGraph]
|
|
2281
|
+
* @param {any | null} [twitterCard]
|
|
2282
|
+
* @param {any | null} [metaTags]
|
|
2316
2283
|
* @param {string | null} [title]
|
|
2317
2284
|
* @param {string | null} [description]
|
|
2318
2285
|
* @param {string | null} [author]
|
|
2319
|
-
* @param {string | null} [
|
|
2320
|
-
* @param {string | null} [
|
|
2286
|
+
* @param {string | null} [canonicalUrl]
|
|
2287
|
+
* @param {string | null} [baseHref]
|
|
2321
2288
|
* @param {string | null} [language]
|
|
2322
|
-
* @param {WasmTextDirection | null} [
|
|
2289
|
+
* @param {WasmTextDirection | null} [textDirection]
|
|
2323
2290
|
*/
|
|
2324
|
-
constructor(keywords,
|
|
2291
|
+
constructor(keywords, openGraph, twitterCard, metaTags, title, description, author, canonicalUrl, baseHref, language, textDirection) {
|
|
2325
2292
|
var ptr0 = isLikeNone(keywords) ? 0 : passArrayJsValueToWasm0(keywords, wasm.__wbindgen_export);
|
|
2326
2293
|
var len0 = WASM_VECTOR_LEN;
|
|
2327
2294
|
var ptr1 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -2330,13 +2297,13 @@ class WasmDocumentMetadata {
|
|
|
2330
2297
|
var len2 = WASM_VECTOR_LEN;
|
|
2331
2298
|
var ptr3 = isLikeNone(author) ? 0 : passStringToWasm0(author, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2332
2299
|
var len3 = WASM_VECTOR_LEN;
|
|
2333
|
-
var ptr4 = isLikeNone(
|
|
2300
|
+
var ptr4 = isLikeNone(canonicalUrl) ? 0 : passStringToWasm0(canonicalUrl, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2334
2301
|
var len4 = WASM_VECTOR_LEN;
|
|
2335
|
-
var ptr5 = isLikeNone(
|
|
2302
|
+
var ptr5 = isLikeNone(baseHref) ? 0 : passStringToWasm0(baseHref, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2336
2303
|
var len5 = WASM_VECTOR_LEN;
|
|
2337
2304
|
var ptr6 = isLikeNone(language) ? 0 : passStringToWasm0(language, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2338
2305
|
var len6 = WASM_VECTOR_LEN;
|
|
2339
|
-
const ret = wasm.wasmdocumentmetadata_new(ptr0, len0, isLikeNone(
|
|
2306
|
+
const ret = wasm.wasmdocumentmetadata_new(ptr0, len0, isLikeNone(openGraph) ? 0 : addHeapObject(openGraph), isLikeNone(twitterCard) ? 0 : addHeapObject(twitterCard), isLikeNone(metaTags) ? 0 : addHeapObject(metaTags), ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, isLikeNone(textDirection) ? 3 : textDirection);
|
|
2340
2307
|
this.__wbg_ptr = ret;
|
|
2341
2308
|
WasmDocumentMetadataFinalization.register(this, this.__wbg_ptr, this);
|
|
2342
2309
|
return this;
|
|
@@ -2543,23 +2510,11 @@ class WasmDocumentNode {
|
|
|
2543
2510
|
}
|
|
2544
2511
|
}
|
|
2545
2512
|
/**
|
|
2546
|
-
* @returns {
|
|
2513
|
+
* @returns {any}
|
|
2547
2514
|
*/
|
|
2548
2515
|
get content() {
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
try {
|
|
2552
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2553
|
-
wasm.wasmdocumentnode_content(retptr, this.__wbg_ptr);
|
|
2554
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2555
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2556
|
-
deferred1_0 = r0;
|
|
2557
|
-
deferred1_1 = r1;
|
|
2558
|
-
return getStringFromWasm0(r0, r1);
|
|
2559
|
-
} finally {
|
|
2560
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2561
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
2562
|
-
}
|
|
2516
|
+
const ret = wasm.wasmdocumentnode_content(this.__wbg_ptr);
|
|
2517
|
+
return takeObject(ret);
|
|
2563
2518
|
}
|
|
2564
2519
|
/**
|
|
2565
2520
|
* @returns {WasmDocumentNode}
|
|
@@ -2589,7 +2544,7 @@ class WasmDocumentNode {
|
|
|
2589
2544
|
}
|
|
2590
2545
|
/**
|
|
2591
2546
|
* @param {string} id
|
|
2592
|
-
* @param {
|
|
2547
|
+
* @param {any} content
|
|
2593
2548
|
* @param {Uint32Array} children
|
|
2594
2549
|
* @param {WasmTextAnnotation[]} annotations
|
|
2595
2550
|
* @param {number | null} [parent]
|
|
@@ -2602,7 +2557,7 @@ class WasmDocumentNode {
|
|
|
2602
2557
|
const len1 = WASM_VECTOR_LEN;
|
|
2603
2558
|
const ptr2 = passArrayJsValueToWasm0(annotations, wasm.__wbindgen_export);
|
|
2604
2559
|
const len2 = WASM_VECTOR_LEN;
|
|
2605
|
-
const ret = wasm.wasmdocumentnode_new(ptr0, len0, content, ptr1, len1, ptr2, len2, isLikeNone(parent) ? Number.MAX_SAFE_INTEGER : (parent) >>> 0, isLikeNone(attributes) ? 0 : addHeapObject(attributes));
|
|
2560
|
+
const ret = wasm.wasmdocumentnode_new(ptr0, len0, addHeapObject(content), ptr1, len1, ptr2, len2, isLikeNone(parent) ? Number.MAX_SAFE_INTEGER : (parent) >>> 0, isLikeNone(attributes) ? 0 : addHeapObject(attributes));
|
|
2606
2561
|
this.__wbg_ptr = ret;
|
|
2607
2562
|
WasmDocumentNodeFinalization.register(this, this.__wbg_ptr, this);
|
|
2608
2563
|
return this;
|
|
@@ -2637,10 +2592,10 @@ class WasmDocumentNode {
|
|
|
2637
2592
|
wasm.wasmdocumentnode_set_children(this.__wbg_ptr, ptr0, len0);
|
|
2638
2593
|
}
|
|
2639
2594
|
/**
|
|
2640
|
-
* @param {
|
|
2595
|
+
* @param {any} value
|
|
2641
2596
|
*/
|
|
2642
2597
|
set content(value) {
|
|
2643
|
-
wasm.wasmdocumentnode_set_content(this.__wbg_ptr, value);
|
|
2598
|
+
wasm.wasmdocumentnode_set_content(this.__wbg_ptr, addHeapObject(value));
|
|
2644
2599
|
}
|
|
2645
2600
|
/**
|
|
2646
2601
|
* @param {string} value
|
|
@@ -2691,12 +2646,12 @@ class WasmDocumentStructure {
|
|
|
2691
2646
|
}
|
|
2692
2647
|
/**
|
|
2693
2648
|
* @param {WasmDocumentNode[]} nodes
|
|
2694
|
-
* @param {string | null} [
|
|
2649
|
+
* @param {string | null} [sourceFormat]
|
|
2695
2650
|
*/
|
|
2696
|
-
constructor(nodes,
|
|
2651
|
+
constructor(nodes, sourceFormat) {
|
|
2697
2652
|
const ptr0 = passArrayJsValueToWasm0(nodes, wasm.__wbindgen_export);
|
|
2698
2653
|
const len0 = WASM_VECTOR_LEN;
|
|
2699
|
-
var ptr1 = isLikeNone(
|
|
2654
|
+
var ptr1 = isLikeNone(sourceFormat) ? 0 : passStringToWasm0(sourceFormat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2700
2655
|
var len1 = WASM_VECTOR_LEN;
|
|
2701
2656
|
const ret = wasm.wasmdocumentstructure_new(ptr0, len0, ptr1, len1);
|
|
2702
2657
|
this.__wbg_ptr = ret;
|
|
@@ -2835,14 +2790,14 @@ class WasmGridCell {
|
|
|
2835
2790
|
* @param {string} content
|
|
2836
2791
|
* @param {number} row
|
|
2837
2792
|
* @param {number} col
|
|
2838
|
-
* @param {number}
|
|
2839
|
-
* @param {number}
|
|
2840
|
-
* @param {boolean}
|
|
2793
|
+
* @param {number} rowSpan
|
|
2794
|
+
* @param {number} colSpan
|
|
2795
|
+
* @param {boolean} isHeader
|
|
2841
2796
|
*/
|
|
2842
|
-
constructor(content, row, col,
|
|
2797
|
+
constructor(content, row, col, rowSpan, colSpan, isHeader) {
|
|
2843
2798
|
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2844
2799
|
const len0 = WASM_VECTOR_LEN;
|
|
2845
|
-
const ret = wasm.wasmgridcell_new(ptr0, len0, row, col,
|
|
2800
|
+
const ret = wasm.wasmgridcell_new(ptr0, len0, row, col, rowSpan, colSpan, isHeader);
|
|
2846
2801
|
this.__wbg_ptr = ret;
|
|
2847
2802
|
WasmGridCellFinalization.register(this, this.__wbg_ptr, this);
|
|
2848
2803
|
return this;
|
|
@@ -2910,19 +2865,6 @@ exports.WasmGridCell = WasmGridCell;
|
|
|
2910
2865
|
* and position in the document structure.
|
|
2911
2866
|
*
|
|
2912
2867
|
* # Examples
|
|
2913
|
-
*
|
|
2914
|
-
* ```
|
|
2915
|
-
* let header = HeaderMetadata {
|
|
2916
|
-
* level: 1,
|
|
2917
|
-
* text: "Main Title".to_string(),
|
|
2918
|
-
* id: Some("main-title".to_string()),
|
|
2919
|
-
* depth: 0,
|
|
2920
|
-
* html_offset: 145,
|
|
2921
|
-
* };
|
|
2922
|
-
*
|
|
2923
|
-
* assert_eq!(header.level, 1);
|
|
2924
|
-
* assert!(header.is_valid());
|
|
2925
|
-
* ```
|
|
2926
2868
|
*/
|
|
2927
2869
|
class WasmHeaderMetadata {
|
|
2928
2870
|
static __wrap(ptr) {
|
|
@@ -2995,26 +2937,6 @@ class WasmHeaderMetadata {
|
|
|
2995
2937
|
* `true` if level is 1-6, `false` otherwise.
|
|
2996
2938
|
*
|
|
2997
2939
|
* # Examples
|
|
2998
|
-
*
|
|
2999
|
-
* ```
|
|
3000
|
-
* let valid = HeaderMetadata {
|
|
3001
|
-
* level: 3,
|
|
3002
|
-
* text: "Title".to_string(),
|
|
3003
|
-
* id: None,
|
|
3004
|
-
* depth: 2,
|
|
3005
|
-
* html_offset: 100,
|
|
3006
|
-
* };
|
|
3007
|
-
* assert!(valid.is_valid());
|
|
3008
|
-
*
|
|
3009
|
-
* let invalid = HeaderMetadata {
|
|
3010
|
-
* level: 7, // Invalid
|
|
3011
|
-
* text: "Title".to_string(),
|
|
3012
|
-
* id: None,
|
|
3013
|
-
* depth: 2,
|
|
3014
|
-
* html_offset: 100,
|
|
3015
|
-
* };
|
|
3016
|
-
* assert!(!invalid.is_valid());
|
|
3017
|
-
* ```
|
|
3018
2940
|
* @returns {boolean}
|
|
3019
2941
|
*/
|
|
3020
2942
|
isValid() {
|
|
@@ -3032,15 +2954,15 @@ class WasmHeaderMetadata {
|
|
|
3032
2954
|
* @param {number} level
|
|
3033
2955
|
* @param {string} text
|
|
3034
2956
|
* @param {number} depth
|
|
3035
|
-
* @param {number}
|
|
2957
|
+
* @param {number} htmlOffset
|
|
3036
2958
|
* @param {string | null} [id]
|
|
3037
2959
|
*/
|
|
3038
|
-
constructor(level, text, depth,
|
|
2960
|
+
constructor(level, text, depth, htmlOffset, id) {
|
|
3039
2961
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3040
2962
|
const len0 = WASM_VECTOR_LEN;
|
|
3041
2963
|
var ptr1 = isLikeNone(id) ? 0 : passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3042
2964
|
var len1 = WASM_VECTOR_LEN;
|
|
3043
|
-
const ret = wasm.wasmheadermetadata_new(level, ptr0, len0, depth,
|
|
2965
|
+
const ret = wasm.wasmheadermetadata_new(level, ptr0, len0, depth, htmlOffset, ptr1, len1);
|
|
3044
2966
|
this.__wbg_ptr = ret;
|
|
3045
2967
|
WasmHeaderMetadataFinalization.register(this, this.__wbg_ptr, this);
|
|
3046
2968
|
return this;
|
|
@@ -3136,18 +3058,6 @@ exports.WasmHighlightStyle = WasmHighlightStyle;
|
|
|
3136
3058
|
* suitable for serialization and transmission across language boundaries.
|
|
3137
3059
|
*
|
|
3138
3060
|
* # Examples
|
|
3139
|
-
*
|
|
3140
|
-
* ```
|
|
3141
|
-
* let metadata = HtmlMetadata {
|
|
3142
|
-
* document: Default::default(),
|
|
3143
|
-
* headers: Vec::new(),
|
|
3144
|
-
* links: Vec::new(),
|
|
3145
|
-
* images: Vec::new(),
|
|
3146
|
-
* structured_data: Vec::new(),
|
|
3147
|
-
* };
|
|
3148
|
-
*
|
|
3149
|
-
* assert!(metadata.headers.is_empty());
|
|
3150
|
-
* ```
|
|
3151
3061
|
*/
|
|
3152
3062
|
class WasmHtmlMetadata {
|
|
3153
3063
|
static __wrap(ptr) {
|
|
@@ -3233,9 +3143,9 @@ class WasmHtmlMetadata {
|
|
|
3233
3143
|
* @param {WasmHeaderMetadata[] | null} [headers]
|
|
3234
3144
|
* @param {WasmLinkMetadata[] | null} [links]
|
|
3235
3145
|
* @param {WasmImageMetadata[] | null} [images]
|
|
3236
|
-
* @param {WasmStructuredData[] | null} [
|
|
3146
|
+
* @param {WasmStructuredData[] | null} [structuredData]
|
|
3237
3147
|
*/
|
|
3238
|
-
constructor(document, headers, links, images,
|
|
3148
|
+
constructor(document, headers, links, images, structuredData) {
|
|
3239
3149
|
let ptr0 = 0;
|
|
3240
3150
|
if (!isLikeNone(document)) {
|
|
3241
3151
|
_assertClass(document, WasmDocumentMetadata);
|
|
@@ -3247,7 +3157,7 @@ class WasmHtmlMetadata {
|
|
|
3247
3157
|
var len2 = WASM_VECTOR_LEN;
|
|
3248
3158
|
var ptr3 = isLikeNone(images) ? 0 : passArrayJsValueToWasm0(images, wasm.__wbindgen_export);
|
|
3249
3159
|
var len3 = WASM_VECTOR_LEN;
|
|
3250
|
-
var ptr4 = isLikeNone(
|
|
3160
|
+
var ptr4 = isLikeNone(structuredData) ? 0 : passArrayJsValueToWasm0(structuredData, wasm.__wbindgen_export);
|
|
3251
3161
|
var len4 = WASM_VECTOR_LEN;
|
|
3252
3162
|
const ret = wasm.wasmhtmlmetadata_new(ptr0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
3253
3163
|
this.__wbg_ptr = ret;
|
|
@@ -3321,19 +3231,6 @@ exports.WasmHtmlMetadata = WasmHtmlMetadata;
|
|
|
3321
3231
|
* for image analysis and optimization.
|
|
3322
3232
|
*
|
|
3323
3233
|
* # Examples
|
|
3324
|
-
*
|
|
3325
|
-
* ```
|
|
3326
|
-
* let img = ImageMetadata {
|
|
3327
|
-
* src: "https://example.com/image.jpg".to_string(),
|
|
3328
|
-
* alt: Some("An example image".to_string()),
|
|
3329
|
-
* title: Some("Example".to_string()),
|
|
3330
|
-
* dimensions: Some((800, 600)),
|
|
3331
|
-
* image_type: ImageType::External,
|
|
3332
|
-
* attributes: Default::default(),
|
|
3333
|
-
* };
|
|
3334
|
-
*
|
|
3335
|
-
* assert_eq!(img.image_type, ImageType::External);
|
|
3336
|
-
* ```
|
|
3337
3234
|
*/
|
|
3338
3235
|
class WasmImageMetadata {
|
|
3339
3236
|
static __wrap(ptr) {
|
|
@@ -3431,13 +3328,13 @@ class WasmImageMetadata {
|
|
|
3431
3328
|
}
|
|
3432
3329
|
/**
|
|
3433
3330
|
* @param {string} src
|
|
3434
|
-
* @param {WasmImageType}
|
|
3331
|
+
* @param {WasmImageType} imageType
|
|
3435
3332
|
* @param {any} attributes
|
|
3436
3333
|
* @param {string | null} [alt]
|
|
3437
3334
|
* @param {string | null} [title]
|
|
3438
3335
|
* @param {Uint32Array | null} [dimensions]
|
|
3439
3336
|
*/
|
|
3440
|
-
constructor(src,
|
|
3337
|
+
constructor(src, imageType, attributes, alt, title, dimensions) {
|
|
3441
3338
|
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3442
3339
|
const len0 = WASM_VECTOR_LEN;
|
|
3443
3340
|
var ptr1 = isLikeNone(alt) ? 0 : passStringToWasm0(alt, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -3446,7 +3343,7 @@ class WasmImageMetadata {
|
|
|
3446
3343
|
var len2 = WASM_VECTOR_LEN;
|
|
3447
3344
|
var ptr3 = isLikeNone(dimensions) ? 0 : passArray32ToWasm0(dimensions, wasm.__wbindgen_export);
|
|
3448
3345
|
var len3 = WASM_VECTOR_LEN;
|
|
3449
|
-
const ret = wasm.wasmimagemetadata_new(ptr0, len0,
|
|
3346
|
+
const ret = wasm.wasmimagemetadata_new(ptr0, len0, imageType, addHeapObject(attributes), ptr1, len1, ptr2, len2, ptr3, len3);
|
|
3450
3347
|
this.__wbg_ptr = ret;
|
|
3451
3348
|
WasmImageMetadataFinalization.register(this, this.__wbg_ptr, this);
|
|
3452
3349
|
return this;
|
|
@@ -3557,20 +3454,6 @@ exports.WasmImageType = WasmImageType;
|
|
|
3557
3454
|
* Represents `<a>` elements with parsed href values, text content, and link type classification.
|
|
3558
3455
|
*
|
|
3559
3456
|
* # Examples
|
|
3560
|
-
*
|
|
3561
|
-
* ```
|
|
3562
|
-
* let link = LinkMetadata {
|
|
3563
|
-
* href: "https://example.com".to_string(),
|
|
3564
|
-
* text: "Example".to_string(),
|
|
3565
|
-
* title: Some("Visit Example".to_string()),
|
|
3566
|
-
* link_type: LinkType::External,
|
|
3567
|
-
* rel: vec!["nofollow".to_string()],
|
|
3568
|
-
* attributes: Default::default(),
|
|
3569
|
-
* };
|
|
3570
|
-
*
|
|
3571
|
-
* assert_eq!(link.link_type, LinkType::External);
|
|
3572
|
-
* assert_eq!(link.text, "Example");
|
|
3573
|
-
* ```
|
|
3574
3457
|
*/
|
|
3575
3458
|
class WasmLinkMetadata {
|
|
3576
3459
|
static __wrap(ptr) {
|
|
@@ -3602,34 +3485,6 @@ class WasmLinkMetadata {
|
|
|
3602
3485
|
const ret = wasm.wasmlinkmetadata_attributes(this.__wbg_ptr);
|
|
3603
3486
|
return takeObject(ret);
|
|
3604
3487
|
}
|
|
3605
|
-
/**
|
|
3606
|
-
* Classify a link based on href value.
|
|
3607
|
-
*
|
|
3608
|
-
* # Arguments
|
|
3609
|
-
*
|
|
3610
|
-
* * `href` - The href attribute value
|
|
3611
|
-
*
|
|
3612
|
-
* # Returns
|
|
3613
|
-
*
|
|
3614
|
-
* Appropriate [`LinkType`] based on protocol and content.
|
|
3615
|
-
*
|
|
3616
|
-
* # Examples
|
|
3617
|
-
*
|
|
3618
|
-
* ```
|
|
3619
|
-
* assert_eq!(LinkMetadata::classify_link("#section"), LinkType::Anchor);
|
|
3620
|
-
* assert_eq!(LinkMetadata::classify_link("mailto:test@example.com"), LinkType::Email);
|
|
3621
|
-
* assert_eq!(LinkMetadata::classify_link("tel:+1234567890"), LinkType::Phone);
|
|
3622
|
-
* assert_eq!(LinkMetadata::classify_link("https://example.com"), LinkType::External);
|
|
3623
|
-
* ```
|
|
3624
|
-
* @param {string} href
|
|
3625
|
-
* @returns {WasmLinkType}
|
|
3626
|
-
*/
|
|
3627
|
-
static classifyLink(href) {
|
|
3628
|
-
const ptr0 = passStringToWasm0(href, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3629
|
-
const len0 = WASM_VECTOR_LEN;
|
|
3630
|
-
const ret = wasm.wasmlinkmetadata_classifyLink(ptr0, len0);
|
|
3631
|
-
return ret;
|
|
3632
|
-
}
|
|
3633
3488
|
/**
|
|
3634
3489
|
* @returns {WasmLinkMetadata}
|
|
3635
3490
|
*/
|
|
@@ -3678,12 +3533,12 @@ class WasmLinkMetadata {
|
|
|
3678
3533
|
/**
|
|
3679
3534
|
* @param {string} href
|
|
3680
3535
|
* @param {string} text
|
|
3681
|
-
* @param {WasmLinkType}
|
|
3536
|
+
* @param {WasmLinkType} linkType
|
|
3682
3537
|
* @param {string[]} rel
|
|
3683
3538
|
* @param {any} attributes
|
|
3684
3539
|
* @param {string | null} [title]
|
|
3685
3540
|
*/
|
|
3686
|
-
constructor(href, text,
|
|
3541
|
+
constructor(href, text, linkType, rel, attributes, title) {
|
|
3687
3542
|
const ptr0 = passStringToWasm0(href, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3688
3543
|
const len0 = WASM_VECTOR_LEN;
|
|
3689
3544
|
const ptr1 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -3692,7 +3547,7 @@ class WasmLinkMetadata {
|
|
|
3692
3547
|
const len2 = WASM_VECTOR_LEN;
|
|
3693
3548
|
var ptr3 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3694
3549
|
var len3 = WASM_VECTOR_LEN;
|
|
3695
|
-
const ret = wasm.wasmlinkmetadata_new(ptr0, len0, ptr1, len1,
|
|
3550
|
+
const ret = wasm.wasmlinkmetadata_new(ptr0, len0, ptr1, len1, linkType, ptr2, len2, addHeapObject(attributes), ptr3, len3);
|
|
3696
3551
|
this.__wbg_ptr = ret;
|
|
3697
3552
|
WasmLinkMetadataFinalization.register(this, this.__wbg_ptr, this);
|
|
3698
3553
|
return this;
|
|
@@ -3856,61 +3711,457 @@ exports.WasmNewlineStyle = WasmNewlineStyle;
|
|
|
3856
3711
|
* The semantic content type of a document node.
|
|
3857
3712
|
*
|
|
3858
3713
|
* Uses internally tagged representation (`"node_type": "heading"`) for JSON serialization.
|
|
3859
|
-
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}
|
|
3860
|
-
*/
|
|
3861
|
-
const WasmNodeContent = Object.freeze({
|
|
3862
|
-
Heading: 0, "0": "Heading",
|
|
3863
|
-
Paragraph: 1, "1": "Paragraph",
|
|
3864
|
-
List: 2, "2": "List",
|
|
3865
|
-
ListItem: 3, "3": "ListItem",
|
|
3866
|
-
Table: 4, "4": "Table",
|
|
3867
|
-
Image: 5, "5": "Image",
|
|
3868
|
-
Code: 6, "6": "Code",
|
|
3869
|
-
Quote: 7, "7": "Quote",
|
|
3870
|
-
DefinitionList: 8, "8": "DefinitionList",
|
|
3871
|
-
DefinitionItem: 9, "9": "DefinitionItem",
|
|
3872
|
-
RawBlock: 10, "10": "RawBlock",
|
|
3873
|
-
MetadataBlock: 11, "11": "MetadataBlock",
|
|
3874
|
-
Group: 12, "12": "Group",
|
|
3875
|
-
});
|
|
3876
|
-
exports.WasmNodeContent = WasmNodeContent;
|
|
3877
|
-
|
|
3878
|
-
/**
|
|
3879
|
-
* Context information passed to all visitor methods.
|
|
3880
|
-
*
|
|
3881
|
-
* Provides comprehensive metadata about the current node being visited,
|
|
3882
|
-
* including its type, attributes, position in the DOM tree, and parent context.
|
|
3883
3714
|
*/
|
|
3884
|
-
class
|
|
3715
|
+
class WasmNodeContent {
|
|
3885
3716
|
static __wrap(ptr) {
|
|
3886
|
-
const obj = Object.create(
|
|
3717
|
+
const obj = Object.create(WasmNodeContent.prototype);
|
|
3887
3718
|
obj.__wbg_ptr = ptr;
|
|
3888
|
-
|
|
3719
|
+
WasmNodeContentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3889
3720
|
return obj;
|
|
3890
3721
|
}
|
|
3891
3722
|
__destroy_into_raw() {
|
|
3892
3723
|
const ptr = this.__wbg_ptr;
|
|
3893
3724
|
this.__wbg_ptr = 0;
|
|
3894
|
-
|
|
3725
|
+
WasmNodeContentFinalization.unregister(this);
|
|
3895
3726
|
return ptr;
|
|
3896
3727
|
}
|
|
3897
3728
|
free() {
|
|
3898
3729
|
const ptr = this.__destroy_into_raw();
|
|
3899
|
-
wasm.
|
|
3900
|
-
}
|
|
3901
|
-
/**
|
|
3902
|
-
* @returns {any}
|
|
3903
|
-
*/
|
|
3904
|
-
get attributes() {
|
|
3905
|
-
const ret = wasm.wasmnodecontext_attributes(this.__wbg_ptr);
|
|
3906
|
-
return takeObject(ret);
|
|
3730
|
+
wasm.__wbg_wasmnodecontent_free(ptr, 0);
|
|
3907
3731
|
}
|
|
3908
3732
|
/**
|
|
3909
|
-
* @returns {
|
|
3733
|
+
* @returns {string | undefined}
|
|
3910
3734
|
*/
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3735
|
+
get content() {
|
|
3736
|
+
try {
|
|
3737
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3738
|
+
wasm.wasmnodecontent_content(retptr, this.__wbg_ptr);
|
|
3739
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3740
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3741
|
+
let v1;
|
|
3742
|
+
if (r0 !== 0) {
|
|
3743
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3744
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3745
|
+
}
|
|
3746
|
+
return v1;
|
|
3747
|
+
} finally {
|
|
3748
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
/**
|
|
3752
|
+
* @returns {WasmNodeContent}
|
|
3753
|
+
*/
|
|
3754
|
+
static default() {
|
|
3755
|
+
const ret = wasm.wasmnodecontent_default();
|
|
3756
|
+
return WasmNodeContent.__wrap(ret);
|
|
3757
|
+
}
|
|
3758
|
+
/**
|
|
3759
|
+
* @returns {string | undefined}
|
|
3760
|
+
*/
|
|
3761
|
+
get definition() {
|
|
3762
|
+
try {
|
|
3763
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3764
|
+
wasm.wasmnodecontent_definition(retptr, this.__wbg_ptr);
|
|
3765
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3766
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3767
|
+
let v1;
|
|
3768
|
+
if (r0 !== 0) {
|
|
3769
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3770
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3771
|
+
}
|
|
3772
|
+
return v1;
|
|
3773
|
+
} finally {
|
|
3774
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3775
|
+
}
|
|
3776
|
+
}
|
|
3777
|
+
/**
|
|
3778
|
+
* @returns {string | undefined}
|
|
3779
|
+
*/
|
|
3780
|
+
get description() {
|
|
3781
|
+
try {
|
|
3782
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3783
|
+
wasm.wasmnodecontent_description(retptr, this.__wbg_ptr);
|
|
3784
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3785
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3786
|
+
let v1;
|
|
3787
|
+
if (r0 !== 0) {
|
|
3788
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3789
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3790
|
+
}
|
|
3791
|
+
return v1;
|
|
3792
|
+
} finally {
|
|
3793
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3794
|
+
}
|
|
3795
|
+
}
|
|
3796
|
+
/**
|
|
3797
|
+
* @returns {any | undefined}
|
|
3798
|
+
*/
|
|
3799
|
+
get entries() {
|
|
3800
|
+
const ret = wasm.wasmnodecontent_entries(this.__wbg_ptr);
|
|
3801
|
+
return takeObject(ret);
|
|
3802
|
+
}
|
|
3803
|
+
/**
|
|
3804
|
+
* @returns {string | undefined}
|
|
3805
|
+
*/
|
|
3806
|
+
get format() {
|
|
3807
|
+
try {
|
|
3808
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3809
|
+
wasm.wasmnodecontent_format(retptr, this.__wbg_ptr);
|
|
3810
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3811
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3812
|
+
let v1;
|
|
3813
|
+
if (r0 !== 0) {
|
|
3814
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3815
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3816
|
+
}
|
|
3817
|
+
return v1;
|
|
3818
|
+
} finally {
|
|
3819
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3820
|
+
}
|
|
3821
|
+
}
|
|
3822
|
+
/**
|
|
3823
|
+
* @returns {WasmTableGrid | undefined}
|
|
3824
|
+
*/
|
|
3825
|
+
get grid() {
|
|
3826
|
+
const ret = wasm.wasmnodecontent_grid(this.__wbg_ptr);
|
|
3827
|
+
return ret === 0 ? undefined : WasmTableGrid.__wrap(ret);
|
|
3828
|
+
}
|
|
3829
|
+
/**
|
|
3830
|
+
* @returns {number | undefined}
|
|
3831
|
+
*/
|
|
3832
|
+
get headingLevel() {
|
|
3833
|
+
const ret = wasm.wasmnodecontent_headingLevel(this.__wbg_ptr);
|
|
3834
|
+
return ret === 0xFFFFFF ? undefined : ret;
|
|
3835
|
+
}
|
|
3836
|
+
/**
|
|
3837
|
+
* @returns {string | undefined}
|
|
3838
|
+
*/
|
|
3839
|
+
get headingText() {
|
|
3840
|
+
try {
|
|
3841
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3842
|
+
wasm.wasmnodecontent_headingText(retptr, this.__wbg_ptr);
|
|
3843
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3844
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3845
|
+
let v1;
|
|
3846
|
+
if (r0 !== 0) {
|
|
3847
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3848
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3849
|
+
}
|
|
3850
|
+
return v1;
|
|
3851
|
+
} finally {
|
|
3852
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3853
|
+
}
|
|
3854
|
+
}
|
|
3855
|
+
/**
|
|
3856
|
+
* @returns {number | undefined}
|
|
3857
|
+
*/
|
|
3858
|
+
get imageIndex() {
|
|
3859
|
+
const ret = wasm.wasmnodecontent_imageIndex(this.__wbg_ptr);
|
|
3860
|
+
return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
|
|
3861
|
+
}
|
|
3862
|
+
/**
|
|
3863
|
+
* @returns {string | undefined}
|
|
3864
|
+
*/
|
|
3865
|
+
get label() {
|
|
3866
|
+
try {
|
|
3867
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3868
|
+
wasm.wasmnodecontent_label(retptr, this.__wbg_ptr);
|
|
3869
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3870
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3871
|
+
let v1;
|
|
3872
|
+
if (r0 !== 0) {
|
|
3873
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3874
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3875
|
+
}
|
|
3876
|
+
return v1;
|
|
3877
|
+
} finally {
|
|
3878
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
/**
|
|
3882
|
+
* @returns {string | undefined}
|
|
3883
|
+
*/
|
|
3884
|
+
get language() {
|
|
3885
|
+
try {
|
|
3886
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3887
|
+
wasm.wasmnodecontent_language(retptr, this.__wbg_ptr);
|
|
3888
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3889
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3890
|
+
let v1;
|
|
3891
|
+
if (r0 !== 0) {
|
|
3892
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
3893
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3894
|
+
}
|
|
3895
|
+
return v1;
|
|
3896
|
+
} finally {
|
|
3897
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
/**
|
|
3901
|
+
* @returns {number | undefined}
|
|
3902
|
+
*/
|
|
3903
|
+
get level() {
|
|
3904
|
+
const ret = wasm.wasmnodecontent_level(this.__wbg_ptr);
|
|
3905
|
+
return ret === 0xFFFFFF ? undefined : ret;
|
|
3906
|
+
}
|
|
3907
|
+
constructor() {
|
|
3908
|
+
const ret = wasm.wasmnodecontent_new();
|
|
3909
|
+
this.__wbg_ptr = ret;
|
|
3910
|
+
WasmNodeContentFinalization.register(this, this.__wbg_ptr, this);
|
|
3911
|
+
return this;
|
|
3912
|
+
}
|
|
3913
|
+
/**
|
|
3914
|
+
* @returns {string}
|
|
3915
|
+
*/
|
|
3916
|
+
get nodeType() {
|
|
3917
|
+
let deferred1_0;
|
|
3918
|
+
let deferred1_1;
|
|
3919
|
+
try {
|
|
3920
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3921
|
+
wasm.wasmnodecontent_nodeType(retptr, this.__wbg_ptr);
|
|
3922
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3923
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3924
|
+
deferred1_0 = r0;
|
|
3925
|
+
deferred1_1 = r1;
|
|
3926
|
+
return getStringFromWasm0(r0, r1);
|
|
3927
|
+
} finally {
|
|
3928
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3929
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
3930
|
+
}
|
|
3931
|
+
}
|
|
3932
|
+
/**
|
|
3933
|
+
* @returns {boolean | undefined}
|
|
3934
|
+
*/
|
|
3935
|
+
get ordered() {
|
|
3936
|
+
const ret = wasm.wasmnodecontent_ordered(this.__wbg_ptr);
|
|
3937
|
+
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
3938
|
+
}
|
|
3939
|
+
/**
|
|
3940
|
+
* @param {string | null} [value]
|
|
3941
|
+
*/
|
|
3942
|
+
set content(value) {
|
|
3943
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3944
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3945
|
+
wasm.wasmnodecontent_set_content(this.__wbg_ptr, ptr0, len0);
|
|
3946
|
+
}
|
|
3947
|
+
/**
|
|
3948
|
+
* @param {string | null} [value]
|
|
3949
|
+
*/
|
|
3950
|
+
set definition(value) {
|
|
3951
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3952
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3953
|
+
wasm.wasmnodecontent_set_definition(this.__wbg_ptr, ptr0, len0);
|
|
3954
|
+
}
|
|
3955
|
+
/**
|
|
3956
|
+
* @param {string | null} [value]
|
|
3957
|
+
*/
|
|
3958
|
+
set description(value) {
|
|
3959
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3960
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3961
|
+
wasm.wasmnodecontent_set_description(this.__wbg_ptr, ptr0, len0);
|
|
3962
|
+
}
|
|
3963
|
+
/**
|
|
3964
|
+
* @param {any | null} [value]
|
|
3965
|
+
*/
|
|
3966
|
+
set entries(value) {
|
|
3967
|
+
wasm.wasmnodecontent_set_entries(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value));
|
|
3968
|
+
}
|
|
3969
|
+
/**
|
|
3970
|
+
* @param {string | null} [value]
|
|
3971
|
+
*/
|
|
3972
|
+
set format(value) {
|
|
3973
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3974
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3975
|
+
wasm.wasmnodecontent_set_format(this.__wbg_ptr, ptr0, len0);
|
|
3976
|
+
}
|
|
3977
|
+
/**
|
|
3978
|
+
* @param {WasmTableGrid | null} [value]
|
|
3979
|
+
*/
|
|
3980
|
+
set grid(value) {
|
|
3981
|
+
let ptr0 = 0;
|
|
3982
|
+
if (!isLikeNone(value)) {
|
|
3983
|
+
_assertClass(value, WasmTableGrid);
|
|
3984
|
+
ptr0 = value.__destroy_into_raw();
|
|
3985
|
+
}
|
|
3986
|
+
wasm.wasmnodecontent_set_grid(this.__wbg_ptr, ptr0);
|
|
3987
|
+
}
|
|
3988
|
+
/**
|
|
3989
|
+
* @param {number | null} [value]
|
|
3990
|
+
*/
|
|
3991
|
+
set headingLevel(value) {
|
|
3992
|
+
wasm.wasmnodecontent_set_headingLevel(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value);
|
|
3993
|
+
}
|
|
3994
|
+
/**
|
|
3995
|
+
* @param {string | null} [value]
|
|
3996
|
+
*/
|
|
3997
|
+
set headingText(value) {
|
|
3998
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3999
|
+
var len0 = WASM_VECTOR_LEN;
|
|
4000
|
+
wasm.wasmnodecontent_set_headingText(this.__wbg_ptr, ptr0, len0);
|
|
4001
|
+
}
|
|
4002
|
+
/**
|
|
4003
|
+
* @param {number | null} [value]
|
|
4004
|
+
*/
|
|
4005
|
+
set imageIndex(value) {
|
|
4006
|
+
wasm.wasmnodecontent_set_imageIndex(this.__wbg_ptr, isLikeNone(value) ? Number.MAX_SAFE_INTEGER : (value) >>> 0);
|
|
4007
|
+
}
|
|
4008
|
+
/**
|
|
4009
|
+
* @param {string | null} [value]
|
|
4010
|
+
*/
|
|
4011
|
+
set label(value) {
|
|
4012
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4013
|
+
var len0 = WASM_VECTOR_LEN;
|
|
4014
|
+
wasm.wasmnodecontent_set_label(this.__wbg_ptr, ptr0, len0);
|
|
4015
|
+
}
|
|
4016
|
+
/**
|
|
4017
|
+
* @param {string | null} [value]
|
|
4018
|
+
*/
|
|
4019
|
+
set language(value) {
|
|
4020
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4021
|
+
var len0 = WASM_VECTOR_LEN;
|
|
4022
|
+
wasm.wasmnodecontent_set_language(this.__wbg_ptr, ptr0, len0);
|
|
4023
|
+
}
|
|
4024
|
+
/**
|
|
4025
|
+
* @param {number | null} [value]
|
|
4026
|
+
*/
|
|
4027
|
+
set level(value) {
|
|
4028
|
+
wasm.wasmnodecontent_set_level(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value);
|
|
4029
|
+
}
|
|
4030
|
+
/**
|
|
4031
|
+
* @param {string} value
|
|
4032
|
+
*/
|
|
4033
|
+
set nodeType(value) {
|
|
4034
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4035
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4036
|
+
wasm.wasmnodecontent_set_nodeType(this.__wbg_ptr, ptr0, len0);
|
|
4037
|
+
}
|
|
4038
|
+
/**
|
|
4039
|
+
* @param {boolean | null} [value]
|
|
4040
|
+
*/
|
|
4041
|
+
set ordered(value) {
|
|
4042
|
+
wasm.wasmnodecontent_set_ordered(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0);
|
|
4043
|
+
}
|
|
4044
|
+
/**
|
|
4045
|
+
* @param {string | null} [value]
|
|
4046
|
+
*/
|
|
4047
|
+
set src(value) {
|
|
4048
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4049
|
+
var len0 = WASM_VECTOR_LEN;
|
|
4050
|
+
wasm.wasmnodecontent_set_src(this.__wbg_ptr, ptr0, len0);
|
|
4051
|
+
}
|
|
4052
|
+
/**
|
|
4053
|
+
* @param {string | null} [value]
|
|
4054
|
+
*/
|
|
4055
|
+
set term(value) {
|
|
4056
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4057
|
+
var len0 = WASM_VECTOR_LEN;
|
|
4058
|
+
wasm.wasmnodecontent_set_term(this.__wbg_ptr, ptr0, len0);
|
|
4059
|
+
}
|
|
4060
|
+
/**
|
|
4061
|
+
* @param {string | null} [value]
|
|
4062
|
+
*/
|
|
4063
|
+
set text(value) {
|
|
4064
|
+
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4065
|
+
var len0 = WASM_VECTOR_LEN;
|
|
4066
|
+
wasm.wasmnodecontent_set_text(this.__wbg_ptr, ptr0, len0);
|
|
4067
|
+
}
|
|
4068
|
+
/**
|
|
4069
|
+
* @returns {string | undefined}
|
|
4070
|
+
*/
|
|
4071
|
+
get src() {
|
|
4072
|
+
try {
|
|
4073
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4074
|
+
wasm.wasmnodecontent_src(retptr, this.__wbg_ptr);
|
|
4075
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4076
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4077
|
+
let v1;
|
|
4078
|
+
if (r0 !== 0) {
|
|
4079
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
4080
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
4081
|
+
}
|
|
4082
|
+
return v1;
|
|
4083
|
+
} finally {
|
|
4084
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4085
|
+
}
|
|
4086
|
+
}
|
|
4087
|
+
/**
|
|
4088
|
+
* @returns {string | undefined}
|
|
4089
|
+
*/
|
|
4090
|
+
get term() {
|
|
4091
|
+
try {
|
|
4092
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4093
|
+
wasm.wasmnodecontent_term(retptr, this.__wbg_ptr);
|
|
4094
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4095
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4096
|
+
let v1;
|
|
4097
|
+
if (r0 !== 0) {
|
|
4098
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
4099
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
4100
|
+
}
|
|
4101
|
+
return v1;
|
|
4102
|
+
} finally {
|
|
4103
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4104
|
+
}
|
|
4105
|
+
}
|
|
4106
|
+
/**
|
|
4107
|
+
* @returns {string | undefined}
|
|
4108
|
+
*/
|
|
4109
|
+
get text() {
|
|
4110
|
+
try {
|
|
4111
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4112
|
+
wasm.wasmnodecontent_text(retptr, this.__wbg_ptr);
|
|
4113
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4114
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4115
|
+
let v1;
|
|
4116
|
+
if (r0 !== 0) {
|
|
4117
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
4118
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
4119
|
+
}
|
|
4120
|
+
return v1;
|
|
4121
|
+
} finally {
|
|
4122
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
if (Symbol.dispose) WasmNodeContent.prototype[Symbol.dispose] = WasmNodeContent.prototype.free;
|
|
4127
|
+
exports.WasmNodeContent = WasmNodeContent;
|
|
4128
|
+
|
|
4129
|
+
/**
|
|
4130
|
+
* Context information passed to all visitor methods.
|
|
4131
|
+
*
|
|
4132
|
+
* Provides comprehensive metadata about the current node being visited,
|
|
4133
|
+
* including its type, attributes, position in the DOM tree, and parent context.
|
|
4134
|
+
*/
|
|
4135
|
+
class WasmNodeContext {
|
|
4136
|
+
static __wrap(ptr) {
|
|
4137
|
+
const obj = Object.create(WasmNodeContext.prototype);
|
|
4138
|
+
obj.__wbg_ptr = ptr;
|
|
4139
|
+
WasmNodeContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
4140
|
+
return obj;
|
|
4141
|
+
}
|
|
4142
|
+
__destroy_into_raw() {
|
|
4143
|
+
const ptr = this.__wbg_ptr;
|
|
4144
|
+
this.__wbg_ptr = 0;
|
|
4145
|
+
WasmNodeContextFinalization.unregister(this);
|
|
4146
|
+
return ptr;
|
|
4147
|
+
}
|
|
4148
|
+
free() {
|
|
4149
|
+
const ptr = this.__destroy_into_raw();
|
|
4150
|
+
wasm.__wbg_wasmnodecontext_free(ptr, 0);
|
|
4151
|
+
}
|
|
4152
|
+
/**
|
|
4153
|
+
* @returns {any}
|
|
4154
|
+
*/
|
|
4155
|
+
get attributes() {
|
|
4156
|
+
const ret = wasm.wasmnodecontext_attributes(this.__wbg_ptr);
|
|
4157
|
+
return takeObject(ret);
|
|
4158
|
+
}
|
|
4159
|
+
/**
|
|
4160
|
+
* @returns {WasmNodeContext}
|
|
4161
|
+
*/
|
|
4162
|
+
static default() {
|
|
4163
|
+
const ret = wasm.wasmnodecontext_default();
|
|
4164
|
+
return WasmNodeContext.__wrap(ret);
|
|
3914
4165
|
}
|
|
3915
4166
|
/**
|
|
3916
4167
|
* @returns {number}
|
|
@@ -3934,20 +4185,20 @@ class WasmNodeContext {
|
|
|
3934
4185
|
return ret !== 0;
|
|
3935
4186
|
}
|
|
3936
4187
|
/**
|
|
3937
|
-
* @param {WasmNodeType}
|
|
3938
|
-
* @param {string}
|
|
4188
|
+
* @param {WasmNodeType} nodeType
|
|
4189
|
+
* @param {string} tagName
|
|
3939
4190
|
* @param {any} attributes
|
|
3940
4191
|
* @param {number} depth
|
|
3941
|
-
* @param {number}
|
|
3942
|
-
* @param {boolean}
|
|
3943
|
-
* @param {string | null} [
|
|
4192
|
+
* @param {number} indexInParent
|
|
4193
|
+
* @param {boolean} isInline
|
|
4194
|
+
* @param {string | null} [parentTag]
|
|
3944
4195
|
*/
|
|
3945
|
-
constructor(
|
|
3946
|
-
const ptr0 = passStringToWasm0(
|
|
4196
|
+
constructor(nodeType, tagName, attributes, depth, indexInParent, isInline, parentTag) {
|
|
4197
|
+
const ptr0 = passStringToWasm0(tagName, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3947
4198
|
const len0 = WASM_VECTOR_LEN;
|
|
3948
|
-
var ptr1 = isLikeNone(
|
|
4199
|
+
var ptr1 = isLikeNone(parentTag) ? 0 : passStringToWasm0(parentTag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3949
4200
|
var len1 = WASM_VECTOR_LEN;
|
|
3950
|
-
const ret = wasm.wasmnodecontext_new(
|
|
4201
|
+
const ret = wasm.wasmnodecontext_new(nodeType, ptr0, len0, addHeapObject(attributes), depth, indexInParent, isInline, ptr1, len1);
|
|
3951
4202
|
this.__wbg_ptr = ret;
|
|
3952
4203
|
WasmNodeContextFinalization.register(this, this.__wbg_ptr, this);
|
|
3953
4204
|
return this;
|
|
@@ -4191,22 +4442,6 @@ class WasmPreprocessingOptions {
|
|
|
4191
4442
|
const ptr = this.__destroy_into_raw();
|
|
4192
4443
|
wasm.__wbg_wasmpreprocessingoptions_free(ptr, 0);
|
|
4193
4444
|
}
|
|
4194
|
-
/**
|
|
4195
|
-
* Apply a partial update to these preprocessing options.
|
|
4196
|
-
*
|
|
4197
|
-
* Any specified fields in the update will override the current values.
|
|
4198
|
-
* Unspecified fields (None) are left unchanged.
|
|
4199
|
-
*
|
|
4200
|
-
* # Arguments
|
|
4201
|
-
*
|
|
4202
|
-
* * `update` - Partial preprocessing options update
|
|
4203
|
-
* @param {WasmPreprocessingOptionsUpdate} update
|
|
4204
|
-
*/
|
|
4205
|
-
applyUpdate(update) {
|
|
4206
|
-
_assertClass(update, WasmPreprocessingOptionsUpdate);
|
|
4207
|
-
var ptr0 = update.__destroy_into_raw();
|
|
4208
|
-
wasm.wasmpreprocessingoptions_applyUpdate(this.__wbg_ptr, ptr0);
|
|
4209
|
-
}
|
|
4210
4445
|
/**
|
|
4211
4446
|
* @returns {WasmPreprocessingOptions}
|
|
4212
4447
|
*/
|
|
@@ -4221,46 +4456,14 @@ class WasmPreprocessingOptions {
|
|
|
4221
4456
|
const ret = wasm.wasmpreprocessingoptions_enabled(this.__wbg_ptr);
|
|
4222
4457
|
return ret !== 0;
|
|
4223
4458
|
}
|
|
4224
|
-
/**
|
|
4225
|
-
* @param {WasmPreprocessingOptionsUpdate} update
|
|
4226
|
-
* @returns {WasmPreprocessingOptions}
|
|
4227
|
-
*/
|
|
4228
|
-
static from(update) {
|
|
4229
|
-
_assertClass(update, WasmPreprocessingOptionsUpdate);
|
|
4230
|
-
var ptr0 = update.__destroy_into_raw();
|
|
4231
|
-
const ret = wasm.wasmpreprocessingoptions_from(ptr0);
|
|
4232
|
-
return WasmPreprocessingOptions.__wrap(ret);
|
|
4233
|
-
}
|
|
4234
|
-
/**
|
|
4235
|
-
* Create new preprocessing options from a partial update.
|
|
4236
|
-
*
|
|
4237
|
-
* Creates a new `PreprocessingOptions` struct with defaults, then applies the update.
|
|
4238
|
-
* Fields not specified in the update keep their default values.
|
|
4239
|
-
*
|
|
4240
|
-
* # Arguments
|
|
4241
|
-
*
|
|
4242
|
-
* * `update` - Partial preprocessing options update
|
|
4243
|
-
*
|
|
4244
|
-
* # Returns
|
|
4245
|
-
*
|
|
4246
|
-
* New `PreprocessingOptions` with specified updates applied to defaults
|
|
4247
|
-
* @param {WasmPreprocessingOptionsUpdate} update
|
|
4248
|
-
* @returns {WasmPreprocessingOptions}
|
|
4249
|
-
*/
|
|
4250
|
-
static fromUpdate(update) {
|
|
4251
|
-
_assertClass(update, WasmPreprocessingOptionsUpdate);
|
|
4252
|
-
var ptr0 = update.__destroy_into_raw();
|
|
4253
|
-
const ret = wasm.wasmpreprocessingoptions_fromUpdate(ptr0);
|
|
4254
|
-
return WasmPreprocessingOptions.__wrap(ret);
|
|
4255
|
-
}
|
|
4256
4459
|
/**
|
|
4257
4460
|
* @param {boolean | null} [enabled]
|
|
4258
4461
|
* @param {WasmPreprocessingPreset | null} [preset]
|
|
4259
|
-
* @param {boolean | null} [
|
|
4260
|
-
* @param {boolean | null} [
|
|
4462
|
+
* @param {boolean | null} [removeNavigation]
|
|
4463
|
+
* @param {boolean | null} [removeForms]
|
|
4261
4464
|
*/
|
|
4262
|
-
constructor(enabled, preset,
|
|
4263
|
-
const ret = wasm.wasmpreprocessingoptions_new(isLikeNone(enabled) ? 0xFFFFFF : enabled ? 1 : 0, isLikeNone(preset) ? 3 : preset, isLikeNone(
|
|
4465
|
+
constructor(enabled, preset, removeNavigation, removeForms) {
|
|
4466
|
+
const ret = wasm.wasmpreprocessingoptions_new(isLikeNone(enabled) ? 0xFFFFFF : enabled ? 1 : 0, isLikeNone(preset) ? 3 : preset, isLikeNone(removeNavigation) ? 0xFFFFFF : removeNavigation ? 1 : 0, isLikeNone(removeForms) ? 0xFFFFFF : removeForms ? 1 : 0);
|
|
4264
4467
|
this.__wbg_ptr = ret;
|
|
4265
4468
|
WasmPreprocessingOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
4266
4469
|
return this;
|
|
@@ -4330,8 +4533,8 @@ exports.WasmPreprocessingOptions = WasmPreprocessingOptions;
|
|
|
4330
4533
|
* Partial update for `PreprocessingOptions`.
|
|
4331
4534
|
*
|
|
4332
4535
|
* This struct uses `Option<T>` to represent optional fields that can be selectively updated.
|
|
4333
|
-
* Only specified fields (
|
|
4334
|
-
* corresponding fields unchanged when applied via
|
|
4536
|
+
* Only specified fields (values) will override existing options; undefined values leave the
|
|
4537
|
+
* corresponding fields unchanged when applied via `PreprocessingOptions.apply_update`.
|
|
4335
4538
|
*/
|
|
4336
4539
|
class WasmPreprocessingOptionsUpdate {
|
|
4337
4540
|
static __wrap(ptr) {
|
|
@@ -4367,11 +4570,11 @@ class WasmPreprocessingOptionsUpdate {
|
|
|
4367
4570
|
/**
|
|
4368
4571
|
* @param {boolean | null} [enabled]
|
|
4369
4572
|
* @param {WasmPreprocessingPreset | null} [preset]
|
|
4370
|
-
* @param {boolean | null} [
|
|
4371
|
-
* @param {boolean | null} [
|
|
4573
|
+
* @param {boolean | null} [removeNavigation]
|
|
4574
|
+
* @param {boolean | null} [removeForms]
|
|
4372
4575
|
*/
|
|
4373
|
-
constructor(enabled, preset,
|
|
4374
|
-
const ret = wasm.wasmpreprocessingoptionsupdate_new(isLikeNone(enabled) ? 0xFFFFFF : enabled ? 1 : 0, isLikeNone(preset) ? 3 : preset, isLikeNone(
|
|
4576
|
+
constructor(enabled, preset, removeNavigation, removeForms) {
|
|
4577
|
+
const ret = wasm.wasmpreprocessingoptionsupdate_new(isLikeNone(enabled) ? 0xFFFFFF : enabled ? 1 : 0, isLikeNone(preset) ? 3 : preset, isLikeNone(removeNavigation) ? 0xFFFFFF : removeNavigation ? 1 : 0, isLikeNone(removeForms) ? 0xFFFFFF : removeForms ? 1 : 0);
|
|
4375
4578
|
this.__wbg_ptr = ret;
|
|
4376
4579
|
WasmPreprocessingOptionsUpdateFinalization.register(this, this.__wbg_ptr, this);
|
|
4377
4580
|
return this;
|
|
@@ -4451,7 +4654,21 @@ const WasmPreprocessingPreset = Object.freeze({
|
|
|
4451
4654
|
exports.WasmPreprocessingPreset = WasmPreprocessingPreset;
|
|
4452
4655
|
|
|
4453
4656
|
/**
|
|
4454
|
-
* A non-fatal
|
|
4657
|
+
* A non-fatal diagnostic produced during HTML conversion.
|
|
4658
|
+
*
|
|
4659
|
+
* Warnings indicate that conversion completed but some content may have been handled
|
|
4660
|
+
* differently than expected — for example, an image that could not be extracted, a truncated
|
|
4661
|
+
* input, or malformed HTML that was repaired with best-effort parsing.
|
|
4662
|
+
*
|
|
4663
|
+
* Conversion always succeeds (returns `ConversionResult`) even when warnings are
|
|
4664
|
+
* present. Callers should inspect `warnings` and decide how to
|
|
4665
|
+
* handle them based on their tolerance for partial results:
|
|
4666
|
+
*
|
|
4667
|
+
* - **Logging pipelines**: emit each warning at `WARN` level and continue.
|
|
4668
|
+
* - **Strict pipelines**: treat any warning as a hard error by checking
|
|
4669
|
+
* `result.warnings.is_empty()` before using the output.
|
|
4670
|
+
*
|
|
4671
|
+
* See `WarningKind` for the full taxonomy of warning categories.
|
|
4455
4672
|
*/
|
|
4456
4673
|
class WasmProcessingWarning {
|
|
4457
4674
|
static __wrap(ptr) {
|
|
@@ -4558,16 +4775,6 @@ exports.WasmProcessingWarning = WasmProcessingWarning;
|
|
|
4558
4775
|
* JSON-LD blocks are collected as raw JSON strings for flexibility.
|
|
4559
4776
|
*
|
|
4560
4777
|
* # Examples
|
|
4561
|
-
*
|
|
4562
|
-
* ```
|
|
4563
|
-
* let schema = StructuredData {
|
|
4564
|
-
* data_type: StructuredDataType::JsonLd,
|
|
4565
|
-
* raw_json: r#"{"@context":"https://schema.org","@type":"Article"}"#.to_string(),
|
|
4566
|
-
* schema_type: Some("Article".to_string()),
|
|
4567
|
-
* };
|
|
4568
|
-
*
|
|
4569
|
-
* assert_eq!(schema.data_type, StructuredDataType::JsonLd);
|
|
4570
|
-
* ```
|
|
4571
4778
|
*/
|
|
4572
4779
|
class WasmStructuredData {
|
|
4573
4780
|
static __wrap(ptr) {
|
|
@@ -4619,16 +4826,16 @@ class WasmStructuredData {
|
|
|
4619
4826
|
return WasmStructuredData.__wrap(ret);
|
|
4620
4827
|
}
|
|
4621
4828
|
/**
|
|
4622
|
-
* @param {WasmStructuredDataType}
|
|
4623
|
-
* @param {string}
|
|
4624
|
-
* @param {string | null} [
|
|
4829
|
+
* @param {WasmStructuredDataType} dataType
|
|
4830
|
+
* @param {string} rawJson
|
|
4831
|
+
* @param {string | null} [schemaType]
|
|
4625
4832
|
*/
|
|
4626
|
-
constructor(
|
|
4627
|
-
const ptr0 = passStringToWasm0(
|
|
4833
|
+
constructor(dataType, rawJson, schemaType) {
|
|
4834
|
+
const ptr0 = passStringToWasm0(rawJson, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4628
4835
|
const len0 = WASM_VECTOR_LEN;
|
|
4629
|
-
var ptr1 = isLikeNone(
|
|
4836
|
+
var ptr1 = isLikeNone(schemaType) ? 0 : passStringToWasm0(schemaType, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
4630
4837
|
var len1 = WASM_VECTOR_LEN;
|
|
4631
|
-
const ret = wasm.wasmstructureddata_new(
|
|
4838
|
+
const ret = wasm.wasmstructureddata_new(dataType, ptr0, len0, ptr1, len1);
|
|
4632
4839
|
this.__wbg_ptr = ret;
|
|
4633
4840
|
WasmStructuredDataFinalization.register(this, this.__wbg_ptr, this);
|
|
4634
4841
|
return this;
|
|
@@ -4898,9 +5105,20 @@ if (Symbol.dispose) WasmTableGrid.prototype[Symbol.dispose] = WasmTableGrid.prot
|
|
|
4898
5105
|
exports.WasmTableGrid = WasmTableGrid;
|
|
4899
5106
|
|
|
4900
5107
|
/**
|
|
4901
|
-
*
|
|
5108
|
+
* A styling or semantic annotation that applies to a byte range within a node's text.
|
|
5109
|
+
*
|
|
5110
|
+
* Unlike `DocumentNode`, which captures block-level structure (headings, paragraphs, etc.),
|
|
5111
|
+
* a `TextAnnotation` describes inline-level markup — bold, italic, links, code spans, and
|
|
5112
|
+
* similar — that spans a contiguous run of bytes inside `DocumentNode.content`'s text field.
|
|
5113
|
+
*
|
|
5114
|
+
* Byte offsets (`start`..`end`) are into the UTF-8 encoded text of the parent node. The range
|
|
5115
|
+
* follows Rust slice conventions: `start` is inclusive and `end` is exclusive, so the annotated
|
|
5116
|
+
* text is `text[start as usize..end as usize]`.
|
|
5117
|
+
*
|
|
5118
|
+
* Multiple annotations on the same node can overlap (e.g. bold-italic text), and they are
|
|
5119
|
+
* stored in the order they are encountered during DOM traversal.
|
|
4902
5120
|
*
|
|
4903
|
-
*
|
|
5121
|
+
* See `AnnotationKind` for the full list of supported annotation types.
|
|
4904
5122
|
*/
|
|
4905
5123
|
class WasmTextAnnotation {
|
|
4906
5124
|
static __wrap(ptr) {
|
|
@@ -4940,31 +5158,19 @@ class WasmTextAnnotation {
|
|
|
4940
5158
|
return ret >>> 0;
|
|
4941
5159
|
}
|
|
4942
5160
|
/**
|
|
4943
|
-
* @returns {
|
|
5161
|
+
* @returns {any}
|
|
4944
5162
|
*/
|
|
4945
5163
|
get kind() {
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
try {
|
|
4949
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4950
|
-
wasm.wasmtextannotation_kind(retptr, this.__wbg_ptr);
|
|
4951
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4952
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4953
|
-
deferred1_0 = r0;
|
|
4954
|
-
deferred1_1 = r1;
|
|
4955
|
-
return getStringFromWasm0(r0, r1);
|
|
4956
|
-
} finally {
|
|
4957
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4958
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
4959
|
-
}
|
|
5164
|
+
const ret = wasm.wasmtextannotation_kind(this.__wbg_ptr);
|
|
5165
|
+
return takeObject(ret);
|
|
4960
5166
|
}
|
|
4961
5167
|
/**
|
|
4962
5168
|
* @param {number} start
|
|
4963
5169
|
* @param {number} end
|
|
4964
|
-
* @param {
|
|
5170
|
+
* @param {any} kind
|
|
4965
5171
|
*/
|
|
4966
5172
|
constructor(start, end, kind) {
|
|
4967
|
-
const ret = wasm.wasmtextannotation_new(start, end, kind);
|
|
5173
|
+
const ret = wasm.wasmtextannotation_new(start, end, addHeapObject(kind));
|
|
4968
5174
|
this.__wbg_ptr = ret;
|
|
4969
5175
|
WasmTextAnnotationFinalization.register(this, this.__wbg_ptr, this);
|
|
4970
5176
|
return this;
|
|
@@ -4976,10 +5182,10 @@ class WasmTextAnnotation {
|
|
|
4976
5182
|
wasm.wasmtextannotation_set_end(this.__wbg_ptr, value);
|
|
4977
5183
|
}
|
|
4978
5184
|
/**
|
|
4979
|
-
* @param {
|
|
5185
|
+
* @param {any} value
|
|
4980
5186
|
*/
|
|
4981
5187
|
set kind(value) {
|
|
4982
|
-
wasm.wasmtextannotation_set_kind(this.__wbg_ptr, value);
|
|
5188
|
+
wasm.wasmtextannotation_set_kind(this.__wbg_ptr, addHeapObject(value));
|
|
4983
5189
|
}
|
|
4984
5190
|
/**
|
|
4985
5191
|
* @param {number} value
|
|
@@ -5029,11 +5235,12 @@ const WasmVisitResult = Object.freeze({
|
|
|
5029
5235
|
exports.WasmVisitResult = WasmVisitResult;
|
|
5030
5236
|
|
|
5031
5237
|
/**
|
|
5032
|
-
*
|
|
5238
|
+
* Shareable, thread-safe handle to a user-provided HTML visitor implementation.
|
|
5033
5239
|
*
|
|
5034
|
-
*
|
|
5035
|
-
*
|
|
5036
|
-
*
|
|
5240
|
+
* Pass an instance wrapped in this handle to `ConversionOptions` to
|
|
5241
|
+
* customise how the HTML document is traversed and converted to Markdown.
|
|
5242
|
+
* The handle may be cloned and shared across threads without additional
|
|
5243
|
+
* synchronisation on the caller's side.
|
|
5037
5244
|
*/
|
|
5038
5245
|
class WasmVisitorHandle {
|
|
5039
5246
|
static __wrap(ptr) {
|
|
@@ -5092,23 +5299,16 @@ const WasmWhitespaceMode = Object.freeze({
|
|
|
5092
5299
|
exports.WasmWhitespaceMode = WasmWhitespaceMode;
|
|
5093
5300
|
|
|
5094
5301
|
/**
|
|
5095
|
-
* Convert HTML to Markdown, returning a
|
|
5302
|
+
* Convert HTML to Markdown, returning a `ConversionResult` with content, metadata, images,
|
|
5096
5303
|
* and warnings.
|
|
5097
5304
|
*
|
|
5098
5305
|
* # Arguments
|
|
5099
5306
|
*
|
|
5100
5307
|
* * `html` — the HTML string to convert.
|
|
5101
|
-
* * `options` — optional conversion options. Defaults to
|
|
5308
|
+
* * `options` — optional conversion options. Defaults to `ConversionOptions.default`.
|
|
5102
5309
|
*
|
|
5103
5310
|
* # Example
|
|
5104
5311
|
*
|
|
5105
|
-
* ```
|
|
5106
|
-
* use html_to_markdown_rs::convert;
|
|
5107
|
-
*
|
|
5108
|
-
* let html = "<h1>Hello World</h1>";
|
|
5109
|
-
* let result = convert(html, None).unwrap();
|
|
5110
|
-
* assert!(result.content.as_deref().unwrap_or("").contains("Hello World"));
|
|
5111
|
-
* ```
|
|
5112
5312
|
*
|
|
5113
5313
|
* # Errors
|
|
5114
5314
|
*
|
|
@@ -5143,20 +5343,20 @@ exports.convert = convert;
|
|
|
5143
5343
|
function __wbg_get_imports() {
|
|
5144
5344
|
const import0 = {
|
|
5145
5345
|
__proto__: null,
|
|
5146
|
-
|
|
5346
|
+
__wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
|
|
5147
5347
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
5148
5348
|
return ret;
|
|
5149
5349
|
},
|
|
5150
|
-
|
|
5350
|
+
__wbg___wbindgen_is_object_56732c2bc353f41d: function(arg0) {
|
|
5151
5351
|
const val = getObject(arg0);
|
|
5152
5352
|
const ret = typeof(val) === 'object' && val !== null;
|
|
5153
5353
|
return ret;
|
|
5154
5354
|
},
|
|
5155
|
-
|
|
5355
|
+
__wbg___wbindgen_is_undefined_67b456be8673d3d7: function(arg0) {
|
|
5156
5356
|
const ret = getObject(arg0) === undefined;
|
|
5157
5357
|
return ret;
|
|
5158
5358
|
},
|
|
5159
|
-
|
|
5359
|
+
__wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
|
|
5160
5360
|
const obj = getObject(arg1);
|
|
5161
5361
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
5162
5362
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -5164,44 +5364,47 @@ function __wbg_get_imports() {
|
|
|
5164
5364
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5165
5365
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5166
5366
|
},
|
|
5167
|
-
|
|
5367
|
+
__wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
|
|
5168
5368
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5169
5369
|
},
|
|
5170
|
-
|
|
5370
|
+
__wbg_apply_292b6d94e4f92b15: function() { return handleError(function (arg0, arg1, arg2) {
|
|
5171
5371
|
const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
|
|
5172
5372
|
return addHeapObject(ret);
|
|
5173
5373
|
}, arguments); },
|
|
5174
|
-
|
|
5374
|
+
__wbg_get_de6a0f7d4d18a304: function() { return handleError(function (arg0, arg1) {
|
|
5175
5375
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
5176
5376
|
return addHeapObject(ret);
|
|
5177
5377
|
}, arguments); },
|
|
5178
|
-
|
|
5378
|
+
__wbg_has_73740b27f436fed3: function() { return handleError(function (arg0, arg1) {
|
|
5179
5379
|
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
5180
5380
|
return ret;
|
|
5181
5381
|
}, arguments); },
|
|
5182
|
-
|
|
5382
|
+
__wbg_new_ce1ab61c1c2b300d: function() {
|
|
5183
5383
|
const ret = new Object();
|
|
5184
5384
|
return addHeapObject(ret);
|
|
5185
5385
|
},
|
|
5186
|
-
|
|
5386
|
+
__wbg_new_d90091b82fdf5b91: function() {
|
|
5187
5387
|
const ret = new Array();
|
|
5188
5388
|
return addHeapObject(ret);
|
|
5189
5389
|
},
|
|
5190
|
-
|
|
5390
|
+
__wbg_parse_03863847d06c4e89: function() { return handleError(function (arg0, arg1) {
|
|
5191
5391
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
5192
5392
|
return addHeapObject(ret);
|
|
5193
5393
|
}, arguments); },
|
|
5194
|
-
|
|
5394
|
+
__wbg_push_a6822215aa43e71c: function(arg0, arg1) {
|
|
5195
5395
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
5196
5396
|
return ret;
|
|
5197
5397
|
},
|
|
5198
|
-
|
|
5199
|
-
getObject(arg0)[arg1
|
|
5398
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
5399
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
5200
5400
|
},
|
|
5201
|
-
|
|
5401
|
+
__wbg_set_6e30c9374c26414c: function() { return handleError(function (arg0, arg1, arg2) {
|
|
5202
5402
|
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
5203
5403
|
return ret;
|
|
5204
5404
|
}, arguments); },
|
|
5405
|
+
__wbg_set_dca99999bba88a9a: function(arg0, arg1, arg2) {
|
|
5406
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
5407
|
+
},
|
|
5205
5408
|
__wbg_wasmdocumentnode_new: function(arg0) {
|
|
5206
5409
|
const ret = WasmDocumentNode.__wrap(arg0);
|
|
5207
5410
|
return addHeapObject(ret);
|
|
@@ -5298,12 +5501,12 @@ function __wbg_get_imports() {
|
|
|
5298
5501
|
};
|
|
5299
5502
|
}
|
|
5300
5503
|
|
|
5504
|
+
const WasmAnnotationKindFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5505
|
+
? { register: () => {}, unregister: () => {} }
|
|
5506
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmannotationkind_free(ptr, 1));
|
|
5301
5507
|
const WasmConversionOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5302
5508
|
? { register: () => {}, unregister: () => {} }
|
|
5303
5509
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmconversionoptions_free(ptr, 1));
|
|
5304
|
-
const WasmConversionOptionsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5305
|
-
? { register: () => {}, unregister: () => {} }
|
|
5306
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmconversionoptionsbuilder_free(ptr, 1));
|
|
5307
5510
|
const WasmConversionOptionsUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5308
5511
|
? { register: () => {}, unregister: () => {} }
|
|
5309
5512
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmconversionoptionsupdate_free(ptr, 1));
|
|
@@ -5334,6 +5537,9 @@ const WasmImageMetadataFinalization = (typeof FinalizationRegistry === 'undefine
|
|
|
5334
5537
|
const WasmLinkMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5335
5538
|
? { register: () => {}, unregister: () => {} }
|
|
5336
5539
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmlinkmetadata_free(ptr, 1));
|
|
5540
|
+
const WasmNodeContentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5541
|
+
? { register: () => {}, unregister: () => {} }
|
|
5542
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnodecontent_free(ptr, 1));
|
|
5337
5543
|
const WasmNodeContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5338
5544
|
? { register: () => {}, unregister: () => {} }
|
|
5339
5545
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnodecontext_free(ptr, 1));
|