File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,15 @@ import { ajv as ajvInternal } from './utils/validation';
10
10
11
11
import { ErrorObject , JSONSchemaType , KeywordDefinition , SchemaObject } from 'ajv' ;
12
12
import { useDebounce } from './Hooks/useDebounce' ;
13
- import { AJVMessageFunction , FormField , IState , UseFormReturn } from './utils/types' ;
13
+ import {
14
+ AJVMessageFunction ,
15
+ FormField ,
16
+ IState ,
17
+ UseFormReturn ,
18
+ ValidateResult ,
19
+ } from './utils/types' ;
14
20
import Logger from './utils/Logger' ;
21
+
15
22
const useAJVForm = < T extends Record < string , any > > (
16
23
initial : T ,
17
24
schema : JSONSchemaType < T > | SchemaObject ,
@@ -114,7 +121,7 @@ const useAJVForm = <T extends Record<string, any>>(
114
121
} ) ;
115
122
} ;
116
123
117
- const validateForm = ( ) => {
124
+ const validateForm = ( ) : ValidateResult < T > => {
118
125
const data = Object . keys ( state ) . reduce ( ( acc , inputName ) => {
119
126
acc [ inputName as keyof T ] = getValue ( state [ inputName ] . value ) as T [ keyof T ] ;
120
127
return acc ;
You can’t perform that action at this time.
0 commit comments