x-runtime-lib 0.5.1 → 0.5.2

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.
@@ -24,33 +24,79 @@ export type ZItem = {
24
24
  title: string;
25
25
  value: string;
26
26
  };
27
- export type ZType = {
27
+ type ZTypeBase = {
28
28
  name: string;
29
- ui: 'word' | 'pixelInput' | 'percentInput';
30
- validator(v: unknown): boolean;
31
- default: unknown;
32
- precision?: number;
33
- min?: number;
34
- max?: number;
35
- step?: number;
29
+ validator: (v: string) => boolean;
30
+ default: string;
36
31
  };
37
- export type ZProp = {
32
+ type ZTypeWord = {
33
+ ui: 'word';
34
+ } & ZTypeBase;
35
+ type ZTypeInput = {
36
+ ui: 'pixelInput' | 'percentInput';
37
+ precision: number;
38
+ min: number;
39
+ max: number;
40
+ step: number;
41
+ } & ZTypeBase;
42
+ export type ZType = ZTypeWord | ZTypeInput;
43
+ type ZPropBase = {
38
44
  key: string;
39
45
  name: string;
40
46
  children?: ZProp[];
41
- ui?: 'void' | 'strInput' | 'numInput' | 'switch' | 'select' | 'colorPicker' | 'multiTypes' | 'compSelect';
42
47
  array?: boolean;
43
- default?: unknown;
48
+ };
49
+ type ZPropBranch = {
50
+ ui?: undefined;
51
+ default?: object[];
52
+ } & ZPropBase;
53
+ type ZPropDummy = {
54
+ ui: 'dummy';
55
+ default: string | number | boolean | object;
56
+ } & ZPropBase;
57
+ type ZPropStrInput = {
58
+ ui: 'strInput';
44
59
  readonly?: boolean;
45
60
  static?: boolean;
46
61
  value?: unknown;
47
- precision?: number;
48
- min?: number;
49
- max?: number;
50
- step?: number;
51
- items?: ZItem[];
52
- types?: ZType[];
53
- };
62
+ default: string;
63
+ } & ZPropBase;
64
+ type ZPropNumInput = {
65
+ ui: 'numInput';
66
+ precision: number;
67
+ min: number;
68
+ max: number;
69
+ step: number;
70
+ readonly?: boolean;
71
+ default: number;
72
+ } & ZPropBase;
73
+ type ZPropSwitch = {
74
+ ui: 'switch';
75
+ readonly?: boolean;
76
+ default: boolean;
77
+ } & ZPropBase;
78
+ type ZPropSelect = {
79
+ ui: 'select';
80
+ items: ZItem[];
81
+ readonly?: boolean;
82
+ default: string;
83
+ } & ZPropBase;
84
+ type ZPropColorPicker = {
85
+ ui: 'colorPicker';
86
+ readonly?: boolean;
87
+ default: string;
88
+ } & ZPropBase;
89
+ type ZPropMultiTypes = {
90
+ ui: 'multiTypes';
91
+ types: ZType[];
92
+ readonly?: boolean;
93
+ default: string;
94
+ } & ZPropBase;
95
+ type ZPropCompSelect = {
96
+ ui: 'compSelect';
97
+ default: string;
98
+ } & ZPropBase;
99
+ export type ZProp = ZPropBranch | ZPropDummy | ZPropStrInput | ZPropNumInput | ZPropSwitch | ZPropSelect | ZPropColorPicker | ZPropMultiTypes | ZPropCompSelect;
54
100
  export type ZProps = {
55
101
  [key: string]: ZProp[];
56
102
  };
@@ -82,3 +128,4 @@ export type ZPkg = {
82
128
  export type ZPkgs = {
83
129
  [key: string]: ZPkg;
84
130
  };
131
+ export {};
@@ -15,5 +15,5 @@ export declare function provideData(data: Data): void;
15
15
  export declare function injectData(): Data;
16
16
  export declare function provideDepends(depends: Depends): void;
17
17
  export declare function injectDepends(): Depends;
18
- export declare function provideInterpreter(interpreter: Interpreter): void;
19
- export declare function injectInterpreter(): Interpreter;
18
+ export declare function provideInterpreter(interpreter: Interpreter | undefined): void;
19
+ export declare function injectInterpreter(): Interpreter | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",