Skip to content

Commit f952db1

Browse files
committed
Refactor to use @imports
1 parent ce46103 commit f952db1

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

lib/index.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
/**
2-
* @typedef {import('mdast').Nodes} Nodes
3-
* @typedef {import('mdast').Paragraph} Paragraph
4-
*
5-
* @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
6-
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
7-
* @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
8-
* @typedef {import('mdast-util-from-markdown').Token} Token
9-
*
10-
* @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName
11-
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
12-
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
13-
* @typedef {import('mdast-util-to-markdown').State} State
14-
*
15-
* @typedef {import('../index.js').Directives} Directives
16-
* @typedef {import('../index.js').LeafDirective} LeafDirective
17-
* @typedef {import('../index.js').TextDirective} TextDirective
2+
* @import {Directives, LeafDirective, TextDirective} from 'mdast-util-directive'
3+
* @import {
4+
* CompileContext,
5+
* Extension as FromMarkdownExtension,
6+
* Handle as FromMarkdownHandle,
7+
* Token
8+
* } from 'mdast-util-from-markdown'
9+
* @import {
10+
* ConstructName,
11+
* Handle as ToMarkdownHandle,
12+
* Options as ToMarkdownExtension,
13+
* State
14+
* } from 'mdast-util-to-markdown'
15+
* @import {Nodes, Paragraph} from 'mdast'
1816
*/
1917

2018
import {ok as assert} from 'devlop'

readme.md

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

430430
```js
431431
/**
432-
* @typedef {import('mdast-util-directive')}
432+
* @import {} from 'mdast-util-directive'
433+
* @import {Root} from 'mdast'
433434
*/
434435

435436
import {visit} from 'unist-util-visit'
436437

437-
/** @type {import('mdast').Root} */
438+
/** @type {Root} */
438439
const tree = getMdastNodeSomeHow()
439440

440441
visit(tree, function (node) {

0 commit comments

Comments
 (0)