builder-settings-types 0.0.241 → 0.0.243
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/dist/types/index.d.ts +20 -2
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { Setting, SettingProps } from '../base/settings';
|
|
2
2
|
import { SettingGroup } from '../base/settings-group/settingsGroup';
|
|
3
|
+
import { HeaderTypographySettingSet } from '../groups/headerTypographySettingsSet';
|
|
4
|
+
import { AlignValue } from '../settings/align-settings/alignSettings';
|
|
3
5
|
export type SettingValue = string | number | boolean | null | undefined;
|
|
4
6
|
export type ComplexSettingValue = SettingValue | Record<string, SettingValue> | Array<SettingValue> | Date;
|
|
7
|
+
type HeaderTypographyValue<T> = T extends HeaderTypographySettingSet ? {
|
|
8
|
+
color: string;
|
|
9
|
+
fontFamily: string;
|
|
10
|
+
fontWeight: string;
|
|
11
|
+
fontSize: number;
|
|
12
|
+
} & (T extends {
|
|
13
|
+
settings: infer G;
|
|
14
|
+
} ? G extends {
|
|
15
|
+
align: AlignValue;
|
|
16
|
+
} ? {
|
|
17
|
+
align: AlignValue;
|
|
18
|
+
} : {
|
|
19
|
+
align?: AlignValue;
|
|
20
|
+
} : {
|
|
21
|
+
align?: AlignValue;
|
|
22
|
+
}) : never;
|
|
5
23
|
export type SettingsProps = SettingValue | ComplexSettingValue;
|
|
6
24
|
export type SettingInstance<T extends SettingsProps = SettingsProps> = Setting<T, SettingProps<T>>;
|
|
7
25
|
export type SettingChild<T extends SettingsProps = SettingsProps> = SettingInstance<T> | SettingGroup<Record<string, SettingChild<T>>>;
|
|
@@ -35,8 +53,8 @@ export type SettingIteratorCallback<TSettings extends SettingsMap> = (key: keyof
|
|
|
35
53
|
export declare type ExtractSettingGroupValues<T> = T extends SettingGroup<infer S> ? {
|
|
36
54
|
[K in keyof S]: S[K] extends Setting<infer V, infer P> ? ExtractSettingValue<S[K]> : S[K] extends SettingGroup<infer U> ? ExtractSettingGroupValues<S[K]> : unknown;
|
|
37
55
|
} : never;
|
|
38
|
-
export
|
|
39
|
-
[K in keyof S]: S[K] extends Setting<infer V, infer P> ? V : S[K] extends SettingGroup<infer U> ? SettingsToProps<S[K]> : S[K] extends {
|
|
56
|
+
export type SettingsToProps<T> = T extends SettingGroup<infer S> ? {
|
|
57
|
+
[K in keyof S]: S[K] extends Setting<infer V, infer P> ? V : S[K] extends HeaderTypographySettingSet ? HeaderTypographyValue<S[K]> : S[K] extends SettingGroup<infer U> ? SettingsToProps<S[K]> : S[K] extends {
|
|
40
58
|
setValue(value: infer V | undefined): void;
|
|
41
59
|
} ? V : S[K] extends {
|
|
42
60
|
value: infer V;
|
package/package.json
CHANGED