@plumeria/core 13.0.2 → 13.1.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/lib/types.d.ts +24 -7
- package/package.json +1 -1
package/lib/types.d.ts
CHANGED
|
@@ -42,23 +42,39 @@ type CSSProperties =
|
|
|
42
42
|
|
|
43
43
|
type CreateStyleValue = CSSProperties | ((...args: any[]) => CSSProperties);
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
const ClassNameTag: unique symbol;
|
|
46
|
+
|
|
47
|
+
type AtomicClassNameFor<out P extends string, out V> = string & {
|
|
48
|
+
readonly _ident: typeof ClassNameTag;
|
|
49
|
+
readonly _key: P;
|
|
50
|
+
readonly _value: V;
|
|
49
51
|
};
|
|
50
52
|
|
|
53
|
+
type MapNamespace<T> = Readonly<{
|
|
54
|
+
[key in keyof T]: T[key] extends Record<string, unknown>
|
|
55
|
+
? key extends `:${string}` | `@${string}` | `[${string}`
|
|
56
|
+
? MapNamespace<T[key]>
|
|
57
|
+
: AtomicClassNameFor<key & string, T[key]>
|
|
58
|
+
: key extends string
|
|
59
|
+
? AtomicClassNameFor<key, T[key]>
|
|
60
|
+
: never;
|
|
61
|
+
}>;
|
|
62
|
+
|
|
63
|
+
type CreateReturnType<T> = Readonly<{
|
|
64
|
+
[K in keyof T]: T[K] extends (...args: infer A) => infer R
|
|
65
|
+
? (...args: A) => MapNamespace<R>
|
|
66
|
+
: MapNamespace<T[K]>;
|
|
67
|
+
}>;
|
|
68
|
+
|
|
51
69
|
type StyleName = CSSProperties | (false | CSSProperties | null | undefined)[];
|
|
52
70
|
|
|
53
71
|
type CreateStatic = Record<string, string | number>;
|
|
54
72
|
|
|
55
|
-
type ReadonlyTheme<T> = Readonly<T> & CSSVariableValue;
|
|
56
|
-
|
|
57
73
|
type CreateTheme = {
|
|
58
74
|
[key: string]: ThemeValue;
|
|
59
75
|
};
|
|
60
76
|
type CreateThemeReturnType<T> = {
|
|
61
|
-
readonly [K in keyof T]:
|
|
77
|
+
readonly [K in keyof T]: Readonly<T[K]>;
|
|
62
78
|
};
|
|
63
79
|
|
|
64
80
|
type KeyframesInSelector = 'from' | 'to' | `${number}%`;
|
|
@@ -97,4 +113,5 @@ export type {
|
|
|
97
113
|
ViewTransition,
|
|
98
114
|
Marker,
|
|
99
115
|
Extended,
|
|
116
|
+
AtomicClassNameFor,
|
|
100
117
|
};
|