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' {
9696 mdxJsxTagStack ?: Tag [ ] | undefined
9797 }
9898}
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) {
520520 const tracker = track ( safeOptions )
521521 const selfClosing =
522522 node . name && ( ! node . children || node . children . length === 0 )
523- // @ts -expect-error: to do: register.
524523 const exit = context . enter ( node . type )
525524 let index = - 1
526525 /** @type {Array<string> } */
You can’t perform that action at this time.
0 commit comments