-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.d.ts
177 lines (168 loc) · 8.78 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import * as CSS from 'csstype';
export interface Style extends FeaturedProperties, PseudoMap {
'@keyframes'?: PropertiesList;
'@font-face'?: FontFace;
}
export interface Properties extends CSS.StandardLonghandPropertiesFallback, CSS.VendorPropertiesFallback {}
type FeaturedProperties = Omit<Properties, keyof ExtendedProperties> &
ExtendedProperties &
Omit<CSS.StandardShorthandPropertiesFallback, keyof ShorthandProperties> &
ShorthandProperties;
interface ExtendedProperties {
animationName?: PropertiesList | Properties['animationName'];
fontFamily?:
| FontFace
| CSS.StandardLonghandProperties['fontFamily']
| Array<FontFace | CSS.StandardLonghandProperties['fontFamily']>;
}
interface ShorthandProperties {
animation?: {
delay?: CSS.StandardLonghandPropertiesFallback['animationDelay'];
direction?: CSS.StandardLonghandPropertiesFallback['animationDirection'];
duration?: CSS.StandardLonghandPropertiesFallback['animationDuration'];
fillMode?: CSS.StandardLonghandPropertiesFallback['animationFillMode'];
iterationCount?: CSS.StandardLonghandPropertiesFallback['animationIterationCount'];
name?: CSS.StandardLonghandPropertiesFallback['animationName'];
playState?: CSS.StandardLonghandPropertiesFallback['animationPlayState'];
timingFunction?: CSS.StandardLonghandPropertiesFallback['animationTimingFunction'];
};
background?: {
attachment?: CSS.StandardLonghandPropertiesFallback['backgroundAttachment'];
blendMode?: CSS.StandardLonghandPropertiesFallback['backgroundBlendMode'];
clip?: CSS.StandardLonghandPropertiesFallback['backgroundClip'];
color?: CSS.StandardLonghandPropertiesFallback['backgroundColor'];
image?: CSS.StandardLonghandPropertiesFallback['backgroundImage'];
origin?: CSS.StandardLonghandPropertiesFallback['backgroundOrigin'];
position?: CSS.StandardLonghandPropertiesFallback['backgroundPosition'];
repeat?: CSS.StandardLonghandPropertiesFallback['backgroundRepeat'];
size?: CSS.StandardLonghandPropertiesFallback['backgroundSize'];
};
border?: {
color?: CSS.StandardShorthandPropertiesFallback['borderColor'];
style?: CSS.StandardShorthandPropertiesFallback['borderStyle'];
width?: CSS.StandardShorthandPropertiesFallback['borderWidth'];
};
borderBottom?: {
color?: CSS.StandardLonghandPropertiesFallback['borderBottomColor'];
style?: CSS.StandardLonghandPropertiesFallback['borderBottomStyle'];
width?: CSS.StandardLonghandPropertiesFallback['borderBottomWidth'];
};
borderImage?: {
outset?: CSS.StandardLonghandPropertiesFallback['borderImageOutset'];
repeat?: CSS.StandardLonghandPropertiesFallback['borderImageRepeat'];
slice?: CSS.StandardLonghandPropertiesFallback['borderImageSlice'];
source?: CSS.StandardLonghandPropertiesFallback['borderImageSource'];
width?: CSS.StandardLonghandPropertiesFallback['borderImageWidth'];
};
borderLeft?: {
color?: CSS.StandardLonghandPropertiesFallback['borderLeftColor'];
style?: CSS.StandardLonghandPropertiesFallback['borderLeftStyle'];
width?: CSS.StandardLonghandPropertiesFallback['borderLeftWidth'];
};
borderRight?: {
color?: CSS.StandardLonghandPropertiesFallback['borderRightColor'];
style?: CSS.StandardLonghandPropertiesFallback['borderRightStyle'];
width?: CSS.StandardLonghandPropertiesFallback['borderRightWidth'];
};
borderTop?: {
color?: CSS.StandardLonghandPropertiesFallback['borderTopColor'];
style?: CSS.StandardLonghandPropertiesFallback['borderTopStyle'];
width?: CSS.StandardLonghandPropertiesFallback['borderTopWidth'];
};
flex?: {
basis?: CSS.StandardLonghandPropertiesFallback['flexBasis'];
direction?: CSS.StandardLonghandPropertiesFallback['flexDirection'];
grow?: CSS.StandardLonghandPropertiesFallback['flexGrow'];
shrink?: CSS.StandardLonghandPropertiesFallback['flexShrink'];
wrap?: CSS.StandardLonghandPropertiesFallback['flexWrap'];
};
font?: {
family?: CSS.StandardLonghandPropertiesFallback['fontFamily'];
featureSettings?: CSS.StandardLonghandPropertiesFallback['fontFeatureSettings'];
kerning?: CSS.StandardLonghandPropertiesFallback['fontKerning'];
languageOverride?: CSS.StandardLonghandPropertiesFallback['fontLanguageOverride'];
variationSettings?: CSS.StandardLonghandPropertiesFallback['fontVariationSettings'];
size?: CSS.StandardLonghandPropertiesFallback['fontSize'];
sizeAdjust?: CSS.StandardLonghandPropertiesFallback['fontSizeAdjust'];
stretch?: CSS.StandardLonghandPropertiesFallback['fontStretch'];
style?: CSS.StandardLonghandPropertiesFallback['fontStyle'];
synthesis?: CSS.StandardLonghandPropertiesFallback['fontSynthesis'];
variant?: CSS.StandardLonghandPropertiesFallback['fontVariant'];
weight?: CSS.StandardLonghandPropertiesFallback['fontWeight'];
};
grid?: {
autoColumns?: CSS.StandardLonghandPropertiesFallback['gridAutoColumns'];
autoFlow?: CSS.StandardLonghandPropertiesFallback['gridAutoFlow'];
autoRows?: CSS.StandardLonghandPropertiesFallback['gridAutoRows'];
column?: CSS.StandardShorthandPropertiesFallback['gridColumn'];
columnGap?: CSS.StandardLonghandPropertiesFallback['gridColumnGap'];
row?: CSS.StandardShorthandPropertiesFallback['gridRow'];
rowGap?: CSS.StandardLonghandPropertiesFallback['gridRowGap'];
template?: CSS.StandardShorthandPropertiesFallback['gridTemplate'];
};
maskBorder?: {
mode?: CSS.StandardLonghandPropertiesFallback['maskBorderMode'];
outset?: CSS.StandardLonghandPropertiesFallback['maskBorderOutset'];
repeat?: CSS.StandardLonghandPropertiesFallback['maskBorderRepeat'];
slice?: CSS.StandardLonghandPropertiesFallback['maskBorderSlice'];
source?: CSS.StandardLonghandPropertiesFallback['maskBorderSource'];
width?: CSS.StandardLonghandPropertiesFallback['maskBorderWidth'];
};
mask?: {
clip?: CSS.StandardLonghandPropertiesFallback['maskClip'];
composite?: CSS.StandardLonghandPropertiesFallback['maskComposite'];
image?: CSS.StandardLonghandPropertiesFallback['maskImage'];
mode?: CSS.StandardLonghandPropertiesFallback['maskMode'];
origin?: CSS.StandardLonghandPropertiesFallback['maskOrigin'];
position?: CSS.StandardLonghandPropertiesFallback['maskPosition'];
repeat?: CSS.StandardLonghandPropertiesFallback['maskRepeat'];
size?: CSS.StandardLonghandPropertiesFallback['maskSize'];
type?: CSS.StandardLonghandPropertiesFallback['maskType'];
};
margin?: {
x?: CSS.StandardLonghandPropertiesFallback['marginLeft'];
y?: CSS.StandardLonghandPropertiesFallback['marginTop'];
top?: CSS.StandardLonghandPropertiesFallback['marginTop'];
right?: CSS.StandardLonghandPropertiesFallback['marginRight'];
bottom?: CSS.StandardLonghandPropertiesFallback['marginBottom'];
left?: CSS.StandardLonghandPropertiesFallback['marginLeft'];
};
offset?: {
anchor?: CSS.StandardLonghandPropertiesFallback['offsetAnchor'];
blockEnd?: CSS.StandardLonghandPropertiesFallback['offsetBlockEnd'];
blockStart?: CSS.StandardLonghandPropertiesFallback['offsetBlockStart'];
inlineEnd?: CSS.StandardLonghandPropertiesFallback['offsetInlineEnd'];
inlineStart?: CSS.StandardLonghandPropertiesFallback['offsetInlineStart'];
distance?: CSS.StandardLonghandPropertiesFallback['offsetDistance'];
path?: CSS.StandardLonghandPropertiesFallback['offsetPath'];
position?: CSS.StandardLonghandPropertiesFallback['offsetPosition'];
rotate?: CSS.StandardLonghandPropertiesFallback['offsetRotate'];
};
outline?: {
color?: CSS.StandardLonghandPropertiesFallback['outlineColor'];
offset?: CSS.StandardLonghandPropertiesFallback['outlineOffset'];
style?: CSS.StandardLonghandPropertiesFallback['outlineStyle'];
width?: CSS.StandardLonghandPropertiesFallback['outlineWidth'];
};
padding?: {
x?: CSS.StandardLonghandPropertiesFallback['paddingLeft'];
y?: CSS.StandardLonghandPropertiesFallback['paddingTop'];
top?: CSS.StandardLonghandPropertiesFallback['paddingTop'];
right?: CSS.StandardLonghandPropertiesFallback['paddingRight'];
bottom?: CSS.StandardLonghandPropertiesFallback['paddingBottom'];
left?: CSS.StandardLonghandPropertiesFallback['paddingLeft'];
};
transition?: {
delay?: CSS.StandardLonghandPropertiesFallback['transitionDelay'];
duration?: CSS.StandardLonghandPropertiesFallback['transitionDuration'];
property?: CSS.StandardLonghandPropertiesFallback['transitionProperty'];
timingFunction?: CSS.StandardLonghandPropertiesFallback['transitionTimingFunction'];
};
}
type PseudoMap = { [P in CSS.SimplePseudos]?: Style };
interface PropertiesList {
[identifier: string]: Properties;
}
type FontFace = Omit<CSS.FontFaceFallback, 'fontFamily'>;
type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;