-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathconfig.ts
More file actions
112 lines (98 loc) · 2.88 KB
/
Copy pathconfig.ts
File metadata and controls
112 lines (98 loc) · 2.88 KB
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
import {
CSSLongNativeTranslatableBlockPropKey,
CSSLongNativeTranslatableTextPropKey
} from './property-types';
export type CSSLengthUnit =
| 'cm'
| 'mm'
| 'in'
| 'px'
| 'pt'
| 'pc'
| 'em'
| 'ex'
| 'ch'
| 'rem'
| 'vw'
| 'vh'
| 'vmin'
| 'vmax'
| '%';
export type CSSHardcodedBorderWidth = 'thin' | 'medium' | 'thick';
export type CSSAbsoluteLengthUnit = Extract<
CSSLengthUnit,
'in' | 'cm' | 'mm' | 'px' | 'pt' | 'pc'
>;
export type CSSRelativeHarcodedFontSize = 'smaller' | 'larger';
export type CSSAbsoluteHardcodedFontSize =
| 'xx-small'
| 'x-small'
| 'small'
| 'medium'
| 'large'
| 'x-large'
| 'xx-large';
export type CSSAbsoluteLengthUnitsMultiplicators = Record<
Exclude<CSSAbsoluteLengthUnit, 'px'>,
number
>;
export type CSSPropertyNameList = Array<
CSSLongNativeTranslatableBlockPropKey | CSSLongNativeTranslatableTextPropKey
>;
export interface CSSProcessorConfig {
readonly absoluteLengthUnitsMultiplicators: CSSAbsoluteLengthUnitsMultiplicators;
readonly absoluteBorderWidthsPixelMap: Record<
CSSHardcodedBorderWidth,
number
>;
readonly relativeFontSizesCoefficientMap: Record<
CSSRelativeHarcodedFontSize,
number
>;
readonly absoluteFontSizesPixelMap: Record<
CSSAbsoluteHardcodedFontSize,
number
>;
/**
* Ignore those properties when compiling inline styles. The names should be
* camelCased.
*
* @remarks As of this version, inline styles are considered 100% safe and
* predictable, thus this property is generally not advised.
*/
readonly inlinePropertiesBlacklist: CSSPropertyNameList;
/**
* Allow those properties when compiling inline styles. The names should be
* camelCased.
*
* @remarks When present, inlinePropertiesBlacklist will be ignored.
*/
readonly inlinePropertiesWhitelist: CSSPropertyNameList | null;
/**
* Font size used to compute REM.
*/
readonly rootFontSize: number;
/**
* Do not normalize font family. It's useful when running on the web where
* you can use more than one font family, and it's not as strict as native
* platforms.
*/
readonly skipFontFamilyValidation?: boolean;
/**
* Determine is the provided font is supported on running platform.
*
* @param fontName - The name of the font to validate. Any quotes have been removed.
* @returns `true` when the font is supported on current platform, a string
* when this font should be mapped to another font (such as monospace →
* Menlo), false otherwise.
*/
isFontSupported(fontName: string): boolean | string;
/**
* Enable a per-instance LRU cache for compiled inline CSS strings.
*
* @experimental Disabled by default. Bounded by {@link CSSProcessorConfig.maxCssLruCacheSize}.
*/
readonly enableExperimentalCssLRUCache?: boolean;
/** Max entries in the inline-CSS LRU cache. Defaults to 256. */
readonly maxCssLruCacheSize?: number;
}