mdast2docx 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +242 -203
  2. package/dist/chunk-3ZZBJC3M.mjs +1 -0
  3. package/dist/chunk-GP6KO6J3.mjs +3 -0
  4. package/dist/{chunk-CRVVOUD7.mjs → chunk-GS5L4UWU.mjs} +1 -1
  5. package/dist/{chunk-MSGIMOZN.mjs → chunk-IW743AEN.mjs} +1 -1
  6. package/dist/chunk-M5XHL7AG.mjs +4 -0
  7. package/dist/chunk-QR3NYQYH.mjs +1 -0
  8. package/dist/chunk-YNJKJBFY.mjs +3 -0
  9. package/dist/{chunk-JOIHCSIR.mjs → chunk-Z5DPYROV.mjs} +1 -1
  10. package/dist/index.js +3 -2
  11. package/dist/index.mjs +1 -1
  12. package/dist/mdast.d.ts +1076 -0
  13. package/dist/mdast.js +1 -0
  14. package/dist/{multipart-parser-ECCTUILZ.mjs → multipart-parser-WKN2UV32.mjs} +1 -1
  15. package/dist/plugins/html.d.ts +1 -1
  16. package/dist/plugins/html.js +3 -5
  17. package/dist/plugins/html.mjs +1 -1
  18. package/dist/plugins/image.mjs +1 -1
  19. package/dist/plugins/index.js +2 -78
  20. package/dist/plugins/index.mjs +1 -1
  21. package/dist/plugins/list.js +1 -1
  22. package/dist/plugins/list.mjs +1 -1
  23. package/dist/plugins/math.js +1 -75
  24. package/dist/plugins/math.mjs +1 -1
  25. package/dist/plugins/node/index.mjs +1 -1
  26. package/dist/plugins/node/node-image.mjs +1 -1
  27. package/dist/plugins/table.mjs +1 -1
  28. package/dist/section.d.ts +1 -1
  29. package/dist/section.js +3 -2
  30. package/dist/section.mjs +1 -1
  31. package/dist/utils.d.ts +16 -6
  32. package/dist/utils.js +1 -1
  33. package/dist/utils.mjs +1 -1
  34. package/package.json +95 -94
  35. package/dist/chunk-35E6UZDH.mjs +0 -4
  36. package/dist/chunk-ALSMH2CW.mjs +0 -75
  37. package/dist/chunk-ECHPYCZC.mjs +0 -2
  38. package/dist/chunk-I5QUWH2X.mjs +0 -1
  39. package/dist/chunk-X6PWMGYB.mjs +0 -5
  40. package/dist/chunk-Z2MODMIK.mjs +0 -1
