autoforma 2.9.9 → 2.9.91

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.
@@ -29,14 +29,16 @@ export interface SelectFieldSchema<TCustom extends string = never> extends BaseF
29
29
  value: string;
30
30
  }[];
31
31
  }
32
- export interface FieldSchemaRegistry {
32
+ export interface FieldSchemaRegistry<TCustom extends string = never> {
33
33
  base: BaseFieldSchema<never>;
34
34
  select: SelectFieldSchema<never>;
35
35
  hasFields: HasFields<never>;
36
36
  array: ArrayFieldSchema<never>;
37
37
  object: ObjectFieldSchema<never>;
38
38
  }
39
- export type FieldSchema<TCustom extends string = never> = FieldSchemaRegistry[keyof FieldSchemaRegistry];
39
+ type BuiltInFieldSchema = FieldSchemaRegistry<never>[keyof FieldSchemaRegistry<never>];
40
+ type CustomFieldSchema<TCustom extends string> = FieldSchemaRegistry<TCustom>[keyof FieldSchemaRegistry<TCustom>];
41
+ export type FieldSchema<TCustom extends string = never> = BuiltInFieldSchema | (TCustom extends never ? never : CustomFieldSchema<TCustom>);
40
42
  export type Schema<TCustom extends string = never> = FieldSchema<TCustom>[];
41
43
  export type UpdateFieldSchema<TCustom extends string = never> = {
42
44
  [key: string]: (path: string, fieldSchema: FieldSchema<TCustom>, values: FormValues) => FieldSchema<TCustom> | Promise<FieldSchema<TCustom>>;
@@ -76,3 +78,4 @@ export interface FormRef {
76
78
  export interface FieldProps<TCustom extends string = never> {
77
79
  fieldSchema: FieldSchema<TCustom>;
78
80
  }
81
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoforma",
3
- "version": "2.9.9",
3
+ "version": "2.9.91",
4
4
  "description": "AutoForma is a headless dynamic form builder based on React Hook Form",
5
5
  "type": "module",
6
6
  "sideEffects": false,