1 |
|
2 | import { ValidationResultType } from './ValidationResultType';
|
3 |
|
4 |
|
5 |
|
6 | export declare class ValidationResult {
|
7 | private _path;
|
8 | private _type;
|
9 | private _code;
|
10 | private _message;
|
11 | private _expected;
|
12 | private _actual;
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | constructor(path?: string, type?: ValidationResultType, code?: string, message?: string, expected?: any, actual?: any);
|
26 | /**
|
27 | * Gets dot notation path of the validated element.
|
28 | *
|
29 | * @returns the path of the validated element.
|
30 | */
|
31 | getPath(): string;
|
32 | /**
|
33 | * Gets the type of the validation result: Information, Warning, or Error.
|
34 | *
|
35 | * @returns the type of the validation result.
|
36 | *
|
37 | * @see [[ValidationResultType]]
|
38 | */
|
39 | getType(): ValidationResultType;
|
40 | /**
|
41 | * Gets the error code.
|
42 | *
|
43 | * @returns the error code
|
44 | */
|
45 | getCode(): string;
|
46 | /**
|
47 | * Gets the human readable message.
|
48 | *
|
49 | * @returns the result message.
|
50 | */
|
51 | getMessage(): string;
|
52 | /**
|
53 | * Gets the value expected by schema validation.
|
54 | *
|
55 | * @returns the expected value.
|
56 | */
|
57 | getExpected(): any;
|
58 | /**
|
59 | * Gets the actual value found by schema validation.
|
60 | *
|
61 | * @returns the actual value.
|
62 | */
|
63 | getActual(): any;
|
64 | toJSON(): {
|
65 | path: string;
|
66 | type: ValidationResultType;
|
67 | code: string;
|
68 | message: string;
|
69 | expected: any;
|
70 | actual: any;
|
71 | };
|
72 | }
|