@kreuzberg/html-to-markdown-wasm 3.6.0-rc.7 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,10 +11,11 @@ export const __wbg_wasmdocumentstructure_free: (a: number, b: number) => void;
11
11
  export const __wbg_wasmgridcell_free: (a: number, b: number) => void;
12
12
  export const __wbg_wasmheadermetadata_free: (a: number, b: number) => void;
13
13
  export const __wbg_wasmhtmlmetadata_free: (a: number, b: number) => void;
14
+ export const __wbg_wasmimagedimensions_free: (a: number, b: number) => void;
14
15
  export const __wbg_wasmimagemetadata_free: (a: number, b: number) => void;
15
16
  export const __wbg_wasmlinkmetadata_free: (a: number, b: number) => void;
17
+ export const __wbg_wasmmetadataentry_free: (a: number, b: number) => void;
16
18
  export const __wbg_wasmnodecontent_free: (a: number, b: number) => void;
17
- export const __wbg_wasmnodecontext_free: (a: number, b: number) => void;
18
19
  export const __wbg_wasmpreprocessingoptions_free: (a: number, b: number) => void;
19
20
  export const __wbg_wasmprocessingwarning_free: (a: number, b: number) => void;
20
21
  export const __wbg_wasmstructureddata_free: (a: number, b: number) => void;
@@ -213,12 +214,10 @@ export const wasmconversionoptionsupdate_wrapWidth: (a: number) => number;
213
214
  export const wasmconversionresult_content: (a: number, b: number) => void;
214
215
  export const wasmconversionresult_default: () => number;
215
216
  export const wasmconversionresult_document: (a: number) => number;
216
- export const wasmconversionresult_images: (a: number, b: number) => void;
217
217
  export const wasmconversionresult_metadata: (a: number) => number;
218
218
  export const wasmconversionresult_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
219
219
  export const wasmconversionresult_set_content: (a: number, b: number, c: number) => void;
220
220
  export const wasmconversionresult_set_document: (a: number, b: number) => void;
221
- export const wasmconversionresult_set_images: (a: number, b: number, c: number) => void;
222
221
  export const wasmconversionresult_set_metadata: (a: number, b: number) => void;
223
222
  export const wasmconversionresult_set_tables: (a: number, b: number, c: number) => void;
224
223
  export const wasmconversionresult_set_warnings: (a: number, b: number, c: number) => void;
@@ -305,15 +304,21 @@ export const wasmhtmlmetadata_set_images: (a: number, b: number, c: number) => v
305
304
  export const wasmhtmlmetadata_set_links: (a: number, b: number, c: number) => void;
306
305
  export const wasmhtmlmetadata_set_structuredData: (a: number, b: number, c: number) => void;
307
306
  export const wasmhtmlmetadata_structuredData: (a: number, b: number) => void;
307
+ export const wasmimagedimensions_default: () => number;
308
+ export const wasmimagedimensions_height: (a: number) => number;
309
+ export const wasmimagedimensions_new: (a: number, b: number) => number;
310
+ export const wasmimagedimensions_set_height: (a: number, b: number) => void;
311
+ export const wasmimagedimensions_set_width: (a: number, b: number) => void;
312
+ export const wasmimagedimensions_width: (a: number) => number;
308
313
  export const wasmimagemetadata_alt: (a: number, b: number) => void;
309
314
  export const wasmimagemetadata_attributes: (a: number) => number;
310
315
  export const wasmimagemetadata_default: () => number;
311
- export const wasmimagemetadata_dimensions: (a: number, b: number) => void;
316
+ export const wasmimagemetadata_dimensions: (a: number) => number;
312
317
  export const wasmimagemetadata_imageType: (a: number, b: number) => void;
313
- export const wasmimagemetadata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
318
+ export const wasmimagemetadata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
314
319
  export const wasmimagemetadata_set_alt: (a: number, b: number, c: number) => void;
