@fxhash/params 0.0.11 → 0.0.13

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/index.d.ts CHANGED
@@ -1,249 +1,250 @@
1
- import { F as FxParamDefinition, a as FxParamType } from './utils-jEvPb5wq.js';
2
- export { u as FxParamDefinitions, m as FxParamOptionsMap, y as FxParamProcessor, x as FxParamProcessorConstrainer, w as FxParamProcessorTransformer, z as FxParamProcessors, A as FxParamTranformType, D as FxParamTransformation, o as FxParamTransformationTypeMap, n as FxParamTypeMap, q as FxParamUpdateMode, t as FxParamValue, B as FxParamsData, C as FxParamsRaw, E as FxParamsTransformed, b as MAX_SAFE_INT64, M as MIN_SAFE_INT64, P as ParameterProcessors, f as buildParamsObject, e as consolidateParams, d as deserializeParams, g as getRandomParamValues, v as hexString, h as hexToRgba, k as jsonStringifyBigint, p as processParam, l as processParams, r as rgbaToHex, s as serializeParams, c as serializeParamsOrNull, j as stringifyParamsData, i as sumBytesParams } from './utils-jEvPb5wq.js';
3
- import { z, SafeParseError, SafeParseSuccess } from 'zod';
1
+ import { FxParamDefinition, FxParamDefinitions, FxParamOptionsMap, FxParamProcessor, FxParamProcessorConstrainer, FxParamProcessorTransformer, FxParamProcessors, FxParamTranformType, FxParamTransformation, FxParamTransformationTypeMap, FxParamType, FxParamTypeMap, FxParamUpdateMode, FxParamValue, FxParamsData, FxParamsRaw, FxParamsTransformed, MAX_SAFE_INT64$1 as MAX_SAFE_INT64, MIN_SAFE_INT64$1 as MIN_SAFE_INT64, ParameterProcessors$1 as ParameterProcessors, buildParamsObject$1 as buildParamsObject, consolidateParams$1 as consolidateParams, deserializeParams$1 as deserializeParams, getRandomParamValues$1 as getRandomParamValues, hexString, hexToRgba$1 as hexToRgba, jsonStringifyBigint$1 as jsonStringifyBigint, processParam$1 as processParam, processParams$1 as processParams, rgbaToHex$1 as rgbaToHex, serializeParams$1 as serializeParams, serializeParamsOrNull$1 as serializeParamsOrNull, stringifyParamsData$1 as stringifyParamsData, sumBytesParams$1 as sumBytesParams } from "./utils-Bd4LPrAy.js";
2
+ import { SafeParseError, SafeParseSuccess, z } from "zod";
4
3
 
4
+ //#region src/validation.d.ts
5
5
  declare const BaseControllerDefinitionSchema: z.ZodObject<{
6
- id: z.ZodString;
7
- name: z.ZodOptional<z.ZodString>;
8
- exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
6
+ id: z.ZodString;
7
+ name: z.ZodOptional<z.ZodString>;
8
+ exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
9
9
  }, "strip", z.ZodTypeAny, {
10
- id: string;
11
- name?: string | undefined;
12
- exposedAsFeature?: boolean | undefined;
10
+ id: string;
11
+ name?: string | undefined;
12
+ exposedAsFeature?: boolean | undefined;
13
13
  }, {
14
- id: string;
15
- name?: string | undefined;
16
- exposedAsFeature?: boolean | undefined;
14
+ id: string;
15
+ name?: string | undefined;
16
+ exposedAsFeature?: boolean | undefined;
17
17
  }>;
