@amodx/schemas 0.0.1 → 0.0.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.
@@ -1,201 +1,37 @@
1
- import { PropertyInputBase, PropertyInputMetaData } from "./PropertyInput";
2
- declare class StringInput extends PropertyInputBase<string, {
1
+ declare const StringInput: import("./registerInput").RegisteredInput<string, import("./PropertyInput").PropertyInputBaseProperties & {
3
2
  min: number;
4
3
  max: number;
5
- }> {
6
- static Meta: {
7
- id: string;
8
- name: string;
9
- };
10
- static Create(data: Partial<StringInput["data"]>): StringInput["data"];
11
- compare(value1: string, value2: string): boolean;
12
- getClass(): typeof StringInput;
13
- getMeta(): PropertyInputMetaData;
14
- }
15
- declare class ColorInput extends PropertyInputBase<string, {}> {
16
- static Meta: {
17
- id: string;
18
- name: string;
19
- };
20
- static Create(data: Partial<ColorInput["data"]>): ColorInput["data"];
21
- compare(value1: string, value2: string): boolean;
22
- getClass(): typeof ColorInput;
23
- getMeta(): PropertyInputMetaData;
24
- }
25
- declare class RangeInput extends PropertyInputBase<number, {
4
+ }>;
5
+ declare const ColorInput: import("./registerInput").RegisteredInput<string, import("./PropertyInput").PropertyInputBaseProperties>;
6
+ declare const RangeInput: import("./registerInput").RegisteredInput<number, import("./PropertyInput").PropertyInputBaseProperties & {
26
7
  min: number;
27
8
  max: number;
28
9
  step: number;
29
- }> {
30
- static Meta: {
31
- id: string;
32
- name: string;
33
- };
34
- static Create(data: Partial<RangeInput["data"]>): RangeInput["data"];
35
- compare(value1: number, value2: number): boolean;
36
- getClass(): typeof RangeInput;
37
- getMeta(): PropertyInputMetaData;
38
- }
39
- declare class FloatInput extends PropertyInputBase<number, {
10
+ }>;
11
+ declare const FloatInput: import("./registerInput").RegisteredInput<number, import("./PropertyInput").PropertyInputBaseProperties & {
40
12
  min: number;
41
13
  max: number;
42
- }> {
43
- static Meta: {
44
- id: string;
45
- name: string;
46
- };
47
- static Create(data: Partial<FloatInput["data"]>): FloatInput["data"];
48
- compare(value1: number, value2: number): boolean;
49
- getClass(): typeof FloatInput;
50
- getMeta(): PropertyInputMetaData;
51
- }
52
- declare class Vec2Input extends PropertyInputBase<{
14
+ }>;
15
+ declare const Vec2Input: import("./registerInput").RegisteredInput<{
53
16
  x: number;
54
17
  y: number;
55
- }, {
18
+ }, import("./PropertyInput").PropertyInputBaseProperties & {
56
19
  valueType: "position" | "dimension";
57
- }> {
58
- static Meta: {
59
- id: string;
60
- name: string;
61
- };
62
- static Create(data: Partial<Vec2Input["data"]>): Vec2Input["data"];
63
- compare(value1: {
64
- x: number;
65
- y: number;
66
- }, value2: {
67
- x: number;
68
- y: number;
69
- }): boolean;
70
- getClass(): typeof Vec2Input;
71
- getMeta(): PropertyInputMetaData;
72
- }
73
- declare class Vec3Input extends PropertyInputBase<{
20
+ }>;
21
+ declare const Vec3Input: import("./registerInput").RegisteredInput<{
74
22
  x: number;
75
23
  y: number;
76
24
  z: number;
77
- }, {
25
+ }, import("./PropertyInput").PropertyInputBaseProperties & {
78
26
  valueType: "position" | "dimension";
79
- }> {
80
- static Meta: {
81
- id: string;
82
- name: string;
83
- };
84
- static Create(data: Partial<Vec3Input["data"]>): Vec3Input["data"];
85
- compare(value1: {
86
- x: number;
87
- y: number;
88
- z: number;
89
- }, value2: {
90
- x: number;
91
- y: number;
92
- z: number;
93
- }): boolean;
94
- getClass(): typeof Vec3Input;
95
- getMeta(): PropertyInputMetaData;
96
- }
97
- declare class IntInput extends PropertyInputBase<number, {
27
+ }>;
28
+ declare const IntInput: import("./registerInput").RegisteredInput<number, import("./PropertyInput").PropertyInputBaseProperties & {
98
29
  min: number;
99
30
  max: number;
100
- }> {
101
- static Meta: {
102
- id: string;
103
- name: string;
104
- };
105
- static Create(data: Partial<IntInput["data"]>): IntInput["data"];
106
- compare(value1: number, value2: number): boolean;
107
- getClass(): typeof IntInput;
108
- getMeta(): PropertyInputMetaData;
109
- }
110
- declare class SelectInput extends PropertyInputBase<string | number, {
111
- options: string[] | [display: string, value: string | number][];
31
+ }>;
32
+ declare const SelectInput: import("./registerInput").RegisteredInput<string | number, import("./PropertyInput").PropertyInputBaseProperties & {
33
+ options: string[] | [string, string | number][];
112
34
  mode?: string;
113
- }> {
114
- static Meta: {
115
- id: string;
116
- name: string;
117
- };
118
- static Create(data: Partial<SelectInput["data"]>): SelectInput["data"];
119
- compare(value1: string | number, value2: string | number): boolean;
120
- getClass(): typeof SelectInput;
121
- getMeta(): PropertyInputMetaData;
122
- }
123
- declare class FilePathInput extends PropertyInputBase<string, {
124
- acceptedFileExtensions: string[];
125
- }> {
126
- static Meta: {
127
- id: string;
128
- name: string;
129
- };
130
- static Create(data: Partial<FilePathInput["data"]>): FilePathInput["data"];
131
- compare(value1: string, value2: string): boolean;
132
- getClass(): typeof FilePathInput;
133
- getMeta(): PropertyInputMetaData;
134
- }
135
- declare class PasswordInput extends PropertyInputBase<string, {
136
- min: number;
137
- max: number;
138
- }> {
139
- static Meta: {
140
- id: string;
141
- name: string;
142
- };
143
- static Create(data: Partial<PasswordInput["data"]>): PasswordInput["data"];
144
- compare(value1: string, value2: string): boolean;
145
- getClass(): typeof PasswordInput;
146
- getMeta(): PropertyInputMetaData;
147
- }
148
- declare class CheckboxInput extends PropertyInputBase<boolean, {}> {
149
- static Meta: {
150
- id: string;
151
- name: string;
152
- };
153
- static Create(data: Partial<CheckboxInput["data"]>): CheckboxInput["data"];
154
- compare(value1: boolean, value2: boolean): boolean;
155
- getClass(): typeof CheckboxInput;
156
- getMeta(): PropertyInputMetaData;
157
- }
158
- declare class DateInput extends PropertyInputBase<string, {}> {
159
- static Meta: {
160
- id: string;
161
- name: string;
162
- };
163
- static Create(data: Partial<DateInput["data"]>): DateInput["data"];
164
- compare(value1: string, value2: string): boolean;
165
- getClass(): typeof DateInput;
166
- getMeta(): PropertyInputMetaData;
167
- }
168
- declare class TextareaInput extends PropertyInputBase<string, {
169
- rows: number;
170
- cols: number;
171
- }> {
172
- static Meta: {
173
- id: string;
174
- name: string;
175
- };
176
- static Create(data: Partial<TextareaInput["data"]>): TextareaInput["data"];
177
- compare(value1: string, value2: string): boolean;
178
- getClass(): typeof TextareaInput;
179
- getMeta(): PropertyInputMetaData;
180
- }
181
- declare class EmailInput extends PropertyInputBase<string, {}> {
182
- static Meta: {
183
- id: string;
184
- name: string;
185
- };
186
- static Create(data: Partial<EmailInput["data"]>): EmailInput["data"];
187
- compare(value1: string, value2: string): boolean;
188
- getClass(): typeof EmailInput;
189
- getMeta(): PropertyInputMetaData;
190
- }
191
- declare class UrlInput extends PropertyInputBase<string, {}> {
192
- static Meta: {
193
- id: string;
194
- name: string;
195
- };
196
- static Create(data: Partial<UrlInput["data"]>): UrlInput["data"];
197
- compare(value1: string, value2: string): boolean;
198
- getClass(): typeof UrlInput;
199
- getMeta(): PropertyInputMetaData;
200
- }
201
- export { ColorInput as ColorPropertyInput, RangeInput as RangePropertyInput, FloatInput as FloatPropertyInput, Vec2Input as Vec2PropertyInput, Vec3Input as Vec3PropertyInput, IntInput as IntPropertyInput, StringInput as StringPropertyInput, SelectInput as SelectPropertyInput, FilePathInput as FilePathPropertyInput, PasswordInput as PasswordPropertyInput, CheckboxInput as CheckboxPropertyInput, DateInput as DatePropertyInput, TextareaInput as TextareaPropertyInput, EmailInput as EmailPropertyInput, UrlInput as UrlPropertyInput, };
35
+ }>;
36
+ declare const BooleanInput: import("./registerInput").RegisteredInput<boolean, import("./PropertyInput").PropertyInputBaseProperties>;
37
+ export { ColorInput as ColorPropertyInput, RangeInput as RangePropertyInput, FloatInput as FloatPropertyInput, Vec2Input as Vec2PropertyInput, Vec3Input as Vec3PropertyInput, IntInput as IntPropertyInput, StringInput as StringPropertyInput, SelectInput as SelectPropertyInput, BooleanInput as BooleanPropertyInput, };
@@ -1,376 +1,122 @@
1
- import { PropertyInputBase } from "./PropertyInput";
2
- import { PropertyInputRegister } from "./PropertyInputRegister";
3
- class StringInput extends PropertyInputBase {
4
- static Meta = {
5
- id: "string",
6
- name: "string",
7
- };
8
- static Create(data) {
9
- return {
10
- ...PropertyInputBase.CreateBase({}),
11
- type: StringInput.Meta.id,
12
- properties: {
13
- min: 0,
14
- max: Number.MAX_SAFE_INTEGER,
15
- },
16
- ...data,
17
- };
18
- }
19
- compare(value1, value2) {
20
- return value1 == value2;
21
- }
22
- getClass() {
23
- return StringInput;
24
- }
25
- getMeta() {
26
- return StringInput.Meta;
27
- }
28
- }
29
- class ColorInput extends PropertyInputBase {
30
- static Meta = {
31
- id: "color",
32
- name: "Color",
33
- };
34
- static Create(data) {
35
- return {
36
- ...PropertyInputBase.CreateBase({}),
37
- type: ColorInput.Meta.id,
38
- properties: {},
39
- ...data,
40
- };
41
- }
1
+ import { registerInput } from "./registerInput";
2
+ const StringInput = registerInput({
3
+ id: "string",
4
+ name: "String",
42
5
  compare(value1, value2) {
43
6
  return value1 == value2;
44
- }
45
- getClass() {
46
- return ColorInput;
47
- }
48
- getMeta() {
49
- return ColorInput.Meta;
50
- }
51
- }
52
- class RangeInput extends PropertyInputBase {
53
- static Meta = {
54
- id: "range",
55
- name: "Range",
56
- };
57
- static Create(data) {
58
- return {
59
- ...PropertyInputBase.CreateBase({}),
60
- type: RangeInput.Meta.id,
61
- properties: {
62
- min: 0,
63
- max: Number.MAX_SAFE_INTEGER,
64
- step: 1,
65
- },
66
- ...data,
67
- };
68
- }
69
- compare(value1, value2) {
70
- return value1 == value2;
71
- }
72
- getClass() {
73
- return RangeInput;
74
- }
75
- getMeta() {
76
- return RangeInput.Meta;
77
- }
78
- }
79
- class FloatInput extends PropertyInputBase {
80
- static Meta = {
81
- id: "float",
82
- name: "Float",
83
- };
84
- static Create(data) {
85
- return {
86
- ...PropertyInputBase.CreateBase({}),
87
- type: FloatInput.Meta.id,
88
- properties: {
89
- min: 0,
90
- max: Number.MAX_SAFE_INTEGER,
91
- },
92
- ...data,
93
- };
94
- }
95
- compare(value1, value2) {
96
- return value1 == value2;
97
- }
98
- getClass() {
99
- return FloatInput;
100
- }
101
- getMeta() {
102
- return FloatInput.Meta;
103
- }
104
- }
105
- class Vec2Input extends PropertyInputBase {
106
- static Meta = {
107
- id: "vec2",
108
- name: "Vec2",
109
- };
110
- static Create(data) {
111
- return {
112
- ...PropertyInputBase.CreateBase({}),
113
- type: Vec2Input.Meta.id,
114
- properties: {
115
- valueType: "position",
116
- },
117
- ...data,
118
- };
119
- }
120
- compare(value1, value2) {
121
- return value1.x == value2.x && value1.y == value2.y;
122
- }
123
- getClass() {
124
- return Vec2Input;
125
- }
126
- getMeta() {
127
- return Vec2Input.Meta;
128
- }
129
- }
130
- class Vec3Input extends PropertyInputBase {
131
- static Meta = {
132
- id: "vec3",
133
- name: "Vec3",
134
- };
135
- static Create(data) {
7
+ },
8
+ createProperties(properties) {
136
9
  return {
137
- ...PropertyInputBase.CreateBase({}),
138
- type: Vec3Input.Meta.id,
139
- properties: {
140
- valueType: "position",
141
- },
142
- ...data,
10
+ min: 0,
11
+ max: Number.MAX_SAFE_INTEGER,
12
+ ...properties,
143
13
  };
144
- }
14
+ },
15
+ });
16
+ const ColorInput = registerInput({
17
+ id: "color",
18
+ name: "Color",
145
19
  compare(value1, value2) {
146
- return value1.x == value2.x && value1.y == value2.y && value1.z == value2.z;
147
- }
148
- getClass() {
149
- return Vec3Input;
150
- }
151
- getMeta() {
152
- return Vec3Input.Meta;
153
- }
154
- }
155
- class IntInput extends PropertyInputBase {
156
- static Meta = {
157
- id: "int",
158
- name: "Int",
159
- };
160
- static Create(data) {
20
+ return value1 === value2;
21
+ },
22
+ createProperties(properties) {
161
23
  return {
162
- ...PropertyInputBase.CreateBase({}),
163
- type: IntInput.Meta.id,
164
- properties: {
165
- min: 0,
166
- max: Number.MAX_SAFE_INTEGER,
167
- },
168
- ...data,
24
+ ...properties,
169
25
  };
170
- }
26
+ },
27
+ });
28
+ const RangeInput = registerInput({
29
+ id: "range",
30
+ name: "Range",
171
31
  compare(value1, value2) {
172
- return value1 == value2;
173
- }
174
- getClass() {
175
- return IntInput;
176
- }
177
- getMeta() {
178
- return IntInput.Meta;
179
- }
180
- }
181
- class SelectInput extends PropertyInputBase {
182
- static Meta = {
183
- id: "select",
184
- name: "Select",
185
- };
186
- static Create(data) {
32
+ return value1 === value2;
33
+ },
34
+ createProperties(properties) {
187
35
  return {
188
- ...PropertyInputBase.CreateBase({}),
189
- type: SelectInput.Meta.id,
190
- properties: {
191
- options: [],
192
- },
193
- ...data,
36
+ min: 0,
37
+ max: Number.MAX_SAFE_INTEGER,
38
+ step: 1,
39
+ ...properties,
194
40
  };
195
- }
41
+ },
42
+ });
43
+ const FloatInput = registerInput({
44
+ id: "float",
45
+ name: "Float",
196
46
  compare(value1, value2) {
197
- return value1 == value2;
198
- }
199
- getClass() {
200
- return SelectInput;
201
- }
202
- getMeta() {
203
- return SelectInput.Meta;
204
- }
205
- }
206
- class FilePathInput extends PropertyInputBase {
207
- static Meta = {
208
- id: "file-path",
209
- name: "File Path",
210
- };
211
- static Create(data) {
47
+ return value1 === value2;
48
+ },
49
+ createProperties(properties) {
212
50
  return {
213
- ...PropertyInputBase.CreateBase({}),
214
- type: FilePathInput.Meta.id,
215
- properties: {
216
- acceptedFileExtensions: [],
217
- },
218
- ...data,
51
+ min: 0,
52
+ max: Number.MAX_SAFE_INTEGER,
53
+ ...properties,
219
54
  };
220
- }
55
+ },
56
+ });
57
+ const Vec2Input = registerInput({
58
+ id: "vec2",
59
+ name: "Vec2",
221
60
  compare(value1, value2) {
222
- return value1 == value2;
223
- }
224
- getClass() {
225
- return FilePathInput;
226
- }
227
- getMeta() {
228
- return FilePathInput.Meta;
229
- }
230
- }
231
- class PasswordInput extends PropertyInputBase {
232
- static Meta = {
233
- id: "password",
234
- name: "Password",
235
- };
236
- static Create(data) {
61
+ return value1.x === value2.x && value1.y === value2.y;
62
+ },
63
+ createProperties(properties) {
237
64
  return {
238
- ...PropertyInputBase.CreateBase({}),
239
- type: PasswordInput.Meta.id,
240
- properties: {
241
- min: 0,
242
- max: Number.MAX_SAFE_INTEGER,
243
- },
244
- ...data,
65
+ valueType: "position",
66
+ ...properties,
245
67
  };
246
- }
68
+ },
69
+ });
70
+ const Vec3Input = registerInput({
71
+ id: "vec3",
72
+ name: "Vec3",
247
73
  compare(value1, value2) {
248
- return value1 == value2;
249
- }
250
- getClass() {
251
- return PasswordInput;
252
- }
253
- getMeta() {
254
- return PasswordInput.Meta;
255
- }
256
- }
257
- class CheckboxInput extends PropertyInputBase {
258
- static Meta = {
259
- id: "checkbox",
260
- name: "Checkbox",
261
- };
262
- static Create(data) {
74
+ return (value1.x === value2.x && value1.y === value2.y && value1.z === value2.z);
75
+ },
76
+ createProperties(properties) {
263
77
  return {
264
- ...PropertyInputBase.CreateBase({}),
265
- type: CheckboxInput.Meta.id,
266
- properties: {},
267
- ...data,
78
+ valueType: "position",
79
+ ...properties,
268
80
  };
269
- }
81
+ },
82
+ });
83
+ const IntInput = registerInput({
84
+ id: "int",
85
+ name: "Int",
270
86
  compare(value1, value2) {
271
- return value1 == value2;
272
- }
273
- getClass() {
274
- return CheckboxInput;
275
- }
276
- getMeta() {
277
- return CheckboxInput.Meta;
278
- }
279
- }
280
- class DateInput extends PropertyInputBase {
281
- static Meta = {
282
- id: "date",
283
- name: "Date",
284
- };
285
- static Create(data) {
87
+ return value1 === value2;
88
+ },
89
+ createProperties(properties) {
286
90
  return {
287
- ...PropertyInputBase.CreateBase({}),
288
- type: DateInput.Meta.id,
289
- properties: {},
290
- ...data,
91
+ min: 0,
92
+ max: Number.MAX_SAFE_INTEGER,
93
+ ...properties,
291
94
  };
292
- }
95
+ },
96
+ });
97
+ const SelectInput = registerInput({
98
+ id: "select",
99
+ name: "Select",
293
100
  compare(value1, value2) {
294
- return value1 == value2;
295
- }
296
- getClass() {
297
- return DateInput;
298
- }
299
- getMeta() {
300
- return DateInput.Meta;
301
- }
302
- }
303
- class TextareaInput extends PropertyInputBase {
304
- static Meta = {
305
- id: "textarea",
306
- name: "Textarea",
307
- };
308
- static Create(data) {
101
+ return value1 === value2;
102
+ },
103
+ createProperties(properties) {
309
104
  return {
310
- ...PropertyInputBase.CreateBase({}),
311
- type: TextareaInput.Meta.id,
312
- properties: {
313
- rows: 4,
314
- cols: 50,
315
- },
316
- ...data,
105
+ options: [],
106
+ ...properties,
317
107
  };
318
- }
108
+ },
109
+ });
110
+ const BooleanInput = registerInput({
111
+ id: "boolean",
112
+ name: "Boolean",
319
113
  compare(value1, value2) {
320
- return value1 == value2;
321
- }
322
- getClass() {
323
- return TextareaInput;
324
- }
325
- getMeta() {
326
- return TextareaInput.Meta;
327
- }
328
- }
329
- class EmailInput extends PropertyInputBase {
330
- static Meta = {
331
- id: "email",
332
- name: "Email",
333
- };
334
- static Create(data) {
114
+ return value1 === value2;
115
+ },
116
+ createProperties(properties) {
335
117
  return {
336
- ...PropertyInputBase.CreateBase({}),
337
- type: EmailInput.Meta.id,
338
- properties: {},
339
- ...data,
118
+ ...properties,
340
119
  };
341
- }
342
- compare(value1, value2) {
343
- return value1 == value2;
344
- }
345
- getClass() {
346
- return EmailInput;
347
- }
348
- getMeta() {
349
- return EmailInput.Meta;
350
- }
351
- }
352
- class UrlInput extends PropertyInputBase {
353
- static Meta = {
354
- id: "url",
355
- name: "URL",
356
- };
357
- static Create(data) {
358
- return {
359
- ...PropertyInputBase.CreateBase({}),
360
- type: UrlInput.Meta.id,
361
- properties: {},
362
- ...data,
363
- };
364
- }
365
- compare(value1, value2) {
366
- return value1 == value2;
367
- }
368
- getClass() {
369
- return UrlInput;
370
- }
371
- getMeta() {
372
- return UrlInput.Meta;
373
- }
374
- }
375
- PropertyInputRegister.regsiterProperty(ColorInput, RangeInput, FloatInput, Vec2Input, Vec3Input, IntInput, StringInput, SelectInput, FilePathInput, PasswordInput, CheckboxInput, DateInput, TextareaInput, EmailInput, UrlInput);
376
- export { ColorInput as ColorPropertyInput, RangeInput as RangePropertyInput, FloatInput as FloatPropertyInput, Vec2Input as Vec2PropertyInput, Vec3Input as Vec3PropertyInput, IntInput as IntPropertyInput, StringInput as StringPropertyInput, SelectInput as SelectPropertyInput, FilePathInput as FilePathPropertyInput, PasswordInput as PasswordPropertyInput, CheckboxInput as CheckboxPropertyInput, DateInput as DatePropertyInput, TextareaInput as TextareaPropertyInput, EmailInput as EmailPropertyInput, UrlInput as UrlPropertyInput, };
120
+ },
121
+ });
122
+ export { ColorInput as ColorPropertyInput, RangeInput as RangePropertyInput, FloatInput as FloatPropertyInput, Vec2Input as Vec2PropertyInput, Vec3Input as Vec3PropertyInput, IntInput as IntPropertyInput, StringInput as StringPropertyInput, SelectInput as SelectPropertyInput, BooleanInput as BooleanPropertyInput, };