1
1
/**
2
2
* @typedef {import('hast').Root } HastRoot
3
- * @typedef {import('hast').DocType } HastDoctype
3
+ * @typedef {import('hast').RootContent } HastRootContent
4
+ * @typedef {import('hast').Doctype } HastDoctype
4
5
* @typedef {import('hast').Element } HastElement
5
6
* @typedef {import('hast').Text } HastText
6
7
* @typedef {import('hast').Comment } HastComment
7
- * @typedef {import('hast').Content } HastChild
8
+ * @typedef {import('hast').Nodes } HastNodes
8
9
*/
9
10
10
11
/**
11
- * @typedef {HastChild | HastRoot } HastNode
12
- *
13
12
* @callback AfterTransform
14
13
* Callback called when each node is transformed.
15
- * @param {HastNode } hastNode
14
+ * @param {HastNodes } hastNode
16
15
* hast node that was handled.
17
16
* @param {Node } domNode
18
17
* Corresponding DOM node.
@@ -54,7 +53,7 @@ const own = {}.hasOwnProperty
54
53
/**
55
54
* Transform a hast tree to a DOM tree
56
55
*
57
- * @param {HastNode } tree
56
+ * @param {HastNodes } tree
58
57
* Tree to transform.
59
58
* @param {Options | null | undefined } [options]
60
59
* Configuration (optional).
@@ -73,7 +72,7 @@ export function toDom(tree, options) {
73
72
}
74
73
75
74
/**
76
- * @param {HastNode } node
75
+ * @param {HastNodes } node
77
76
* Node to transform.
78
77
* @param {State } state
79
78
* Info passed around about the current state.
@@ -89,7 +88,7 @@ function transform(node, state) {
89
88
/**
90
89
* Transform any hast node.
91
90
*
92
- * @param {HastNode } node
91
+ * @param {HastNodes } node
93
92
* Node to transform.
94
93
* @param {State } state
95
94
* Info passed around about the current state.
@@ -307,7 +306,7 @@ function element(node, state) {
307
306
*
308
307
* @param {Node } node
309
308
* DOM node to append to.
310
- * @param {Array<HastChild > } children
309
+ * @param {Array<HastRootContent > } children
311
310
* hast children.
312
311
* @param {State } state
313
312
* Info passed around about the current state.
0 commit comments