18
18
  declare const ControllerDefinitionSchema: z.ZodUnion<[z.ZodObject<{
19
- id: z.ZodString;
20
- name: z.ZodOptional<z.ZodString>;
21
- exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
19
+ id: z.ZodString;
20
+ name: z.ZodOptional<z.ZodString>;
21
+ exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
22
22
  } & {
23
- type: z.ZodLiteral<"string">;
24
- options: z.ZodOptional<z.ZodObject<{
25
- minLength: z.ZodOptional<z.ZodNumber>;
26
- maxLength: z.ZodOptional<z.ZodNumber>;
27
- }, "strip", z.ZodTypeAny, {
28
- minLength?: number | undefined;
29
- maxLength?: number | undefined;
30
- }, {
31
- minLength?: number | undefined;
32
- maxLength?: number | undefined;
33
- }>>;
34
- default: z.ZodOptional<z.ZodString>;
23
+ type: z.ZodLiteral<"string">;
24
+ options: z.ZodOptional<z.ZodObject<{
25
+ minLength: z.ZodOptional<z.ZodNumber>;
26
+ maxLength: z.ZodOptional<z.ZodNumber>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ minLength?: number | undefined;
29
+ maxLength?: number | undefined;
30
+ }, {
31
+ minLength?: number | undefined;
32
+ maxLength?: number | undefined;
33
+ }>>;
34
+ default: z.ZodOptional<z.ZodString>;
35
35
  }, "strip", z.ZodTypeAny, {
36
- id: string;
37
- type: "string";
38
- default?: string | undefined;
39
- options?: {
40
- minLength?: number | undefined;
41
- maxLength?: number | undefined;
42
- } | undefined;
43
- name?: string | undefined;
44
- exposedAsFeature?: boolean | undefined;
36
+ id: string;
37
+ type: "string";
38
+ name?: string | undefined;
39
+ exposedAsFeature?: boolean | undefined;
40
+ options?: {
41
+ minLength?: number | undefined;
42
+ maxLength?: number | undefined;
43
+ } | undefined;
44
+ default?: string | undefined;
45
45
  }, {
46
- id: string;
47
- type: "string";
48
- default?: string | undefined;
49
- options?: {
50
- minLength?: number | undefined;
51
- maxLength?: number | undefined;
52
- } | undefined;
53
- name?: string | undefined;
54
- exposedAsFeature?: boolean | undefined;
46
+ id: string;
47
+ type: "string";
48
+ name?: string | undefined;
49
+ exposedAsFeature?: boolean | undefined;
50
+ options?: {
51
+ minLength?: number | undefined;
52
+ maxLength?: number | undefined;
53
+ } | undefined;
54
+ default?: string | undefined;
55
55
  }>, z.ZodObject<{
56
- id: z.ZodString;
57
- name: z.ZodOptional<z.ZodString>;
58
- exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
56
+ id: z.ZodString;
57
+ name: z.ZodOptional<z.ZodString>;
58
+ exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
59
59
  } & {
60
- type: z.ZodLiteral<"number">;
61
- options: z.ZodOptional<z.ZodObject<{
62
- min: z.ZodOptional<z.ZodNumber>;
63
- max: z.ZodOptional<z.ZodNumber>;
64
- step: z.ZodOptional<z.ZodNumber>;
65
- }, "strip", z.ZodTypeAny, {
66
- min?: number | undefined;
67
- max?: number | undefined;
68
- step?: number | undefined;
69
- }, {
70
- min?: number | undefined;
71
- max?: number | undefined;
72
- step?: number | undefined;
73
- }>>;
74
- default: z.ZodOptional<z.ZodNumber>;
60
+ type: z.ZodLiteral<"number">;
61
+ options: z.ZodOptional<z.ZodObject<{
62
+ min: z.ZodOptional<z.ZodNumber>;
63
+ max: z.ZodOptional<z.ZodNumber>;
64
+ step: z.ZodOptional<z.ZodNumber>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ min?: number | undefined;
67
+ max?: number | undefined;
68
+ step?: number | undefined;
69
+ }, {
70
+ min?: number | undefined;
71
+ max?: number | undefined;
72
+ step?: number | undefined;
73
+ }>>;
74
+ default: z.ZodOptional<z.ZodNumber>;
75
75
  }, "strip", z.ZodTypeAny, {
76
- id: string;
77
- type: "number";
78
- default?: number | undefined;
79
- options?: {
80
- min?: number | undefined;
81
- max?: number | undefined;
82
- step?: number | undefined;
83
- } | undefined;
84
- name?: string | undefined;
85
- exposedAsFeature?: boolean | undefined;
76
+ id: string;
77
+ type: "number";
78
+ name?: string | undefined;
79
+ exposedAsFeature?: boolean | undefined;
80
+ options?: {
81
+ min?: number | undefined;
82
+ max?: number | undefined;
83
+ step?: number | undefined;
84
+ } | undefined;
85
+ default?: number | undefined;
86
86
  }, {
87
- id: string;
88
- type: "number";
89
- default?: number | undefined;
90
- options?: {
91
- min?: number | undefined;
92
- max?: number | undefined;
93
- step?: number | undefined;
94
- } | undefined;
95
- name?: string | undefined;
96
- exposedAsFeature?: boolean | undefined;
87
+ id: string;
88
+ type: "number";
89
+ name?: string | undefined;
90
+ exposedAsFeature?: boolean | undefined;
91
+ options?: {
92
+ min?: number | undefined;
93
+ max?: number | undefined;
94
+ step?: number | undefined;
95
+ } | undefined;
96
+ default?: number | undefined;
97
97
  }>, z.ZodObject<{
98
- id: z.ZodString;
99
- name: z.ZodOptional<z.ZodString>;
100
- exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
98
+ id: z.ZodString;
99
+ name: z.ZodOptional<z.ZodString>;
100
+ exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
101
101
  } & {
102
- type: z.ZodLiteral<"bigint">;
103
- options: z.ZodOptional<z.ZodObject<{
104
- min: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>>;
105
- max: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>>;
106
- }, "strip", z.ZodTypeAny, {
107
- min?: number | bigint | undefined;
108
- max?: number | bigint | undefined;
109
- }, {
110
- min?: number | bigint | undefined;
111
- max?: number | bigint | undefined;
112
- }>>;
113
- default: z.ZodOptional<z.ZodBigInt>;
102
+ type: z.ZodLiteral<"bigint">;
103
+ options: z.ZodOptional<z.ZodObject<{
104
+ min: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>>;
105
+ max: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ min?: number | bigint | undefined;
108
+ max?: number | bigint | undefined;
109
+ }, {
110
+ min?: number | bigint | undefined;
111
+ max?: number | bigint | undefined;
112
+ }>>;
113
+ default: z.ZodOptional<z.ZodBigInt>;
114
114
  }, "strip", z.ZodTypeAny, {
115
- id: string;
116
- type: "bigint";
117
- default?: bigint | undefined;
118
- options?: {
119
- min?: number | bigint | undefined;
120
- max?: number | bigint | undefined;
121
- } | undefined;
122
- name?: string | undefined;
123
- exposedAsFeature?: boolean | undefined;
115
+ id: string;
116
+ type: "bigint";
117
+ name?: string | undefined;
118
+ exposedAsFeature?: boolean | undefined;
119
+ options?: {
120
+ min?: number | bigint | undefined;
121
+ max?: number | bigint | undefined;
122
+ } | undefined;
123
+ default?: bigint | undefined;
124
124
  }, {
125
- id: string;
126
- type: "bigint";
127
- default?: bigint | undefined;
128
- options?: {
129
- min?: number | bigint | undefined;
130
- max?: number | bigint | undefined;
131
- } | undefined;
132
- name?: string | undefined;
133
- exposedAsFeature?: boolean | undefined;
125
+ id: string;
126
+ type: "bigint";
127
+ name?: string | undefined;
128
+ exposedAsFeature?: boolean | undefined;
129
+ options?: {
130
+ min?: number | bigint | undefined;
131
+ max?: number | bigint | undefined;
132
+ } | undefined;
133
+ default?: bigint | undefined;
134
134
  }>, z.ZodObject<{
135
- id: z.ZodString;
136
- name: z.ZodOptional<z.ZodString>;
137
- exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
135
+ id: z.ZodString;
136
+ name: z.ZodOptional<z.ZodString>;
137
+ exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
138
138
  } & {
139
- type: z.ZodLiteral<"select">;
140
- options: z.ZodObject<{
141
- options: z.ZodArray<z.ZodString, "atleastone">;
142
- }, "strip", z.ZodTypeAny, {
143
- options: [string, ...string[]];
144
- }, {
145
- options: [string, ...string[]];
146
- }>;
147
- default: z.ZodOptional<z.ZodString>;
139
+ type: z.ZodLiteral<"select">;
140
+ options: z.ZodObject<{
141
+ options: z.ZodArray<z.ZodString, "atleastone">;
142
+ }, "strip", z.ZodTypeAny, {
143
+ options: [string, ...string[]];
144
+ }, {
145
+ options: [string, ...string[]];
146
+ }>;
147
+ default: z.ZodOptional<z.ZodString>;
148
148
  }, "strip", z.ZodTypeAny, {
149
- id: string;
150
- type: "select";
151
- options: {
152
- options: [string, ...string[]];
153
- };
154
- default?: string | undefined;
155
- name?: string | undefined;
156
- exposedAsFeature?: boolean | undefined;
149
+ id: string;
150
+ options: {
151
+ options: [string, ...string[]];
152
+ };
153
+ type: "select";
154
+ name?: string | undefined;
155
+ exposedAsFeature?: boolean | undefined;
156
+ default?: string | undefined;
157
157
  }, {
158
- id: string;
159
- type: "select";
160
- options: {
161
- options: [string, ...string[]];
162
- };
163
- default?: string | undefined;
164
- name?: string | undefined;
165
- exposedAsFeature?: boolean | undefined;
158
+ id: string;
159
+ options: {
160
+ options: [string, ...string[]];
161
+ };
162
+ type: "select";
163
+ name?: string | undefined;
164
+ exposedAsFeature?: boolean | undefined;
165
+ default?: string | undefined;
166
166
  }>, z.ZodObject<{
167
- id: z.ZodString;
168
- name: z.ZodOptional<z.ZodString>;
169
- exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
167
+ id: z.ZodString;
168
+ name: z.ZodOptional<z.ZodString>;
169
+ exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
170
170
  } & {
171
- type: z.ZodLiteral<"bytes">;
172
- options: z.ZodObject<{
173
- length: z.ZodNumber;
174
- }, "strip", z.ZodTypeAny, {
175
- length: number;
176
- }, {
177
- length: number;
178
- }>;
179
- default: z.ZodOptional<z.ZodAny>;
180
- update: z.ZodLiteral<"code-driven">;
171
+ type: z.ZodLiteral<"bytes">;
172
+ options: z.ZodObject<{
173
+ length: z.ZodNumber;
174
+ }, "strip", z.ZodTypeAny, {
175
+ length: number;
176
+ }, {
177
+ length: number;
178
+ }>;
179
+ default: z.ZodOptional<z.ZodAny>;
180
+ update: z.ZodLiteral<"code-driven">;
181
181
  }, "strip", z.ZodTypeAny, {
182
- id: string;
183
- type: "bytes";
184
- options: {
185
- length: number;
186
- };
187
- update: "code-driven";
188
- default?: any;
189
- name?: string | undefined;
190
- exposedAsFeature?: boolean | undefined;
182
+ id: string;
183
+ options: {
184
+ length: number;
185
+ };
186
+ type: "bytes";
187
+ update: "code-driven";
188
+ name?: string | undefined;
189
+ exposedAsFeature?: boolean | undefined;
190
+ default?: any;
191
191
  }, {
192
- id: string;
193
- type: "bytes";
194
- options: {
195
- length: number;
196
- };
197
- update: "code-driven";
198
- default?: any;
199
- name?: string | undefined;
200
- exposedAsFeature?: boolean | undefined;
192
+ id: string;
193
+ options: {
194
+ length: number;
195
+ };
196
+ type: "bytes";
197
+ update: "code-driven";
198
+ name?: string | undefined;
199
+ exposedAsFeature?: boolean | undefined;
200
+ default?: any;
201
201
  }>, z.ZodObject<{
202
- id: z.ZodString;
203
- name: z.ZodOptional<z.ZodString>;
204
- exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
202
+ id: z.ZodString;
203
+ name: z.ZodOptional<z.ZodString>;
204
+ exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
205
205
  } & {
206
- type: z.ZodLiteral<"boolean">;
207
- options: z.ZodUndefined;
208
- default: z.ZodOptional<z.ZodBoolean>;
206
+ type: z.ZodLiteral<"boolean">;
207
+ options: z.ZodUndefined;
208
+ default: z.ZodOptional<z.ZodBoolean>;
209
209
  }, "strip", z.ZodTypeAny, {
210
- id: string;
211
- type: "boolean";
212
- default?: boolean | undefined;
213
- options?: undefined;
214
- name?: string | undefined;
215
- exposedAsFeature?: boolean | undefined;
210
+ id: string;
211
+ type: "boolean";
212
+ name?: string | undefined;
213
+ exposedAsFeature?: boolean | undefined;
214
+ options?: undefined;
215
+ default?: boolean | undefined;
216
216
  }, {
217
- id: string;
218
- type: "boolean";
219
- default?: boolean | undefined;
220
- options?: undefined;
221
- name?: string | undefined;
222
- exposedAsFeature?: boolean | undefined;
217
+ id: string;
218
+ type: "boolean";
219
+ name?: string | undefined;
220
+ exposedAsFeature?: boolean | undefined;
221
+ options?: undefined;
222
+ default?: boolean | undefined;
223
223
  }>, z.ZodObject<{
224
- id: z.ZodString;
225
- name: z.ZodOptional<z.ZodString>;
226
- exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
224
+ id: z.ZodString;
225
+ name: z.ZodOptional<z.ZodString>;
226
+ exposedAsFeature: z.ZodOptional<z.ZodBoolean>;
227
227
  } & {
228
- type: z.ZodLiteral<"color">;
229
- options: z.ZodUndefined;
230
- default: z.ZodOptional<z.ZodString>;
228
+ type: z.ZodLiteral<"color">;
229
+ options: z.ZodUndefined;
230
+ default: z.ZodOptional<z.ZodString>;
231
231
  }, "strip", z.ZodTypeAny, {
232
- id: string;
233
- type: "color";
234
- default?: string | undefined;
235
- options?: undefined;
236
- name?: string | undefined;
237
- exposedAsFeature?: boolean | undefined;
232
+ id: string;
233
+ type: "color";
234
+ name?: string | undefined;
235
+ exposedAsFeature?: boolean | undefined;
236
+ options?: undefined;
237
+ default?: string | undefined;
238
238
  }, {
239
- id: string;
240
- type: "color";
241
- default?: string | undefined;
242
- options?: undefined;
243
- name?: string | undefined;
244
- exposedAsFeature?: boolean | undefined;
239
+ id: string;
240
+ type: "color";
241
+ name?: string | undefined;
242
+ exposedAsFeature?: boolean | undefined;
243
+ options?: undefined;
244
+ default?: string | undefined;
245
245
  }>]>;
