Skip to content

Commit 8892b29

Browse files
committed
Refactor to use @imports
1 parent c855537 commit 8892b29

37 files changed

+118
-260
lines changed

lib/handlers/a.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
*
4-
* @typedef {import('mdast').Link} Link
5-
* @typedef {import('mdast').PhrasingContent} PhrasingContent
6-
*
7-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Element} from 'hast'
4+
* @import {Link, PhrasingContent} from 'mdast'
85
*/
96

10-
// Fix to let VS Code see references to the above types.
11-
''
12-
137
/**
148
* @param {State} state
159
* State.

lib/handlers/base.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
*
4-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Element} from 'hast'
54
*/
65

7-
// Fix to let VS Code see references to the above types.
8-
''
9-
106
/**
117
* @param {State} state
128
* State.

lib/handlers/blockquote.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
*
4-
* @typedef {import('mdast').Blockquote} Blockquote
5-
*
6-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Element} from 'hast'
4+
* @import {Blockquote} from 'mdast'
75
*/
86

9-
// Fix to let VS Code see references to the above types.
10-
''
11-
127
/**
138
* @param {State} state
149
* State.

lib/handlers/br.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
*
4-
* @typedef {import('mdast').Break} Break
5-
*
6-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Element} from 'hast'
4+
* @import {Break} from 'mdast'
75
*/
86

9-
// Fix to let VS Code see references to the above types.
10-
''
11-
127
/**
138
* @param {State} state
149
* State.

lib/handlers/code.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
*
4-
* @typedef {import('mdast').Code} Code
5-
*
6-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Element} from 'hast'
4+
* @import {Code} from 'mdast'
75
*/
86

97
import {toText} from 'hast-util-to-text'

lib/handlers/comment.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
/**
2-
* @typedef {import('hast').Comment} Comment
3-
*
4-
* @typedef {import('mdast').Html} Html
5-
*
6-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Comment} from 'hast'
4+
* @import {Html} from 'mdast'
75
*/
86

9-
// Fix to let VS Code see references to the above types.
10-
''
11-
127
/**
138
* @param {State} state
149
* State.

lib/handlers/del.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
*
4-
* @typedef {import('mdast').Delete} Delete
5-
* @typedef {import('mdast').PhrasingContent} PhrasingContent
6-
*
7-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Element} from 'hast'
4+
* @import {Delete, PhrasingContent} from 'mdast'
85
*/
96

10-
// Fix to let VS Code see references to the above types.
11-
''
12-
137
/**
148
* @param {State} state
159
* State.

lib/handlers/dl.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
* @typedef {import('hast').ElementContent} ElementContent
4-
*
5-
* @typedef {import('mdast').BlockContent} BlockContent
6-
* @typedef {import('mdast').DefinitionContent} DefinitionContent
7-
* @typedef {import('mdast').List} List
8-
* @typedef {import('mdast').ListContent} ListContent
9-
* @typedef {import('mdast').ListItem} ListItem
10-
*
11-
* @typedef {import('../state.js').State} State
12-
*
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {ElementContent, Element} from 'hast'
4+
* @import {BlockContent, DefinitionContent, ListContent, ListItem, List} from 'mdast'
135
*/
146

157
/**

lib/handlers/em.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
*
4-
* @typedef {import('mdast').Emphasis} Emphasis
5-
* @typedef {import('mdast').PhrasingContent} PhrasingContent
6-
*
7-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Element} from 'hast'
4+
* @import {Emphasis, PhrasingContent} from 'mdast'
85
*/
96

10-
// Fix to let VS Code see references to the above types.
11-
''
12-
137
/**
148
* @param {State} state
159
* State.

lib/handlers/heading.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
/**
2-
* @typedef {import('hast').Element} Element
3-
*
4-
* @typedef {import('mdast').Heading} Heading
5-
* @typedef {import('mdast').PhrasingContent} PhrasingContent
6-
*
7-
* @typedef {import('../state.js').State} State
2+
* @import {State} from 'hast-util-to-mdast'
3+
* @import {Element} from 'hast'
4+
* @import {Heading, PhrasingContent} from 'mdast'
85
*/
96

10-
// Fix to let VS Code see references to the above types.
11-
''
12-
137
/**
148
* @param {State} state
159
* State.

0 commit comments

Comments
 (0)