55 * @typedef {import('unist').Point } Point
66 * @typedef {import('hast').Element } Element
77 * @typedef {import('hast').Root } Root
8- * @typedef {import('hast').Content } Content
8+ * @typedef {import('hast').RootContent } RootContent
9+ * @typedef {import('hast').Nodes } Nodes
910 * @typedef {import('parse5').DefaultTreeAdapterMap } DefaultTreeAdapterMap
1011 * @typedef {import('parse5').Token.ElementLocation } P5ElementLocation
1112 * @typedef {import('parse5').Token.Location } P5Location
1213 */
1314
1415/**
15- * @typedef {Content | Root } Node
1616 * @typedef {DefaultTreeAdapterMap['document'] } P5Document
1717 * @typedef {DefaultTreeAdapterMap['documentFragment'] } P5DocumentFragment
1818 * @typedef {DefaultTreeAdapterMap['documentType'] } P5DocumentType
@@ -72,7 +72,7 @@ const proto = Object.prototype
7272 * `parse5` tree to transform.
7373 * @param {Options | VFile | null | undefined } [options]
7474 * Configuration.
75- * @returns {Node }
75+ * @returns {Nodes }
7676 * hast tree.
7777 */
7878export function fromParse5 ( tree , options ) {
@@ -108,11 +108,11 @@ export function fromParse5(tree, options) {
108108 * Info passed around about the current state.
109109 * @param {P5Node } node
110110 * p5 node.
111- * @returns {Node }
111+ * @returns {Nodes }
112112 * hast node.
113113 */
114114function one ( state , node ) {
115- /** @type {Node } */
115+ /** @type {Nodes } */
116116 let result
117117
118118 switch ( node . nodeName ) {
@@ -151,7 +151,6 @@ function one(state, node) {
151151
152152 case '#documentType' : {
153153 const reference = /** @type {P5DocumentType } */ ( node )
154- // @ts -expect-error Types are out of date.
155154 result = { type : 'doctype' }
156155 patch ( state , reference , result )
157156 return result
@@ -180,12 +179,12 @@ function one(state, node) {
180179 * Info passed around about the current state.
181180 * @param {Array<P5Node> } nodes
182181 * Nodes.
183- * @returns {Array<Content > }
182+ * @returns {Array<RootContent > }
184183 * hast nodes.
185184 */
186185function all ( state , nodes ) {
187186 let index = - 1
188- /** @type {Array<Content > } */
187+ /** @type {Array<RootContent > } */
189188 const result = [ ]
190189
191190 while ( ++ index < nodes . length ) {
@@ -260,7 +259,7 @@ function element(state, node) {
260259 * Info passed around about the current state.
261260 * @param {P5Node } from
262261 * p5 node.
263- * @param {Node } to
262+ * @param {Nodes } to
264263 * hast node.
265264 * @returns {void }
266265 * Nothing.
@@ -281,7 +280,7 @@ function patch(state, from, to) {
281280 *
282281 * @param {State } state
283282 * Info passed around about the current state.
284- * @param {Node } node
283+ * @param {Nodes } node
285284 * hast node.
286285 * @param {P5ElementLocation } location
287286 * p5 location info.
0 commit comments