246
246
  type ControllerDefinitionSchemaType = z.infer<typeof ControllerDefinitionSchema>;
247
247
  declare function validateParameterDefinition(parameterDefinition: FxParamDefinition<FxParamType>): SafeParseError<ControllerDefinitionSchemaType> | SafeParseSuccess<ControllerDefinitionSchemaType> | undefined;
248
-
249
- export { BaseControllerDefinitionSchema, type ControllerDefinitionSchemaType, FxParamDefinition, FxParamType, validateParameterDefinition };
248
+ //#endregion
249
+ export { BaseControllerDefinitionSchema, ControllerDefinitionSchemaType, FxParamDefinition, FxParamDefinitions, FxParamOptionsMap, FxParamProcessor, FxParamProcessorConstrainer, FxParamProcessorTransformer, FxParamProcessors, FxParamTranformType, FxParamTransformation, FxParamTransformationTypeMap, FxParamType, FxParamTypeMap, FxParamUpdateMode, FxParamValue, FxParamsData, FxParamsRaw, FxParamsTransformed, MAX_SAFE_INT64, MIN_SAFE_INT64, ParameterProcessors, buildParamsObject, consolidateParams, deserializeParams, getRandomParamValues, hexString, hexToRgba, jsonStringifyBigint, processParam, processParams, rgbaToHex, serializeParams, serializeParamsOrNull, stringifyParamsData, sumBytesParams, validateParameterDefinition };
250
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,102 +1,97 @@
1
- export { MAX_SAFE_INT64, MIN_SAFE_INT64, ParameterProcessors, buildParamsObject, consolidateParams, deserializeParams, getRandomParamValues, hexToRgba, jsonStringifyBigint, processParam, processParams, rgbaToHex, serializeParams, serializeParamsOrNull, stringifyParamsData, sumBytesParams } from './chunk-B3N473DY.js';
2
- import { z } from 'zod';
1
+ import { MAX_SAFE_INT64, MIN_SAFE_INT64, ParameterProcessors, buildParamsObject, consolidateParams, deserializeParams, getRandomParamValues, hexToRgba, jsonStringifyBigint, processParam, processParams, rgbaToHex, serializeParams, serializeParamsOrNull, stringifyParamsData, sumBytesParams } from "./utils-BXUz-G9x.js";
2
+ import { z } from "zod";
3
3
 
