11/**
2- * @typedef {import('unist ').Parent } UnistParent
3- * @typedef {import('xast').Root } Root
4- * @typedef {import('xast').RootChildMap } RootChildMap
2+ * @typedef {import('xast ').Nodes } Nodes
3+ * @typedef {import('xast').Parents } Parents
4+ * @typedef {import('xast').RootContent } RootContent
55 * @typedef {import('./index.js').State } State
66 */
77
8- /**
9- * @typedef {Root | RootChildMap[keyof RootChildMap] } Node
10- * @typedef {Extract<Node, UnistParent> } Parent
11- * @typedef {Parent['children'][number] } Child
12- */
13-
148import { element } from './element.js'
159import { text } from './text.js'
1610import { comment } from './comment.js'
@@ -35,7 +29,7 @@ const handlers = {
3529/**
3630 * Serialize a node.
3731 *
38- * @param {Node } node
32+ * @param {Nodes } node
3933 * xast node.
4034 * @param {State } state
4135 * Info passed around about the current state.
@@ -63,15 +57,15 @@ export function one(node, state) {
6357/**
6458 * Serialize all children of `parent`.
6559 *
66- * @param {Parent } parent
60+ * @param {Parents } parent
6761 * xast parent node.
6862 * @param {State } state
6963 * Info passed around about the current state.
7064 * @returns {string }
7165 * Serialized XML.
7266 */
7367export function all ( parent , state ) {
74- /** @type {Array<Child > } */
68+ /** @type {Array<RootContent > } */
7569 const children = ( parent && parent . children ) || [ ]
7670 let index = - 1
7771 /** @type {Array<string> } */
0 commit comments