@asaidimu/anansi 1.5.0 → 1.5.1

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