1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export as namespace CSSOM;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export function clone(stylesheet: CSSStyleSheet): CSSStyleSheet;
|
12 |
|
13 | export function parse(token: string): CSSStyleSheet;
|
14 |
|
15 | export abstract class StyleSheet {
|
16 | parentStyleSheet: StyleSheet | null;
|
17 | }
|
18 |
|
19 | export class CSSStyleSheet extends StyleSheet {
|
20 | cssRules: CSSRule[];
|
21 |
|
22 | deleteRule(index: number): void;
|
23 | insertRule(rule: string, index?: number): number;
|
24 | }
|
25 |
|
26 | export abstract class CSSRule {
|
27 | readonly cssText: string;
|
28 |
|
29 | parentRule: CSSRule | null;
|
30 | parentStyleSheet: StyleSheet | null;
|
31 |
|
32 | readonly type: number;
|
33 | }
|
34 |
|
35 | export namespace CSSRule {
|
36 |
|
37 | const UNKNOWN_RULE = 0;
|
38 | const STYLE_RULE = 1;
|
39 |
|
40 | const CHARSET_RULE = 2;
|
41 | const IMPORT_RULE = 3;
|
42 | const MEDIA_RULE = 4;
|
43 | const FONT_FACE_RULE = 5;
|
44 | const PAGE_RULE = 6;
|
45 | const KEYFRAMES_RULE = 7;
|
46 | const KEYFRAME_RULE = 8;
|
47 | const MARGIN_RULE = 9;
|
48 | const NAMESPACE_RULE = 10;
|
49 | const COUNTER_STYLE_RULE = 11;
|
50 | const SUPPORTS_RULE = 12;
|
51 | const DOCUMENT_RULE = 13;
|
52 | const FONT_FEATURE_VALUES_RULE = 14;
|
53 | const VIEWPORT_RULE = 15;
|
54 | const REGION_STYLE_RULE = 16;
|
55 | }
|
56 |
|
57 | export class CSSStyleRule extends CSSRule {
|
58 | cssText: string;
|
59 |
|
60 | selectorText: string;
|
61 | style: CSSStyleDeclaration;
|
62 |
|
63 | static parse(ruleText: any): any;
|
64 | readonly type: 1;
|
65 | }
|
66 |
|
67 | export class CSSImportRule extends CSSRule {
|
68 | cssText: string;
|
69 |
|
70 | href: string;
|
71 | media: MediaList;
|
72 | styleSheet: CSSStyleSheet;
|
73 |
|
74 | readonly type: 3;
|
75 | }
|
76 |
|
77 | export class CSSMediaRule extends CSSRule {
|
78 | media: MediaList;
|
79 | cssRules: CSSRule[];
|
80 |
|
81 | readonly type: 4;
|
82 | }
|
83 |
|
84 | export class CSSFontFaceRule extends CSSRule {
|
85 | style: CSSStyleDeclaration;
|
86 |
|
87 | readonly type: 5;
|
88 | }
|
89 |
|
90 | export class CSSKeyframesRule extends CSSRule {
|
91 | name: string;
|
92 | cssRules: CSSRule[];
|
93 |
|
94 | readonly type: 7;
|
95 | }
|
96 |
|
97 | export class CSSKeyframeRule extends CSSRule {
|
98 | keyText: string;
|
99 | style: CSSStyleDeclaration;
|
100 |
|
101 | readonly type: 8;
|
102 | }
|
103 |
|
104 | export class CSSSupportsRule extends CSSRule {
|
105 | conditionText: string;
|
106 | cssRules: CSSRule[];
|
107 |
|
108 | readonly type: 12;
|
109 | }
|
110 |
|
111 |
|
112 | export class CSSDocumentRule extends CSSRule {
|
113 | matcher: MatcherList;
|
114 | cssRules: CSSRule[];
|
115 |
|
116 | readonly type: 13;
|
117 | }
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 | export class CSSHostRule extends CSSRule {
|
124 | cssRules: CSSRule[];
|
125 |
|
126 | readonly type: 1001;
|
127 | }
|
128 |
|
129 | export class CSSStyleDeclaration {
|
130 | cssText: string;
|
131 | length: number;
|
132 | parentRule: CSSRule | null;
|
133 |
|
134 | getPropertyPriority(name: string): string;
|
135 | getPropertyValue(name: string): string;
|
136 | removeProperty(name: string): string;
|
137 | setProperty(name: string, value: string | null, priority?: string | null): void;
|
138 |
|
139 | [index: number]: string;
|
140 | }
|
141 |
|
142 |
|
143 | export class CSSValue {
|
144 |
|
145 | cssText: string;
|
146 | }
|
147 |
|
148 |
|
149 | export class CSSValueExpression extends CSSValue {
|
150 | constructor(token: string, idx: number);
|
151 |
|
152 | parse(): { error: any } | { idx: number; expression: string };
|
153 | }
|
154 |
|
155 |
|
156 | export class MatcherList {
|
157 | length: number;
|
158 | matcherText: string;
|
159 |
|
160 | appendMatcher(matcher: string): void;
|
161 | deleteMatcher(matcher: string): void;
|
162 |
|
163 | [index: number]: string;
|
164 | }
|
165 |
|
166 | export class MediaList {
|
167 | length: number;
|
168 | mediaText: string;
|
169 |
|
170 | appendMedium(medium: string): void;
|
171 | deleteMedium(medium: string): void;
|
172 |
|
173 | [index: number]: string;
|
174 | }
|