11/**
22 * @typedef {import('property-information').Schema } Schema
33 * @typedef {import('hast').Root } HastRoot
4- * @typedef {import('hast').DocType } HastDoctype
4+ * @typedef {import('hast').Doctype } HastDoctype
55 * @typedef {import('hast').Element } HastElement
66 * @typedef {import('hast').Comment } HastComment
77 * @typedef {import('hast').Text } HastText
8- * @typedef {import('hast').Content } HastContent
8+ * @typedef {import('hast').Nodes } HastNodes
99 * @typedef {import('xast').Root } XastRoot
1010 * @typedef {import('xast').Element } XastElement
1111 * @typedef {import('xast').Text } XastText
1212 * @typedef {import('xast').Comment } XastComment
1313 * @typedef {import('xast').Doctype } XastDoctype
1414 * @typedef {import('xast').Attributes } XastAttributes
15- * @typedef {import('xast').RootChildMap } XastRootChildMap
16- * @typedef {import('xast').ElementChildMap } XastElementChildMap
15+ * @typedef {import('xast').RootContent } XastRootContent
16+ * @typedef {import('xast').Nodes } XastNodes
17+ * @typedef {import('xast').ElementContent } XastElementContent
1718 */
1819
1920/**
20- * @typedef {XastRootChildMap[keyof XastRootChildMap] } XastContent
21- * @typedef {XastRoot | XastContent } XastNode
22- * @typedef {HastRoot | HastContent } HastNode
23- *
2421 * @typedef {'html' | 'svg' } Space
2522 * Namespace.
2623 *
@@ -53,7 +50,7 @@ import {zwitch} from 'zwitch'
5350
5451const own = { } . hasOwnProperty
5552
56- /** @type {(node: HastNode , state: State) => XastNode } */
53+ /** @type {(node: HastNodes , state: State) => XastNodes } */
5754const one = zwitch ( 'type' , {
5855 handlers : { root, element, text, comment, doctype} ,
5956 invalid,
@@ -63,11 +60,11 @@ const one = zwitch('type', {
6360/**
6461 * Turn a hast tree into a xast tree.
6562 *
66- * @param {HastNode } tree
63+ * @param {HastNodes } tree
6764 * hast tree to transform.
6865 * @param {Space | Options | null | undefined } [options]
6966 * Configuration.
70- * @returns {XastNode }
67+ * @returns {XastNodes }
7168 * xast tree.
7269 */
7370export function toXast ( tree , options ) {
@@ -116,7 +113,7 @@ function unknown(value) {
116113 * xast node.
117114 */
118115function root ( node , state ) {
119- /** @type {Array<XastContent > } */
116+ /** @type {Array<XastRootContent > } */
120117 const children = [ ]
121118 let index = - 1
122119
@@ -262,7 +259,7 @@ function element(node, state) {
262259 }
263260 }
264261
265- /** @type {Array<XastElementChildMap[keyof XastElementChildMap] > } */
262+ /** @type {Array<XastElementContent > } */
266263 const children = [ ]
267264 let index = - 1
268265
@@ -293,8 +290,8 @@ function element(node, state) {
293290}
294291
295292/**
296- * @param {HastNode } origin
297- * @param {XastNode } node
293+ * @param {HastNodes } origin
294+ * @param {XastNodes } node
298295 * @returns {void }
299296 */
300297function patch ( origin , node ) {
0 commit comments