File tree Expand file tree Collapse file tree 10 files changed +28
-58
lines changed Expand file tree Collapse file tree 10 files changed +28
-58
lines changed Original file line number Diff line number Diff line change 11/**
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'
95 */
106
117import { stringify as commas } from 'comma-separated-tokens'
Original file line number Diff line number Diff line change 11/**
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'
44 */
55
66/** @type {Array<never> } */
Original file line number Diff line number Diff line change 11/**
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'
95 */
106
117import { direction } from 'direction'
@@ -112,7 +108,7 @@ export function enterState(state, node) {
112108 state . editableOrEditingHost = editableOrEditingHost
113109 }
114110
115- /** @type {Visitor } */
111+ /** @type {Visitor<ElementContent> } */
116112 function inferDirectionality ( child ) {
117113 if ( child . type === 'text' ) {
118114 directionInferred = directionBidi ( child . value )
Original file line number Diff line number Diff line change 11/**
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'
54 */
65
7- // Workaround to show references to above types in VS Code.
8- ''
9-
106/**
117 * Check whether an element has an ID.
128 *
Original file line number Diff line number Diff line change 11/**
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'
95 */
106
117/**
Original file line number Diff line number Diff line change 11/**
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'
54 */
65
7- // Workaround to show references to above types in VS Code.
8- ''
9-
106/**
117 * Check whether an element has a tag name.
128 *
Original file line number Diff line number Diff line change 11/**
2- * @typedef { import( 'css-selector-parser').AstSelector } AstSelector
2+ * @import {AstSelector} from 'css-selector-parser'
33 */
44
55import { createParser } from 'css-selector-parser'
Original file line number Diff line number Diff line change 11/**
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'
96 */
107
118import { extendedFilter } from 'bcp-47-match'
@@ -17,7 +14,7 @@ import fauxEsmNthCheck from 'nth-check'
1714import { zwitch } from 'zwitch'
1815import { walk } from './walk.js'
1916
20- /** @type {import('nth-check').default } */
17+ /** @type {NthCheck } */
2118// @ts -expect-error: types are broken.
2219const nthCheck = fauxEsmNthCheck . default || fauxEsmNthCheck
2320
Original file line number Diff line number Diff line change 11/**
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'
85 */
96
107import { attribute } from './attribute.js'
Original file line number Diff line number Diff line change 11/**
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'
95 */
106
117/**
You can’t perform that action at this time.
0 commit comments