dothtml-interfaces 0.4.6 → 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 -141
- 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 -19
- package/src/bindings/i-ref.d.ts +0 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export default interface IEventBus{
|
|
3
|
-
|
|
4
|
-
on (event, callback);
|
|
5
|
-
|
|
6
|
-
off (event, callback);
|
|
7
|
-
|
|
8
|
-
emit (event, ...args);
|
|
9
|
-
|
|
10
|
-
flush (event);
|
|
1
|
+
|
|
2
|
+
export default interface IEventBus{
|
|
3
|
+
|
|
4
|
+
on (event, callback);
|
|
5
|
+
|
|
6
|
+
off (event, callback);
|
|
7
|
+
|
|
8
|
+
emit (event, ...args);
|
|
9
|
+
|
|
10
|
+
flush (event);
|
|
11
11
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { IDotCore } from "./i-dot";
|
|
2
|
-
|
|
3
|
-
export * from "./i-dot";
|
|
4
|
-
|
|
5
|
-
export { default as IDotCss } from "./styles/i-dot-css";
|
|
6
|
-
export * from "./styles/i-dot-css";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { default as IDotComponent, FrameworkItems } from "./i-dot-component";
|
|
10
|
-
|
|
11
|
-
export { IWatcher } from "./bindings/i-watcher";
|
|
12
|
-
export { IObserver } from "./bindings/i-observer";
|
|
13
|
-
export { IBinding } from "./bindings/i-binding";
|
|
14
|
-
export { IReactive } from "./bindings/i-reactive";
|
|
1
|
+
import { IDotCore } from "./i-dot";
|
|
2
|
+
|
|
3
|
+
export * from "./i-dot";
|
|
4
|
+
|
|
5
|
+
export { default as IDotCss } from "./styles/i-dot-css";
|
|
6
|
+
export * from "./styles/i-dot-css";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export { default as IDotComponent, FrameworkItems } from "./i-dot-component";
|
|
10
|
+
|
|
11
|
+
export { IWatcher } from "./bindings/i-watcher";
|
|
12
|
+
export { IObserver } from "./bindings/i-observer";
|
|
13
|
+
export { IBinding } from "./bindings/i-binding";
|
|
14
|
+
export { IReactive } from "./bindings/i-reactive";
|
|
15
15
|
export { default as IEventBus } from "./i-event-bus";
|
package/src/styles/at-rules/{i-at-color-profile-builder.d.ts → i-at-color-profile-builder.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export default interface IAtColorProfileBuilder{
|
|
3
|
-
src?: string;
|
|
4
|
-
renderingIntent?: "relative-colorimetric"|"absolute-colorimetric"|"perceptual"|"saturation";
|
|
1
|
+
|
|
2
|
+
export default interface IAtColorProfileBuilder{
|
|
3
|
+
src?: string;
|
|
4
|
+
renderingIntent?: "relative-colorimetric"|"absolute-colorimetric"|"perceptual"|"saturation";
|
|
5
5
|
}
|
package/src/styles/at-rules/{i-at-counter-style-builder.d.ts → i-at-counter-style-builder.ts}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
type SystemValue = "cyclic"|"numeric"|"alphabetic"|"symbolic"|"additive"|`fixed ${number}`|`extends ${string}`;
|
|
2
|
-
export default interface IAtCounterStyleBuilder{
|
|
3
|
-
|
|
4
|
-
// TODO: need a testcase on this.
|
|
5
|
-
system?: SystemValue|["fixed", number]|["extends", string];
|
|
6
|
-
|
|
7
|
-
symbols?: string;
|
|
8
|
-
additiveSymbols?: string;
|
|
9
|
-
negative?: string;
|
|
10
|
-
prefix?: string;
|
|
11
|
-
suffix?: string;
|
|
12
|
-
range?: string;
|
|
13
|
-
pad?: string;
|
|
14
|
-
speakAs?: string;
|
|
1
|
+
type SystemValue = "cyclic"|"numeric"|"alphabetic"|"symbolic"|"additive"|`fixed ${number}`|`extends ${string}`;
|
|
2
|
+
export default interface IAtCounterStyleBuilder{
|
|
3
|
+
|
|
4
|
+
// TODO: need a testcase on this.
|
|
5
|
+
system?: SystemValue|["fixed", number]|["extends", string];
|
|
6
|
+
|
|
7
|
+
symbols?: string;
|
|
8
|
+
additiveSymbols?: string;
|
|
9
|
+
negative?: string;
|
|
10
|
+
prefix?: string;
|
|
11
|
+
suffix?: string;
|
|
12
|
+
range?: string;
|
|
13
|
+
pad?: string;
|
|
14
|
+
speakAs?: string;
|
|
15
15
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
type NormalOrPercentage = "normal" | number | `${string}%`;
|
|
3
|
-
type StretchValues = `${number}%`|number|"ultra-condensed"|"extra-condensed"|"condensed"|"semi-condensed"|"normal"|"semi-expanded"|"expanded"|"extra-expanded"|"ultra-expanded";
|
|
4
|
-
|
|
5
|
-
export default interface IAtFontFamilyBuilder{
|
|
6
|
-
ascentOverride?: string;
|
|
7
|
-
descentOverride?: NormalOrPercentage | [NormalOrPercentage] | [NormalOrPercentage, NormalOrPercentage];
|
|
8
|
-
fontDisplay?: "auto"|"block"|"swap"|"fallback"|"optional";
|
|
9
|
-
fontFamily: string;
|
|
10
|
-
fontStretch?: StretchValues | [StretchValues] | [StretchValues, StretchValues];
|
|
11
|
-
fontStyle?: "normal"|"italic"|"auto"|"oblique"|`oblique ${string}`;
|
|
12
|
-
fontWeight?: "normal"|"bold"|number|`${number}`;
|
|
13
|
-
fontFeatureSettings?: string;
|
|
14
|
-
fontVariationSettings?: string|string[];
|
|
15
|
-
lineGapOverride?: NormalOrPercentage | [NormalOrPercentage] | [NormalOrPercentage, NormalOrPercentage];
|
|
16
|
-
sizeAdjust?: `${number}%`|number;
|
|
17
|
-
src?: string;
|
|
18
|
-
unicodeRange?: string;
|
|
1
|
+
|
|
2
|
+
type NormalOrPercentage = "normal" | number | `${string}%`;
|
|
3
|
+
type StretchValues = `${number}%`|number|"ultra-condensed"|"extra-condensed"|"condensed"|"semi-condensed"|"normal"|"semi-expanded"|"expanded"|"extra-expanded"|"ultra-expanded";
|
|
4
|
+
|
|
5
|
+
export default interface IAtFontFamilyBuilder{
|
|
6
|
+
ascentOverride?: string;
|
|
7
|
+
descentOverride?: NormalOrPercentage | [NormalOrPercentage] | [NormalOrPercentage, NormalOrPercentage];
|
|
8
|
+
fontDisplay?: "auto"|"block"|"swap"|"fallback"|"optional";
|
|
9
|
+
fontFamily: string;
|
|
10
|
+
fontStretch?: StretchValues | [StretchValues] | [StretchValues, StretchValues];
|
|
11
|
+
fontStyle?: "normal"|"italic"|"auto"|"oblique"|`oblique ${string}`;
|
|
12
|
+
fontWeight?: "normal"|"bold"|number|`${number}`;
|
|
13
|
+
fontFeatureSettings?: string;
|
|
14
|
+
fontVariationSettings?: string|string[];
|
|
15
|
+
lineGapOverride?: NormalOrPercentage | [NormalOrPercentage] | [NormalOrPercentage, NormalOrPercentage];
|
|
16
|
+
sizeAdjust?: `${number}%`|number;
|
|
17
|
+
src?: string;
|
|
18
|
+
unicodeRange?: string;
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export default interface IAtFontPaletteValues{
|
|
3
|
-
fontFamily?: string;
|
|
4
|
-
basePalette?: string;
|
|
5
|
-
overrideColors?: string[];
|
|
1
|
+
|
|
2
|
+
export default interface IAtFontPaletteValues{
|
|
3
|
+
fontFamily?: string;
|
|
4
|
+
basePalette?: string;
|
|
5
|
+
overrideColors?: string[];
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import IDotcssProp from "../i-css-prop";
|
|
2
|
-
|
|
3
|
-
export default interface IAtKeyframesBuilder{
|
|
4
|
-
to: IDotcssProp;
|
|
5
|
-
from: IDotcssProp;
|
|
6
|
-
|
|
7
|
-
[key: `${number}%`]: IDotcssProp;
|
|
1
|
+
import IDotcssProp from "../i-css-prop";
|
|
2
|
+
|
|
3
|
+
export default interface IAtKeyframesBuilder{
|
|
4
|
+
to: IDotcssProp;
|
|
5
|
+
from: IDotcssProp;
|
|
6
|
+
|
|
7
|
+
[key: `${number}%`]: IDotcssProp;
|
|
8
8
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import IDotcssProp from "../i-css-prop";
|
|
2
|
-
|
|
3
|
-
export default interface IAtPageBuilder extends IDotcssProp{
|
|
4
|
-
topLeftCorner: IDotcssProp;
|
|
5
|
-
topLeft: IDotcssProp;
|
|
6
|
-
topCenter: IDotcssProp;
|
|
7
|
-
topRight: IDotcssProp;
|
|
8
|
-
topRightCorner: IDotcssProp;
|
|
9
|
-
bottomLeftCorner: IDotcssProp;
|
|
10
|
-
bottomLeft: IDotcssProp;
|
|
11
|
-
bottomCenter: IDotcssProp;
|
|
12
|
-
bottomRight: IDotcssProp;
|
|
13
|
-
bottomRightCorner: IDotcssProp;
|
|
14
|
-
leftTop: IDotcssProp;
|
|
15
|
-
leftMiddle: IDotcssProp;
|
|
16
|
-
leftBottom: IDotcssProp;
|
|
17
|
-
rightTop: IDotcssProp;
|
|
18
|
-
rightMiddle: IDotcssProp;
|
|
19
|
-
rightBottom: IDotcssProp;
|
|
1
|
+
import IDotcssProp from "../i-css-prop";
|
|
2
|
+
|
|
3
|
+
export default interface IAtPageBuilder extends IDotcssProp{
|
|
4
|
+
topLeftCorner: IDotcssProp;
|
|
5
|
+
topLeft: IDotcssProp;
|
|
6
|
+
topCenter: IDotcssProp;
|
|
7
|
+
topRight: IDotcssProp;
|
|
8
|
+
topRightCorner: IDotcssProp;
|
|
9
|
+
bottomLeftCorner: IDotcssProp;
|
|
10
|
+
bottomLeft: IDotcssProp;
|
|
11
|
+
bottomCenter: IDotcssProp;
|
|
12
|
+
bottomRight: IDotcssProp;
|
|
13
|
+
bottomRightCorner: IDotcssProp;
|
|
14
|
+
leftTop: IDotcssProp;
|
|
15
|
+
leftMiddle: IDotcssProp;
|
|
16
|
+
leftBottom: IDotcssProp;
|
|
17
|
+
rightTop: IDotcssProp;
|
|
18
|
+
rightMiddle: IDotcssProp;
|
|
19
|
+
rightBottom: IDotcssProp;
|
|
20
20
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import AngleProp from "../mapped-types/angle-prop";
|
|
2
|
-
import { Percentage, ValueOrReactive } from "../css-types";
|
|
3
|
-
import LengthProp from "../mapped-types/length-prop";
|
|
4
|
-
import IShadowProp from "./i-shadow-prop";
|
|
5
|
-
|
|
6
|
-
export default interface IFilterProp extends
|
|
7
|
-
AngleProp<["hueRotate"]>,
|
|
8
|
-
LengthProp<"blur", 1>
|
|
9
|
-
{
|
|
10
|
-
// url(commonfilters.svg#filter); // Don't know how this works yet.
|
|
11
|
-
brightness?: ValueOrReactive<number> | Percentage;
|
|
12
|
-
contrast?: ValueOrReactive<number> | Percentage;
|
|
13
|
-
dropShadow?: IShadowProp | IShadowProp[];
|
|
14
|
-
grayscale?: ValueOrReactive<number> | Percentage;
|
|
15
|
-
invert?: ValueOrReactive<number> | Percentage;
|
|
16
|
-
opacity?: ValueOrReactive<number> | Percentage;
|
|
17
|
-
sepia?: ValueOrReactive<number> | Percentage;
|
|
18
|
-
saturate?: ValueOrReactive<number> | Percentage;
|
|
19
|
-
// url(filters.svg#filter) blur(4px) saturate(150%); // example.
|
|
1
|
+
import AngleProp from "../mapped-types/angle-prop";
|
|
2
|
+
import { Percentage, ValueOrReactive } from "../css-types";
|
|
3
|
+
import LengthProp from "../mapped-types/length-prop";
|
|
4
|
+
import IShadowProp from "./i-shadow-prop";
|
|
5
|
+
|
|
6
|
+
export default interface IFilterProp extends
|
|
7
|
+
AngleProp<["hueRotate"]>,
|
|
8
|
+
LengthProp<"blur", 1>
|
|
9
|
+
{
|
|
10
|
+
// url(commonfilters.svg#filter); // Don't know how this works yet.
|
|
11
|
+
brightness?: ValueOrReactive<number> | Percentage;
|
|
12
|
+
contrast?: ValueOrReactive<number> | Percentage;
|
|
13
|
+
dropShadow?: IShadowProp | IShadowProp[];
|
|
14
|
+
grayscale?: ValueOrReactive<number> | Percentage;
|
|
15
|
+
invert?: ValueOrReactive<number> | Percentage;
|
|
16
|
+
opacity?: ValueOrReactive<number> | Percentage;
|
|
17
|
+
sepia?: ValueOrReactive<number> | Percentage;
|
|
18
|
+
saturate?: ValueOrReactive<number> | Percentage;
|
|
19
|
+
// url(filters.svg#filter) blur(4px) saturate(150%); // example.
|
|
20
20
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import ColorProps from "../mapped-types/color-props.js";
|
|
2
|
-
import LengthProp from "../mapped-types/length-prop.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default interface IShadowProp extends
|
|
6
|
-
LengthProp<"length", 2>,
|
|
7
|
-
LengthProp<"blur">,
|
|
8
|
-
LengthProp<"spread">,
|
|
9
|
-
ColorProps<"color">
|
|
10
|
-
{
|
|
11
|
-
|
|
1
|
+
import ColorProps from "../mapped-types/color-props.js";
|
|
2
|
+
import LengthProp from "../mapped-types/length-prop.js";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default interface IShadowProp extends
|
|
6
|
+
LengthProp<"length", 2>,
|
|
7
|
+
LengthProp<"blur">,
|
|
8
|
+
LengthProp<"spread">,
|
|
9
|
+
ColorProps<"color">
|
|
10
|
+
{
|
|
11
|
+
|
|
12
12
|
}
|
package/src/styles/complex-css-types/{i-transformation-prop.d.ts → i-transformation-prop.ts}
RENAMED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import AngleProp from "../mapped-types/angle-prop";
|
|
2
|
-
import { ValueOrReactive } from "../css-types";
|
|
3
|
-
import LengthProp from "../mapped-types/length-prop";
|
|
4
|
-
|
|
5
|
-
// Transforms are special because the order matters and functions can be called mulitple times.
|
|
6
|
-
// To support this functionality, we use an array of transform JSON specs.
|
|
7
|
-
export default interface ITransformationProp extends
|
|
8
|
-
LengthProp<"translate", 1|2>,
|
|
9
|
-
LengthProp<"translate3d", 3>,
|
|
10
|
-
LengthProp<"translateX">,
|
|
11
|
-
LengthProp<"translateY">,
|
|
12
|
-
LengthProp<"translateZ">,
|
|
13
|
-
LengthProp<"perspective">,
|
|
14
|
-
AngleProp<["rotate3d"], 4>,
|
|
15
|
-
AngleProp<["skew"], 1|2>,
|
|
16
|
-
AngleProp<["rotate", "rotateX", "rotateY", "rotateZ", "skewX", "skewY"]>
|
|
17
|
-
{
|
|
18
|
-
// a, b, c, d, tx, ty
|
|
19
|
-
matrix?: [ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>];
|
|
20
|
-
// a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4
|
|
21
|
-
matrix3d?: [
|
|
22
|
-
ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>,
|
|
23
|
-
ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>,
|
|
24
|
-
ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>,
|
|
25
|
-
ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
scale?: ValueOrReactive<number> | [ValueOrReactive<number>, ValueOrReactive<number>];
|
|
29
|
-
scale3d?: [ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>];
|
|
30
|
-
scaleX?: ValueOrReactive<number>;
|
|
31
|
-
scaleY?: ValueOrReactive<number>;
|
|
32
|
-
scaleZ?: ValueOrReactive<number>;
|
|
1
|
+
import AngleProp from "../mapped-types/angle-prop";
|
|
2
|
+
import { ValueOrReactive } from "../css-types";
|
|
3
|
+
import LengthProp from "../mapped-types/length-prop";
|
|
4
|
+
|
|
5
|
+
// Transforms are special because the order matters and functions can be called mulitple times.
|
|
6
|
+
// To support this functionality, we use an array of transform JSON specs.
|
|
7
|
+
export default interface ITransformationProp extends
|
|
8
|
+
LengthProp<"translate", 1|2>,
|
|
9
|
+
LengthProp<"translate3d", 3>,
|
|
10
|
+
LengthProp<"translateX">,
|
|
11
|
+
LengthProp<"translateY">,
|
|
12
|
+
LengthProp<"translateZ">,
|
|
13
|
+
LengthProp<"perspective">,
|
|
14
|
+
AngleProp<["rotate3d"], 4>,
|
|
15
|
+
AngleProp<["skew"], 1|2>,
|
|
16
|
+
AngleProp<["rotate", "rotateX", "rotateY", "rotateZ", "skewX", "skewY"]>
|
|
17
|
+
{
|
|
18
|
+
// a, b, c, d, tx, ty
|
|
19
|
+
matrix?: [ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>];
|
|
20
|
+
// a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4
|
|
21
|
+
matrix3d?: [
|
|
22
|
+
ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>,
|
|
23
|
+
ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>,
|
|
24
|
+
ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>,
|
|
25
|
+
ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
scale?: ValueOrReactive<number> | [ValueOrReactive<number>, ValueOrReactive<number>];
|
|
29
|
+
scale3d?: [ValueOrReactive<number>, ValueOrReactive<number>, ValueOrReactive<number>];
|
|
30
|
+
scaleX?: ValueOrReactive<number>;
|
|
31
|
+
scaleY?: ValueOrReactive<number>;
|
|
32
|
+
scaleZ?: ValueOrReactive<number>;
|
|
33
33
|
}
|
|
@@ -1,142 +1,142 @@
|
|
|
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"
|
|
30
|
-
// export type RelativeUnits = "
|
|
31
|
-
// |"vh"|"vw"|"vmin"|"vmax"
|
|
32
|
-
// |"cqw"|"cqh"|"cqi"|"cqb"|"cqmin"|"cqmax"
|
|
33
|
-
// |"%";
|
|
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;
|
|
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;
|
|
142
142
|
export type DashedIdent = `--${string}`;
|