Skip to content

Commit d1cecb6

Browse files
committed
Refactor to use @imports
1 parent 965180a commit d1cecb6

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

index.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import type {
44
BlockContent,
55
Data as MdastData,
66
DefinitionContent,
7-
Literal as MdastLiteral,
8-
Node as MdastNode,
97
Parent as MdastParent,
108
PhrasingContent
119
} from 'mdast'

lib/index.js

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
11
/**
2-
* @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
3-
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
4-
* @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
5-
* @typedef {import('mdast-util-from-markdown').OnEnterError} OnEnterError
6-
* @typedef {import('mdast-util-from-markdown').OnExitError} OnExitError
7-
* @typedef {import('mdast-util-from-markdown').Token} Token
8-
*
9-
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
10-
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
11-
* @typedef {import('mdast-util-to-markdown').State} State
12-
* @typedef {import('mdast-util-to-markdown').Tracker} Tracker
13-
*
14-
* @typedef {import('unist').Point} Point
15-
*
16-
* @typedef {import('../index.js').MdxJsxAttribute} MdxJsxAttribute
17-
* @typedef {import('../index.js').MdxJsxAttributeValueExpression} MdxJsxAttributeValueExpression
18-
* @typedef {import('../index.js').MdxJsxExpressionAttribute} MdxJsxExpressionAttribute
19-
* @typedef {import('../index.js').MdxJsxFlowElement} MdxJsxFlowElement
20-
* @typedef {import('../index.js').MdxJsxTextElement} MdxJsxTextElement
2+
* @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, OnEnterError, OnExitError, Token} from 'mdast-util-from-markdown'
3+
* @import {Handle as ToMarkdownHandle, Options as ToMarkdownExtension, State, Tracker} from 'mdast-util-to-markdown'
4+
* @import {Point} from 'unist'
5+
* @import {MdxJsxAttribute, MdxJsxAttributeValueExpression, MdxJsxExpressionAttribute, MdxJsxFlowElement, MdxJsxTextElement} from '../index.js'
216
*/
227

238
/**

readme.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,13 @@ somewhere in your types, as that registers the new node types in the tree.
562562

563563
```js
564564
/**
565-
* @typedef {import('mdast-util-mdx-jsx')}
565+
* @import {} from 'mdast-util-mdx-jsx'
566+
* @import {Root} from 'mdast'
566567
*/
567568

568569
import {visit} from 'unist-util-visit'
569570

570-
/** @type {import('mdast').Root} */
571+
/** @type {Root} */
571572
const tree = getMdastNodeSomeHow()
572573

573574
visit(tree, function (node) {
@@ -582,7 +583,7 @@ versions of Node.js.
582583

583584
When we cut a new major release, we drop support for unmaintained versions of
584585
Node.
585-
This means we try to keep the current release line, `mdast-util-mdx-jsx@^3`,
586+
This means we try to keep the current release line, `mdast-util-mdx-jsx@3`,
586587
compatible with Node.js 16.
587588

588589
This utility works with `mdast-util-from-markdown` version 2+ and

0 commit comments

Comments
 (0)