1
1
/**
2
- * @typedef {import('hast').Root } HastRoot
3
- * @typedef {import('hast').Element } HastElement
2
+ * @typedef {import('hast').Root } Root
3
+ * @typedef {import('hast').Element } Element
4
4
* @typedef {import('hast').Properties } Properties
5
- * @typedef {HastRoot['children'][number] } HastChild
6
- * @typedef {import('property-information').html['property'][string] } Info
7
- * @typedef {typeof import('property-information').html } Schema
8
- */
9
-
10
- /**
11
- * @typedef {HastRoot|HastElement } HResult
5
+ * @typedef {Root['children'][number] } Child
6
+ * @typedef {Child|Root } Node
7
+ * @typedef {import('property-information').Info } Info
8
+ * @typedef {import('property-information').Schema } Schema
9
+ *
10
+ * @typedef {Root|Element } HResult
12
11
* @typedef {string|number } HStyleValue
13
12
* @typedef {Object.<string, HStyleValue> } HStyle
14
13
* @typedef {string|number|boolean|null|undefined } HPrimitiveValue
17
16
* @typedef {{[property: string]: HPropertyValue|HStyle} } HProperties
18
17
*
19
18
* @typedef {string|number|null|undefined } HPrimitiveChild
20
- * @typedef {HastChild|HastRoot } HNodeChild
21
- * @typedef {Array.<HPrimitiveChild|HNodeChild> } HArrayChild
22
- * @typedef {HPrimitiveChild|HNodeChild|HArrayChild } HChild
19
+ * @typedef {Array.<Node|HPrimitiveChild> } HArrayChild
20
+ * @typedef {Node|HPrimitiveChild|HArrayChild } HChild
23
21
*/
24
22
25
23
import { find , normalize } from 'property-information'
@@ -42,10 +40,10 @@ export function core(schema, defaultTagName, caseSensitive) {
42
40
const h =
43
41
/**
44
42
* @type {{
45
- * (): HastRoot
46
- * (selector: null|undefined, ...children: HChild[]): HastRoot
47
- * (selector: string, properties: HProperties, ...children: HChild[]): HastElement
48
- * (selector: string, ...children: HChild[]): HastElement
43
+ * (): Root
44
+ * (selector: null|undefined, ...children: HChild[]): Root
45
+ * (selector: string, properties: HProperties, ...children: HChild[]): Element
46
+ * (selector: string, ...children: HChild[]): Element
49
47
* }}
50
48
*/
51
49
(
@@ -59,7 +57,7 @@ export function core(schema, defaultTagName, caseSensitive) {
59
57
*/
60
58
function ( selector , properties , ...children ) {
61
59
var index = - 1
62
- /** @type {HResult|HastElement } */
60
+ /** @type {HResult } */
63
61
var node
64
62
/** @type {string } */
65
63
var key
@@ -202,7 +200,7 @@ function addProperty(schema, properties, key, value) {
202
200
}
203
201
204
202
/**
205
- * @param {Array.<HastChild > } nodes
203
+ * @param {Array.<Child > } nodes
206
204
* @param {HChild } value
207
205
* @returns {void }
208
206
*/
0 commit comments