forked from frenic/csstype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypecheck.js
73 lines (65 loc) · 1.65 KB
/
typecheck.js
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
// @flow
import * as CSS from './';
// Fallback due to https://github.com/frenic/csstype/issues/17
type Exact<T> = T & $Shape<T>;
const css: Exact<CSS.Properties<*>> = {
flexGrow: 1,
flexShrink: 1,
flexBasis: '1px',
flexDirection: 'row',
opacity: 1,
top: '1px',
fontWeight: 'normal',
width: 0,
height: '1px',
MozAppearance: 'button',
msOverflowStyle: 'scrollbar',
};
const cssWithFallbackValues: Exact<CSS.PropertiesFallback<*>> = {
flexGrow: [1],
flexShrink: [1],
flexBasis: ['1px'],
flexDirection: ['row'],
opacity: [1],
top: ['1px'],
fontWeight: ['normal'],
width: [0],
height: ['1px'],
MozAppearance: ['button'],
msOverflowStyle: ['scrollbar'],
};
const cssWithHyphenProperties: Exact<CSS.PropertiesHyphen<*>> = {
'flex-grow': 1,
'flex-shrink': 0,
'flex-basis': '1px',
'flex-direction': 'row',
opacity: 1,
top: '1px',
'font-weight': 'normal',
width: 0,
height: '1px',
'-moz-appearance': 'button',
'-ms-overflow-style': 'scrollbar',
};
const cssWithBothCamelAndHyphenProperties: $Exact<CSS.Properties<*>> & $Exact<CSS.PropertiesHyphen<*>> = {
animation: '',
};
const atRuleFontFace: $Exact<CSS.FontFace> = {
fontFamily: '',
fontWeight: 'normal',
};
type X =
| CSS.Globals
| CSS.BorderColorProperty
| CSS.BorderStyleProperty
| CSS.BorderWidthProperty<string>
| CSS.BorderBlockStartStyleProperty
| CSS.BackgroundImageProperty
| CSS.BackgroundPositionProperty<string>
| CSS.BackgroundSizeProperty<string>
| CSS.BackgroundRepeatProperty
| CSS.BackgroundOriginProperty
| CSS.BackgroundClipProperty
| CSS.BackgroundAttachmentProperty
| CSS.ColorProperty
| CSS.WidthProperty<string>;