@@ -0,0 +1,1076 @@
1
+ import { AlignmentType, IBorderOptions, IBordersOptions, IFrameOptions, UnderlineType } from "docx";
2
+ import type { Data as UnistData, Literal as UnistLiteral, Node as UnistNode, Parent as UnistParent } from "unist";
3
+ import { Mutable } from "./utils";
4
+ /**
5
+ * This is used to avoid multiple times processing of a given node.
6
+ * Acts like event.stopPropagation.
7
+ */
8
+ export interface EmptyNode {
9
+ type: "";
10
+ [key: string]: unknown;
11
+ }
12
+ export interface Fragment extends Parent {
13
+ type: "fragment";
14
+ children: (RootContent | PhrasingContent)[];
15
+ }
16
+ export interface Checkbox extends Node {
17
+ type: "checkbox";
18
+ checked?: boolean;
19
+ }
20
+ /**
21
+ * How phrasing content is aligned
22
+ * ({@link https://drafts.csswg.org/css-text/ | [CSSTEXT]}).
23
+ *
24
+ * * `'left'`: See the
25
+ * {@link https://drafts.csswg.org/css-text/#valdef-text-align-left | left}
26
+ * value of the `text-align` CSS property
27
+ * * `'right'`: See the
28
+ * {@link https://drafts.csswg.org/css-text/#valdef-text-align-right | right}
29
+ * value of the `text-align` CSS property
30
+ * * `'center'`: See the
31
+ * {@link https://drafts.csswg.org/css-text/#valdef-text-align-center | center}
32
+ * value of the `text-align` CSS property
33
+ * * `null`: phrasing content is aligned as defined by the host environment
34
+ *
35
+ * Used in GFM tables.
36
+ */
37
+ export type AlignType = "center" | "left" | "right" | null;
38
+ /**
39
+ * Explicitness of a reference.
40
+ *
41
+ * `'shortcut'`: the reference is implicit, its identifier inferred from its
42
+ * content
43
+ * `'collapsed'`: the reference is explicit, its identifier inferred from its
44
+ * content
45
+ * `'full'`: the reference is explicit, its identifier explicitly set
46
+ */
47
+ export type ReferenceType = "shortcut" | "collapsed" | "full";
48
+ /**
49
+ * Node with a fallback.
50
+ */
51
+ export interface Alternative {
52
+ /**
53
+ * Equivalent content for environments that cannot represent the node as
54
+ * intended.
55
+ */
56
+ alt?: string | null;
57
+ }
58
+ /**
59
+ * Internal relation from one node to another.
60
+ *
61
+ * Whether the value of `identifier` is expected to be a unique identifier or
62
+ * not depends on the type of node including the Association.
63
+ * An example of this is that they should be unique on {@link Definition},
64
+ * whereas multiple {@link LinkReference}s can be non-unique to be associated
65
+ * with one definition.
66
+ */
67
+ export interface Association {
68
+ /**
69
+ * Relation of association.
70
+ *
71
+ * `identifier` is a source value: character escapes and character
72
+ * references are not parsed.
73
+ *
74
+ * It can match another node.
75
+ *
76
+ * Its value must be normalized.
77
+ * To normalize a value, collapse markdown whitespace (`[\t\n\r ]+`) to a space,
78
+ * trim the optional initial and/or final space, and perform Unicode-aware
79
+ * case-folding.
80
+ */
81
+ identifier: string;
82
+ /**
83
+ * Relation of association, in parsed form.
84
+ *
85
+ * `label` is a `string` value: it works just like `title` on {@link Link}
86
+ * or a `lang` on {@link Code}: character escapes and character references
87
+ * are parsed.
88
+ *
89
+ * It can match another node.
90
+ */
91
+ label?: string | null;
92
+ }
93
+ /**
94
+ * Marker that is associated to another node.
95
+ */
96
+ export interface Reference extends Association {
97
+ /**
98
+ * Explicitness of the reference.
99
+ */
100
+ referenceType: ReferenceType;
101
+ }
102
+ /**
103
+ * Reference to resource.
104
+ */
105
+ export interface Resource {
106
+ /**
107
+ * URL to the referenced resource.
108
+ */
109
+ url: string;
110
+ /**
111
+ * Advisory information for the resource, such as would be appropriate for
112
+ * a tooltip.
113
+ */
114
+ title?: string | null;
115
+ }
116
+ /**
117
+ * Info associated with mdast nodes by the ecosystem.
118
+ *
119
+ * This space is guaranteed to never be specified by unist or mdast.
120
+ * But you can use it in utilities and plugins to store data.
121
+ *
122
+ * This type can be augmented to register custom data.
123
+ * For example:
124
+ *
125
+ * ```ts
126
+ * declare module 'mdast' {
127
+ * interface Data {
128
+ * // `someNode.data.myId` is typed as `number | undefined`
129
+ * myId?: number | undefined
130
+ * }
131
+ * }
132
+ * ```
133
+ */
134
+ export interface Data extends UnistData {
135
+ /**
136
+ * Styles data compatible with docx - could be passed via inline or block html
137
+ */
138
+ border?: Mutable<IBorderOptions | IBordersOptions>;
139
+ alignment?: (typeof AlignmentType)[keyof typeof AlignmentType];
140
+ bold?: boolean;
141
+ italics?: boolean;
142
+ underline?: {
143
+ type: (typeof UnderlineType)[keyof typeof UnderlineType];
144
+ color: string;
145
+ } | {};
146
+ emphasisMark?: {};
147
+ strike?: boolean;
148
+ allCaps?: boolean;
149
+ smallCaps?: boolean;
150
+ subScript?: boolean;
151
+ superScript?: boolean;
152
+ color?: string;
153
+ highlight?: string;
154
+ frame?: IFrameOptions;
155
+ pre?: boolean;
156
+ }
157
+ /**
158
+ * Union of registered mdast nodes that can occur where block content is
159
+ * expected.
160
+ *
161
+ * To register custom mdast nodes, add them to {@link BlockContentMap}.
162
+ * They will be automatically added here.
163
+ */
164
+ export type BlockContent = BlockContentMap[keyof BlockContentMap];
165
+ /**
166
+ * Registry of all mdast nodes that can occur where {@link BlockContent} is
167
+ * expected.
168
+ *
169
+ * This interface can be augmented to register custom node types:
170
+ *
171
+ * ```ts
172
+ * declare module 'mdast' {
173
+ * interface BlockContentMap {
174
+ * // Allow using MDX ESM nodes defined by `remark-mdx`.
175
+ * mdxjsEsm: MdxjsEsm;
176
+ * }
177
+ * }
178
+ * ```
179
+ *
180
+ * For a union of all block content, see {@link RootContent}.
181
+ */
182
+ export interface BlockContentMap {
183
+ blockquote: Blockquote;
184
+ code: Code;
185
+ heading: Heading;
186
+ html: Html;
187
+ list: List;
188
+ paragraph: Paragraph;
189
+ table: Table;
190
+ thematicBreak: ThematicBreak;
191
+ fragment: Fragment;
192
+ }
193
+ /**
194
+ * Union of registered mdast nodes that can occur where definition content is
195
+ * expected.
196
+ *
197
+ * To register custom mdast nodes, add them to {@link DefinitionContentMap}.
198
+ * They will be automatically added here.
199
+ */
200
+ export type DefinitionContent = DefinitionContentMap[keyof DefinitionContentMap];
201
+ /**
202
+ * Registry of all mdast nodes that can occur where {@link DefinitionContent}
203
+ * is expected.
204
+ *
205
+ * This interface can be augmented to register custom node types:
206
+ *
207
+ * ```ts
208
+ * declare module 'mdast' {
209
+ * interface DefinitionContentMap {
210
+ * custom: Custom;
211
+ * }
212
+ * }
213
+ * ```
214
+ *
215
+ * For a union of all definition content, see {@link RootContent}.
216
+ */
217
+ export interface DefinitionContentMap {
218
+ definition: Definition;
219
+ footnoteDefinition: FootnoteDefinition;
220
+ }
221
+ /**
222
+ * Union of registered mdast nodes that can occur where frontmatter content is
223
+ * expected.
224
+ *
225
+ * To register custom mdast nodes, add them to {@link FrontmatterContentMap}.
226
+ * They will be automatically added here.
227
+ */
228
+ export type FrontmatterContent = FrontmatterContentMap[keyof FrontmatterContentMap];
229
+ /**
230
+ * Registry of all mdast nodes that can occur where {@link FrontmatterContent}
231
+ * is expected.
232
+ *
233
+ * This interface can be augmented to register custom node types:
234
+ *
235
+ * ```ts
236
+ * declare module 'mdast' {
237
+ * interface FrontmatterContentMap {
238
+ * // Allow using toml nodes defined by `remark-frontmatter`.
239
+ * toml: TOML;
240
+ * }
241
+ * }
242
+ * ```
243
+ *
244
+ * For a union of all frontmatter content, see {@link RootContent}.
245
+ */
246
+ export interface FrontmatterContentMap {
247
+ yaml: Yaml;
248
+ }
249
+ /**
250
+ * Union of registered mdast nodes that can occur where list content is
251
+ * expected.
252
+ *
253
+ * To register custom mdast nodes, add them to {@link ListContentMap}.
254
+ * They will be automatically added here.
255
+ */
256
+ export type ListContent = ListContentMap[keyof ListContentMap];
257
+ /**
258
+ * Registry of all mdast nodes that can occur where {@link ListContent}
259
+ * is expected.
260
+ *
261
+ * This interface can be augmented to register custom node types:
262
+ *
263
+ * ```ts
264
+ * declare module 'mdast' {
265
+ * interface ListContentMap {
266
+ * custom: Custom;
267
+ * }
268
+ * }
269
+ * ```
270
+ *
271
+ * For a union of all list content, see {@link RootContent}.
272
+ */
273
+ export interface ListContentMap {
274
+ listItem: ListItem;
275
+ }
276
+ /**
277
+ * Union of registered mdast nodes that can occur where phrasing content is
278
+ * expected.
279
+ *
280
+ * To register custom mdast nodes, add them to {@link PhrasingContentMap}.
281
+ * They will be automatically added here.
282
+ */
283
+ export type PhrasingContent = PhrasingContentMap[keyof PhrasingContentMap];
284
+ /**
285
+ * Registry of all mdast nodes that can occur where {@link PhrasingContent}
286
+ * is expected.
287
+ *
288
+ * This interface can be augmented to register custom node types:
289
+ *
290
+ * ```ts
291
+ * declare module 'mdast' {
292
+ * interface PhrasingContentMap {
293
+ * // Allow using MDX JSX (text) nodes defined by `remark-mdx`.
294
+ * mdxJsxTextElement: MDXJSXTextElement;
295
+ * }
296
+ * }
297
+ * ```
298
+ *
299
+ * For a union of all phrasing content, see {@link RootContent}.
300
+ */
301
+ export interface PhrasingContentMap {
302
+ break: Break;
303
+ delete: Delete;
304
+ emphasis: Emphasis;
305
+ footnoteReference: FootnoteReference;
306
+ html: Html;
307
+ image: Image;
308
+ imageReference: ImageReference;
309
+ inlineCode: InlineCode;
310
+ link: Link;
311
+ linkReference: LinkReference;
312
+ strong: Strong;
313
+ text: Text;
314
+ empty: EmptyNode;
315
+ fragment: Fragment;
316
+ checkbox: Checkbox;
317
+ }
318
+ /**
319
+ * Union of registered mdast nodes that can occur in {@link Root}.
320
+ *
321
+ * To register custom mdast nodes, add them to {@link RootContentMap}.
322
+ * They will be automatically added here.
323
+ */
324
+ export type RootContent = RootContentMap[keyof RootContentMap];
325
+ /**
326
+ * Registry of all mdast nodes that can occur as children of {@link Root}.
327
+ *
328
+ * > **Note**: {@link Root} does not need to be an entire document.
329
+ * > it can also be a fragment.
330
+ *
331
+ * This interface can be augmented to register custom node types:
332
+ *
333
+ * ```ts
334
+ * declare module 'mdast' {
335
+ * interface RootContentMap {
336
+ * // Allow using toml nodes defined by `remark-frontmatter`.
337
+ * toml: TOML;
338
+ * }
339
+ * }
340
+ * ```
341
+ *
342
+ * For a union of all {@link Root} children, see {@link RootContent}.
343
+ */
344
+ export interface RootContentMap extends PhrasingContentMap, BlockContentMap {
345
+ definition: Definition;
346
+ footnoteDefinition: FootnoteDefinition;
347
+ listItem: ListItem;
348
+ tableCell: TableCell;
349
+ tableRow: TableRow;
350
+ yaml: Yaml;
351
+ }
352
+ /**
353
+ * Union of registered mdast nodes that can occur where row content is
354
+ * expected.
355
+ *
356
+ * To register custom mdast nodes, add them to {@link RowContentMap}.
357
+ * They will be automatically added here.
358
+ */
359
+ export type RowContent = RowContentMap[keyof RowContentMap];
360
+ /**
361
+ * Registry of all mdast nodes that can occur where {@link RowContent}
362
+ * is expected.
363
+ *
364
+ * This interface can be augmented to register custom node types:
365
+ *
366
+ * ```ts
367
+ * declare module 'mdast' {
368
+ * interface RowContentMap {
369
+ * custom: Custom;
370
+ * }
371
+ * }
372
+ * ```
373
+ *
374
+ * For a union of all row content, see {@link RootContent}.
375
+ */
376
+ export interface RowContentMap {
377
+ tableCell: TableCell;
378
+ }
379
+ /**
380
+ * Union of registered mdast nodes that can occur where table content is
381
+ * expected.
382
+ *
383
+ * To register custom mdast nodes, add them to {@link TableContentMap}.
384
+ * They will be automatically added here.
385
+ */
386
+ export type TableContent = TableContentMap[keyof TableContentMap];
387
+ /**
388
+ * Registry of all mdast nodes that can occur where {@link TableContent}
389
+ * is expected.
390
+ *
391
+ * This interface can be augmented to register custom node types:
392
+ *
393
+ * ```ts
394
+ * declare module 'mdast' {
395
+ * interface TableContentMap {
396
+ * custom: Custom;
397
+ * }
398
+ * }
399
+ * ```
400
+ *
401
+ * For a union of all table content, see {@link RootContent}.
402
+ */
403
+ export interface TableContentMap {
404
+ tableRow: TableRow;
405
+ }
406
+ /**
407
+ * Union of registered mdast nodes that can occur in {@link Root}.
408
+ *
409
+ * @deprecated Use {@link RootContent} instead.
410
+ */
411
+ export type Content = RootContent;
412
+ /**
413
+ * Union of registered mdast literals.
414
+ *
415
+ * To register custom mdast nodes, add them to {@link RootContentMap} and other
416
+ * places where relevant.
417
+ * They will be automatically added here.
418
+ */
419
+ export type Literals = Extract<Nodes, UnistLiteral>;
420
+ /**
421
+ * Union of registered mdast nodes.
422
+ *
423
+ * To register custom mdast nodes, add them to {@link RootContentMap} and other
424
+ * places where relevant.
425
+ * They will be automatically added here.
426
+ */
427
+ export type Nodes = Root | RootContent;
428
+ /**
429
+ * Union of registered mdast parents.
430
+ *
431
+ * To register custom mdast nodes, add them to {@link RootContentMap} and other
432
+ * places where relevant.
433
+ * They will be automatically added here.
434
+ */
435
+ export type Parents = Extract<Nodes, UnistParent>;
436
+ /**
437
+ * Union of registered mdast nodes that can occur at the top of the document.
438
+ *
439
+ * To register custom mdast nodes, add them to {@link BlockContent},
440
+ * {@link FrontmatterContent}, or {@link DefinitionContent}.
441
+ * They will be automatically added here.
442
+ */
443
+ export type TopLevelContent = BlockContent | FrontmatterContent | DefinitionContent;
444
+ /**
445
+ * Abstract mdast node that contains the smallest possible value.
446
+ *
447
+ * This interface is supposed to be extended if you make custom mdast nodes.
448
+ *
449
+ * For a union of all registered mdast literals, see {@link Literals}.
450
+ */
451
+ export interface Literal extends Node {
452
+ /**
453
+ * Plain-text value.
454
+ */
455
+ value: string;
456
+ }
457
+ /**
458
+ * Abstract mdast node.
459
+ *
460
+ * This interface is supposed to be extended.
461
+ * If you can use {@link Literal} or {@link Parent}, you should.
462
+ * But for example in markdown, a thematic break (`***`) is neither literal nor
463
+ * parent, but still a node.
464
+ *
465
+ * To register custom mdast nodes, add them to {@link RootContentMap} and other
466
+ * places where relevant (such as {@link ElementContentMap}).
467
+ *
468
+ * For a union of all registered mdast nodes, see {@link Nodes}.
469
+ */
470
+ export interface Node extends UnistNode {
471
+ /**
472
+ * Info from the ecosystem.
473
+ */
474
+ data?: Data;
475
+ }
476
+ /**
477
+ * Abstract mdast node that contains other mdast nodes (*children*).
478
+ *
479
+ * This interface is supposed to be extended if you make custom mdast nodes.
480
+ *
481
+ * For a union of all registered mdast parents, see {@link Parents}.
482
+ */
483
+ export interface Parent extends Node {
484
+ /**
485
+ * List of children.
486
+ */
487
+ children: RootContent[];
488
+ }
489
+ /**
490
+ * Markdown block quote.
491
+ */
492
+ export interface Blockquote extends Parent {
493
+ /**
494
+ * Node type of mdast block quote.
495
+ */
496
+ type: "blockquote";
497
+ /**
498
+ * Children of block quote.
499
+ */
500
+ children: Array<BlockContent | DefinitionContent>;
501
+ /**
502
+ * Data associated with the mdast block quote.
503
+ */
504
+ data?: BlockquoteData;
505
+ }
506
+ /**
507
+ * Info associated with mdast block quote nodes by the ecosystem.
508
+ */
509
+ export interface BlockquoteData extends Data {
510
+ }
511
+ /**
512
+ * Markdown break.
513
+ */
514
+ export interface Break extends Node {
515
+ /**
516
+ * Node type of mdast break.
517
+ */
518
+ type: "break";
519
+ /**
520
+ * Data associated with the mdast break.
521
+ */
522
+ data?: BreakData;
523
+ }
524
+ /**
525
+ * Info associated with mdast break nodes by the ecosystem.
526
+ */
527
+ export interface BreakData extends Data {
528
+ }
529
+ /**
530
+ * Markdown code (flow) (block).
531
+ */
532
+ export interface Code extends Literal {
533
+ /**
534
+ * Node type of mdast code (flow).
535
+ */
536
+ type: "code";
537
+ /**
538
+ * Language of computer code being marked up.
539
+ */
540
+ lang?: string | null;
541
+ /**
542
+ * Custom information relating to the node.
543
+ *
544
+ * If the lang field is present, a meta field can be present.
545
+ */
546
+ meta?: string | null;
547
+ /**
548
+ * Data associated with the mdast code (flow).
549
+ */
550
+ data?: CodeData;
551
+ }
552
+ /**
553
+ * Info associated with mdast code (flow) (block) nodes by the ecosystem.
554
+ */
555
+ export interface CodeData extends Data {
556
+ }
557
+ /**
558
+ * Markdown definition.
559
+ */
560
+ export interface Definition extends Node, Association, Resource {
561
+ /**
562
+ * Node type of mdast definition.
563
+ */
564
+ type: "definition";
565
+ /**
566
+ * Data associated with the mdast definition.
567
+ */
568
+ data?: DefinitionData;
569
+ }
570
+ /**
571
+ * Info associated with mdast definition nodes by the ecosystem.
572
+ */
573
+ export interface DefinitionData extends Data {
574
+ }
575
+ /**
576
+ * Markdown GFM delete (strikethrough).
577
+ */
578
+ export interface Delete extends Parent {
579
+ /**
580
+ * Node type of mdast GFM delete.
581
+ */
582
+ type: "delete";
583
+ /**
584
+ * Children of GFM delete.
585
+ */
586
+ children: PhrasingContent[];
587
+ /**
588
+ * Data associated with the mdast GFM delete.
589
+ */
590
+ data?: DeleteData;
591
+ }
592
+ /**
593
+ * Info associated with mdast GFM delete nodes by the ecosystem.
594
+ */
595
+ export interface DeleteData extends Data {
596
+ }
597
+ /**
598
+ * Markdown emphasis.
599
+ */
600
+ export interface Emphasis extends Parent {
601
+ /**
602
+ * Node type of mdast emphasis.
603
+ */
604
+ type: "emphasis";
605
+ /**
606
+ * Children of emphasis.
607
+ */
608
+ children: PhrasingContent[];
609
+ /**
610
+ * Data associated with the mdast emphasis.
611
+ */
612
+ data?: EmphasisData;
613
+ }
614
+ /**
615
+ * Info associated with mdast emphasis nodes by the ecosystem.
616
+ */
617
+ export interface EmphasisData extends Data {
618
+ }
619
+ /**
620
+ * Markdown GFM footnote definition.
621
+ */
622
+ export interface FootnoteDefinition extends Parent, Association {
623
+ /**
624
+ * Node type of mdast GFM footnote definition.
625
+ */
626
+ type: "footnoteDefinition";
627
+ /**
628
+ * Children of GFM footnote definition.
629
+ */
630
+ children: Array<BlockContent | DefinitionContent>;
631
+ /**
632
+ * Data associated with the mdast GFM footnote definition.
633
+ */
634
+ data?: FootnoteDefinitionData;
635
+ }
636
+ /**
637
+ * Info associated with mdast GFM footnote definition nodes by the ecosystem.
638
+ */
639
+ export interface FootnoteDefinitionData extends Data {
640
+ }
641
+ /**
642
+ * Markdown GFM footnote reference.
643
+ */
644
+ export interface FootnoteReference extends Association, Node {
645
+ /**
646
+ * Node type of mdast GFM footnote reference.
647
+ */
648
+ type: "footnoteReference";
649
+ /**
650
+ * Data associated with the mdast GFM footnote reference.
651
+ */
652
+ data?: FootnoteReferenceData;
653
+ }
654
+ /**
655
+ * Info associated with mdast GFM footnote reference nodes by the ecosystem.
656
+ */
657
+ export interface FootnoteReferenceData extends Data {
658
+ }
659
+ /**
660
+ * Markdown heading.
661
+ */
662
+ export interface Heading extends Parent {
663
+ /**
664
+ * Node type of mdast heading.
665
+ */
666
+ type: "heading";
667
+ /**
668
+ * Heading rank.
669
+ *
670
+ * A value of `1` is said to be the highest rank and `6` the lowest.
671
+ */
672
+ depth: 1 | 2 | 3 | 4 | 5 | 6;
673
+ /**
674
+ * Children of heading.
675
+ */
676
+ children: PhrasingContent[];
677
+ /**
678
+ * Data associated with the mdast heading.
679
+ */
680
+ data?: HeadingData;
681
+ }
682
+ /**
683
+ * Info associated with mdast heading nodes by the ecosystem.
684
+ */
685
+ export interface HeadingData extends Data {
686
+ }
687
+ /**
688
+ * Markdown HTML.
689
+ */
690
+ export interface Html extends Literal {
691
+ /**
692
+ * Node type of mdast HTML.
693
+ */
694
+ type: "html";
695
+ /**
696
+ * Data associated with the mdast HTML.
697
+ */
698
+ data?: HtmlData;
699
+ }
700
+ /**
701
+ * Info associated with mdast HTML nodes by the ecosystem.
702
+ */
703
+ export interface HtmlData extends Data {
704
+ }
705
+ /**
706
+ * Old name of `Html` node.
707
+ *
708
+ * @deprecated
709
+ * Please use `Html` instead.
710
+ */
711
+ export type HTML = Html;
712
+ /**
713
+ * Markdown image.
714
+ */
715
+ export interface Image extends Alternative, Node, Resource {
716
+ /**
717
+ * Node type of mdast image.
718
+ */
719
+ type: "image";
720
+ /**
721
+ * Data associated with the mdast image.
722
+ */
723
+ data?: ImageData;
724
+ }
725
+ /**
726
+ * Info associated with mdast image nodes by the ecosystem.
727
+ */
728
+ export interface ImageData extends Data {
729
+ width?: number | null;
730
+ height?: number | null;
731
+ }
732
+ /**
733
+ * Markdown image reference.
734
+ */
735
+ export interface ImageReference extends Alternative, Node, Reference {
736
+ /**
737
+ * Node type of mdast image reference.
738
+ */
739
+ type: "imageReference";
740
+ /**
741
+ * Data associated with the mdast image reference.
742
+ */
743
+ data?: ImageReferenceData;
744
+ }
745
+ /**
746
+ * Info associated with mdast image reference nodes by the ecosystem.
747
+ */
748
+ export interface ImageReferenceData extends Data {
749
+ }
750
+ /**
751
+ * Markdown code (text) (inline).
752
+ */
753
+ export interface InlineCode extends Literal {
754
+ /**
755
+ * Node type of mdast code (text).
756
+ */
757
+ type: "inlineCode";
758
+ /**
759
+ * Data associated with the mdast code (text).
760
+ */
761
+ data?: InlineCodeData;
762
+ }
763
+ /**
764
+ * Info associated with mdast code (text) (inline) nodes by the ecosystem.
765
+ */
766
+ export interface InlineCodeData extends Data {
767
+ }
768
+ /**
769
+ * Markdown link.
770
+ */
771
+ export interface Link extends Parent, Resource {
772
+ /**
773
+ * Node type of mdast link.
774
+ */
775
+ type: "link";
776
+ /**
777
+ * Children of link.
778
+ */
779
+ children: PhrasingContent[];
780
+ /**
781
+ * Data associated with the mdast link.
782
+ */
783
+ data?: LinkData;
784
+ }
785
+ /**
786
+ * Info associated with mdast link nodes by the ecosystem.
787
+ */
788
+ export interface LinkData extends Data {
789
+ }
790
+ /**
791
+ * Markdown link reference.
792
+ */
793
+ export interface LinkReference extends Parent, Reference {
794
+ /**
795
+ * Node type of mdast link reference.
796
+ */
797
+ type: "linkReference";
798
+ /**
799
+ * Children of link reference.
800
+ */
801
+ children: PhrasingContent[];
802
+ /**
803
+ * Data associated with the mdast link reference.
804
+ */
805
+ data?: LinkReferenceData;
806
+ }
807
+ /**
808
+ * Info associated with mdast link reference nodes by the ecosystem.
809
+ */
810
+ export interface LinkReferenceData extends Data {
811
+ }
812
+ /**
813
+ * Markdown list.
814
+ */
815
+ export interface List extends Parent {
816
+ /**
817
+ * Node type of mdast list.
818
+ */
819
+ type: "list";
820
+ /**
821
+ * Whether the items have been intentionally ordered (when `true`), or that
822
+ * the order of items is not important (when `false` or not present).
823
+ */
824
+ ordered?: boolean | null;
825
+ /**
826
+ * The starting number of the list, when the `ordered` field is `true`.
827
+ */
828
+ start?: number | null;
829
+ /**
830
+ * Whether one or more of the children are separated with a blank line from
831
+ * its siblings (when `true`), or not (when `false` or not present).
832
+ */
833
+ spread?: boolean | null;
834
+ /**
835
+ * Children of list.
836
+ */
837
+ children: ListContent[];
838
+ /**
839
+ * Data associated with the mdast list.
840
+ */
841
+ data?: ListData;
842
+ }
843
+ /**
844
+ * Info associated with mdast list nodes by the ecosystem.
845
+ */
846
+ export interface ListData extends Data {
847
+ }
848
+ /**
849
+ * Markdown list item.
850
+ */
851
+ export interface ListItem extends Parent {
852
+ /**
853
+ * Node type of mdast list item.
854
+ */
855
+ type: "listItem";
856
+ /**
857
+ * Whether the item is a tasklist item (when `boolean`).
858
+ *
859
+ * When `true`, the item is complete.
860
+ * When `false`, the item is incomplete.
861
+ */
862
+ checked?: boolean | null;
863
+ /**
864
+ * Whether one or more of the children are separated with a blank line from
865
+ * its siblings (when `true`), or not (when `false` or not present).
866
+ */
867
+ spread?: boolean | null;
868
+ /**
869
+ * Children of list item.
870
+ */
871
+ children: Array<BlockContent | DefinitionContent>;
872
+ /**
873
+ * Data associated with the mdast list item.
874
+ */
875
+ data?: ListItemData;
876
+ }
877
+ /**
878
+ * Info associated with mdast list item nodes by the ecosystem.
879
+ */
880
+ export interface ListItemData extends Data {
881
+ }
882
+ /**
883
+ * Markdown paragraph.
884
+ */
885
+ export interface Paragraph extends Parent {
886
+ /**
887
+ * Node type of mdast paragraph.
888
+ */
889
+ type: "paragraph";
890
+ /**
891
+ * Children of paragraph.
892
+ */
893
+ children: PhrasingContent[];
894
+ /**
895
+ * Data associated with the mdast paragraph.
896
+ */
897
+ data?: ParagraphData;
898
+ }
899
+ /**
900
+ * Info associated with mdast paragraph nodes by the ecosystem.
901
+ */
902
+ export interface ParagraphData extends Data {
903
+ }
904
+ /**
905
+ * Document fragment or a whole document.
906
+ *
907
+ * Should be used as the root of a tree and must not be used as a child.
908
+ */
909
+ export interface Root extends Parent {
910
+ /**
911
+ * Node type of mdast root.
912
+ */
913
+ type: "root";
914
+ /**
915
+ * Data associated with the mdast root.
916
+ */
917
+ data?: RootData;
918
+ }
919
+ /**
920
+ * Info associated with mdast root nodes by the ecosystem.
921
+ */
922
+ export interface RootData extends Data {
923
+ }
924
+ /**
925
+ * Markdown strong.
926
+ */
927
+ export interface Strong extends Parent {
928
+ /**
929
+ * Node type of mdast strong.
930
+ */
931
+ type: "strong";
932
+ /**
933
+ * Children of strong.
934
+ */
935
+ children: PhrasingContent[];
936
+ /**
937
+ * Data associated with the mdast strong.
938
+ */
939
+ data?: StrongData;
940
+ }
941
+ /**
942
+ * Info associated with mdast strong nodes by the ecosystem.
943
+ */
944
+ export interface StrongData extends Data {
945
+ }
946
+ /**
947
+ * Markdown GFM table.
948
+ */
949
+ export interface Table extends Parent {
950
+ /**
951
+ * Node type of mdast GFM table.
952
+ */
953
+ type: "table";
954
+ /**
955
+ * How cells in columns are aligned.
956
+ */
957
+ align?: AlignType[] | null;
958
+ /**
959
+ * Children of GFM table.
960
+ */
961
+ children: TableContent[];
962
+ /**
963
+ * Data associated with the mdast GFM table.
964
+ */
965
+ data?: TableData;
966
+ }
967
+ /**
968
+ * Info associated with mdast GFM table nodes by the ecosystem.
969
+ */
970
+ export interface TableData extends Data {
971
+ }
972
+ /**
973
+ * Markdown GFM table row.
974
+ */
975
+ export interface TableRow extends Parent {
976
+ /**
977
+ * Node type of mdast GFM table row.
978
+ */
979
+ type: "tableRow";
980
+ /**
981
+ * Children of GFM table row.
982
+ */
983
+ children: RowContent[];
984
+ /**
985
+ * Data associated with the mdast GFM table row.
986
+ */
987
+ data?: TableRowData;
988
+ }
989
+ /**
990
+ * Info associated with mdast GFM table row nodes by the ecosystem.
991
+ */
992
+ export interface TableRowData extends Data {
993
+ }
994
+ /**
995
+ * Markdown GFM table cell.
996
+ */
997
+ export interface TableCell extends Parent {
998
+ /**
999
+ * Node type of mdast GFM table cell.
1000
+ */
1001
+ type: "tableCell";
1002
+ /**
1003
+ * Children of GFM table cell.
1004
+ */
1005
+ children: PhrasingContent[];
1006
+ /**
1007
+ * Data associated with the mdast GFM table cell.
1008
+ */
1009
+ data?: TableCellData;
1010
+ }
1011
+ /**
1012
+ * Info associated with mdast GFM table cell nodes by the ecosystem.
1013
+ */
1014
+ export interface TableCellData extends Data {
1015
+ }
1016
+ /**
1017
+ * Markdown text.
1018
+ */
1019
+ export interface Text extends Literal {
1020
+ /**
1021
+ * Node type of mdast text.
1022
+ */
1023
+ type: "text";
1024
+ /**
1025
+ * Data associated with the mdast text.
1026
+ */
1027
+ data?: TextData;
1028
+ }
1029
+ /**
1030
+ * Info associated with mdast text nodes by the ecosystem.
1031
+ */
1032
+ export interface TextData extends Data {
1033
+ }
1034
+ /**
1035
+ * Markdown thematic break (horizontal rule).
1036
+ */
1037
+ export interface ThematicBreak extends Node {
1038
+ /**
1039
+ * Node type of mdast thematic break.
1040
+ */
1041
+ type: "thematicBreak";
1042
+ /**
1043
+ * Data associated with the mdast thematic break.
1044
+ */
1045
+ data?: ThematicBreakData;
1046
+ }
1047
+ /**
1048
+ * Info associated with mdast thematic break nodes by the ecosystem.
1049
+ */
1050
+ export interface ThematicBreakData extends Data {
1051
+ }
1052
+ /**
1053
+ * Markdown YAML.
1054
+ */
1055
+ export interface Yaml extends Literal {
1056
+ /**
1057
+ * Node type of mdast YAML.
1058
+ */
1059
+ type: "yaml";
1060
+ /**
1061
+ * Data associated with the mdast YAML.
1062
+ */
1063
+ data?: YamlData;
1064
+ }
1065
+ /**
1066
+ * Info associated with mdast YAML nodes by the ecosystem.
1067
+ */
1068
+ export interface YamlData extends Data {
1069
+ }
1070
+ /**
1071
+ * Old name of `Yaml` node.
1072
+ *
1073
+ * @deprecated
1074
+ * Please use `Yaml` instead.
1075
+ */
1076
+ export type YAML = Yaml;