UNPKG

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