@kreuzberg/html-to-markdown-wasm 2.19.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +569 -0
- package/dist/LICENSE +21 -0
- package/dist/README.md +202 -0
- package/dist/html_to_markdown_wasm.d.ts +200 -0
- package/dist/html_to_markdown_wasm.js +116 -0
- package/dist/html_to_markdown_wasm_bg.js +1355 -0
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/html_to_markdown_wasm_bg.wasm.d.ts +55 -0
- package/dist/package.json +27 -0
- package/dist-node/LICENSE +21 -0
- package/dist-node/README.md +202 -0
- package/dist-node/html_to_markdown_wasm.d.ts +197 -0
- package/dist-node/html_to_markdown_wasm.js +1369 -0
- package/dist-node/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-node/html_to_markdown_wasm_bg.wasm.d.ts +55 -0
- package/dist-node/package.json +21 -0
- package/dist-web/LICENSE +21 -0
- package/dist-web/README.md +202 -0
- package/dist-web/html_to_markdown_wasm.d.ts +277 -0
- package/dist-web/html_to_markdown_wasm.js +1395 -0
- package/dist-web/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-web/html_to_markdown_wasm_bg.wasm.d.ts +55 -0
- package/dist-web/package.json +25 -0
- package/package.json +68 -0
|
@@ -0,0 +1,1355 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {import("./html_to_markdown_wasm").WasmConversionOptions} WasmConversionOptions
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export function __wbg_set_wasm(val) {
|
|
7
|
+
wasm = val;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function addHeapObject(obj) {
|
|
11
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
12
|
+
const idx = heap_next;
|
|
13
|
+
heap_next = heap[idx];
|
|
14
|
+
|
|
15
|
+
heap[idx] = obj;
|
|
16
|
+
return idx;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _assertClass(instance, klass) {
|
|
20
|
+
if (!(instance instanceof klass)) {
|
|
21
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function debugString(val) {
|
|
26
|
+
// primitive types
|
|
27
|
+
const type = typeof val;
|
|
28
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
29
|
+
return `${val}`;
|
|
30
|
+
}
|
|
31
|
+
if (type == 'string') {
|
|
32
|
+
return `"${val}"`;
|
|
33
|
+
}
|
|
34
|
+
if (type == 'symbol') {
|
|
35
|
+
const description = val.description;
|
|
36
|
+
if (description == null) {
|
|
37
|
+
return 'Symbol';
|
|
38
|
+
} else {
|
|
39
|
+
return `Symbol(${description})`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (type == 'function') {
|
|
43
|
+
const name = val.name;
|
|
44
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
45
|
+
return `Function(${name})`;
|
|
46
|
+
} else {
|
|
47
|
+
return 'Function';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// objects
|
|
51
|
+
if (Array.isArray(val)) {
|
|
52
|
+
const length = val.length;
|
|
53
|
+
let debug = '[';
|
|
54
|
+
if (length > 0) {
|
|
55
|
+
debug += debugString(val[0]);
|
|
56
|
+
}
|
|
57
|
+
for(let i = 1; i < length; i++) {
|
|
58
|
+
debug += ', ' + debugString(val[i]);
|
|
59
|
+
}
|
|
60
|
+
debug += ']';
|
|
61
|
+
return debug;
|
|
62
|
+
}
|
|
63
|
+
// Test for built-in
|
|
64
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
65
|
+
let className;
|
|
66
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
67
|
+
className = builtInMatches[1];
|
|
68
|
+
} else {
|
|
69
|
+
// Failed to match the standard '[object ClassName]'
|
|
70
|
+
return toString.call(val);
|
|
71
|
+
}
|
|
72
|
+
if (className == 'Object') {
|
|
73
|
+
// we're a user defined class or Object
|
|
74
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
75
|
+
// easier than looping through ownProperties of `val`.
|
|
76
|
+
try {
|
|
77
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
78
|
+
} catch (_) {
|
|
79
|
+
return 'Object';
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// errors
|
|
83
|
+
if (val instanceof Error) {
|
|
84
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
85
|
+
}
|
|
86
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
87
|
+
return className;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function dropObject(idx) {
|
|
91
|
+
if (idx < 132) return;
|
|
92
|
+
heap[idx] = heap_next;
|
|
93
|
+
heap_next = idx;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
97
|
+
ptr = ptr >>> 0;
|
|
98
|
+
const mem = getDataViewMemory0();
|
|
99
|
+
const result = [];
|
|
100
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
101
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
107
|
+
ptr = ptr >>> 0;
|
|
108
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
112
|
+
ptr = ptr >>> 0;
|
|
113
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
let cachedDataViewMemory0 = null;
|
|
117
|
+
function getDataViewMemory0() {
|
|
118
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
119
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
120
|
+
}
|
|
121
|
+
return cachedDataViewMemory0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function getStringFromWasm0(ptr, len) {
|
|
125
|
+
ptr = ptr >>> 0;
|
|
126
|
+
return decodeText(ptr, len);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
let cachedUint32ArrayMemory0 = null;
|
|
130
|
+
function getUint32ArrayMemory0() {
|
|
131
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
132
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
133
|
+
}
|
|
134
|
+
return cachedUint32ArrayMemory0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let cachedUint8ArrayMemory0 = null;
|
|
138
|
+
function getUint8ArrayMemory0() {
|
|
139
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
140
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
141
|
+
}
|
|
142
|
+
return cachedUint8ArrayMemory0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function getObject(idx) { return heap[idx]; }
|
|
146
|
+
|
|
147
|
+
function handleError(f, args) {
|
|
148
|
+
try {
|
|
149
|
+
return f.apply(this, args);
|
|
150
|
+
} catch (e) {
|
|
151
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
let heap = new Array(128).fill(undefined);
|
|
156
|
+
heap.push(undefined, null, true, false);
|
|
157
|
+
|
|
158
|
+
let heap_next = heap.length;
|
|
159
|
+
|
|
160
|
+
function isLikeNone(x) {
|
|
161
|
+
return x === undefined || x === null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
165
|
+
if (realloc === undefined) {
|
|
166
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
167
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
168
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
169
|
+
WASM_VECTOR_LEN = buf.length;
|
|
170
|
+
return ptr;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
let len = arg.length;
|
|
174
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
175
|
+
|
|
176
|
+
const mem = getUint8ArrayMemory0();
|
|
177
|
+
|
|
178
|
+
let offset = 0;
|
|
179
|
+
|
|
180
|
+
for (; offset < len; offset++) {
|
|
181
|
+
const code = arg.charCodeAt(offset);
|
|
182
|
+
if (code > 0x7F) break;
|
|
183
|
+
mem[ptr + offset] = code;
|
|
184
|
+
}
|
|
185
|
+
if (offset !== len) {
|
|
186
|
+
if (offset !== 0) {
|
|
187
|
+
arg = arg.slice(offset);
|
|
188
|
+
}
|
|
189
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
190
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
191
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
192
|
+
|
|
193
|
+
offset += ret.written;
|
|
194
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
WASM_VECTOR_LEN = offset;
|
|
198
|
+
return ptr;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function takeObject(idx) {
|
|
202
|
+
const ret = getObject(idx);
|
|
203
|
+
dropObject(idx);
|
|
204
|
+
return ret;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
208
|
+
cachedTextDecoder.decode();
|
|
209
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
210
|
+
let numBytesDecoded = 0;
|
|
211
|
+
function decodeText(ptr, len) {
|
|
212
|
+
numBytesDecoded += len;
|
|
213
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
214
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
215
|
+
cachedTextDecoder.decode();
|
|
216
|
+
numBytesDecoded = len;
|
|
217
|
+
}
|
|
218
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const cachedTextEncoder = new TextEncoder();
|
|
222
|
+
|
|
223
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
224
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
225
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
226
|
+
view.set(buf);
|
|
227
|
+
return {
|
|
228
|
+
read: arg.length,
|
|
229
|
+
written: buf.length
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
let WASM_VECTOR_LEN = 0;
|
|
235
|
+
|
|
236
|
+
const WasmConversionOptionsHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
237
|
+
? { register: () => {}, unregister: () => {} }
|
|
238
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmconversionoptionshandle_free(ptr >>> 0, 1));
|
|
239
|
+
|
|
240
|
+
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
241
|
+
? { register: () => {}, unregister: () => {} }
|
|
242
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
243
|
+
|
|
244
|
+
const WasmInlineImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
245
|
+
? { register: () => {}, unregister: () => {} }
|
|
246
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimage_free(ptr >>> 0, 1));
|
|
247
|
+
|
|
248
|
+
const WasmInlineImageConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
249
|
+
? { register: () => {}, unregister: () => {} }
|
|
250
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimageconfig_free(ptr >>> 0, 1));
|
|
251
|
+
|
|
252
|
+
const WasmInlineImageWarningFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
253
|
+
? { register: () => {}, unregister: () => {} }
|
|
254
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimagewarning_free(ptr >>> 0, 1));
|
|
255
|
+
|
|
256
|
+
const WasmMetadataConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
257
|
+
? { register: () => {}, unregister: () => {} }
|
|
258
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmmetadataconfig_free(ptr >>> 0, 1));
|
|
259
|
+
|
|
260
|
+
export class WasmConversionOptionsHandle {
|
|
261
|
+
static __wrap(ptr) {
|
|
262
|
+
ptr = ptr >>> 0;
|
|
263
|
+
const obj = Object.create(WasmConversionOptionsHandle.prototype);
|
|
264
|
+
obj.__wbg_ptr = ptr;
|
|
265
|
+
WasmConversionOptionsHandleFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
266
|
+
return obj;
|
|
267
|
+
}
|
|
268
|
+
__destroy_into_raw() {
|
|
269
|
+
const ptr = this.__wbg_ptr;
|
|
270
|
+
this.__wbg_ptr = 0;
|
|
271
|
+
WasmConversionOptionsHandleFinalization.unregister(this);
|
|
272
|
+
return ptr;
|
|
273
|
+
}
|
|
274
|
+
free() {
|
|
275
|
+
const ptr = this.__destroy_into_raw();
|
|
276
|
+
wasm.__wbg_wasmconversionoptionshandle_free(ptr, 0);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* @param {WasmConversionOptions | null | undefined} [options]
|
|
280
|
+
*/
|
|
281
|
+
constructor(options) {
|
|
282
|
+
try {
|
|
283
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
284
|
+
wasm.wasmconversionoptionshandle_new(retptr, addHeapObject(options));
|
|
285
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
286
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
287
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
288
|
+
if (r2) {
|
|
289
|
+
throw takeObject(r1);
|
|
290
|
+
}
|
|
291
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
292
|
+
WasmConversionOptionsHandleFinalization.register(this, this.__wbg_ptr, this);
|
|
293
|
+
return this;
|
|
294
|
+
} finally {
|
|
295
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
if (Symbol.dispose) WasmConversionOptionsHandle.prototype[Symbol.dispose] = WasmConversionOptionsHandle.prototype.free;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Result of HTML extraction with inline images
|
|
303
|
+
*/
|
|
304
|
+
export class WasmHtmlExtraction {
|
|
305
|
+
static __wrap(ptr) {
|
|
306
|
+
ptr = ptr >>> 0;
|
|
307
|
+
const obj = Object.create(WasmHtmlExtraction.prototype);
|
|
308
|
+
obj.__wbg_ptr = ptr;
|
|
309
|
+
WasmHtmlExtractionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
310
|
+
return obj;
|
|
311
|
+
}
|
|
312
|
+
__destroy_into_raw() {
|
|
313
|
+
const ptr = this.__wbg_ptr;
|
|
314
|
+
this.__wbg_ptr = 0;
|
|
315
|
+
WasmHtmlExtractionFinalization.unregister(this);
|
|
316
|
+
return ptr;
|
|
317
|
+
}
|
|
318
|
+
free() {
|
|
319
|
+
const ptr = this.__destroy_into_raw();
|
|
320
|
+
wasm.__wbg_wasmhtmlextraction_free(ptr, 0);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* @returns {WasmInlineImage[]}
|
|
324
|
+
*/
|
|
325
|
+
get inlineImages() {
|
|
326
|
+
try {
|
|
327
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
328
|
+
wasm.wasmhtmlextraction_inlineImages(retptr, this.__wbg_ptr);
|
|
329
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
330
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
331
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
332
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
333
|
+
return v1;
|
|
334
|
+
} finally {
|
|
335
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* @returns {string}
|
|
340
|
+
*/
|
|
341
|
+
get markdown() {
|
|
342
|
+
let deferred1_0;
|
|
343
|
+
let deferred1_1;
|
|
344
|
+
try {
|
|
345
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
346
|
+
wasm.wasmhtmlextraction_markdown(retptr, this.__wbg_ptr);
|
|
347
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
348
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
349
|
+
deferred1_0 = r0;
|
|
350
|
+
deferred1_1 = r1;
|
|
351
|
+
return getStringFromWasm0(r0, r1);
|
|
352
|
+
} finally {
|
|
353
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
354
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* @returns {WasmInlineImageWarning[]}
|
|
359
|
+
*/
|
|
360
|
+
get warnings() {
|
|
361
|
+
try {
|
|
362
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
363
|
+
wasm.wasmhtmlextraction_warnings(retptr, this.__wbg_ptr);
|
|
364
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
365
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
366
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
367
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
368
|
+
return v1;
|
|
369
|
+
} finally {
|
|
370
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (Symbol.dispose) WasmHtmlExtraction.prototype[Symbol.dispose] = WasmHtmlExtraction.prototype.free;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Inline image data
|
|
378
|
+
*/
|
|
379
|
+
export class WasmInlineImage {
|
|
380
|
+
static __wrap(ptr) {
|
|
381
|
+
ptr = ptr >>> 0;
|
|
382
|
+
const obj = Object.create(WasmInlineImage.prototype);
|
|
383
|
+
obj.__wbg_ptr = ptr;
|
|
384
|
+
WasmInlineImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
385
|
+
return obj;
|
|
386
|
+
}
|
|
387
|
+
__destroy_into_raw() {
|
|
388
|
+
const ptr = this.__wbg_ptr;
|
|
389
|
+
this.__wbg_ptr = 0;
|
|
390
|
+
WasmInlineImageFinalization.unregister(this);
|
|
391
|
+
return ptr;
|
|
392
|
+
}
|
|
393
|
+
free() {
|
|
394
|
+
const ptr = this.__destroy_into_raw();
|
|
395
|
+
wasm.__wbg_wasminlineimage_free(ptr, 0);
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* @returns {Record<string, string>}
|
|
399
|
+
*/
|
|
400
|
+
get attributes() {
|
|
401
|
+
const ret = wasm.wasminlineimage_attributes(this.__wbg_ptr);
|
|
402
|
+
return takeObject(ret);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* @returns {Uint32Array | undefined}
|
|
406
|
+
*/
|
|
407
|
+
get dimensions() {
|
|
408
|
+
try {
|
|
409
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
410
|
+
wasm.wasminlineimage_dimensions(retptr, this.__wbg_ptr);
|
|
411
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
412
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
413
|
+
let v1;
|
|
414
|
+
if (r0 !== 0) {
|
|
415
|
+
v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
416
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
417
|
+
}
|
|
418
|
+
return v1;
|
|
419
|
+
} finally {
|
|
420
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* @returns {string | undefined}
|
|
425
|
+
*/
|
|
426
|
+
get description() {
|
|
427
|
+
try {
|
|
428
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
429
|
+
wasm.wasminlineimage_description(retptr, this.__wbg_ptr);
|
|
430
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
431
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
432
|
+
let v1;
|
|
433
|
+
if (r0 !== 0) {
|
|
434
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
435
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
436
|
+
}
|
|
437
|
+
return v1;
|
|
438
|
+
} finally {
|
|
439
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* @returns {Uint8Array}
|
|
444
|
+
*/
|
|
445
|
+
get data() {
|
|
446
|
+
const ret = wasm.wasminlineimage_data(this.__wbg_ptr);
|
|
447
|
+
return takeObject(ret);
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* @returns {string}
|
|
451
|
+
*/
|
|
452
|
+
get format() {
|
|
453
|
+
let deferred1_0;
|
|
454
|
+
let deferred1_1;
|
|
455
|
+
try {
|
|
456
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
457
|
+
wasm.wasminlineimage_format(retptr, this.__wbg_ptr);
|
|
458
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
459
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
460
|
+
deferred1_0 = r0;
|
|
461
|
+
deferred1_1 = r1;
|
|
462
|
+
return getStringFromWasm0(r0, r1);
|
|
463
|
+
} finally {
|
|
464
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
465
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* @returns {string}
|
|
470
|
+
*/
|
|
471
|
+
get source() {
|
|
472
|
+
let deferred1_0;
|
|
473
|
+
let deferred1_1;
|
|
474
|
+
try {
|
|
475
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
476
|
+
wasm.wasminlineimage_source(retptr, this.__wbg_ptr);
|
|
477
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
478
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
479
|
+
deferred1_0 = r0;
|
|
480
|
+
deferred1_1 = r1;
|
|
481
|
+
return getStringFromWasm0(r0, r1);
|
|
482
|
+
} finally {
|
|
483
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
484
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* @returns {string | undefined}
|
|
489
|
+
*/
|
|
490
|
+
get filename() {
|
|
491
|
+
try {
|
|
492
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
493
|
+
wasm.wasminlineimage_filename(retptr, this.__wbg_ptr);
|
|
494
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
495
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
496
|
+
let v1;
|
|
497
|
+
if (r0 !== 0) {
|
|
498
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
499
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
500
|
+
}
|
|
501
|
+
return v1;
|
|
502
|
+
} finally {
|
|
503
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
if (Symbol.dispose) WasmInlineImage.prototype[Symbol.dispose] = WasmInlineImage.prototype.free;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Inline image configuration
|
|
511
|
+
*/
|
|
512
|
+
export class WasmInlineImageConfig {
|
|
513
|
+
__destroy_into_raw() {
|
|
514
|
+
const ptr = this.__wbg_ptr;
|
|
515
|
+
this.__wbg_ptr = 0;
|
|
516
|
+
WasmInlineImageConfigFinalization.unregister(this);
|
|
517
|
+
return ptr;
|
|
518
|
+
}
|
|
519
|
+
free() {
|
|
520
|
+
const ptr = this.__destroy_into_raw();
|
|
521
|
+
wasm.__wbg_wasminlineimageconfig_free(ptr, 0);
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @param {boolean} capture
|
|
525
|
+
*/
|
|
526
|
+
set captureSvg(capture) {
|
|
527
|
+
wasm.wasminlineimageconfig_set_captureSvg(this.__wbg_ptr, capture);
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* @param {string | null} [prefix]
|
|
531
|
+
*/
|
|
532
|
+
set filenamePrefix(prefix) {
|
|
533
|
+
var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
534
|
+
var len0 = WASM_VECTOR_LEN;
|
|
535
|
+
wasm.wasminlineimageconfig_set_filenamePrefix(this.__wbg_ptr, ptr0, len0);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* @param {boolean} infer
|
|
539
|
+
*/
|
|
540
|
+
set inferDimensions(infer) {
|
|
541
|
+
wasm.wasminlineimageconfig_set_inferDimensions(this.__wbg_ptr, infer);
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* @param {number | null} [max_decoded_size_bytes]
|
|
545
|
+
*/
|
|
546
|
+
constructor(max_decoded_size_bytes) {
|
|
547
|
+
const ret = wasm.wasminlineimageconfig_new(!isLikeNone(max_decoded_size_bytes), isLikeNone(max_decoded_size_bytes) ? 0 : max_decoded_size_bytes);
|
|
548
|
+
this.__wbg_ptr = ret >>> 0;
|
|
549
|
+
WasmInlineImageConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
550
|
+
return this;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
if (Symbol.dispose) WasmInlineImageConfig.prototype[Symbol.dispose] = WasmInlineImageConfig.prototype.free;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Warning about inline image processing
|
|
557
|
+
*/
|
|
558
|
+
export class WasmInlineImageWarning {
|
|
559
|
+
static __wrap(ptr) {
|
|
560
|
+
ptr = ptr >>> 0;
|
|
561
|
+
const obj = Object.create(WasmInlineImageWarning.prototype);
|
|
562
|
+
obj.__wbg_ptr = ptr;
|
|
563
|
+
WasmInlineImageWarningFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
564
|
+
return obj;
|
|
565
|
+
}
|
|
566
|
+
__destroy_into_raw() {
|
|
567
|
+
const ptr = this.__wbg_ptr;
|
|
568
|
+
this.__wbg_ptr = 0;
|
|
569
|
+
WasmInlineImageWarningFinalization.unregister(this);
|
|
570
|
+
return ptr;
|
|
571
|
+
}
|
|
572
|
+
free() {
|
|
573
|
+
const ptr = this.__destroy_into_raw();
|
|
574
|
+
wasm.__wbg_wasminlineimagewarning_free(ptr, 0);
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* @returns {number}
|
|
578
|
+
*/
|
|
579
|
+
get index() {
|
|
580
|
+
const ret = wasm.wasminlineimagewarning_index(this.__wbg_ptr);
|
|
581
|
+
return ret >>> 0;
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* @returns {string}
|
|
585
|
+
*/
|
|
586
|
+
get message() {
|
|
587
|
+
let deferred1_0;
|
|
588
|
+
let deferred1_1;
|
|
589
|
+
try {
|
|
590
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
591
|
+
wasm.wasminlineimagewarning_message(retptr, this.__wbg_ptr);
|
|
592
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
593
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
594
|
+
deferred1_0 = r0;
|
|
595
|
+
deferred1_1 = r1;
|
|
596
|
+
return getStringFromWasm0(r0, r1);
|
|
597
|
+
} finally {
|
|
598
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
599
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
if (Symbol.dispose) WasmInlineImageWarning.prototype[Symbol.dispose] = WasmInlineImageWarning.prototype.free;
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Metadata extraction configuration
|
|
607
|
+
*/
|
|
608
|
+
export class WasmMetadataConfig {
|
|
609
|
+
__destroy_into_raw() {
|
|
610
|
+
const ptr = this.__wbg_ptr;
|
|
611
|
+
this.__wbg_ptr = 0;
|
|
612
|
+
WasmMetadataConfigFinalization.unregister(this);
|
|
613
|
+
return ptr;
|
|
614
|
+
}
|
|
615
|
+
free() {
|
|
616
|
+
const ptr = this.__destroy_into_raw();
|
|
617
|
+
wasm.__wbg_wasmmetadataconfig_free(ptr, 0);
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* @returns {boolean}
|
|
621
|
+
*/
|
|
622
|
+
get extract_links() {
|
|
623
|
+
const ret = wasm.wasmmetadataconfig_extract_links(this.__wbg_ptr);
|
|
624
|
+
return ret !== 0;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* @returns {boolean}
|
|
628
|
+
*/
|
|
629
|
+
get extract_images() {
|
|
630
|
+
const ret = wasm.wasmmetadataconfig_extract_images(this.__wbg_ptr);
|
|
631
|
+
return ret !== 0;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* @returns {boolean}
|
|
635
|
+
*/
|
|
636
|
+
get extract_headers() {
|
|
637
|
+
const ret = wasm.wasmmetadataconfig_extract_headers(this.__wbg_ptr);
|
|
638
|
+
return ret !== 0;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* @returns {boolean}
|
|
642
|
+
*/
|
|
643
|
+
get extract_document() {
|
|
644
|
+
const ret = wasm.wasmmetadataconfig_extract_document(this.__wbg_ptr);
|
|
645
|
+
return ret !== 0;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* @param {boolean} value
|
|
649
|
+
*/
|
|
650
|
+
set extract_links(value) {
|
|
651
|
+
wasm.wasmmetadataconfig_set_extract_links(this.__wbg_ptr, value);
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* @param {boolean} value
|
|
655
|
+
*/
|
|
656
|
+
set extract_images(value) {
|
|
657
|
+
wasm.wasmmetadataconfig_set_extract_images(this.__wbg_ptr, value);
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* @param {boolean} value
|
|
661
|
+
*/
|
|
662
|
+
set extract_headers(value) {
|
|
663
|
+
wasm.wasmmetadataconfig_set_extract_headers(this.__wbg_ptr, value);
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* @param {boolean} value
|
|
667
|
+
*/
|
|
668
|
+
set extract_document(value) {
|
|
669
|
+
wasm.wasmmetadataconfig_set_extract_document(this.__wbg_ptr, value);
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* @returns {boolean}
|
|
673
|
+
*/
|
|
674
|
+
get extract_structured_data() {
|
|
675
|
+
const ret = wasm.wasmmetadataconfig_extract_structured_data(this.__wbg_ptr);
|
|
676
|
+
return ret !== 0;
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* @returns {number}
|
|
680
|
+
*/
|
|
681
|
+
get max_structured_data_size() {
|
|
682
|
+
const ret = wasm.wasmmetadataconfig_max_structured_data_size(this.__wbg_ptr);
|
|
683
|
+
return ret >>> 0;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* @param {boolean} value
|
|
687
|
+
*/
|
|
688
|
+
set extract_structured_data(value) {
|
|
689
|
+
wasm.wasmmetadataconfig_set_extract_structured_data(this.__wbg_ptr, value);
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* @param {number} value
|
|
693
|
+
*/
|
|
694
|
+
set max_structured_data_size(value) {
|
|
695
|
+
wasm.wasmmetadataconfig_set_max_structured_data_size(this.__wbg_ptr, value);
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* Create a new metadata configuration with defaults
|
|
699
|
+
*
|
|
700
|
+
* All extraction types enabled by default with 1MB structured data limit
|
|
701
|
+
*/
|
|
702
|
+
constructor() {
|
|
703
|
+
const ret = wasm.wasmmetadataconfig_new();
|
|
704
|
+
this.__wbg_ptr = ret >>> 0;
|
|
705
|
+
WasmMetadataConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
706
|
+
return this;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
if (Symbol.dispose) WasmMetadataConfig.prototype[Symbol.dispose] = WasmMetadataConfig.prototype.free;
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Convert HTML to Markdown
|
|
713
|
+
*
|
|
714
|
+
* # Arguments
|
|
715
|
+
*
|
|
716
|
+
* * `html` - The HTML string to convert
|
|
717
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
718
|
+
*
|
|
719
|
+
* # Example
|
|
720
|
+
*
|
|
721
|
+
* ```javascript
|
|
722
|
+
* import { convert } from 'html-to-markdown-wasm';
|
|
723
|
+
*
|
|
724
|
+
* const html = '<h1>Hello World</h1>';
|
|
725
|
+
* const markdown = convert(html);
|
|
726
|
+
* console.log(markdown); // # Hello World
|
|
727
|
+
* ```
|
|
728
|
+
* @param {string} html
|
|
729
|
+
* @param {WasmConversionOptions | null | undefined} [options]
|
|
730
|
+
* @returns {string}
|
|
731
|
+
*/
|
|
732
|
+
export function convert(html, options) {
|
|
733
|
+
let deferred3_0;
|
|
734
|
+
let deferred3_1;
|
|
735
|
+
try {
|
|
736
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
737
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
738
|
+
const len0 = WASM_VECTOR_LEN;
|
|
739
|
+
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
740
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
741
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
742
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
743
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
744
|
+
var ptr2 = r0;
|
|
745
|
+
var len2 = r1;
|
|
746
|
+
if (r3) {
|
|
747
|
+
ptr2 = 0; len2 = 0;
|
|
748
|
+
throw takeObject(r2);
|
|
749
|
+
}
|
|
750
|
+
deferred3_0 = ptr2;
|
|
751
|
+
deferred3_1 = len2;
|
|
752
|
+
return getStringFromWasm0(ptr2, len2);
|
|
753
|
+
} finally {
|
|
754
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
755
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* @param {Uint8Array} html
|
|
761
|
+
* @param {WasmConversionOptions | null | undefined} [options]
|
|
762
|
+
* @returns {string}
|
|
763
|
+
*/
|
|
764
|
+
export function convertBytes(html, options) {
|
|
765
|
+
let deferred2_0;
|
|
766
|
+
let deferred2_1;
|
|
767
|
+
try {
|
|
768
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
769
|
+
wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
|
|
770
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
771
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
772
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
773
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
774
|
+
var ptr1 = r0;
|
|
775
|
+
var len1 = r1;
|
|
776
|
+
if (r3) {
|
|
777
|
+
ptr1 = 0; len1 = 0;
|
|
778
|
+
throw takeObject(r2);
|
|
779
|
+
}
|
|
780
|
+
deferred2_0 = ptr1;
|
|
781
|
+
deferred2_1 = len1;
|
|
782
|
+
return getStringFromWasm0(ptr1, len1);
|
|
783
|
+
} finally {
|
|
784
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
785
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* @param {Uint8Array} html
|
|
791
|
+
* @param {WasmConversionOptions | null | undefined} [options]
|
|
792
|
+
* @param {WasmInlineImageConfig | null} [image_config]
|
|
793
|
+
* @returns {WasmHtmlExtraction}
|
|
794
|
+
*/
|
|
795
|
+
export function convertBytesWithInlineImages(html, options, image_config) {
|
|
796
|
+
try {
|
|
797
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
798
|
+
let ptr0 = 0;
|
|
799
|
+
if (!isLikeNone(image_config)) {
|
|
800
|
+
_assertClass(image_config, WasmInlineImageConfig);
|
|
801
|
+
ptr0 = image_config.__destroy_into_raw();
|
|
802
|
+
}
|
|
803
|
+
wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
804
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
805
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
806
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
807
|
+
if (r2) {
|
|
808
|
+
throw takeObject(r1);
|
|
809
|
+
}
|
|
810
|
+
return WasmHtmlExtraction.__wrap(r0);
|
|
811
|
+
} finally {
|
|
812
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Convert HTML bytes to Markdown with metadata extraction
|
|
818
|
+
*
|
|
819
|
+
* # Arguments
|
|
820
|
+
*
|
|
821
|
+
* * `html` - The HTML bytes to convert
|
|
822
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
823
|
+
* * `metadata_config` - Metadata extraction configuration
|
|
824
|
+
*
|
|
825
|
+
* # Returns
|
|
826
|
+
*
|
|
827
|
+
* JavaScript object with `markdown` (string) and `metadata` (object) fields
|
|
828
|
+
* @param {Uint8Array} html
|
|
829
|
+
* @param {WasmConversionOptions | null | undefined} [options]
|
|
830
|
+
* @param {WasmMetadataConfig | null} [metadata_config]
|
|
831
|
+
* @returns {Record<string, string>}
|
|
832
|
+
*/
|
|
833
|
+
export function convertBytesWithMetadata(html, options, metadata_config) {
|
|
834
|
+
try {
|
|
835
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
836
|
+
let ptr0 = 0;
|
|
837
|
+
if (!isLikeNone(metadata_config)) {
|
|
838
|
+
_assertClass(metadata_config, WasmMetadataConfig);
|
|
839
|
+
ptr0 = metadata_config.__destroy_into_raw();
|
|
840
|
+
}
|
|
841
|
+
wasm.convertBytesWithMetadata(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
842
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
843
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
844
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
845
|
+
if (r2) {
|
|
846
|
+
throw takeObject(r1);
|
|
847
|
+
}
|
|
848
|
+
return takeObject(r0);
|
|
849
|
+
} finally {
|
|
850
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* @param {Uint8Array} html
|
|
856
|
+
* @param {WasmConversionOptionsHandle} handle
|
|
857
|
+
* @returns {string}
|
|
858
|
+
*/
|
|
859
|
+
export function convertBytesWithOptionsHandle(html, handle) {
|
|
860
|
+
let deferred2_0;
|
|
861
|
+
let deferred2_1;
|
|
862
|
+
try {
|
|
863
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
864
|
+
_assertClass(handle, WasmConversionOptionsHandle);
|
|
865
|
+
wasm.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
|
|
866
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
867
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
868
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
869
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
870
|
+
var ptr1 = r0;
|
|
871
|
+
var len1 = r1;
|
|
872
|
+
if (r3) {
|
|
873
|
+
ptr1 = 0; len1 = 0;
|
|
874
|
+
throw takeObject(r2);
|
|
875
|
+
}
|
|
876
|
+
deferred2_0 = ptr1;
|
|
877
|
+
deferred2_1 = len1;
|
|
878
|
+
return getStringFromWasm0(ptr1, len1);
|
|
879
|
+
} finally {
|
|
880
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
881
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* @param {string} html
|
|
887
|
+
* @param {WasmConversionOptions | null | undefined} [options]
|
|
888
|
+
* @param {WasmInlineImageConfig | null} [image_config]
|
|
889
|
+
* @returns {WasmHtmlExtraction}
|
|
890
|
+
*/
|
|
891
|
+
export function convertWithInlineImages(html, options, image_config) {
|
|
892
|
+
try {
|
|
893
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
894
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
895
|
+
const len0 = WASM_VECTOR_LEN;
|
|
896
|
+
let ptr1 = 0;
|
|
897
|
+
if (!isLikeNone(image_config)) {
|
|
898
|
+
_assertClass(image_config, WasmInlineImageConfig);
|
|
899
|
+
ptr1 = image_config.__destroy_into_raw();
|
|
900
|
+
}
|
|
901
|
+
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
902
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
903
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
904
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
905
|
+
if (r2) {
|
|
906
|
+
throw takeObject(r1);
|
|
907
|
+
}
|
|
908
|
+
return WasmHtmlExtraction.__wrap(r0);
|
|
909
|
+
} finally {
|
|
910
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Convert HTML to Markdown with metadata extraction
|
|
916
|
+
*
|
|
917
|
+
* # Arguments
|
|
918
|
+
*
|
|
919
|
+
* * `html` - The HTML string to convert
|
|
920
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
921
|
+
* * `metadata_config` - Metadata extraction configuration
|
|
922
|
+
*
|
|
923
|
+
* # Returns
|
|
924
|
+
*
|
|
925
|
+
* JavaScript object with `markdown` (string) and `metadata` (object) fields
|
|
926
|
+
*
|
|
927
|
+
* # Example
|
|
928
|
+
*
|
|
929
|
+
* ```javascript
|
|
930
|
+
* import { convertWithMetadata, WasmMetadataConfig } from 'html-to-markdown-wasm';
|
|
931
|
+
*
|
|
932
|
+
* const html = '<h1>Hello World</h1><a href="https://example.com">Link</a>';
|
|
933
|
+
* const config = new WasmMetadataConfig();
|
|
934
|
+
* config.extractHeaders = true;
|
|
935
|
+
* config.extractLinks = true;
|
|
936
|
+
*
|
|
937
|
+
* const result = convertWithMetadata(html, null, config);
|
|
938
|
+
* console.log(result.markdown); // # Hello World\n\n[Link](https://example.com)
|
|
939
|
+
* console.log(result.metadata.headers); // [{ level: 1, text: "Hello World", ... }]
|
|
940
|
+
* console.log(result.metadata.links); // [{ href: "https://example.com", text: "Link", ... }]
|
|
941
|
+
* ```
|
|
942
|
+
* @param {string} html
|
|
943
|
+
* @param {WasmConversionOptions | null | undefined} [options]
|
|
944
|
+
* @param {WasmMetadataConfig | null} [metadata_config]
|
|
945
|
+
* @returns {Record<string, string>}
|
|
946
|
+
*/
|
|
947
|
+
export function convertWithMetadata(html, options, metadata_config) {
|
|
948
|
+
try {
|
|
949
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
950
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
951
|
+
const len0 = WASM_VECTOR_LEN;
|
|
952
|
+
let ptr1 = 0;
|
|
953
|
+
if (!isLikeNone(metadata_config)) {
|
|
954
|
+
_assertClass(metadata_config, WasmMetadataConfig);
|
|
955
|
+
ptr1 = metadata_config.__destroy_into_raw();
|
|
956
|
+
}
|
|
957
|
+
wasm.convertWithMetadata(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
958
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
959
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
960
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
961
|
+
if (r2) {
|
|
962
|
+
throw takeObject(r1);
|
|
963
|
+
}
|
|
964
|
+
return takeObject(r0);
|
|
965
|
+
} finally {
|
|
966
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* @param {string} html
|
|
972
|
+
* @param {WasmConversionOptionsHandle} handle
|
|
973
|
+
* @returns {string}
|
|
974
|
+
*/
|
|
975
|
+
export function convertWithOptionsHandle(html, handle) {
|
|
976
|
+
let deferred3_0;
|
|
977
|
+
let deferred3_1;
|
|
978
|
+
try {
|
|
979
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
980
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
981
|
+
const len0 = WASM_VECTOR_LEN;
|
|
982
|
+
_assertClass(handle, WasmConversionOptionsHandle);
|
|
983
|
+
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
984
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
985
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
986
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
987
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
988
|
+
var ptr2 = r0;
|
|
989
|
+
var len2 = r1;
|
|
990
|
+
if (r3) {
|
|
991
|
+
ptr2 = 0; len2 = 0;
|
|
992
|
+
throw takeObject(r2);
|
|
993
|
+
}
|
|
994
|
+
deferred3_0 = ptr2;
|
|
995
|
+
deferred3_1 = len2;
|
|
996
|
+
return getStringFromWasm0(ptr2, len2);
|
|
997
|
+
} finally {
|
|
998
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
999
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* @param {WasmConversionOptions | null | undefined} [options]
|
|
1005
|
+
* @returns {WasmConversionOptionsHandle}
|
|
1006
|
+
*/
|
|
1007
|
+
export function createConversionOptionsHandle(options) {
|
|
1008
|
+
try {
|
|
1009
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1010
|
+
wasm.createConversionOptionsHandle(retptr, addHeapObject(options));
|
|
1011
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1012
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1013
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1014
|
+
if (r2) {
|
|
1015
|
+
throw takeObject(r1);
|
|
1016
|
+
}
|
|
1017
|
+
return WasmConversionOptionsHandle.__wrap(r0);
|
|
1018
|
+
} finally {
|
|
1019
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* Initialize panic hook for better error messages in the browser
|
|
1025
|
+
*/
|
|
1026
|
+
export function init() {
|
|
1027
|
+
wasm.init();
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
|
|
1031
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1032
|
+
return addHeapObject(ret);
|
|
1033
|
+
};
|
|
1034
|
+
|
|
1035
|
+
export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
|
|
1036
|
+
const ret = Number(getObject(arg0));
|
|
1037
|
+
return ret;
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
1041
|
+
const ret = String(getObject(arg1));
|
|
1042
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1043
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1044
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1045
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
export function __wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d(arg0, arg1) {
|
|
1049
|
+
const v = getObject(arg1);
|
|
1050
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
1051
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
1052
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
export function __wbg___wbindgen_boolean_get_dea25b33882b895b(arg0) {
|
|
1056
|
+
const v = getObject(arg0);
|
|
1057
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
1058
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
|
|
1062
|
+
const ret = debugString(getObject(arg1));
|
|
1063
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1064
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1065
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1066
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1067
|
+
};
|
|
1068
|
+
|
|
1069
|
+
export function __wbg___wbindgen_in_0d3e1e8f0c669317(arg0, arg1) {
|
|
1070
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
1071
|
+
return ret;
|
|
1072
|
+
};
|
|
1073
|
+
|
|
1074
|
+
export function __wbg___wbindgen_is_bigint_0e1a2e3f55cfae27(arg0) {
|
|
1075
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
1076
|
+
return ret;
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
|
|
1080
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
1081
|
+
return ret;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
export function __wbg___wbindgen_is_null_dfda7d66506c95b5(arg0) {
|
|
1085
|
+
const ret = getObject(arg0) === null;
|
|
1086
|
+
return ret;
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
export function __wbg___wbindgen_is_object_ce774f3490692386(arg0) {
|
|
1090
|
+
const val = getObject(arg0);
|
|
1091
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1092
|
+
return ret;
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
|
|
1096
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
1097
|
+
return ret;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
export function __wbg___wbindgen_is_undefined_f6b95eab589e0269(arg0) {
|
|
1101
|
+
const ret = getObject(arg0) === undefined;
|
|
1102
|
+
return ret;
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
export function __wbg___wbindgen_jsval_eq_b6101cc9cef1fe36(arg0, arg1) {
|
|
1106
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
1107
|
+
return ret;
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
export function __wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d(arg0, arg1) {
|
|
1111
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
1112
|
+
return ret;
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
export function __wbg___wbindgen_number_get_9619185a74197f95(arg0, arg1) {
|
|
1116
|
+
const obj = getObject(arg1);
|
|
1117
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1118
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1119
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1122
|
+
export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
|
|
1123
|
+
const obj = getObject(arg1);
|
|
1124
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1125
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1126
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1127
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1128
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
|
|
1132
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg0, arg1) {
|
|
1136
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
1137
|
+
return addHeapObject(ret);
|
|
1138
|
+
}, arguments) };
|
|
1139
|
+
|
|
1140
|
+
export function __wbg_codePointAt_6fd4439a1e465afd(arg0, arg1) {
|
|
1141
|
+
const ret = getObject(arg0).codePointAt(arg1 >>> 0);
|
|
1142
|
+
return addHeapObject(ret);
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
export function __wbg_done_62ea16af4ce34b24(arg0) {
|
|
1146
|
+
const ret = getObject(arg0).done;
|
|
1147
|
+
return ret;
|
|
1148
|
+
};
|
|
1149
|
+
|
|
1150
|
+
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
1151
|
+
let deferred0_0;
|
|
1152
|
+
let deferred0_1;
|
|
1153
|
+
try {
|
|
1154
|
+
deferred0_0 = arg0;
|
|
1155
|
+
deferred0_1 = arg1;
|
|
1156
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1157
|
+
} finally {
|
|
1158
|
+
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
export function __wbg_get_6b7bd52aca3f9671(arg0, arg1) {
|
|
1163
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1164
|
+
return addHeapObject(ret);
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
export function __wbg_get_af9dab7e9603ea93() { return handleError(function (arg0, arg1) {
|
|
1168
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1169
|
+
return addHeapObject(ret);
|
|
1170
|
+
}, arguments) };
|
|
1171
|
+
|
|
1172
|
+
export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
|
|
1173
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
1174
|
+
return addHeapObject(ret);
|
|
1175
|
+
};
|
|
1176
|
+
|
|
1177
|
+
export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
|
|
1178
|
+
let result;
|
|
1179
|
+
try {
|
|
1180
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
1181
|
+
} catch (_) {
|
|
1182
|
+
result = false;
|
|
1183
|
+
}
|
|
1184
|
+
const ret = result;
|
|
1185
|
+
return ret;
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
export function __wbg_instanceof_Object_577e21051f7bcb79(arg0) {
|
|
1189
|
+
let result;
|
|
1190
|
+
try {
|
|
1191
|
+
result = getObject(arg0) instanceof Object;
|
|
1192
|
+
} catch (_) {
|
|
1193
|
+
result = false;
|
|
1194
|
+
}
|
|
1195
|
+
const ret = result;
|
|
1196
|
+
return ret;
|
|
1197
|
+
};
|
|
1198
|
+
|
|
1199
|
+
export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
|
|
1200
|
+
let result;
|
|
1201
|
+
try {
|
|
1202
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
1203
|
+
} catch (_) {
|
|
1204
|
+
result = false;
|
|
1205
|
+
}
|
|
1206
|
+
const ret = result;
|
|
1207
|
+
return ret;
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
export function __wbg_isArray_51fd9e6422c0a395(arg0) {
|
|
1211
|
+
const ret = Array.isArray(getObject(arg0));
|
|
1212
|
+
return ret;
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
export function __wbg_isSafeInteger_ae7d3f054d55fa16(arg0) {
|
|
1216
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
1217
|
+
return ret;
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
export function __wbg_iterator_27b7c8b35ab3e86b() {
|
|
1221
|
+
const ret = Symbol.iterator;
|
|
1222
|
+
return addHeapObject(ret);
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1225
|
+
export function __wbg_keys_f5c6002ff150fc6c(arg0) {
|
|
1226
|
+
const ret = Object.keys(getObject(arg0));
|
|
1227
|
+
return addHeapObject(ret);
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
export function __wbg_length_1f83b8e5895c84aa(arg0) {
|
|
1231
|
+
const ret = getObject(arg0).length;
|
|
1232
|
+
return ret;
|
|
1233
|
+
};
|
|
1234
|
+
|
|
1235
|
+
export function __wbg_length_22ac23eaec9d8053(arg0) {
|
|
1236
|
+
const ret = getObject(arg0).length;
|
|
1237
|
+
return ret;
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1240
|
+
export function __wbg_length_d45040a40c570362(arg0) {
|
|
1241
|
+
const ret = getObject(arg0).length;
|
|
1242
|
+
return ret;
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
export function __wbg_new_1ba21ce319a06297() {
|
|
1246
|
+
const ret = new Object();
|
|
1247
|
+
return addHeapObject(ret);
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
export function __wbg_new_25f239778d6112b9() {
|
|
1251
|
+
const ret = new Array();
|
|
1252
|
+
return addHeapObject(ret);
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
export function __wbg_new_6421f6084cc5bc5a(arg0) {
|
|
1256
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
1257
|
+
return addHeapObject(ret);
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
export function __wbg_new_8a6f238a6ece86ea() {
|
|
1261
|
+
const ret = new Error();
|
|
1262
|
+
return addHeapObject(ret);
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
export function __wbg_new_b546ae120718850e() {
|
|
1266
|
+
const ret = new Map();
|
|
1267
|
+
return addHeapObject(ret);
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
export function __wbg_new_from_slice_f9c22b9153b26992(arg0, arg1) {
|
|
1271
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1272
|
+
return addHeapObject(ret);
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1275
|
+
export function __wbg_next_138a17bbf04e926c(arg0) {
|
|
1276
|
+
const ret = getObject(arg0).next;
|
|
1277
|
+
return addHeapObject(ret);
|
|
1278
|
+
};
|
|
1279
|
+
|
|
1280
|
+
export function __wbg_next_3cfe5c0fe2a4cc53() { return handleError(function (arg0) {
|
|
1281
|
+
const ret = getObject(arg0).next();
|
|
1282
|
+
return addHeapObject(ret);
|
|
1283
|
+
}, arguments) };
|
|
1284
|
+
|
|
1285
|
+
export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
|
|
1286
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
1290
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1291
|
+
};
|
|
1292
|
+
|
|
1293
|
+
export function __wbg_set_781438a03c0c3c81() { return handleError(function (arg0, arg1, arg2) {
|
|
1294
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1295
|
+
return ret;
|
|
1296
|
+
}, arguments) };
|
|
1297
|
+
|
|
1298
|
+
export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
|
|
1299
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
|
|
1303
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
1304
|
+
return addHeapObject(ret);
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
1308
|
+
const ret = getObject(arg1).stack;
|
|
1309
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1310
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1311
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1312
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1313
|
+
};
|
|
1314
|
+
|
|
1315
|
+
export function __wbg_value_57b7b035e117f7ee(arg0) {
|
|
1316
|
+
const ret = getObject(arg0).value;
|
|
1317
|
+
return addHeapObject(ret);
|
|
1318
|
+
};
|
|
1319
|
+
|
|
1320
|
+
export function __wbg_wasminlineimage_new(arg0) {
|
|
1321
|
+
const ret = WasmInlineImage.__wrap(arg0);
|
|
1322
|
+
return addHeapObject(ret);
|
|
1323
|
+
};
|
|
1324
|
+
|
|
1325
|
+
export function __wbg_wasminlineimagewarning_new(arg0) {
|
|
1326
|
+
const ret = WasmInlineImageWarning.__wrap(arg0);
|
|
1327
|
+
return addHeapObject(ret);
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
1331
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1332
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1333
|
+
return addHeapObject(ret);
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
1337
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
1338
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1339
|
+
return addHeapObject(ret);
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
1343
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1344
|
+
const ret = arg0;
|
|
1345
|
+
return addHeapObject(ret);
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
1349
|
+
const ret = getObject(arg0);
|
|
1350
|
+
return addHeapObject(ret);
|
|
1351
|
+
};
|
|
1352
|
+
|
|
1353
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
1354
|
+
takeObject(arg0);
|
|
1355
|
+
};
|