form: {
changeValue: (fieldName: string, value: any, callback?: () => void) => void, // change value of some field, you can use callback that will be called after data set, for example if you need to submit form
data: {
[field-name]: ...data-inside-field, // - data can be string, file, etc.
},
field: {
[field-name]: {
isValid: boolean, // is field valid
validationError: string, // only validation erros generated by page schema
error: string, // all field errors including validation errors and server errors
isFilled: boolean, // is there any data
isVisited: boolean, // true, if field was visited before (focused and blur)
}
},
recompileSchema: () => void, // recompile form validation schema
clearErrors: (allErrors?: boolean) => void // clear global/validation/manually set errors
setError: (fieldName: string, error: string) => void // manually set error to some specific field, error can be cleared by passing falsy value
addTags: (tags: string[]) => void, // add tags to form
removeTags: (tags: string[]) => void, // regexp as string can be also used to identify more tags
hasTags: (tags: string | string[]) => boolean // checks if all passed tags are present
tag: {
[tag-name]: boolean, // form visual tags
},
submit: (actionName: string, params: string[]) => void, // submit form
valid: boolean, // is form valid
visited: {
[field-name]: boolean // indicated if field was visited
},
}