-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
49 lines (45 loc) · 960 Bytes
/
index.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
declare module "js-object-validation";
declare interface ValidatorMethods {
required?: boolean;
email?: boolean;
username?: boolean;
password?: boolean;
numeric?: boolean;
maxnumber?: number;
minnumbers?: number;
alphanumeric?: boolean;
alpha?: boolean;
maxlength?: number;
minlength?: number;
equal?: string;
url?: boolean;
}
declare interface ValidatorMessageMethods {
required?: string;
email?: string;
username?: string;
password?: string;
numeric?: string;
maxnumber?: string;
minnumbers?: string;
alphanumeric?: string;
alpha?: string;
maxlength?: string;
minlength?: string;
equal?: string;
url?: string;
}
declare interface ValidatorReturnType {
isValid: boolean;
errors: any;
}
declare function Validator(
data: any,
validation?: {
[key: string]: ValidatorMethods;
},
messages?: {
[key: string]: ValidatorMessageMethods;
}
): ValidatorReturnType;
export default Validator;