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