@@ -24,7 +24,7 @@ const createQueries = () => {
24
24
* Sanitizes the YAML source by returning the inner YAML content
25
25
* and then parsing it into an API Metadata object and updating the current Metadata
26
26
*
27
- * @param {import('mdast').Html } node A HTML node containing the YAML content
27
+ * @param {import('@types/ mdast').Html } node A HTML node containing the YAML content
28
28
* @param {ReturnType<import('./metadata.mjs').default> } apiEntryMetadata The API entry Metadata
29
29
*/
30
30
const addYAMLMetadata = ( node , apiEntryMetadata ) => {
@@ -42,7 +42,7 @@ const createQueries = () => {
42
42
/**
43
43
* Parse a Heading node into metadata and updates the current metadata
44
44
*
45
- * @param {import('mdast').Heading } node A Markdown heading node
45
+ * @param {import('@types/ mdast').Heading } node A Markdown heading node
46
46
* @param {ReturnType<import('./metadata.mjs').default> } apiEntryMetadata The API entry Metadata
47
47
*/
48
48
const setHeadingMetadata = ( node , apiEntryMetadata ) => {
@@ -57,7 +57,7 @@ const createQueries = () => {
57
57
/**
58
58
* Updates a Markdown link into a HTML link for API docs
59
59
*
60
- * @param {import('mdast').Link } node A Markdown link node
60
+ * @param {import('@types/ mdast').Link } node A Markdown link node
61
61
*/
62
62
const updateMarkdownLink = node => {
63
63
node . url = node . url . replace (
@@ -72,8 +72,8 @@ const createQueries = () => {
72
72
* Updates a Markdown text containing an API type reference
73
73
* into a Markdown link referencing to the correct API docs
74
74
*
75
- * @param {import('mdast').Text } node A Markdown link node
76
- * @param {import('mdast').Parent } parent The parent node
75
+ * @param {import('@types/ mdast').Text } node A Markdown link node
76
+ * @param {import('@types/ mdast').Parent } parent The parent node
77
77
*/
78
78
const updateTypeReference = ( node , parent ) => {
79
79
const replacedTypes = node . value
@@ -104,8 +104,8 @@ const createQueries = () => {
104
104
/**
105
105
* Updates a Markdown Link Reference into an actual Link to the Definition
106
106
*
107
- * @param {import('mdast').LinkReference } node A link reference node
108
- * @param {Array<import('mdast').Definition> } definitions The Definitions of the API Doc
107
+ * @param {import('@types/ mdast').LinkReference } node A link reference node
108
+ * @param {Array<import('@types/ mdast').Definition> } definitions The Definitions of the API Doc
109
109
*/
110
110
const updateLinkReference = ( node , definitions ) => {
111
111
const definition = definitions . find (
@@ -121,7 +121,7 @@ const createQueries = () => {
121
121
/**
122
122
* Parses a Stability Index Entry and updates the current Metadata
123
123
*
124
- * @param {import('mdast').Blockquote } node Thead Link Reference Node
124
+ * @param {import('@types/ mdast').Blockquote } node Thead Link Reference Node
125
125
* @param {ReturnType<import('./metadata.mjs').default> } apiEntryMetadata The API entry Metadata
126
126
*/
127
127
const addStabilityMetadata = ( node , apiEntryMetadata ) => {
@@ -204,44 +204,44 @@ createQueries.QUERIES = {
204
204
205
205
createQueries . UNIST = {
206
206
/**
207
- * @param {import('mdast').Blockquote } blockquote
207
+ * @param {import('@types/ mdast').Blockquote } blockquote
208
208
* @returns {boolean }
209
209
*/
210
210
isStabilityNode : ( { type, children } ) =>
211
211
type === 'blockquote' &&
212
212
createQueries . QUERIES . stabilityIndex . test ( transformNodesToString ( children ) ) ,
213
213
/**
214
- * @param {import('mdast').Html } html
214
+ * @param {import('@types/ mdast').Html } html
215
215
* @returns {boolean }
216
216
*/
217
217
isYamlNode : ( { type, value } ) =>
218
218
type === 'html' && createQueries . QUERIES . yamlInnerContent . test ( value ) ,
219
219
/**
220
- * @param {import('mdast').Text } text
220
+ * @param {import('@types/ mdast').Text } text
221
221
* @returns {boolean }
222
222
*/
223
223
isTextWithType : ( { type, value } ) =>
224
224
type === 'text' && createQueries . QUERIES . normalizeTypes . test ( value ) ,
225
225
/**
226
- * @param {import('mdast').Html } html
226
+ * @param {import('@types/ mdast').Html } html
227
227
* @returns {boolean }
228
228
*/
229
229
isHtmlWithType : ( { type, value } ) =>
230
230
type === 'html' && createQueries . QUERIES . linksWithTypes . test ( value ) ,
231
231
/**
232
- * @param {import('mdast').Link } link
232
+ * @param {import('@types/ mdast').Link } link
233
233
* @returns {boolean }
234
234
*/
235
235
isMarkdownUrl : ( { type, url } ) =>
236
236
type === 'link' && createQueries . QUERIES . markdownUrl . test ( url ) ,
237
237
/**
238
- * @param {import('mdast').Heading } heading
238
+ * @param {import('@types/ mdast').Heading } heading
239
239
* @returns {boolean }
240
240
*/
241
241
isHeading : ( { type, depth } ) =>
242
242
type === 'heading' && depth >= 1 && depth <= 5 ,
243
243
/**
244
- * @param {import('mdast').LinkReference } linkReference
244
+ * @param {import('@types/ mdast').LinkReference } linkReference
245
245
* @returns {boolean }
246
246
*/
247
247
isLinkReference : ( { type, identifier } ) =>
0 commit comments