Skip to content

Commit 53e9124

Browse files
committed
fix(styles): fixed missing types on parser services
1 parent baf2b4b commit 53e9124

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/parser/index.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { KEYS } from "../visitor-keys.js";
22
import { Context } from "../context/index.js";
33
import type {
44
Comment,
5+
SourceLocation,
56
SvelteProgram,
67
SvelteScriptElement,
78
SvelteStyleElement,
@@ -10,8 +11,11 @@ import type {
1011
import type { Program } from "estree";
1112
import type { ScopeManager } from "eslint-scope";
1213
import { Variable } from "eslint-scope";
13-
import type { Rule } from "postcss";
14-
import type { Root as SelectorRoot } from "postcss-selector-parser";
14+
import type { Rule, Node } from "postcss";
15+
import type {
16+
Node as SelectorNode,
17+
Root as SelectorRoot,
18+
} from "postcss-selector-parser";
1519
import { parseScript, parseScriptInSvelte } from "./script.js";
1620
import type * as SvAST from "./svelte-ast-types.js";
1721
import type * as Compiler from "./svelte-ast-types-for-v5.js";
@@ -89,6 +93,11 @@ type ParseResult = {
8993
getSvelteHtmlAst: () => SvAST.Fragment | Compiler.Fragment;
9094
getStyleContext: () => StyleContext;
9195
getStyleSelectorAST: (rule: Rule) => SelectorRoot;
96+
styleNodeLoc: (node: Node) => Partial<SourceLocation>;
97+
styleNodeRange: (
98+
node: Node,
99+
) => [number | undefined, number | undefined];
100+
styleSelectorNodeLoc: (node: SelectorNode) => Partial<SourceLocation>;
92101
svelteParseContext: SvelteParseContext;
93102
}
94103
| {

0 commit comments

Comments
 (0)