forked from ansman/validate.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate.d.ts
55 lines (48 loc) · 1.7 KB
/
validate.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
50
51
52
53
54
55
declare namespace validate {
export interface ValidateOption {
format?: string;
prettify?: Function;
fullMessages?: boolean;
}
export interface AsyncValidateOption {
wrapErrors?: Function;
prettify?: Function;
cleanAttributes?: boolean;
}
export interface CollectFormValuesOption {
nullify?: boolean;
trim?: boolean;
}
export interface ValidateJS {
(attributes: any, constraints: any, options?: ValidateOption): any;
validate(attributes: any, constraints: any, options?: ValidateOption): any;
async(attributes: any, constraints: any, options?: AsyncValidateOption): Promise<any>;
single(value: any, constraints: any, options?: ValidateOption): any;
validators: any;
formatters: any;
capitalize(value: string): string;
cleanAttributes(attributes: any, whitelist: any): any;
collectFormValues(form: any, options?: CollectFormValuesOption): any;
contains(obj: any, value: any): boolean;
extend(obj: any, ...otherObjects: any[]): any;
format(str: string, vals: any): string;
getDeepObjectValue(obj: any, keypath: string): any;
isArray(value: any): boolean;
isBoolean(value: any): boolean;
isDate(value: any): boolean;
isDefined(value: any): boolean;
isDomElement(value: any): boolean;
isEmpty(value: any): boolean;
isFunction(value: any): boolean;
isHash(value: any): boolean;
isInteger(value: any): boolean;
isNumber(value: any): boolean;
isObject(value: any): boolean;
isPromise(value: any): boolean;
isString(value: any): boolean;
prettify(value: string): string;
result(value: any, ...args: any[]): any;
}
}
declare const validate: validate.ValidateJS;
export = validate;