4
- var ControllerTypeSchema = z.enum([
5
- "number",
6
- "bigint",
7
- "color",
8
- "string",
9
- "bytes",
10
- "boolean",
11
- "select"
4
+ //#region src/validation.ts
5
+ const ControllerTypeSchema = z.enum([
6
+ "number",
7
+ "bigint",
8
+ "color",
9
+ "string",
10
+ "bytes",
11
+ "boolean",
12
+ "select"
12
13
  ]);
13
- var FxParamOptions_bigintSchema = z.object({
14
- min: z.number().or(z.bigint()).optional(),
15
- max: z.number().or(z.bigint()).optional()
14
+ const FxParamOptions_bigintSchema = z.object({
15
+ min: z.number().or(z.bigint()).optional(),
16
+ max: z.number().or(z.bigint()).optional()
16
17
  });
17
- var FxParamOptions_numberSchema = z.object({
18
- min: z.number().gte(Number.MIN_SAFE_INTEGER).optional(),
19
- max: z.number().lte(Number.MAX_SAFE_INTEGER).optional(),
20
- step: z.number().optional()
18
+ const FxParamOptions_numberSchema = z.object({
19
+ min: z.number().gte(Number.MIN_SAFE_INTEGER).optional(),
20
+ max: z.number().lte(Number.MAX_SAFE_INTEGER).optional(),
21
+ step: z.number().optional()
21
22
  });
22
- var FxParamOptions_stringSchema = z.object({
23
- minLength: z.number().gte(0).optional(),
24
- maxLength: z.number().optional()
23
+ const FxParamOptions_stringSchema = z.object({
24
+ minLength: z.number().gte(0).optional(),
25
+ maxLength: z.number().optional()
25
26
  });
26
- var FxParamOptions_bytesSchema = z.object({
27
- length: z.number().gt(0)
27
+ const FxParamOptions_bytesSchema = z.object({ length: z.number().gt(0) });
28
+ const FxParamOptions_selectSchema = z.object({ options: z.string().array().nonempty() });
29
+ const BaseControllerDefinitionSchema = z.object({
30
+ id: z.string(),
31
+ name: z.string().optional(),
32
+ exposedAsFeature: z.boolean().optional()
28
33
  });
29
- var FxParamOptions_selectSchema = z.object({
30
- options: z.string().array().nonempty()
34
+ const StringControllerSchema = BaseControllerDefinitionSchema.extend({
35
+ type: z.literal(ControllerTypeSchema.enum.string),
36
+ options: FxParamOptions_stringSchema.optional(),
37
+ default: z.string().optional()
31
38
  });
32
- var BaseControllerDefinitionSchema = z.object({
33
- id: z.string(),
34
- name: z.string().optional(),
35
- exposedAsFeature: z.boolean().optional()
39
+ const BytesControllerSchema = BaseControllerDefinitionSchema.extend({
40
+ type: z.literal(ControllerTypeSchema.enum.bytes),
41
+ options: FxParamOptions_bytesSchema,
42
+ default: z.any().optional(),
43
+ update: z.literal("code-driven", {
44
+ invalid_type_error: "Bytes parameters must be code-driven",
45
+ required_error: "Bytes parameters must be code-driven"
46
+ })
36
47
  });
37
- var StringControllerSchema = BaseControllerDefinitionSchema.extend({
38
- type: z.literal(ControllerTypeSchema.enum.string),
39
- options: FxParamOptions_stringSchema.optional(),
40
- default: z.string().optional()
48
+ const NumberControllerSchema = BaseControllerDefinitionSchema.extend({
49
+ type: z.literal(ControllerTypeSchema.enum.number),
50
+ options: FxParamOptions_numberSchema.optional(),
51
+ default: z.number().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).optional()
41
52
  });
42
- var BytesControllerSchema = BaseControllerDefinitionSchema.extend({
43
- type: z.literal(ControllerTypeSchema.enum.bytes),
44
- options: FxParamOptions_bytesSchema,
45
- default: z.any().optional(),
46
- update: z.literal("code-driven", {
47
- invalid_type_error: "Bytes parameters must be code-driven",
48
- required_error: "Bytes parameters must be code-driven"
49
- })
53
+ const BigIntControllerSchema = BaseControllerDefinitionSchema.extend({
54
+ type: z.literal(ControllerTypeSchema.enum.bigint),
55
+ options: FxParamOptions_bigintSchema.optional(),
56
+ default: z.bigint().optional()
50
57
  });
51
- var NumberControllerSchema = BaseControllerDefinitionSchema.extend({
52
- type: z.literal(ControllerTypeSchema.enum.number),
53
- options: FxParamOptions_numberSchema.optional(),
54
- default: z.number().gte(Number.MIN_SAFE_INTEGER).lte(Number.MAX_SAFE_INTEGER).optional()
58
+ const SelectControllerSchema = BaseControllerDefinitionSchema.extend({
59
+ type: z.literal(ControllerTypeSchema.enum.select),
60
+ options: FxParamOptions_selectSchema,
61
+ default: z.string().optional()
55
62
  });
56
- var BigIntControllerSchema = BaseControllerDefinitionSchema.extend({
57
- type: z.literal(ControllerTypeSchema.enum.bigint),
58
- options: FxParamOptions_bigintSchema.optional(),
59
- default: z.bigint().optional()
63
+ const BooleanControllerSchema = BaseControllerDefinitionSchema.extend({
64
+ type: z.literal(ControllerTypeSchema.enum.boolean),
65
+ options: z.undefined(),
66
+ default: z.boolean().optional()
60
67
  });
61
- var SelectControllerSchema = BaseControllerDefinitionSchema.extend({
62
- type: z.literal(ControllerTypeSchema.enum.select),
63
- options: FxParamOptions_selectSchema,
64
- default: z.string().optional()
68
+ const ColorControllerSchema = BaseControllerDefinitionSchema.extend({
69
+ type: z.literal(ControllerTypeSchema.enum.color),
70
+ options: z.undefined(),
71
+ default: z.string().optional()
65
72
  });
66
- var BooleanControllerSchema = BaseControllerDefinitionSchema.extend({
67
- type: z.literal(ControllerTypeSchema.enum.boolean),
68
- options: z.undefined(),
69
- default: z.boolean().optional()
70
- });
71
- var ColorControllerSchema = BaseControllerDefinitionSchema.extend({
72
- type: z.literal(ControllerTypeSchema.enum.color),
73
- options: z.undefined(),
74
- default: z.string().optional()
75
- });
76
- z.union([
77
- StringControllerSchema,
78
- NumberControllerSchema,
79
- BigIntControllerSchema,
80
- SelectControllerSchema,
81
- BytesControllerSchema,
82
- BooleanControllerSchema,
83
- ColorControllerSchema
73
+ const ControllerDefinitionSchema = z.union([
74
+ StringControllerSchema,
75
+ NumberControllerSchema,
76
+ BigIntControllerSchema,
77
+ SelectControllerSchema,
78
+ BytesControllerSchema,
79
+ BooleanControllerSchema,
80
+ ColorControllerSchema
84
81
  ]);
85
- var controllerSchema = {
86
- number: NumberControllerSchema,
87
- bigint: BigIntControllerSchema,
88
- color: ColorControllerSchema,
89
- string: StringControllerSchema,
90
- bytes: BytesControllerSchema,
91
- boolean: BooleanControllerSchema,
92
- select: SelectControllerSchema
82
+ const controllerSchema = {
83
+ number: NumberControllerSchema,
84
+ bigint: BigIntControllerSchema,
85
+ color: ColorControllerSchema,
86
+ string: StringControllerSchema,
87
+ bytes: BytesControllerSchema,
88
+ boolean: BooleanControllerSchema,
89
+ select: SelectControllerSchema
93
90
  };
94
91
  function validateParameterDefinition(parameterDefinition) {
95
- return controllerSchema[parameterDefinition.type]?.safeParse(
96
- parameterDefinition
97
- );
92
+ return controllerSchema[parameterDefinition.type]?.safeParse(parameterDefinition);
98
93
  }
99
94
 
100
- export { BaseControllerDefinitionSchema, validateParameterDefinition };
101
- //# sourceMappingURL=index.js.map
95
+ //#endregion
96
+ export { BaseControllerDefinitionSchema, MAX_SAFE_INT64, MIN_SAFE_INT64, ParameterProcessors, buildParamsObject, consolidateParams, deserializeParams, getRandomParamValues, hexToRgba, jsonStringifyBigint, processParam, processParams, rgbaToHex, serializeParams, serializeParamsOrNull, stringifyParamsData, sumBytesParams, validateParameterDefinition };
102
97
  //# sourceMappingURL=index.js.map