File tree 10 files changed +28
-58
lines changed
10 files changed +28
-58
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('css-selector-parser').AstAttribute } AstAttribute
3
- *
4
- * @typedef {import('hast').Element } Element
5
- * @typedef {import('hast').Properties } Properties
6
- *
7
- * @typedef {import('property-information').Info } Info
8
- * @typedef {import('property-information').Schema } Schema
2
+ * @import {AstAttribute} from 'css-selector-parser'
3
+ * @import {Element, Properties} from 'hast'
4
+ * @import {Info, Schema} from 'property-information'
9
5
*/
10
6
11
7
import { stringify as commas } from 'comma-separated-tokens'
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef { import( 'css-selector-parser').AstClassName } AstClassName
3
- * @typedef { import('hast'). Element } Element
2
+ * @import {AstClassName} from 'css-selector-parser'
3
+ * @import { Element} from 'hast'
4
4
*/
5
5
6
6
/** @type {Array<never> } */
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('hast').ElementContent } ElementContent
3
- * @typedef {import('hast').Nodes } Nodes
4
- *
5
- * @typedef {import('unist-util-visit').Visitor<ElementContent> } Visitor
6
- *
7
- * @typedef {import('./index.js').Direction } Direction
8
- * @typedef {import('./index.js').State } State
2
+ * @import {Visitor} from 'unist-util-visit'
3
+ * @import {ElementContent, Nodes} from 'hast'
4
+ * @import {Direction, State} from './index.js'
9
5
*/
10
6
11
7
import { direction } from 'direction'
@@ -112,7 +108,7 @@ export function enterState(state, node) {
112
108
state . editableOrEditingHost = editableOrEditingHost
113
109
}
114
110
115
- /** @type {Visitor } */
111
+ /** @type {Visitor<ElementContent> } */
116
112
function inferDirectionality ( child ) {
117
113
if ( child . type === 'text' ) {
118
114
directionInferred = directionBidi ( child . value )
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('css-selector-parser').AstId } AstId
3
- *
4
- * @typedef {import('hast').Element } Element
2
+ * @import {AstId} from 'css-selector-parser'
3
+ * @import {Element} from 'hast'
5
4
*/
6
5
7
- // Workaround to show references to above types in VS Code.
8
- ''
9
-
10
6
/**
11
7
* Check whether an element has an ID.
12
8
*
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('css-selector-parser').AstSelector } AstSelector
3
- *
4
- * @typedef {import('hast').Element } Element
5
- * @typedef {import('hast').Nodes } Nodes
6
- * @typedef {import('hast').RootContent } RootContent
7
- *
8
- * @typedef {import('property-information').Schema } Schema
2
+ * @import {AstSelector} from 'css-selector-parser'
3
+ * @import {Element, Nodes, RootContent} from 'hast'
4
+ * @import {Schema} from 'property-information'
9
5
*/
10
6
11
7
/**
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('css-selector-parser').AstTagName } AstTagName
3
- *
4
- * @typedef {import('hast').Element } Element
2
+ * @import {AstTagName} from 'css-selector-parser'
3
+ * @import {Element} from 'hast'
5
4
*/
6
5
7
- // Workaround to show references to above types in VS Code.
8
- ''
9
-
10
6
/**
11
7
* Check whether an element has a tag name.
12
8
*
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef { import( 'css-selector-parser').AstSelector } AstSelector
2
+ * @import {AstSelector} from 'css-selector-parser'
3
3
*/
4
4
5
5
import { createParser } from 'css-selector-parser'
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('css-selector-parser').AstPseudoClass } AstPseudoClass
3
- *
4
- * @typedef {import('hast').Element } Element
5
- * @typedef {import('hast').ElementContent } ElementContent
6
- * @typedef {import('hast').Parents } Parents
7
- *
8
- * @typedef {import('./index.js').State } State
2
+ * @import {AstPseudoClass} from 'css-selector-parser'
3
+ * @import {default as NthCheck} from 'nth-check'
4
+ * @import {ElementContent, Element, Parents} from 'hast'
5
+ * @import {State} from './index.js'
9
6
*/
10
7
11
8
import { extendedFilter } from 'bcp-47-match'
@@ -17,7 +14,7 @@ import fauxEsmNthCheck from 'nth-check'
17
14
import { zwitch } from 'zwitch'
18
15
import { walk } from './walk.js'
19
16
20
- /** @type {import('nth-check').default } */
17
+ /** @type {NthCheck } */
21
18
// @ts -expect-error: types are broken.
22
19
const nthCheck = fauxEsmNthCheck . default || fauxEsmNthCheck
23
20
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('css-selector-parser').AstRule } AstRule
3
- *
4
- * @typedef {import('hast').Element } Element
5
- * @typedef {import('hast').Parents } Parents
6
- *
7
- * @typedef {import('./index.js').State } State
2
+ * @import {AstRule} from 'css-selector-parser'
3
+ * @import {Element, Parents} from 'hast'
4
+ * @import {State} from './index.js'
8
5
*/
9
6
10
7
import { attribute } from './attribute.js'
Original file line number Diff line number Diff line change 1
1
/**
2
- * @typedef {import('css-selector-parser').AstRule } AstRule
3
- *
4
- * @typedef {import('hast').Element } Element
5
- * @typedef {import('hast').Nodes } Nodes
6
- * @typedef {import('hast').Parents } Parents
7
- *
8
- * @typedef {import('./index.js').State } State
2
+ * @import {AstRule} from 'css-selector-parser'
3
+ * @import {Element, Nodes, Parents} from 'hast'
4
+ * @import {State} from './index.js'
9
5
*/
10
6
11
7
/**
You can’t perform that action at this time.
0 commit comments