Skip to content

Commit 45365a2

Browse files
committed
Add expressions, elements, esm to mdast registry
When using this utility, the MDX node types will automatically be added to mdast in the correct places. See DefinitelyTyped/DefinitelyTyped#54421 for more information.
1 parent b27dc8a commit 45365a2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
/**
22
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
33
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
4+
* @typedef {import('mdast-util-mdx-expression').MDXFlowExpression} MDXFlowExpression
5+
* @typedef {import('mdast-util-mdx-expression').MDXTextExpression} MDXTextExpression
6+
* @typedef {import('mdast-util-mdx-jsx').MDXJsxAttributeValueExpression} MDXJsxAttributeValueExpression
7+
* @typedef {import('mdast-util-mdx-jsx').MDXJsxAttribute} MDXJsxAttribute
8+
* @typedef {import('mdast-util-mdx-jsx').MDXJsxExpressionAttribute} MDXJsxExpressionAttribute
9+
* @typedef {import('mdast-util-mdx-jsx').MDXJsxFlowElement} MDXJsxFlowElement
10+
* @typedef {import('mdast-util-mdx-jsx').MDXJsxTextElement} MDXJsxTextElement
11+
* @typedef {import('mdast-util-mdxjs-esm').MDXJSEsm} MDXJSEsm
412
*/
513

614
import {

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ test('mdast -> markdown', (t) => {
218218

219219
t.equal(
220220
toMarkdown(
221-
{type: 'mdxJsxFlowElement', name: 'x'},
221+
{type: 'mdxJsxFlowElement', name: 'x', attributes: [], children: []},
222222
{extensions: [mdxToMarkdown]}
223223
),
224224
'<x/>\n',

0 commit comments

Comments
 (0)