@codemask-labs/forms
Advanced tools
Comparing version
import * as z from 'zod'; | ||
type FormSchema = Record<string, z.ZodDefault<z.ZodTypeAny> | z.ZodOptional<z.ZodTypeAny>>; | ||
type FormSchema = Record<string, z.ZodDefault<z.ZodTypeAny>>; | ||
type FormField<T> = { | ||
@@ -31,7 +31,3 @@ value: T; | ||
updateForm: (fields: Partial<{ [K_3 in keyof { [K in keyof TSchema]: z.TypeOf<TSchema[K]>; }]: Partial<FormField<{ [K in keyof TSchema]: z.TypeOf<TSchema[K]>; }[K_3]>>; }>) => void; | ||
getValues: () => { [K_2 in keyof { [K in keyof TSchema]: z.TypeOf<TSchema[K]>; }]: FormField<{ [K in keyof TSchema]: z.TypeOf<TSchema[K]>; }[K_2]>; } & { | ||
readonly isValid: boolean; | ||
} extends infer T extends Record<string, FormField<any>> ? { [K_4 in keyof T]: ({ [K_2 in keyof { [K in keyof TSchema]: z.TypeOf<TSchema[K]>; }]: FormField<{ [K in keyof TSchema]: z.TypeOf<TSchema[K]>; }[K_2]>; } & { | ||
readonly isValid: boolean; | ||
})[K_4]["value"]; } : never; | ||
getValues: () => { [K in keyof TSchema]: z.TypeOf<TSchema[K]>; }; | ||
reset: (...keys: ("isValid" | keyof TSchema)[]) => void; | ||
@@ -38,0 +34,0 @@ submit: () => void; |
{ | ||
"name": "@codemask-labs/forms", | ||
"version": "0.0.4-alpha", | ||
"version": "0.0.5-alpha", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%13148
-5.15%51
-3.77%