1 | export interface Position {
|
2 | start: { line: number; column: number };
|
3 | end: { line: number; column: number };
|
4 | }
|
5 |
|
6 | export interface Node {
|
7 | type: 'rule' | 'keyframes' | 'declaration' | 'import' | 'media';
|
8 | position: Position;
|
9 | }
|
10 |
|
11 | export interface Declaration extends Node {
|
12 | property: string;
|
13 | value: string;
|
14 | }
|
15 |
|
16 | export interface Rule extends Node {
|
17 | selectors: string[];
|
18 | declarations: Declaration[];
|
19 | }
|
20 |
|
21 | export type AtRule = KeyFrames | Media;
|
22 |
|
23 | export interface Keyframes extends Rule {
|
24 | name: string;
|
25 | vendor?: string;
|
26 | keyframes?: Array<KeyFrame>;
|
27 | }
|
28 |
|
29 | export interface KeyFrame extends Node {
|
30 | values: string[];
|
31 | declarations: Array<Declaration>;
|
32 | }
|
33 |
|
34 | export interface Media extends Node {
|
35 | media: string;
|
36 | rules: Array<Rule | AtRule>;
|
37 | }
|
38 |
|
39 | export interface StyleSheet {
|
40 | rules: Rule[];
|
41 | }
|
42 |
|
43 | export interface SyntaxTree {
|
44 | stylesheet: StyleSheet;
|
45 | }
|
46 |
|
47 | export function parse(css: string, options: any): SyntaxTree;
|