-
-
Notifications
You must be signed in to change notification settings - Fork 572
/
FormValidation.d.ts
27 lines (27 loc) · 1005 Bytes
/
FormValidation.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
export function tryParseJSON(requestItem: string): any;
export default FormValidation;
export function validateFileUploadSize(file: File, intlFunc: Function): boolean;
declare class FormValidation {
/**
* The first Fieldset (Tab) that has any errors
* will be selected
* @param {Object} errors
* @param {Object} schema
* @returns {number} activeIndex
*/
static showFirstTabWithErrors({ errors, schema, }?: any): number;
/**
* Create the errors object from backend the same way it is done on Frontend validation
* @param {string} requestError form the server
* @returns {Object}
*/
static giveServerErrorsToCorrespondingFields(requestError?: string): any;
/**
* Return validation result
* @param {Object} schema
* @param {Object} formData
* @param {function} formatMessage
* @returns {Object} errors
*/
static validateFieldsPerFieldset({ schema, formData, formatMessage, touchedField, }?: any): any;
}