Skip to content

Commit 21a4d41

Browse files
committed
Refactor to use @imports
1 parent 7de410d commit 21a4d41

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

lib/index.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
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-
*
6-
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
7-
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
8-
*
9-
* @typedef {import('../index.js').MdxFlowExpression} MdxFlowExpression
10-
* @typedef {import('../index.js').MdxTextExpression} MdxTextExpression
2+
* @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle} from 'mdast-util-from-markdown'
3+
* @import {Handle as ToMarkdownHandle, Options as ToMarkdownExtension} from 'mdast-util-to-markdown'
4+
* @import {MdxFlowExpression, MdxTextExpression} from '../index.js'
115
*/
126

137
import {ok as assert} from 'devlop'

readme.md

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

391391
```js
392392
/**
393-
* @typedef {import('mdast-util-mdx-expression')}
393+
* @import {} from 'mdast-util-mdx-expression'
394+
* @import {Root} from 'mdast'
394395
*/
395396

396397
import {visit} from 'unist-util-visit'
397398

398-
/** @type {import('mdast').Root} */
399+
/** @type {Root} */
399400
const tree = getMdastNodeSomeHow()
400401

401402
visit(tree, function (node) {

0 commit comments

Comments
 (0)