315
320
  export const wasmimagemetadata_set_attributes: (a: number, b: number) => void;
316
- export const wasmimagemetadata_set_dimensions: (a: number, b: number, c: number) => void;
321
+ export const wasmimagemetadata_set_dimensions: (a: number, b: number) => void;
317
322
  export const wasmimagemetadata_set_imageType: (a: number, b: number) => void;
318
323
  export const wasmimagemetadata_set_src: (a: number, b: number, c: number) => void;
319
324
  export const wasmimagemetadata_set_title: (a: number, b: number, c: number) => void;
@@ -333,11 +338,17 @@ export const wasmlinkmetadata_set_text: (a: number, b: number, c: number) => voi
333
338
  export const wasmlinkmetadata_set_title: (a: number, b: number, c: number) => void;
334
339
  export const wasmlinkmetadata_text: (a: number, b: number) => void;
335
340
  export const wasmlinkmetadata_title: (a: number, b: number) => void;
341
+ export const wasmmetadataentry_default: () => number;
342
+ export const wasmmetadataentry_key: (a: number, b: number) => void;
343
+ export const wasmmetadataentry_new: (a: number, b: number, c: number, d: number) => number;
344
+ export const wasmmetadataentry_set_key: (a: number, b: number, c: number) => void;
345
+ export const wasmmetadataentry_set_value: (a: number, b: number, c: number) => void;
346
+ export const wasmmetadataentry_value: (a: number, b: number) => void;
336
347
  export const wasmnodecontent_content: (a: number, b: number) => void;
337
348
  export const wasmnodecontent_default: () => number;
338
349
  export const wasmnodecontent_definition: (a: number, b: number) => void;
339
350
  export const wasmnodecontent_description: (a: number, b: number) => void;
340
- export const wasmnodecontent_entries: (a: number) => number;
351
+ export const wasmnodecontent_entries: (a: number, b: number) => void;
341
352
  export const wasmnodecontent_format: (a: number, b: number) => void;
342
353
  export const wasmnodecontent_grid: (a: number) => number;
343
354
  export const wasmnodecontent_headingLevel: (a: number) => number;
@@ -346,11 +357,10 @@ export const wasmnodecontent_label: (a: number, b: number) => void;
346
357
  export const wasmnodecontent_language: (a: number, b: number) => void;
347
358
  export const wasmnodecontent_level: (a: number) => number;
348
359
  export const wasmnodecontent_nodeType: (a: number, b: number) => void;
349
- export const wasmnodecontent_ordered: (a: number) => number;
350
360
  export const wasmnodecontent_set_content: (a: number, b: number, c: number) => void;
351
361
  export const wasmnodecontent_set_definition: (a: number, b: number, c: number) => void;
352
362
  export const wasmnodecontent_set_description: (a: number, b: number, c: number) => void;
353
- export const wasmnodecontent_set_entries: (a: number, b: number) => void;
363
+ export const wasmnodecontent_set_entries: (a: number, b: number, c: number) => void;
354
364
  export const wasmnodecontent_set_format: (a: number, b: number, c: number) => void;
355
365
  export const wasmnodecontent_set_grid: (a: number, b: number) => void;
356
366
  export const wasmnodecontent_set_headingLevel: (a: number, b: number) => void;
@@ -359,7 +369,6 @@ export const wasmnodecontent_set_label: (a: number, b: number, c: number) => voi
359
369
  export const wasmnodecontent_set_language: (a: number, b: number, c: number) => void;
360
370
  export const wasmnodecontent_set_level: (a: number, b: number) => void;
361
371
  export const wasmnodecontent_set_nodeType: (a: number, b: number, c: number) => void;
362
- export const wasmnodecontent_set_ordered: (a: number, b: number) => void;
363
372
  export const wasmnodecontent_set_src: (a: number, b: number, c: number) => void;
364
373
  export const wasmnodecontent_set_term: (a: number, b: number, c: number) => void;
365
374
  export const wasmnodecontent_set_text: (a: number, b: number, c: number) => void;
@@ -368,18 +377,13 @@ export const wasmnodecontent_term: (a: number, b: number) => void;
368
377
  export const wasmnodecontent_text: (a: number, b: number) => void;
369
378
  export const wasmnodecontext_attributes: (a: number) => number;
370
379
  export const wasmnodecontext_default: () => number;
371
- export const wasmnodecontext_indexInParent: (a: number) => number;
380
+ export const wasmnodecontext_intoOwned: (a: number) => number;
372
381
  export const wasmnodecontext_isInline: (a: number) => number;
373
- export const wasmnodecontext_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
382
+ export const wasmnodecontext_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
374
383
  export const wasmnodecontext_nodeType: (a: number, b: number) => void;
375
- export const wasmnodecontext_parentTag: (a: number, b: number) => void;
376
- export const wasmnodecontext_set_attributes: (a: number, b: number) => void;
377
- export const wasmnodecontext_set_indexInParent: (a: number, b: number) => void;
378
384
  export const wasmnodecontext_set_isInline: (a: number, b: number) => void;
379
385
  export const wasmnodecontext_set_nodeType: (a: number, b: number) => void;
380
- export const wasmnodecontext_set_parentTag: (a: number, b: number, c: number) => void;
381
- export const wasmnodecontext_set_tagName: (a: number, b: number, c: number) => void;
382
- export const wasmnodecontext_tagName: (a: number, b: number) => void;
386
+ export const wasmnodecontext_withOwnedAttributes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
383
387
  export const wasmpreprocessingoptions_default: () => number;
384
388
  export const wasmpreprocessingoptions_enabled: (a: number) => number;
385
389
  export const wasmpreprocessingoptions_new: (a: number, b: number, c: number, d: number) => number;
@@ -425,26 +429,35 @@ export const wasmtablegrid_default: () => number;
425
429
  export const wasmtablegrid_new: (a: number, b: number, c: number, d: number) => number;
426
430
  export const wasmtablegrid_set_cells: (a: number, b: number, c: number) => void;
427
431
  export const wasmtextannotation_default: () => number;
428
- export const wasmtextannotation_end: (a: number) => number;
429
432
  export const wasmtextannotation_kind: (a: number) => number;
430
433
  export const wasmtextannotation_new: (a: number, b: number, c: number) => number;
431
- export const wasmtextannotation_set_end: (a: number, b: number) => void;
432
434
  export const wasmtextannotation_set_kind: (a: number, b: number) => void;
433
- export const wasmtextannotation_set_start: (a: number, b: number) => void;
434
- export const wasmtextannotation_start: (a: number) => number;
435
435
  export const wasmvisitorhandle_new: (a: number) => number;
436
+ export const wasmnodecontent_ordered: (a: number) => number;
436
437
  export const wasmnodecontent_new: () => number;
437
438
  export const wasmheadermetadata_set_depth: (a: number, b: number) => void;
438
439
  export const wasmnodecontext_set_depth: (a: number, b: number) => void;
440
+ export const wasmnodecontext_set_indexInParent: (a: number, b: number) => void;
439
441
  export const wasmtablegrid_set_cols: (a: number, b: number) => void;
440
442
  export const wasmtablegrid_set_rows: (a: number, b: number) => void;
443
+ export const wasmtextannotation_set_end: (a: number, b: number) => void;
444
+ export const wasmtextannotation_set_start: (a: number, b: number) => void;
441
445
  export const wasmnodecontent_set_imageIndex: (a: number, b: number) => void;
442
446
  export const wasmheadermetadata_depth: (a: number) => number;
443
447
  export const wasmnodecontext_depth: (a: number) => number;
448
+ export const wasmnodecontext_indexInParent: (a: number) => number;
444
449
  export const wasmtablegrid_cols: (a: number) => number;
445
450
  export const wasmtablegrid_rows: (a: number) => number;
