File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -96,3 +96,29 @@ declare module 'mdast-util-from-markdown' {
96
96
mdxJsxTagStack ?: Tag [ ] | undefined
97
97
}
98
98
}
99
+
100
+ // Add custom data tracked to turn a syntax tree into markdown.
101
+ declare module 'mdast-util-to-markdown' {
102
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
103
+ interface ConstructNameMap {
104
+ /**
105
+ * Whole JSX element, in flow.
106
+ *
107
+ * ```markdown
108
+ * > | <a />
109
+ * ^^^^^
110
+ * ```
111
+ */
112
+ mdxJsxFlowElement : 'mdxJsxFlowElement'
113
+
114
+ /**
115
+ * Whole JSX element, in text.
116
+ *
117
+ * ```markdown
118
+ * > | a <b />.
119
+ * ^^^^^
120
+ * ```
121
+ */
122
+ mdxJsxTextElement : 'mdxJsxTextElement'
123
+ }
124
+ }
Original file line number Diff line number Diff line change @@ -520,7 +520,6 @@ export function mdxJsxToMarkdown(options) {
520
520
const tracker = track ( safeOptions )
521
521
const selfClosing =
522
522
node . name && ( ! node . children || node . children . length === 0 )
523
- // @ts -expect-error: to do: register.
524
523
const exit = context . enter ( node . type )
525
524
let index = - 1
526
525
/** @type {Array<string> } */
You can’t perform that action at this time.
0 commit comments