dothtml-interfaces 0.4.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +6 -4
- package/src/bindings/{i-binding.d.ts → i-binding.ts} +11 -11
- package/src/bindings/{i-observer.d.ts → i-observer.ts} +2 -2
- package/src/bindings/{i-reactive.d.ts → i-reactive.ts} +4 -4
- package/src/bindings/i-ref.ts +5 -0
- package/src/bindings/{i-watcher.d.ts → i-watcher.ts} +52 -38
- package/src/{i-dot-component.d.ts → i-dot-component.ts} +113 -84
- package/src/{i-dot.d.ts → i-dot.ts} +1041 -1047
- package/src/{i-event-bus.d.ts → i-event-bus.ts} +10 -10
- package/src/{index.d.ts → index.ts} +14 -14
- package/src/styles/at-rules/{i-at-color-profile-builder.d.ts → i-at-color-profile-builder.ts} +4 -4
- package/src/styles/at-rules/{i-at-counter-style-builder.d.ts → i-at-counter-style-builder.ts} +14 -14
- package/src/styles/at-rules/{i-at-font-family-builder.d.ts → i-at-font-family-builder.ts} +18 -18
- package/src/styles/at-rules/{i-at-font-palette-values.d.ts → i-at-font-palette-values.ts} +5 -5
- package/src/styles/at-rules/{i-at-keyframes-builder.d.ts → i-at-keyframes-builder.ts} +7 -7
- package/src/styles/at-rules/{i-at-page-builder.d.ts → i-at-page-builder.ts} +19 -19
- package/src/styles/complex-css-types/{i-filter-prop.d.ts → i-filter-prop.ts} +19 -19
- package/src/styles/complex-css-types/{i-shadow-prop.d.ts → i-shadow-prop.ts} +11 -11
- package/src/styles/complex-css-types/{i-transformation-prop.d.ts → i-transformation-prop.ts} +32 -32
- package/src/styles/{css-types.d.ts → css-types.ts} +141 -142
- package/src/styles/{i-css-prop.d.ts → i-css-prop.ts} +295 -295
- package/src/styles/{i-dot-css.d.ts → i-dot-css.ts} +218 -214
- package/src/styles/mapped-types/{angle-prop.d.ts → angle-prop.ts} +15 -15
- package/src/styles/mapped-types/{color-props.d.ts → color-props.ts} +60 -60
- package/src/styles/mapped-types/{length-prop.d.ts → length-prop.ts} +21 -20
- package/src/bindings/i-ref.d.ts +0 -4
|
@@ -1,143 +1,142 @@
|
|
|
1
|
-
import { IBinding } from "../bindings/i-binding";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// export type
|
|
20
|
-
// export type
|
|
21
|
-
// export type
|
|
22
|
-
// export type
|
|
23
|
-
// export type
|
|
24
|
-
// export type
|
|
25
|
-
// export type
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
// export type
|
|
31
|
-
//
|
|
32
|
-
// |"
|
|
33
|
-
// |"
|
|
34
|
-
//
|
|
35
|
-
// export type
|
|
36
|
-
// export type
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export type
|
|
41
|
-
export type
|
|
42
|
-
export type
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export type
|
|
50
|
-
export type
|
|
51
|
-
export type
|
|
52
|
-
export type
|
|
53
|
-
export type
|
|
54
|
-
export type
|
|
55
|
-
export type
|
|
56
|
-
export type
|
|
57
|
-
export type
|
|
58
|
-
export type
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
export type
|
|
67
|
-
export type
|
|
68
|
-
export type
|
|
69
|
-
export type
|
|
70
|
-
export type
|
|
71
|
-
export type
|
|
72
|
-
export type
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
export type
|
|
77
|
-
export type
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
export type
|
|
83
|
-
export type
|
|
84
|
-
export type
|
|
85
|
-
export type
|
|
86
|
-
export type
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
//
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
// export type
|
|
104
|
-
// export type
|
|
105
|
-
// export type CalcValue
|
|
106
|
-
// export type
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
// export type
|
|
110
|
-
// export type
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
// export type
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
export type
|
|
119
|
-
export type
|
|
120
|
-
export type
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
| `${DisplayOutside} ${DisplayFlow}
|
|
134
|
-
| `${DisplayOutside} list-item
|
|
135
|
-
| `${DisplayFlow} ${DisplayOutside}
|
|
136
|
-
|
|
|
137
|
-
| `list-item ${
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
export type
|
|
142
|
-
export type CustomIdent = string;
|
|
1
|
+
import { IBinding } from "../bindings/i-binding";
|
|
2
|
+
import { IWatcher } from "../bindings/i-watcher";
|
|
3
|
+
|
|
4
|
+
// Global keyword values.
|
|
5
|
+
export type GKV = IWatcher<string>|IBinding<any, string>|"inherit"|"initial"|"unset"|"revert"|"revert-layer";
|
|
6
|
+
|
|
7
|
+
export type ComplexType = string;
|
|
8
|
+
|
|
9
|
+
export type ValueOrReactive<T> = T|IBinding<any, T>|IWatcher<T>;
|
|
10
|
+
|
|
11
|
+
// BASIC TYPES
|
|
12
|
+
export type Str = `"${string|""}"`|`'${string|""}'`; // TODO: wherever str is required, we could just inject quotes...
|
|
13
|
+
export type Int = number;
|
|
14
|
+
export type Percentage = `${number}%`;
|
|
15
|
+
export type AlphaValue = number | Percentage; // Number should be interpreted as a decimal (x/1);
|
|
16
|
+
export type Ratio = number|`${number}/${number}`;
|
|
17
|
+
|
|
18
|
+
// export type DigitStr = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9";
|
|
19
|
+
// export type HexStr = DigitStr|"A"|"B"|"C"|"D"|"E"|"F"|"a"|"b"|"c"|"d"|"e"|"f";
|
|
20
|
+
// export type Hex2 = `${HexStr}${HexStr}`;
|
|
21
|
+
// export type Hex3 = `${Hex2}${HexStr}`;
|
|
22
|
+
// export type Hex4 = `${Hex3}${HexStr}`;
|
|
23
|
+
// export type Hex5 = `${Hex4}${HexStr}`;
|
|
24
|
+
// export type Hex6 = `${Hex5}${HexStr}`;
|
|
25
|
+
// export type HexColor = `#${Hex3|Hex6}`;
|
|
26
|
+
export type HexColor = `#${ComplexType}`;
|
|
27
|
+
|
|
28
|
+
// LENGTH
|
|
29
|
+
// export type AbsoluteUnits = "cm"|"mm"|"in"|"px"|"pt"|"pc"; // Esoteric removed: "Q"
|
|
30
|
+
// export type RelativeUnits = "ch"|"em"|"ex"|"lh"|"rem"
|
|
31
|
+
// |"vh"|"vw"|"vmin"|"vmax"
|
|
32
|
+
// |"cqw"|"cqh"|"cqi"|"cqb"|"cqmin"|"cqmax"
|
|
33
|
+
// |"%"; // Esoteric removed: "cap"|"ic"|"rlh"|"vb"|"vi"
|
|
34
|
+
// export type AllLengthUnits = AbsoluteUnits|RelativeUnits;
|
|
35
|
+
// export type NumericLength = number|`${number}${AllLengthUnits}`;
|
|
36
|
+
// export type LengthPercentage = NumericLength|Percentage;
|
|
37
|
+
|
|
38
|
+
// TIME & FREQUENCY
|
|
39
|
+
export type Time = `${number}${"s"|"ms"}`;
|
|
40
|
+
export type TimePercentage = Time|Percentage;
|
|
41
|
+
export type Frequency = `${number}${"Hz"|"kHz"}`;
|
|
42
|
+
export type FrequencyPercentage = Frequency|Percentage;
|
|
43
|
+
|
|
44
|
+
// RESOLUTION
|
|
45
|
+
export type Resolution = `${number}${"dpi"|"dpcm"|"dppx"|"x"}`;
|
|
46
|
+
|
|
47
|
+
// MISC ENUM TYPES
|
|
48
|
+
export type AbsoluteSize = "xx-small"|"x-small"|"small"|"medium"|"large"|"x-large"|"xx-large"|"xxx-large";
|
|
49
|
+
export type BlendMode = "normal"|"multiply"|"screen"|"overlay"|"darken"|"lighten"|"color-dodge"|"color-burn"|"hard-light"|"soft-light"|"difference"|"exclusion"|"hue"|"saturation"|"color"|"luminosity";
|
|
50
|
+
export type LineStyle = "none"|"hidden"|"dotted"|"dashed"|"solid"|"double"|"groove"|"ridge"|"inset"|"outset";
|
|
51
|
+
export type DisplayBox = "contents"|"none"
|
|
52
|
+
export type DisplayInside = "flow"|"flow-root"|"table"|"flex"|"grid"|"ruby";
|
|
53
|
+
export type DisplayInternal = "table-row-group"|"table-header-group"|"table-footer-group"|"table-row"|"table-cell"|"table-column-group"|"table-column"|"table-caption"|"ruby-base"|"ruby-text"|"ruby-base-container"|"ruby-text-container";
|
|
54
|
+
export type DisplayLegacy = "inline-block"|"inline-table"|"inline-flex"|"inline-grid";
|
|
55
|
+
export type DisplayOutside = "block"|"inline"|"run-in";
|
|
56
|
+
export type DisplayFlow = "flow"|"flow-root";
|
|
57
|
+
export type Overflow = "visible"|"hidden"|"clip"|"scroll";
|
|
58
|
+
export type RelativeSize = "smaller"|"larger";
|
|
59
|
+
|
|
60
|
+
// BASIC SHAPE
|
|
61
|
+
// TODO need a builder.
|
|
62
|
+
// Most of these are too complex to represent as a typescript type.
|
|
63
|
+
// Realistically they should just be constructed usign a builder rather than setting the strings.
|
|
64
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/basic-shape
|
|
65
|
+
export type InsetFunction = `inset(${ComplexType})`;
|
|
66
|
+
export type RectFunction = `rect(${ComplexType})`;
|
|
67
|
+
export type XywhFunction = `xywh(${ComplexType})`;
|
|
68
|
+
export type CircleFunction = `circle(${ComplexType})`;
|
|
69
|
+
export type EllipseFunction = `ellipse(${ComplexType})`;
|
|
70
|
+
export type PolygonFunction = `polygon(${ComplexType})`;
|
|
71
|
+
export type PathFunction = `path(${ComplexType})`;
|
|
72
|
+
export type BasicShape = InsetFunction|RectFunction|XywhFunction|CircleFunction|EllipseFunction|PolygonFunction|PathFunction;
|
|
73
|
+
|
|
74
|
+
// ANGLES
|
|
75
|
+
export type AngleUnits = "deg"|"turn"|"rad"|"grad";
|
|
76
|
+
export type Angle = number | `${number}${AngleUnits}`; // Pure number should be interpreted as degrees.
|
|
77
|
+
export type AnglePercentage = number | Angle | Percentage; // Number should be interpreted as a decimal (x/1);
|
|
78
|
+
|
|
79
|
+
// ADVANCED TYPES
|
|
80
|
+
// Box.
|
|
81
|
+
export type VisualBox = "content-box" | "padding-box" | "border-box"; // the three <box> values
|
|
82
|
+
export type RayoutBox = VisualBox | "margin-box" // the <shape-box> values
|
|
83
|
+
export type PaintBox = VisualBox | "fill-box" | "stroke-box"
|
|
84
|
+
export type CoordBox = VisualBox | "fill-box" | "stroke-box" | "view-box"
|
|
85
|
+
export type GeometryBox = RayoutBox | "fill-box" | "stroke-box" | "view-box"
|
|
86
|
+
export type BoxEdge = VisualBox | RayoutBox | PaintBox | CoordBox | GeometryBox;
|
|
87
|
+
|
|
88
|
+
// DIMENSION
|
|
89
|
+
// export type Dimension = Angle|Time|Frequency|NumericLength;
|
|
90
|
+
|
|
91
|
+
// Calc.
|
|
92
|
+
export type Calc = ComplexType;
|
|
93
|
+
|
|
94
|
+
// It's difficult to compose calc types because they're too complex. See below.
|
|
95
|
+
// May consider adding a builder for this, but not sure what it will look like.
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
// Can't get this working because the types get too complex for TS.
|
|
99
|
+
// export type Decrement = [
|
|
100
|
+
// never, 0, 1, 2, 3, 4, 5, 6, 7
|
|
101
|
+
// ];
|
|
102
|
+
// export type CalcConstant = "e"|"-e"|"E"|"pi"|"-pi"|"infinity"|"-infinity"|"NaN"; // Defined on a different page. Not sure what it's for.
|
|
103
|
+
// export type CalcKeyword = 'e' | 'pi' | 'infinity' | '-infinity' | 'NaN';
|
|
104
|
+
// export type CalcValue = number | Percentage | Dimension | CalcKeyword;// | CalcSum;
|
|
105
|
+
// export type CalcProductSuffix<T extends CalcValue, Depth extends number> = Depth extends 0 ? string : `${"*"|"/"}${T}${CalcProductSuffix<T, Decrement[Depth]>}`;
|
|
106
|
+
// export type CalcSumSuffix<T extends CalcValue, Depth extends number> = Depth extends 0 ? string : `${"+"|"-"}${T}${CalcProductSuffix<T, 8>}`;
|
|
107
|
+
// // TODO: optional space can go here.
|
|
108
|
+
// export type CalcProduct<T extends CalcValue> = T|`${T}${CalcProductSuffix<T, 8>}`;
|
|
109
|
+
// export type CalcSum<T extends CalcValue> = CalcProduct<T>|`${CalcProduct<T>}${"+"|"-"}${CalcProduct<T>}`
|
|
110
|
+
// CalcValue export type definition
|
|
111
|
+
// Helper types for CalcProduct and CalcSum
|
|
112
|
+
// export type CalcOperation = '+' | '-' | '*' | '/';
|
|
113
|
+
// export type CalcProductPart = CalcValue | [CalcOperation, CalcValue];
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
// Color Interpolation.
|
|
117
|
+
export type RectangularColorSpace = "srgb"|"srgb-linear"|"display-p3"|"a98-rgb"|"prophoto-rgb"|"rec2020"|"lab"|"oklab"|"xyz"|"xyz-d50"|"xyz-d65";
|
|
118
|
+
export type PolarColorSpace = "hsl"|"hwb"|"lch"|"oklch";
|
|
119
|
+
export type HueInterpolationMethod = `${"shorter"|"longer"|"increasing"|"decreasing"} hue`
|
|
120
|
+
export type ColorInterpolationMethod = RectangularColorSpace|PolarColorSpace|`${PolarColorSpace} ${HueInterpolationMethod}`;
|
|
121
|
+
|
|
122
|
+
export type Color = string;
|
|
123
|
+
|
|
124
|
+
// Display List Item
|
|
125
|
+
|
|
126
|
+
export type DisplayListItem =
|
|
127
|
+
| 'list-item'
|
|
128
|
+
| `${DisplayOutside} list-item`
|
|
129
|
+
| `list-item ${DisplayOutside}`
|
|
130
|
+
| `${DisplayFlow} list-item`
|
|
131
|
+
| `list-item ${DisplayFlow}`
|
|
132
|
+
| `${DisplayOutside} ${DisplayFlow} list-item`
|
|
133
|
+
| `${DisplayOutside} list-item ${DisplayFlow}`
|
|
134
|
+
| `${DisplayFlow} ${DisplayOutside} list-item`
|
|
135
|
+
| `${DisplayFlow} list-item ${DisplayOutside}`
|
|
136
|
+
| `list-item ${DisplayOutside} ${DisplayFlow}`
|
|
137
|
+
| `list-item ${DisplayFlow} ${DisplayOutside}`;
|
|
138
|
+
|
|
139
|
+
// ID
|
|
140
|
+
export type Ident = string;
|
|
141
|
+
export type CustomIdent = string;
|
|
143
142
|
export type DashedIdent = `--${string}`;
|