@asaidimu/anansi 1.5.0 → 1.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.
package/index.d.cts CHANGED
@@ -81,6 +81,10 @@ type EnumHint = {
81
81
  label?: string;
82
82
  group?: string;
83
83
  ignore?: boolean;
84
+ options?: Array<{
85
+ value: string | number;
86
+ label: string;
87
+ }>;
84
88
  };
85
89
  /**
86
90
  * Hints for generating an array input control.
@@ -178,9 +182,6 @@ type ConstraintsMap = Record<string, Predicate>;
178
182
  * Names of supported predicates, derived from a PredicateMap.
179
183
  */
180
184
  type PredicateName<T extends PredicateMap = any> = keyof T;
181
- /**
182
- * Parameters for predicates, tailored to each field type.
183
- */
184
185
  /**
185
186
  * Parameters for predicates, tailored to each field type.
186
187
  */
@@ -194,6 +195,8 @@ type PredicateParameters<T extends FieldType> = T extends "string" ? string | st
194
195
  } : T extends "boolean" ? boolean : T extends "array" | "set" ? number | {
195
196
  minItems: number;
196
197
  maxItems: number;
198
+ } : T extends "enum" ? string[] | number[] | {
199
+ field: string;
197
200
  } : T extends "object" ? {
198
201
  schema: Record<string, unknown>;
199
202
  } : T extends "record" ? Record<string, unknown> : T extends "dynamic" ? any : never;
package/index.d.ts CHANGED
@@ -81,6 +81,10 @@ type EnumHint = {
81
81
  label?: string;
82
82
  group?: string;
83
83
  ignore?: boolean;
84
+ options?: Array<{
85
+ value: string | number;
86
+ label: string;
87
+ }>;
84
88
  };
85
89
  /**
86
90
  * Hints for generating an array input control.
@@ -178,9 +182,6 @@ type ConstraintsMap = Record<string, Predicate>;
178
182
  * Names of supported predicates, derived from a PredicateMap.
179
183
  */
180
184
  type PredicateName<T extends PredicateMap = any> = keyof T;
181
- /**
182
- * Parameters for predicates, tailored to each field type.
183
- */
184
185
  /**
185
186
  * Parameters for predicates, tailored to each field type.
186
187
  */
@@ -194,6 +195,8 @@ type PredicateParameters<T extends FieldType> = T extends "string" ? string | st
194
195
  } : T extends "boolean" ? boolean : T extends "array" | "set" ? number | {
195
196
  minItems: number;
196
197
  maxItems: number;
198
+ } : T extends "enum" ? string[] | number[] | {
199
+ field: string;
197
200
  } : T extends "object" ? {
198
201
  schema: Record<string, unknown>;
199
202
  } : T extends "record" ? Record<string, unknown> : T extends "dynamic" ? any : never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaidimu/anansi",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "A toolkit for advanced data modelling",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",