import CSSTree, { CssLocation, List } from "css-tree"; import { Range } from "./range"; type ToESTree = Omit< Node, "type" | "children" > & { range: Range; loc: CssLocation; }; export type AnyCssNode = | CssStyleSheet | CssSelectorList | CssSelector | CssBlock | CssDeclaration | CssCombinator; export type CssStyleSheet = ToESTree & { parent?: AnyCssNode; type: "CssStyleSheet"; children: List; }; export type CssSelectorList = ToESTree & { parent?: AnyCssNode; type: "CssSelectorList"; children: List; }; export type CssSelector = ToESTree & { parent?: AnyCssNode; type: "CssSelector"; children: List; }; export type CssBlock = ToESTree & { parent?: AnyCssNode; type: "CssBlock"; children: AnyCssNode[]; }; export type CssDeclaration = ToESTree & { parent?: AnyCssNode; type: "CssDeclaration"; children: List; }; export type CssCombinator = ToESTree & { parent?: AnyCssNode; type: "CssCombinator"; loc?: CssLocation | null; };