451
+ export const wasmtextannotation_end: (a: number) => number;
452
+ export const wasmtextannotation_start: (a: number) => number;
446
453
  export const wasmannotationkind_new: () => number;
454
+ export const wasmnodecontext_parentTag: (a: number, b: number) => void;
455
+ export const wasmnodecontent_set_ordered: (a: number, b: number) => void;
456
+ export const wasmnodecontext_set_tagName: (a: number, b: number, c: number) => void;
457
+ export const wasmnodecontext_set_parentTag: (a: number, b: number, c: number) => void;
458
+ export const wasmnodecontext_tagName: (a: number, b: number) => void;
447
459
  export const wasmnodecontent_imageIndex: (a: number) => number;
460
+ export const __wbg_wasmnodecontext_free: (a: number, b: number) => void;
448
461
  export const __wbg_wasmpreprocessingoptionsupdate_free: (a: number, b: number) => void;
449
462
  export const __wbindgen_export: (a: number, b: number) => number;
450
463
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
@@ -225,7 +225,6 @@ export class WasmConversionResult {
225
225
  set content(value: string | null | undefined);
226
226
  get document(): WasmDocumentStructure | undefined;
227
227
  set document(value: WasmDocumentStructure | null | undefined);
228
- images: string[];
229
228
  metadata: WasmHtmlMetadata;
230
229
  tables: WasmTableData[];
231
230
  warnings: WasmProcessingWarning[];
@@ -387,6 +386,23 @@ export class WasmHtmlMetadata {
387
386
  structuredData: WasmStructuredData[];
388
387
  }
389
388
 
389
+ /**
390
+ * Image dimensions in pixels.
391
+ *
392
+ * Binding-safe replacement for `(u32, u32)` tuples, which degrade to
393
+ * `Vec<Vec<String>>` when sanitized for cross-language binding generation.
394
+ * Used by both `ImageMetadata` and
395
+ * `InlineImage`.
396
+ */
397
+ export class WasmImageDimensions {
398
+ free(): void;
399
+ [Symbol.dispose](): void;
400
+ static default(): WasmImageDimensions;
401
+ constructor(width: number, height: number);
402
+ height: number;
403
+ width: number;
404
+ }
405
+
390
406
  /**
391
407
  * Image metadata with source and dimensions.
392
408
  *
@@ -399,12 +415,12 @@ export class WasmImageMetadata {
399
415
  free(): void;
400
416
  [Symbol.dispose](): void;
401
417
  static default(): WasmImageMetadata;
402
- constructor(src: string, imageType: WasmImageType, attributes: any, alt?: string | null, title?: string | null, dimensions?: Uint32Array | null);
418
+ constructor(src: string, imageType: WasmImageType, attributes: any, alt?: string | null, title?: string | null, dimensions?: WasmImageDimensions | null);
403
419
  get alt(): string | undefined;
404
420
  set alt(value: string | null | undefined);
405
421
  attributes: any;
406
- get dimensions(): Uint32Array | undefined;
407
- set dimensions(value: Uint32Array | null | undefined);
422
+ get dimensions(): WasmImageDimensions | undefined;
423
+ set dimensions(value: WasmImageDimensions | null | undefined);
408
424
  get imageType(): string;
409
425
  set imageType(value: WasmImageType);
410
426
  src: string;
@@ -481,6 +497,22 @@ export enum WasmListIndentType {
481
497
  Tabs = 1,
482
498
  }
483
499
 
500
+ /**
501
+ * A single key-value metadata entry from `<head>` meta tags.
502
+ *
503
+ * Binding-safe replacement for `(String, String)` tuples used in
504
+ * `NodeContent.MetadataBlock`. Tuple pairs cannot be represented
505
+ * across language boundaries without lossy degradation.
506
+ */
507
+ export class WasmMetadataEntry {
508
+ free(): void;
509
+ [Symbol.dispose](): void;
510
+ static default(): WasmMetadataEntry;
511
+ constructor(key: string, value: string);
512
+ key: string;
513
+ value: string;
514
+ }
515
+
484
516
  /**
485
517
  * Line break syntax in Markdown output.
486
518
  *
@@ -507,8 +539,8 @@ export class WasmNodeContent {
507
539
  set definition(value: string | null | undefined);
508
540
  get description(): string | undefined;
509
541
  set description(value: string | null | undefined);
510
- get entries(): any | undefined;
511
- set entries(value: any | null | undefined);
542
+ get entries(): WasmMetadataEntry[] | undefined;
543
+ set entries(value: WasmMetadataEntry[] | null | undefined);
512
544
  get format(): string | undefined;
513
545
  set format(value: string | null | undefined);
514
546
  get grid(): WasmTableGrid | undefined;
@@ -540,14 +572,46 @@ export class WasmNodeContent {
540
572
  * Context information passed to all visitor methods.
541
573
  *
542
574
  * Provides comprehensive metadata about the current node being visited,
543
- * including its type, attributes, position in the DOM tree, and parent context.
575
+ * including its type, tag name, position in the DOM tree, and parent context.
576
+ *
577
+ * ## Attributes
578
+ *
579
+ * Access attributes via `NodeContext.attributes`, which returns
580
+ * `&BTreeMap<String, String>`. When the context was built with
581
+ * `NodeContext.with_lazy_attributes` (the hot path inside the converter),
582
+ * the map is only materialized on the first call — if the visitor never reads
583
+ * attributes, the allocation is skipped.
584
+ *
585
+ * ## Lifetimes
586
+ *
587
+ * String fields use `Cow<'_, str>` so the converter can pass slices directly
588
+ * out of the parsed DOM without allocating. Visitor implementations that need
589
+ * to outlive the callback should call `NodeContext.into_owned`.
544
590
  */
545
591
  export class WasmNodeContext {
546
592
  free(): void;
547
593
  [Symbol.dispose](): void;
594
+ /**
595
+ * Return a reference to the attribute map.
596
+ *
597
+ * If the context was built with `NodeContext.with_lazy_attributes`, the
598
+ * map is materialized on the first call and cached for subsequent calls.
599
+ * If this method is never called, no allocation occurs for attributes.
600
+ */
601
+ attributes(): any;
548
602
  static default(): WasmNodeContext;
549
- constructor(nodeType: WasmNodeType, tagName: string, attributes: any, depth: number, indexInParent: number, isInline: boolean, parentTag?: string | null);
550
- attributes: any;
603
+ /**
604
+ * Promote any borrowed fields into owned storage so the context can outlive `'a`.
605
+ */
606
+ intoOwned(): WasmNodeContext;
607
+ constructor(nodeType: WasmNodeType, tagName: string, depth: number, indexInParent: number, isInline: boolean, parentTag?: string | null);
608
+ /**
609
+ * Construct a `NodeContext` with an owned attribute map.
610
+ *
611
+ * Prefer `NodeContext.with_lazy_attributes` (pub(crate)) inside the
612
+ * converter to avoid the eager `collect_tag_attributes` allocation.
613
+ */
614
+ static withOwnedAttributes(node_type: WasmNodeType, tag_name: string, attributes: any, depth: number, index_in_parent: number, parent_tag: string | null | undefined, is_inline: boolean): WasmNodeContext;
551
615
  depth: number;
552
616
  indexInParent: number;
553
617
  isInline: boolean;
@@ -742,7 +806,7 @@ export class WasmProcessingWarning {
742
806
  }
743
807
 
744
808
  /**
745
- * Structured data block (JSON-LD, Microdata, or RDFa).
809
+ * Structured data block (JSON-LD, Microdata, or `RDFa`).
746
810
  *
747
811
  * Represents machine-readable structured data found in the document.
748
812
  * JSON-LD blocks are collected as raw JSON strings for flexibility.