-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.d.ts
73 lines (42 loc) · 1.62 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
export function setLang(lang: string): void;
export function extend(name: string, callback: any): void;
export function extendMessages(newMessages: object, lang?: string): void;
export function addCustomMessages(customMessages: object, lang?: string): void;
export function niceNames(attributes: object, lang?: string): void;
export function koa(): Function;
export function bailable(sure: boolean): void;
export function assert(rules: object): any;
export function setStrNotationRepetition(repetition: number): void;
export declare class Validator {
inputs: any;
errors: any;
postValidation: any;
filters: any;
lang: string;
customMessages: any;
attributeNames: any;
wasFailed: any;
doBail: any;
validationRules: any;
constructor(inputs: object, rules: object, customMessages?: object);
bail(sure?: boolean): void;
niceNames(attributeNames: object): void;
parseRules(validationRules: object): void;
getErrors(): any;
validate(): Promise<boolean>;
check(): Promise<boolean>;
fails(): Promise<boolean>;
passes(): Promise<boolean>;
parseValue(attribute: string): any;
applyOnDeep(attributes: any): Promise<void>;
parseNestedAttr(attribute: any): void;
apply(attr: string): boolean | undefined;
postApply(rule: any): Promise<void>;
addPostRule(rule: any): void;
addPostRules(rulesObject: any): void;
getParsedMessage(options: any): string;
getExistinParsedMessage(options: any): string;
error(key: string, rule: string, message: string): void;
addError(key: string, rule: string, message: string): void;
appendError(key: string, rule: string, message: string): void;
}