UNPKG

1.63 kBJavaScriptView Raw
1declare class postcss$node {
2 raw: Function;
3 raws: Object;
4 type: "rule" | "atrule" | "root" | "comment" | "decl";
5 parent: Object;
6 nodes: Array<Object>;
7 next(): postcss$node | void;
8 prev(): postcss$node | void;
9 source: {
10 start: {
11 line: number,
12 column: number
13 },
14 end: {
15 line: number,
16 column: number
17 }
18 };
19 error(message: string, options: { plugin: string }): void;
20}
21
22declare class postcss$comment extends postcss$node {
23 text: string;
24 raws: {
25 before?: string,
26 after?: string
27 };
28}
29
30declare class postcss$atRule extends postcss$node {
31 name: string;
32 params: string;
33 raws: {
34 before?: string,
35 after?: string,
36 afterName?: string
37 };
38}
39
40declare class postcss$rule extends postcss$node {
41 selector: string;
42 raws: {
43 before?: string,
44 after?: string
45 };
46}
47
48declare class postcss$decl extends postcss$node {
49 prop: string;
50 value: string;
51 raws: {
52 before?: string,
53 after?: string
54 };
55}
56
57declare function postcss$parser(
58 css: ?string,
59 opts: postcss$options
60): postcss$node;
61
62declare function postcss$stringifier(postcss$node, builder: Function): void;
63
64export type postcss$syntax = {
65 stringify?: postcss$stringifier,
66 parse?: postcss$parser
67};
68
69export type postcss$options = {
70 from?: string,
71 to?: string,
72 parser?: postcss$parser,
73 stringifier?: postcss$stringifier,
74 syntax?: postcss$syntax,
75 map?: Object
76};
77
78export type postcss$result = {
79 css: string,
80 root: Object,
81 stylelint: {
82 disabledRanges: disabledRangeObject,
83 ruleSeverities?: Object,
84 customMessages?: Object,
85 quiet?: boolean
86 }
87};