|
1 | 1 | /** |
2 | | - * @typedef {import('css-selector-parser').AstAttribute} AstAttribute |
3 | | - * @typedef {import('css-selector-parser').AstRule} AstRule |
4 | | - * |
5 | | - * @typedef {import('hast').Element} HastElement |
6 | | - * @typedef {import('hast').Properties} HastProperties |
| 2 | + * @import {AstAttribute, AstRule} from 'css-selector-parser' |
| 3 | + * @import {Element, Properties} from 'hast' |
7 | 4 | */ |
8 | 5 |
|
9 | 6 | /** |
10 | 7 | * @typedef Options |
11 | 8 | * Configuration. |
12 | | - * @property {Space} [space] |
| 9 | + * @property {Space | null | undefined} [space] |
13 | 10 | * Which space first element in the selector is in (default: `'html'`). |
14 | 11 | * |
15 | 12 | * When an `svg` element is created in HTML, the space is automatically |
@@ -40,7 +37,7 @@ const emptyOptions = {} |
40 | 37 | * CSS selector (default: `''`). |
41 | 38 | * @param {Options | null | undefined} [options] |
42 | 39 | * Configuration (optional). |
43 | | - * @returns {HastElement} |
| 40 | + * @returns {Element} |
44 | 41 | * Built tree. |
45 | 42 | */ |
46 | 43 | export function fromSelector(selector, options) { |
@@ -78,7 +75,7 @@ export function fromSelector(selector, options) { |
78 | 75 | * Selector. |
79 | 76 | * @param {State} state |
80 | 77 | * Info on current context. |
81 | | - * @returns {Array<HastElement>} |
| 78 | + * @returns {Array<Element>} |
82 | 79 | * One or more elements. |
83 | 80 | */ |
84 | 81 | function rule(query, state) { |
@@ -138,11 +135,11 @@ function rule(query, state) { |
138 | 135 | * |
139 | 136 | * @param {Array<AstAttribute> | undefined} attributes |
140 | 137 | * Attribute selectors. |
141 | | - * @returns {HastProperties} |
| 138 | + * @returns {Properties} |
142 | 139 | * Properties. |
143 | 140 | */ |
144 | 141 | function attributesToHast(attributes) { |
145 | | - /** @type {HastProperties} */ |
| 142 | + /** @type {Properties} */ |
146 | 143 | const properties = {} |
147 | 144 | let index = -1 |
148 | 145 |
|
|
0 commit comments