-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
90 lines (80 loc) · 2.19 KB
/
types.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
/**
* Generates a scale based on the given configuration.
*
* @param {ScaleConfig} config - The configuration for generating the scale.
* @returns {Object<string, string>} The generated scale.
*/
export function generateScale(config: ScaleConfig): { [key: string]: string };
/**
* Scale configuration for the scale generator.
*
* @property {string} [classPrefix=""] - Prefix to be added to the class names.
* @property {string} [classSuffix] - Suffix to be added to the class names.
* @property {string} [unit] - Unit of measurement.
* @property {number} [scale] - The scale factor.
* @property {number} [from] - The starting value of the scale.
* @property {number} [to] - The ending value of the scale.
* @property {IncrementConfig} [increment] - Increment configuration.
*/
export type ScaleConfig = {
/**
* Prefix to be added to the class names.
* @default ""
*/
classPrefix?: string,
/**
* Suffix to be added to the class names.
* @default ""
*/
classSuffix?: string,
/**
* Unit of measurement.
* @default "rem"
*/
unit?: string,
/**
* The scale factor.
* @default 4
*/
scale?: number,
/**
* The starting value of the scale.
* @default 0
*/
from?: number,
/**
* The ending value of the scale.
* @default 256
*/
to?: number,
/**
* Increment configuration.
* @default { default: 1, below: { 5: 0.5 }, above: { 100: 2, 200: 4 } }
*/
increment?: IncrementConfig
};
/**
* Increment configuration for the scale generator.
*
* @property {number} default - The default increment value.
* @property {Object<number, number>} [below] - Increment values for sizes below certain thresholds.
* @property {Object<number, number>} [above] - Increment values for sizes above certain thresholds.
*/
export type IncrementConfig = {
/**
* The default increment value.
*/
default: number,
/**
* Increment values for sizes below certain thresholds.
*/
below?: {
[key: number]: number
},
/**
* Increment values for sizes above certain thresholds.
*/
above?: {
[key: number]: number
}
};