@kreuzberg/html-to-markdown-wasm 3.4.0 → 3.5.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.
@@ -6,16 +6,16 @@
6
6
  *
7
7
  * Uses internally tagged representation (`"annotation_type": "bold"`) for JSON serialization.
8
8
  */
9
- export enum WasmAnnotationKind {
10
- Bold = 0,
11
- Italic = 1,
12
- Underline = 2,
13
- Strikethrough = 3,
14
- Code = 4,
15
- Subscript = 5,
16
- Superscript = 6,
17
- Highlight = 7,
18
- Link = 8,
9
+ export class WasmAnnotationKind {
10
+ free(): void;
11
+ [Symbol.dispose](): void;
12
+ static default(): WasmAnnotationKind;
13
+ constructor();
14
+ annotationType: string;
15
+ get title(): string | undefined;
16
+ set title(value: string | null | undefined);
17
+ get url(): string | undefined;
18
+ set url(value: string | null | undefined);
19
19
  }
20
20
 
21
21
  /**
@@ -32,44 +32,23 @@ export enum WasmCodeBlockStyle {
32
32
  /**
33
33
  * Main conversion options for HTML to Markdown conversion.
34
34
  *
35
- * Use [`ConversionOptions::builder()`] to construct, or [`Default::default()`] for defaults.
35
+ * Use `ConversionOptions.builder()` to construct, or `Default.default()` for defaults.
36
36
  *
37
37
  * # Example
38
- *
39
- * ```text
40
- * use html_to_markdown_rs::ConversionOptions;
41
- *
42
- * let options = ConversionOptions::builder()
43
- * .heading_style(HeadingStyle::Atx)
44
- * .wrap(true)
45
- * .wrap_width(100)
46
- * .build();
47
- * ```
48
38
  */
49
39
  export class WasmConversionOptions {
50
40
  free(): void;
51
41
  [Symbol.dispose](): void;
52
- /**
53
- * Apply a partial update to these conversion options.
54
- */
55
- applyUpdate(_update: WasmConversionOptionsUpdate): void;
56
- /**
57
- * Create a new builder with default values.
58
- */
59
- static builder(): WasmConversionOptionsBuilder;
60
42
  static default(): WasmConversionOptions;
61
- static from(update: WasmConversionOptionsUpdate): WasmConversionOptions;
62
- /**
63
- * Create from a partial update, applying to defaults.
64
- */
65
- static fromUpdate(update: WasmConversionOptionsUpdate): WasmConversionOptions;
66
- constructor(heading_style?: WasmHeadingStyle | null, list_indent_type?: WasmListIndentType | null, list_indent_width?: number | null, bullets?: string | null, strong_em_symbol?: string | null, escape_asterisks?: boolean | null, escape_underscores?: boolean | null, escape_misc?: boolean | null, escape_ascii?: boolean | null, code_language?: string | null, autolinks?: boolean | null, default_title?: boolean | null, br_in_tables?: boolean | null, highlight_style?: WasmHighlightStyle | null, extract_metadata?: boolean | null, whitespace_mode?: WasmWhitespaceMode | null, strip_newlines?: boolean | null, wrap?: boolean | null, wrap_width?: number | null, convert_as_inline?: boolean | null, sub_symbol?: string | null, sup_symbol?: string | null, newline_style?: WasmNewlineStyle | null, code_block_style?: WasmCodeBlockStyle | null, keep_inline_images_in?: string[] | null, preprocessing?: WasmPreprocessingOptions | null, encoding?: string | null, debug?: boolean | null, strip_tags?: string[] | null, preserve_tags?: string[] | null, skip_images?: boolean | null, link_style?: WasmLinkStyle | null, output_format?: WasmOutputFormat | null, include_document_structure?: boolean | null, extract_images?: boolean | null, max_image_size?: bigint | null, capture_svg?: boolean | null, infer_dimensions?: boolean | null, exclude_selectors?: string[] | null, max_depth?: number | null, visitor?: WasmVisitorHandle | null);
43
+ constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptions | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, excludeSelectors?: string[] | null, maxDepth?: number | null);
67
44
  autolinks: boolean;
68
45
  brInTables: boolean;
69
46
  bullets: string;
70
47
  captureSvg: boolean;
71
- codeBlockStyle: WasmCodeBlockStyle;
48
+ get codeBlockStyle(): string;
49
+ set codeBlockStyle(value: WasmCodeBlockStyle);
72
50
  codeLanguage: string;
51
+ compactTables: boolean;
73
52
  convertAsInline: boolean;
74
53
  debug: boolean;
75
54
  defaultTitle: boolean;
@@ -81,19 +60,25 @@ export class WasmConversionOptions {
81
60
  excludeSelectors: string[];
82
61
  extractImages: boolean;
83
62
  extractMetadata: boolean;
84
- headingStyle: WasmHeadingStyle;
85
- highlightStyle: WasmHighlightStyle;
63
+ get headingStyle(): string;
64
+ set headingStyle(value: WasmHeadingStyle);
65
+ get highlightStyle(): string;
66
+ set highlightStyle(value: WasmHighlightStyle);
86
67
  includeDocumentStructure: boolean;
87
68
  inferDimensions: boolean;
88
69
  keepInlineImagesIn: string[];
89
- linkStyle: WasmLinkStyle;
90
- listIndentType: WasmListIndentType;
70
+ get linkStyle(): string;
71
+ set linkStyle(value: WasmLinkStyle);
72
+ get listIndentType(): string;
73
+ set listIndentType(value: WasmListIndentType);
91
74
  listIndentWidth: number;
92
75
  get maxDepth(): number | undefined;
93
76
  set maxDepth(value: number | null | undefined);
94
77
  maxImageSize: bigint;
95
- newlineStyle: WasmNewlineStyle;
96
- outputFormat: WasmOutputFormat;
78
+ get newlineStyle(): string;
79
+ set newlineStyle(value: WasmNewlineStyle);
80
+ get outputFormat(): string;
81
+ set outputFormat(value: WasmOutputFormat);
97
82
  preprocessing: WasmPreprocessingOptions;
98
83
  preserveTags: string[];
99
84
  skipImages: boolean;
@@ -104,60 +89,23 @@ export class WasmConversionOptions {
104
89
  supSymbol: string;
105
90
  get visitor(): WasmVisitorHandle | undefined;
106
91
  set visitor(value: WasmVisitorHandle | null | undefined);
107
- whitespaceMode: WasmWhitespaceMode;
92
+ get whitespaceMode(): string;
93
+ set whitespaceMode(value: WasmWhitespaceMode);
108
94
  wrap: boolean;
109
95
  wrapWidth: number;
110
96
  }
111
97
 
112
- /**
113
- * Builder for [`ConversionOptions`].
114
- *
115
- * All fields start with default values. Call `.build()` to produce the final options.
116
- */
117
- export class WasmConversionOptionsBuilder {
118
- private constructor();
119
- free(): void;
120
- [Symbol.dispose](): void;
121
- /**
122
- * Build the final [`ConversionOptions`].
123
- */
124
- build(): WasmConversionOptions;
125
- /**
126
- * Set the list of CSS selectors for elements to exclude entirely from output.
127
- */
128
- excludeSelectors(selectors: string[]): WasmConversionOptionsBuilder;
129
- /**
130
- * Set the list of HTML tag names whose `<img>` children are kept inline.
131
- */
132
- keepInlineImagesIn(tags: string[]): WasmConversionOptionsBuilder;
133
- /**
134
- * Set the pre-processing options applied to the HTML before conversion.
135
- */
136
- preprocessing(preprocessing: WasmPreprocessingOptions): WasmConversionOptionsBuilder;
137
- /**
138
- * Set the list of HTML tag names that are preserved verbatim in output.
139
- */
140
- preserveTags(tags: string[]): WasmConversionOptionsBuilder;
141
- /**
142
- * Set the list of HTML tag names whose content is stripped from output.
143
- */
144
- stripTags(tags: string[]): WasmConversionOptionsBuilder;
145
- /**
146
- * Set the visitor used during conversion.
147
- */
148
- visitor(visitor?: WasmVisitorHandle | null): WasmConversionOptionsBuilder;
149
- }
150
-
151
98
  /**
152
99
  * Partial update for `ConversionOptions`.
153
100
  *
154
101
  * Uses `Option<T>` fields for selective updates. Bindings use this to construct
155
- * options from language-native types. Prefer [`ConversionOptionsBuilder`] for Rust code.
102
+ * options from language-native types. Prefer `ConversionOptionsBuilder` for Rust code.
156
103
  */
157
104
  export class WasmConversionOptionsUpdate {
158
105
  free(): void;
159
106
  [Symbol.dispose](): void;
160
- constructor(heading_style?: WasmHeadingStyle | null, list_indent_type?: WasmListIndentType | null, list_indent_width?: number | null, bullets?: string | null, strong_em_symbol?: string | null, escape_asterisks?: boolean | null, escape_underscores?: boolean | null, escape_misc?: boolean | null, escape_ascii?: boolean | null, code_language?: string | null, autolinks?: boolean | null, default_title?: boolean | null, br_in_tables?: boolean | null, highlight_style?: WasmHighlightStyle | null, extract_metadata?: boolean | null, whitespace_mode?: WasmWhitespaceMode | null, strip_newlines?: boolean | null, wrap?: boolean | null, wrap_width?: number | null, convert_as_inline?: boolean | null, sub_symbol?: string | null, sup_symbol?: string | null, newline_style?: WasmNewlineStyle | null, code_block_style?: WasmCodeBlockStyle | null, keep_inline_images_in?: string[] | null, preprocessing?: WasmPreprocessingOptionsUpdate | null, encoding?: string | null, debug?: boolean | null, strip_tags?: string[] | null, preserve_tags?: string[] | null, skip_images?: boolean | null, link_style?: WasmLinkStyle | null, output_format?: WasmOutputFormat | null, include_document_structure?: boolean | null, extract_images?: boolean | null, max_image_size?: bigint | null, capture_svg?: boolean | null, infer_dimensions?: boolean | null, max_depth?: number | null, exclude_selectors?: string[] | null, visitor?: WasmVisitorHandle | null);
107
+ static default(): WasmConversionOptionsUpdate;
108
+ constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptionsUpdate | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, maxDepth?: number | null, excludeSelectors?: string[] | null);
161
109
  get autolinks(): boolean | undefined;
162
110
  set autolinks(value: boolean | null | undefined);
163
111
  get brInTables(): boolean | undefined;
@@ -166,10 +114,12 @@ export class WasmConversionOptionsUpdate {
166
114
  set bullets(value: string | null | undefined);
167
115
  get captureSvg(): boolean | undefined;
168
116
  set captureSvg(value: boolean | null | undefined);
169
- get codeBlockStyle(): WasmCodeBlockStyle | undefined;
117
+ get codeBlockStyle(): string | undefined;
170
118
  set codeBlockStyle(value: WasmCodeBlockStyle | null | undefined);
171
119
  get codeLanguage(): string | undefined;
172
120
  set codeLanguage(value: string | null | undefined);
121
+ get compactTables(): boolean | undefined;
122
+ set compactTables(value: boolean | null | undefined);
173
123
  get convertAsInline(): boolean | undefined;
174
124
  set convertAsInline(value: boolean | null | undefined);
175
125
  get debug(): boolean | undefined;
@@ -192,9 +142,9 @@ export class WasmConversionOptionsUpdate {
192
142
  set extractImages(value: boolean | null | undefined);
193
143
  get extractMetadata(): boolean | undefined;
194
144
  set extractMetadata(value: boolean | null | undefined);
195
- get headingStyle(): WasmHeadingStyle | undefined;
145
+ get headingStyle(): string | undefined;
196
146
  set headingStyle(value: WasmHeadingStyle | null | undefined);
197
- get highlightStyle(): WasmHighlightStyle | undefined;
147
+ get highlightStyle(): string | undefined;
198
148
  set highlightStyle(value: WasmHighlightStyle | null | undefined);
199
149
  get includeDocumentStructure(): boolean | undefined;
200
150
  set includeDocumentStructure(value: boolean | null | undefined);
@@ -202,9 +152,9 @@ export class WasmConversionOptionsUpdate {
202
152
  set inferDimensions(value: boolean | null | undefined);
203
153
  get keepInlineImagesIn(): string[] | undefined;
204
154
  set keepInlineImagesIn(value: string[] | null | undefined);
205
- get linkStyle(): WasmLinkStyle | undefined;
155
+ get linkStyle(): string | undefined;
206
156
  set linkStyle(value: WasmLinkStyle | null | undefined);
207
- get listIndentType(): WasmListIndentType | undefined;
157
+ get listIndentType(): string | undefined;
208
158
  set listIndentType(value: WasmListIndentType | null | undefined);
209
159
  get listIndentWidth(): number | undefined;
210
160
  set listIndentWidth(value: number | null | undefined);
@@ -212,9 +162,9 @@ export class WasmConversionOptionsUpdate {
212
162
  set maxDepth(value: number | null | undefined);
213
163
  get maxImageSize(): bigint | undefined;
214
164
  set maxImageSize(value: bigint | null | undefined);
215
- get newlineStyle(): WasmNewlineStyle | undefined;
165
+ get newlineStyle(): string | undefined;
216
166
  set newlineStyle(value: WasmNewlineStyle | null | undefined);
217
- get outputFormat(): WasmOutputFormat | undefined;
167
+ get outputFormat(): string | undefined;
218
168
  set outputFormat(value: WasmOutputFormat | null | undefined);
219
169
  get preprocessing(): WasmPreprocessingOptionsUpdate | undefined;
220
170
  set preprocessing(value: WasmPreprocessingOptionsUpdate | null | undefined);
@@ -234,7 +184,7 @@ export class WasmConversionOptionsUpdate {
234
184
  set supSymbol(value: string | null | undefined);
235
185
  get visitor(): WasmVisitorHandle | undefined;
236
186
  set visitor(value: WasmVisitorHandle | null | undefined);
237
- get whitespaceMode(): WasmWhitespaceMode | undefined;
187
+ get whitespaceMode(): string | undefined;
238
188
  set whitespaceMode(value: WasmWhitespaceMode | null | undefined);
239
189
  get wrap(): boolean | undefined;
240
190
  set wrap(value: boolean | null | undefined);
@@ -261,7 +211,8 @@ export class WasmConversionOptionsUpdate {
261
211
  export class WasmConversionResult {
262
212
  free(): void;
263
213
  [Symbol.dispose](): void;
264
- constructor(metadata?: WasmHtmlMetadata | null, tables?: WasmTableData[] | null, images?: string[] | null, warnings?: WasmProcessingWarning[] | null, content?: string | null, document?: WasmDocumentStructure | null);
214
+ static default(): WasmConversionResult;
215
+ constructor(tables?: WasmTableData[] | null, warnings?: WasmProcessingWarning[] | null, content?: string | null, document?: WasmDocumentStructure | null);
265
216
  get content(): string | undefined;
266
217
  set content(value: string | null | undefined);
267
218
  get document(): WasmDocumentStructure | undefined;
@@ -279,22 +230,12 @@ export class WasmConversionResult {
279
230
  * and browsers for document indexing and presentation.
280
231
  *
281
232
  * # Examples
282
- *
283
- * ```
284
- * let doc = DocumentMetadata {
285
- * title: Some("My Article".to_string()),
286
- * description: Some("A great article about Rust".to_string()),
287
- * keywords: vec!["rust".to_string(), "programming".to_string()],
288
- * ..Default::default()
289
- * };
290
- *
291
- * assert_eq!(doc.title, Some("My Article".to_string()));
292
- * ```
293
233
  */
294
234
  export class WasmDocumentMetadata {
295
235
  free(): void;
296
236
  [Symbol.dispose](): void;
297
- constructor(keywords?: string[] | null, open_graph?: any | null, twitter_card?: any | null, meta_tags?: any | null, title?: string | null, description?: string | null, author?: string | null, canonical_url?: string | null, base_href?: string | null, language?: string | null, text_direction?: WasmTextDirection | null);
237
+ static default(): WasmDocumentMetadata;
238
+ constructor(keywords?: string[] | null, openGraph?: any | null, twitterCard?: any | null, metaTags?: any | null, title?: string | null, description?: string | null, author?: string | null, canonicalUrl?: string | null, baseHref?: string | null, language?: string | null, textDirection?: WasmTextDirection | null);
298
239
  get author(): string | undefined;
299
240
  set author(value: string | null | undefined);
300
241
  get baseHref(): string | undefined;
@@ -308,7 +249,7 @@ export class WasmDocumentMetadata {
308
249
  set language(value: string | null | undefined);
309
250
  metaTags: any;
310
251
  openGraph: any;
311
- get textDirection(): WasmTextDirection | undefined;
252
+ get textDirection(): string | undefined;
312
253
  set textDirection(value: WasmTextDirection | null | undefined);
313
254
  get title(): string | undefined;
314
255
  set title(value: string | null | undefined);
@@ -321,12 +262,13 @@ export class WasmDocumentMetadata {
321
262
  export class WasmDocumentNode {
322
263
  free(): void;
323
264
  [Symbol.dispose](): void;
324
- constructor(id: string, content: WasmNodeContent, children: Uint32Array, annotations: WasmTextAnnotation[], parent?: number | null, attributes?: any | null);
265
+ static default(): WasmDocumentNode;
266
+ constructor(id: string, content: any, children: Uint32Array, annotations: WasmTextAnnotation[], parent?: number | null, attributes?: any | null);
325
267
  annotations: WasmTextAnnotation[];
326
268
  get attributes(): any | undefined;
327
269
  set attributes(value: any | null | undefined);
328
270
  children: Uint32Array;
329
- content: WasmNodeContent;
271
+ content: any;
330
272
  id: string;
331
273
  get parent(): number | undefined;
332
274
  set parent(value: number | null | undefined);
@@ -340,7 +282,8 @@ export class WasmDocumentNode {
340
282
  export class WasmDocumentStructure {
341
283
  free(): void;
342
284
  [Symbol.dispose](): void;
343
- constructor(nodes: WasmDocumentNode[], source_format?: string | null);
285
+ static default(): WasmDocumentStructure;
286
+ constructor(nodes: WasmDocumentNode[], sourceFormat?: string | null);
344
287
  nodes: WasmDocumentNode[];
345
288
  get sourceFormat(): string | undefined;
346
289
  set sourceFormat(value: string | null | undefined);
@@ -352,7 +295,8 @@ export class WasmDocumentStructure {
352
295
  export class WasmGridCell {
353
296
  free(): void;
354
297
  [Symbol.dispose](): void;
355
- constructor(content: string, row: number, col: number, row_span: number, col_span: number, is_header: boolean);
298
+ static default(): WasmGridCell;
299
+ constructor(content: string, row: number, col: number, rowSpan: number, colSpan: number, isHeader: boolean);
356
300
  col: number;
357
301
  colSpan: number;
358
302
  content: string;
@@ -368,23 +312,11 @@ export class WasmGridCell {
368
312
  * and position in the document structure.
369
313
  *
370
314
  * # Examples
371
- *
372
- * ```
373
- * let header = HeaderMetadata {
374
- * level: 1,
375
- * text: "Main Title".to_string(),
376
- * id: Some("main-title".to_string()),
377
- * depth: 0,
378
- * html_offset: 145,
379
- * };
380
- *
381
- * assert_eq!(header.level, 1);
382
- * assert!(header.is_valid());
383
- * ```
384
315
  */
385
316
  export class WasmHeaderMetadata {
386
317
  free(): void;
387
318
  [Symbol.dispose](): void;
319
+ static default(): WasmHeaderMetadata;
388
320
  /**
389
321
  * Validate that the header level is within valid range (1-6).
390
322
  *
@@ -393,29 +325,9 @@ export class WasmHeaderMetadata {
393
325
  * `true` if level is 1-6, `false` otherwise.
394
326
  *
395
327
  * # Examples
396
- *
397
- * ```
398
- * let valid = HeaderMetadata {
399
- * level: 3,
400
- * text: "Title".to_string(),
401
- * id: None,
402
- * depth: 2,
403
- * html_offset: 100,
404
- * };
405
- * assert!(valid.is_valid());
406
- *
407
- * let invalid = HeaderMetadata {
408
- * level: 7, // Invalid
409
- * text: "Title".to_string(),
410
- * id: None,
411
- * depth: 2,
412
- * html_offset: 100,
413
- * };
414
- * assert!(!invalid.is_valid());
415
- * ```
416
328
  */
417
329
  isValid(): boolean;
418
- constructor(level: number, text: string, depth: number, html_offset: number, id?: string | null);
330
+ constructor(level: number, text: string, depth: number, htmlOffset: number, id?: string | null);
419
331
  depth: number;
420
332
  htmlOffset: number;
421
333
  get id(): string | undefined;
@@ -454,23 +366,12 @@ export enum WasmHighlightStyle {
454
366
  * suitable for serialization and transmission across language boundaries.
455
367
  *
456
368
  * # Examples
457
- *
458
- * ```
459
- * let metadata = HtmlMetadata {
460
- * document: Default::default(),
461
- * headers: Vec::new(),
462
- * links: Vec::new(),
463
- * images: Vec::new(),
464
- * structured_data: Vec::new(),
465
- * };
466
- *
467
- * assert!(metadata.headers.is_empty());
468
- * ```
469
369
  */
470
370
  export class WasmHtmlMetadata {
471
371
  free(): void;
472
372
  [Symbol.dispose](): void;
473
- constructor(document?: WasmDocumentMetadata | null, headers?: WasmHeaderMetadata[] | null, links?: WasmLinkMetadata[] | null, images?: WasmImageMetadata[] | null, structured_data?: WasmStructuredData[] | null);
373
+ static default(): WasmHtmlMetadata;
374
+ constructor(document?: WasmDocumentMetadata | null, headers?: WasmHeaderMetadata[] | null, links?: WasmLinkMetadata[] | null, images?: WasmImageMetadata[] | null, structuredData?: WasmStructuredData[] | null);
474
375
  document: WasmDocumentMetadata;
475
376
  headers: WasmHeaderMetadata[];
476
377
  images: WasmImageMetadata[];
@@ -485,30 +386,19 @@ export class WasmHtmlMetadata {
485
386
  * for image analysis and optimization.
486
387
  *
487
388
  * # Examples
488
- *
489
- * ```
490
- * let img = ImageMetadata {
491
- * src: "https://example.com/image.jpg".to_string(),
492
- * alt: Some("An example image".to_string()),
493
- * title: Some("Example".to_string()),
494
- * dimensions: Some((800, 600)),
495
- * image_type: ImageType::External,
496
- * attributes: Default::default(),
497
- * };
498
- *
499
- * assert_eq!(img.image_type, ImageType::External);
500
- * ```
501
389
  */
502
390
  export class WasmImageMetadata {
503
391
  free(): void;
504
392
  [Symbol.dispose](): void;
505
- constructor(src: string, image_type: WasmImageType, attributes: any, alt?: string | null, title?: string | null, dimensions?: Uint32Array | null);
393
+ static default(): WasmImageMetadata;
394
+ constructor(src: string, imageType: WasmImageType, attributes: any, alt?: string | null, title?: string | null, dimensions?: Uint32Array | null);
506
395
  get alt(): string | undefined;
507
396
  set alt(value: string | null | undefined);
508
397
  attributes: any;
509
398
  get dimensions(): Uint32Array | undefined;
510
399
  set dimensions(value: Uint32Array | null | undefined);
511
- imageType: WasmImageType;
400
+ get imageType(): string;
401
+ set imageType(value: WasmImageType);
512
402
  src: string;
513
403
  get title(): string | undefined;
514
404
  set title(value: string | null | undefined);
@@ -532,49 +422,16 @@ export enum WasmImageType {
532
422
  * Represents `<a>` elements with parsed href values, text content, and link type classification.
533
423
  *
534
424
  * # Examples
535
- *
536
- * ```
537
- * let link = LinkMetadata {
538
- * href: "https://example.com".to_string(),
539
- * text: "Example".to_string(),
540
- * title: Some("Visit Example".to_string()),
541
- * link_type: LinkType::External,
542
- * rel: vec!["nofollow".to_string()],
543
- * attributes: Default::default(),
544
- * };
545
- *
546
- * assert_eq!(link.link_type, LinkType::External);
547
- * assert_eq!(link.text, "Example");
548
- * ```
549
425
  */
550
426
  export class WasmLinkMetadata {
551
427
  free(): void;
552
428
  [Symbol.dispose](): void;
553
- /**
554
- * Classify a link based on href value.
555
- *
556
- * # Arguments
557
- *
558
- * * `href` - The href attribute value
559
- *
560
- * # Returns
561
- *
562
- * Appropriate [`LinkType`] based on protocol and content.
563
- *
564
- * # Examples
565
- *
566
- * ```
567
- * assert_eq!(LinkMetadata::classify_link("#section"), LinkType::Anchor);
568
- * assert_eq!(LinkMetadata::classify_link("mailto:test@example.com"), LinkType::Email);
569
- * assert_eq!(LinkMetadata::classify_link("tel:+1234567890"), LinkType::Phone);
570
- * assert_eq!(LinkMetadata::classify_link("https://example.com"), LinkType::External);
571
- * ```
572
- */
573
- static classifyLink(href: string): WasmLinkType;
574
- constructor(href: string, text: string, link_type: WasmLinkType, rel: string[], attributes: any, title?: string | null);
429
+ static default(): WasmLinkMetadata;
430
+ constructor(href: string, text: string, linkType: WasmLinkType, rel: string[], attributes: any, title?: string | null);
575
431
  attributes: any;
576
432
  href: string;
577
- linkType: WasmLinkType;
433
+ get linkType(): string;
434
+ set linkType(value: WasmLinkType);
578
435
  rel: string[];
579
436
  text: string;
580
437
  get title(): string | undefined;
@@ -631,20 +488,44 @@ export enum WasmNewlineStyle {
631
488
  *
632
489
  * Uses internally tagged representation (`"node_type": "heading"`) for JSON serialization.
633
490
  */
634
- export enum WasmNodeContent {
635
- Heading = 0,
636
- Paragraph = 1,
637
- List = 2,
638
- ListItem = 3,
639
- Table = 4,
640
- Image = 5,
641
- Code = 6,
642
- Quote = 7,
643
- DefinitionList = 8,
644
- DefinitionItem = 9,
645
- RawBlock = 10,
646
- MetadataBlock = 11,
647
- Group = 12,
491
+ export class WasmNodeContent {
492
+ free(): void;
493
+ [Symbol.dispose](): void;
494
+ static default(): WasmNodeContent;
495
+ constructor();
496
+ get content(): string | undefined;
497
+ set content(value: string | null | undefined);
498
+ get definition(): string | undefined;
499
+ set definition(value: string | null | undefined);
500
+ get description(): string | undefined;
501
+ set description(value: string | null | undefined);
502
+ get entries(): any | undefined;
503
+ set entries(value: any | null | undefined);
504
+ get format(): string | undefined;
505
+ set format(value: string | null | undefined);
506
+ get grid(): WasmTableGrid | undefined;
507
+ set grid(value: WasmTableGrid | null | undefined);
508
+ get headingLevel(): number | undefined;
509
+ set headingLevel(value: number | null | undefined);
510
+ get headingText(): string | undefined;
511
+ set headingText(value: string | null | undefined);
512
+ get imageIndex(): number | undefined;
513
+ set imageIndex(value: number | null | undefined);
514
+ get label(): string | undefined;
515
+ set label(value: string | null | undefined);
516
+ get language(): string | undefined;
517
+ set language(value: string | null | undefined);
518
+ get level(): number | undefined;
519
+ set level(value: number | null | undefined);
520
+ nodeType: string;
521
+ get ordered(): boolean | undefined;
522
+ set ordered(value: boolean | null | undefined);
523
+ get src(): string | undefined;
524
+ set src(value: string | null | undefined);
525
+ get term(): string | undefined;
526
+ set term(value: string | null | undefined);
527
+ get text(): string | undefined;
528
+ set text(value: string | null | undefined);
648
529
  }
649
530
 
650
531
  /**
@@ -656,12 +537,14 @@ export enum WasmNodeContent {
656
537
  export class WasmNodeContext {
657
538
  free(): void;
658
539
  [Symbol.dispose](): void;
659
- constructor(node_type: WasmNodeType, tag_name: string, attributes: any, depth: number, index_in_parent: number, is_inline: boolean, parent_tag?: string | null);
540
+ static default(): WasmNodeContext;
541
+ constructor(nodeType: WasmNodeType, tagName: string, attributes: any, depth: number, indexInParent: number, isInline: boolean, parentTag?: string | null);
660
542
  attributes: any;
661
543
  depth: number;
662
544
  indexInParent: number;
663
545
  isInline: boolean;
664
- nodeType: WasmNodeType;
546
+ get nodeType(): string;
547
+ set nodeType(value: WasmNodeType);
665
548
  get parentTag(): string | undefined;
666
549
  set parentTag(value: string | null | undefined);
667
550
  tagName: string;
@@ -781,37 +664,11 @@ export enum WasmOutputFormat {
781
664
  export class WasmPreprocessingOptions {
782
665
  free(): void;
783
666
  [Symbol.dispose](): void;
784
- /**
785
- * Apply a partial update to these preprocessing options.
786
- *
787
- * Any specified fields in the update will override the current values.
788
- * Unspecified fields (None) are left unchanged.
789
- *
790
- * # Arguments
791
- *
792
- * * `update` - Partial preprocessing options update
793
- */
794
- applyUpdate(_update: WasmPreprocessingOptionsUpdate): void;
795
667
  static default(): WasmPreprocessingOptions;
796
- static from(update: WasmPreprocessingOptionsUpdate): WasmPreprocessingOptions;
797
- /**
798
- * Create new preprocessing options from a partial update.
799
- *
800
- * Creates a new `PreprocessingOptions` struct with defaults, then applies the update.
801
- * Fields not specified in the update keep their default values.
802
- *
803
- * # Arguments
804
- *
805
- * * `update` - Partial preprocessing options update
806
- *
807
- * # Returns
808
- *
809
- * New `PreprocessingOptions` with specified updates applied to defaults
810
- */
811
- static fromUpdate(update: WasmPreprocessingOptionsUpdate): WasmPreprocessingOptions;
812
- constructor(enabled?: boolean | null, preset?: WasmPreprocessingPreset | null, remove_navigation?: boolean | null, remove_forms?: boolean | null);
668
+ constructor(enabled?: boolean | null, preset?: WasmPreprocessingPreset | null, removeNavigation?: boolean | null, removeForms?: boolean | null);
813
669
  enabled: boolean;
814
- preset: WasmPreprocessingPreset;
670
+ get preset(): string;
671
+ set preset(value: WasmPreprocessingPreset);
815
672
  removeForms: boolean;
816
673
  removeNavigation: boolean;
817
674
  }
@@ -820,16 +677,17 @@ export class WasmPreprocessingOptions {
820
677
  * Partial update for `PreprocessingOptions`.
821
678
  *
822
679
  * This struct uses `Option<T>` to represent optional fields that can be selectively updated.
823
- * Only specified fields (Some values) will override existing options; None values leave the
824
- * corresponding fields unchanged when applied via [`PreprocessingOptions::apply_update`].
680
+ * Only specified fields (values) will override existing options; undefined values leave the
681
+ * corresponding fields unchanged when applied via `PreprocessingOptions.apply_update`.
825
682
  */
826
683
  export class WasmPreprocessingOptionsUpdate {
827
684
  free(): void;
828
685
  [Symbol.dispose](): void;
829
- constructor(enabled?: boolean | null, preset?: WasmPreprocessingPreset | null, remove_navigation?: boolean | null, remove_forms?: boolean | null);
686
+ static default(): WasmPreprocessingOptionsUpdate;
687
+ constructor(enabled?: boolean | null, preset?: WasmPreprocessingPreset | null, removeNavigation?: boolean | null, removeForms?: boolean | null);
830
688
  get enabled(): boolean | undefined;
831
689
  set enabled(value: boolean | null | undefined);
832
- get preset(): WasmPreprocessingPreset | undefined;
690
+ get preset(): string | undefined;
833
691
  set preset(value: WasmPreprocessingPreset | null | undefined);
834
692
  get removeForms(): boolean | undefined;
835
693
  set removeForms(value: boolean | null | undefined);
@@ -849,13 +707,29 @@ export enum WasmPreprocessingPreset {
849
707
  }
850
708
 
851
709
  /**
852
- * A non-fatal warning generated during HTML processing.
710
+ * A non-fatal diagnostic produced during HTML conversion.
711
+ *
712
+ * Warnings indicate that conversion completed but some content may have been handled
713
+ * differently than expected — for example, an image that could not be extracted, a truncated
714
+ * input, or malformed HTML that was repaired with best-effort parsing.
715
+ *
716
+ * Conversion always succeeds (returns `ConversionResult`) even when warnings are
717
+ * present. Callers should inspect `warnings` and decide how to
718
+ * handle them based on their tolerance for partial results:
719
+ *
720
+ * - **Logging pipelines**: emit each warning at `WARN` level and continue.
721
+ * - **Strict pipelines**: treat any warning as a hard error by checking
722
+ * `result.warnings.is_empty()` before using the output.
723
+ *
724
+ * See `WarningKind` for the full taxonomy of warning categories.
853
725
  */
854
726
  export class WasmProcessingWarning {
855
727
  free(): void;
856
728
  [Symbol.dispose](): void;
729
+ static default(): WasmProcessingWarning;
857
730
  constructor(message: string, kind: WasmWarningKind);
858
- kind: WasmWarningKind;
731
+ get kind(): string;
732
+ set kind(value: WasmWarningKind);
859
733
  message: string;
860
734
  }
861
735
 
@@ -866,22 +740,14 @@ export class WasmProcessingWarning {
866
740
  * JSON-LD blocks are collected as raw JSON strings for flexibility.
867
741
  *
868
742
  * # Examples
869
- *
870
- * ```
871
- * let schema = StructuredData {
872
- * data_type: StructuredDataType::JsonLd,
873
- * raw_json: r#"{"@context":"https://schema.org","@type":"Article"}"#.to_string(),
874
- * schema_type: Some("Article".to_string()),
875
- * };
876
- *
877
- * assert_eq!(schema.data_type, StructuredDataType::JsonLd);
878
- * ```
879
743
  */
880
744
  export class WasmStructuredData {
881
745
  free(): void;
882
746
  [Symbol.dispose](): void;
883
- constructor(data_type: WasmStructuredDataType, raw_json: string, schema_type?: string | null);
884
- dataType: WasmStructuredDataType;
747
+ static default(): WasmStructuredData;
748
+ constructor(dataType: WasmStructuredDataType, rawJson: string, schemaType?: string | null);
749
+ get dataType(): string;
750
+ set dataType(value: WasmStructuredDataType);
885
751
  rawJson: string;
886
752
  get schemaType(): string | undefined;
887
753
  set schemaType(value: string | null | undefined);
@@ -904,6 +770,7 @@ export enum WasmStructuredDataType {
904
770
  export class WasmTableData {
905
771
  free(): void;
906
772
  [Symbol.dispose](): void;
773
+ static default(): WasmTableData;
907
774
  constructor(grid: WasmTableGrid, markdown: string);
908
775
  grid: WasmTableGrid;
909
776
  markdown: string;
@@ -915,6 +782,7 @@ export class WasmTableData {
915
782
  export class WasmTableGrid {
916
783
  free(): void;
917
784
  [Symbol.dispose](): void;
785
+ static default(): WasmTableGrid;
918
786
  constructor(rows?: number | null, cols?: number | null, cells?: WasmGridCell[] | null);
919
787
  cells: WasmGridCell[];
920
788
  cols: number;
@@ -922,16 +790,28 @@ export class WasmTableGrid {
922
790
  }
923
791
 
924
792
  /**
925
- * An inline text annotation with byte-range offsets.
793
+ * A styling or semantic annotation that applies to a byte range within a node's text.
926
794
  *
927
- * Annotations describe formatting (bold, italic, etc.) and links within a node's text content.
795
+ * Unlike `DocumentNode`, which captures block-level structure (headings, paragraphs, etc.),
796
+ * a `TextAnnotation` describes inline-level markup — bold, italic, links, code spans, and
797
+ * similar — that spans a contiguous run of bytes inside `DocumentNode.content`'s text field.
798
+ *
799
+ * Byte offsets (`start`..`end`) are into the UTF-8 encoded text of the parent node. The range
800
+ * follows Rust slice conventions: `start` is inclusive and `end` is exclusive, so the annotated
801
+ * text is `text[start as usize..end as usize]`.
802
+ *
803
+ * Multiple annotations on the same node can overlap (e.g. bold-italic text), and they are
804
+ * stored in the order they are encountered during DOM traversal.
805
+ *
806
+ * See `AnnotationKind` for the full list of supported annotation types.
928
807
  */
929
808
  export class WasmTextAnnotation {
930
809
  free(): void;
931
810
  [Symbol.dispose](): void;
932
- constructor(start: number, end: number, kind: WasmAnnotationKind);
811
+ static default(): WasmTextAnnotation;
812
+ constructor(start: number, end: number, kind: any);
933
813
  end: number;
934
- kind: WasmAnnotationKind;
814
+ kind: any;
935
815
  start: number;
936
816
  }
937
817
 
@@ -962,9 +842,12 @@ export enum WasmVisitResult {
962
842
  }
963
843
 
964
844
  /**
965
- * Type alias for a visitor handle (Rc-wrapped `RefCell` for interior mutability).
845
+ * Shareable, thread-safe handle to a user-provided HTML visitor implementation.
966
846
  *
967
- * This allows visitors to be passed around and shared while still being mutable.
847
+ * Pass an instance wrapped in this handle to `ConversionOptions` to
848
+ * customise how the HTML document is traversed and converted to Markdown.
849
+ * The handle may be cloned and shared across threads without additional
850
+ * synchronisation on the caller's side.
968
851
  */
969
852
  export class WasmVisitorHandle {
970
853
  free(): void;
@@ -995,23 +878,16 @@ export enum WasmWhitespaceMode {
995
878
  }
996
879
 
997
880
  /**
998
- * Convert HTML to Markdown, returning a [`ConversionResult`] with content, metadata, images,
881
+ * Convert HTML to Markdown, returning a `ConversionResult` with content, metadata, images,
999
882
  * and warnings.
1000
883
  *
1001
884
  * # Arguments
1002
885
  *
1003
886
  * * `html` — the HTML string to convert.
1004
- * * `options` — optional conversion options. Defaults to [`ConversionOptions::default`].
887
+ * * `options` — optional conversion options. Defaults to `ConversionOptions.default`.
1005
888
  *
1006
889
  * # Example
1007
890
  *
1008
- * ```
1009
- * use html_to_markdown_rs::convert;
1010
- *
1011
- * let html = "<h1>Hello World</h1>";
1012
- * let result = convert(html, None).unwrap();
1013
- * assert!(result.content.as_deref().unwrap_or("").contains("Hello World"));
1014
- * ```
1015
891
  *
1016
892
  * # Errors
1017
893
  *