Skip to content

Commit 243f4c4

Browse files
committed
fix(styles): fixed missing types on parser services
1 parent 0c66ec6 commit 243f4c4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/parser/index.ts

Lines changed: 11 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy